staging: comedi: pcl818: interrupt handlers should not busywait
The interrupt is only generated by the hardware at the completion of an A/D conversion. Because of this the sanity check to make sure that the A/D conversion is complete and data is available is probably unnecessary but it doesn't hurt anything. The busywait loop is a different issue. Interrupt routines should not busywait. That's just mean... Remove the bustwait and use pcl818_ai_eoc() to check for the end-of- conversion. Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Reviewed-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
db0446d0e2
commit
127005717d
1 changed files with 7 additions and 12 deletions
|
@ -547,21 +547,16 @@ static irqreturn_t interrupt_pcl818_ai_mode13_int(int irq, void *d)
|
||||||
struct comedi_subdevice *s = dev->read_subdev;
|
struct comedi_subdevice *s = dev->read_subdev;
|
||||||
struct comedi_cmd *cmd = &s->async->cmd;
|
struct comedi_cmd *cmd = &s->async->cmd;
|
||||||
unsigned int chan;
|
unsigned int chan;
|
||||||
int timeout = 50; /* wait max 50us */
|
|
||||||
|
|
||||||
while (timeout--) {
|
if (pcl818_ai_eoc(dev, s, NULL, 0)) {
|
||||||
if (inb(dev->iobase + PCL818_STATUS) & 0x10)
|
outb(0, dev->iobase + PCL818_STATUS); /* clear INT request */
|
||||||
goto conv_finish;
|
comedi_error(dev, "A/D mode1/3 IRQ without DRDY!");
|
||||||
udelay(1);
|
s->cancel(dev, s);
|
||||||
|
s->async->events |= COMEDI_CB_EOA | COMEDI_CB_ERROR;
|
||||||
|
comedi_event(dev, s);
|
||||||
|
return IRQ_HANDLED;
|
||||||
}
|
}
|
||||||
outb(0, dev->iobase + PCL818_STATUS); /* clear INT request */
|
|
||||||
comedi_error(dev, "A/D mode1/3 IRQ without DRDY!");
|
|
||||||
s->cancel(dev, s);
|
|
||||||
s->async->events |= COMEDI_CB_EOA | COMEDI_CB_ERROR;
|
|
||||||
comedi_event(dev, s);
|
|
||||||
return IRQ_HANDLED;
|
|
||||||
|
|
||||||
conv_finish:
|
|
||||||
comedi_buf_put(s->async, pcl818_ai_get_sample(dev, s, &chan));
|
comedi_buf_put(s->async, pcl818_ai_get_sample(dev, s, &chan));
|
||||||
outb(0, dev->iobase + PCL818_CLRINT); /* clear INT request */
|
outb(0, dev->iobase + PCL818_CLRINT); /* clear INT request */
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue