fix deadlock on end-of-acquisition
authorFrank Mori Hess <fmhess@speakeasy.net>
Fri, 6 Aug 2004 00:48:02 +0000 (00:48 +0000)
committerFrank Mori Hess <fmhess@speakeasy.net>
Fri, 6 Aug 2004 00:48:02 +0000 (00:48 +0000)
comedi/drivers/das800.c

index 60d878dca3b7b310a17a4de2526eed6376838be8..1895853cebf5d04711bc059c90d9fa34c83380a2 100644 (file)
@@ -438,13 +438,14 @@ static irqreturn_t das800_interrupt(int irq, void *d, struct pt_regs *regs)
                 * We already have spinlock, so indirect addressing is safe */
                outb(CONTROL1, dev->iobase + DAS800_GAIN);      /* select dev->iobase + 2 to be control register 1 */
                outb(CONTROL1_INTE | devpriv->do_bits, dev->iobase + DAS800_CONTROL1);
+               comedi_spin_unlock_irqrestore(&dev->spinlock, irq_flags);
        /* otherwise, stop taking data */
        } else
        {
+               comedi_spin_unlock_irqrestore(&dev->spinlock, irq_flags);
                disable_das800(dev);            /* diable hardware triggered conversions */
                async->events |= COMEDI_CB_EOA;
        }
-       comedi_spin_unlock_irqrestore(&dev->spinlock, irq_flags);
        comedi_event(dev, s, async->events);
        async->events = 0;
        return IRQ_HANDLED;