From: Frank Mori Hess Date: Fri, 22 Jun 2001 15:50:42 +0000 (+0000) Subject: dma is no longer disabled in das1800 driver when rt suppport is configured X-Git-Tag: r0_7_60~138 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=3236df9cd914d187ae10ebd44dbd1268ad8fc6b4;p=comedi.git dma is no longer disabled in das1800 driver when rt suppport is configured for comedi. dma is instead disabled on a cmd by cmd basis when the TRIG_RT flag is received. --- diff --git a/Documentation/comedi/drivers.txt b/Documentation/comedi/drivers.txt index ec6dd1a8..8f22f213 100644 --- a/Documentation/comedi/drivers.txt +++ b/Documentation/comedi/drivers.txt @@ -333,8 +333,7 @@ Device Names: das-1701st, das-1701st-da, das-1701ao, das-1702st, das-1802hr, das-1802hr-da, das-1802hc, das-1802ao Status: works -Presently, DMA is disabled if you enable hard real-time support for -Comedi. The waveform analog output on the 'ao' cards is not supported. +The waveform analog output on the 'ao' cards is not supported. If you need it, send me (Frank Hess) an email. Configuration options: diff --git a/comedi/drivers/das1800.c b/comedi/drivers/das1800.c index a920c2b8..bbf456c7 100644 --- a/comedi/drivers/das1800.c +++ b/comedi/drivers/das1800.c @@ -69,8 +69,6 @@ at least 1 and no more than 0x10000 == 65536 NOTES: Only the DAS-1801ST has been tested by me. Unipolar and bipolar ranges cannot be mixed in the channel/gain list. -For safety reasons, the driver disables dma transfers if you enable - real-time support in comedi. TODO: Add support for analog out on 'ao' cards. @@ -498,21 +496,11 @@ static int das1800_attach(comedi_device *dev, comedi_devconfig *it) unsigned long flags; int iobase = it->options[0]; int irq = it->options[1]; - int dma0, dma1; + int dma0 = it->options[2]; + int dma1 = it->options[3]; int iobase2; int board; -// disable unsafe isa dma if comedi real time kernel support is on -#ifdef CONFIG_COMEDI_RT - dma0 = 0; - dma1 = 0; - if(it->options[2] || it->options[3]) - printk("%s: dma disabled to avoid conflicts with RT support\n", driver_das1800.driver_name); -#else - dma0 = it->options[2]; - dma1 = it->options[3]; -#endif - /* allocate and initialize dev->private */ if(alloc_private(dev, sizeof(das1800_private)) < 0) return -ENOMEM; @@ -1472,20 +1460,25 @@ static int das1800_ai_do_cmd(comedi_device *dev, comedi_subdevice *s) return -1; } + /* disable dma on TRIG_WAKE_EOS (to reduce latency) or TRIG_RT + * (because dma in handler is unsafe at hard real-time priority) */ + if(cmd.flags & (TRIG_WAKE_EOS | TRIG_RT)) + { + devpriv->irq_dma_bits &= ~DMA_ENABLED; + }else + { + devpriv->irq_dma_bits |= devpriv->dma_bits; + } + // interrupt on end of conversion for TRIG_WAKE_EOS if(cmd.flags & TRIG_WAKE_EOS) { // interrupt fifo not empty devpriv->irq_dma_bits &= ~FIMD; - // turn off dma - devpriv->irq_dma_bits &= ~DMA_ENABLED; }else { // interrupt fifo half full devpriv->irq_dma_bits |= FIMD; - // turn on dma if configured - devpriv->irq_dma_bits |= devpriv->dma_bits; } - // determine how many conversions we need if(cmd.stop_src == TRIG_COUNT) {