Commit 22ca19d9 authored by H Hartley Sweeten's avatar H Hartley Sweeten Committed by Greg Kroah-Hartman

staging: comedi: move (*insn_{read, write}) timeout debug messages to core

Have the comedi core display a standard dev_dbg() message when a timeout
occurs and remove all the driver specific messages.
Signed-off-by: default avatarH Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent f7b3d79a
...@@ -1194,6 +1194,11 @@ static int parse_insn(struct comedi_device *dev, struct comedi_insn *insn, ...@@ -1194,6 +1194,11 @@ static int parse_insn(struct comedi_device *dev, struct comedi_insn *insn,
switch (insn->insn) { switch (insn->insn) {
case INSN_READ: case INSN_READ:
ret = s->insn_read(dev, s, insn, data); ret = s->insn_read(dev, s, insn, data);
if (ret == -ETIMEDOUT) {
dev_dbg(dev->class_dev,
"subdevice %d read instruction timed out\n",
s->index);
}
break; break;
case INSN_WRITE: case INSN_WRITE:
maxdata = s->maxdata_list maxdata = s->maxdata_list
...@@ -1207,8 +1212,14 @@ static int parse_insn(struct comedi_device *dev, struct comedi_insn *insn, ...@@ -1207,8 +1212,14 @@ static int parse_insn(struct comedi_device *dev, struct comedi_insn *insn,
break; break;
} }
} }
if (ret == 0) if (ret == 0) {
ret = s->insn_write(dev, s, insn, data); ret = s->insn_write(dev, s, insn, data);
if (ret == -ETIMEDOUT) {
dev_dbg(dev->class_dev,
"subdevice %d write instruction timed out\n",
s->index);
}
}
break; break;
case INSN_BITS: case INSN_BITS:
if (insn->n != 2) { if (insn->n != 2) {
......
...@@ -748,7 +748,6 @@ static int pci9111_ai_insn_read(struct comedi_device *dev, ...@@ -748,7 +748,6 @@ static int pci9111_ai_insn_read(struct comedi_device *dev,
ret = comedi_timeout(dev, s, insn, pci9111_ai_eoc, 0); ret = comedi_timeout(dev, s, insn, pci9111_ai_eoc, 0);
if (ret) { if (ret) {
comedi_error(dev, "A/D read timeout");
data[i] = 0; data[i] = 0;
pci9111_fifo_reset(dev); pci9111_fifo_reset(dev);
return ret; return ret;
......
...@@ -614,7 +614,6 @@ static int pci9118_insn_read_ai(struct comedi_device *dev, ...@@ -614,7 +614,6 @@ static int pci9118_insn_read_ai(struct comedi_device *dev,
ret = comedi_timeout(dev, s, insn, pci9118_ai_eoc, 0); ret = comedi_timeout(dev, s, insn, pci9118_ai_eoc, 0);
if (ret) { if (ret) {
comedi_error(dev, "A/D insn timeout");
data[n] = 0; data[n] = 0;
outl(0, dev->iobase + PCI9118_DELFIFO); /* flush FIFO */ outl(0, dev->iobase + PCI9118_DELFIFO); /* flush FIFO */
return ret; return ret;
......
...@@ -467,7 +467,6 @@ static int pci171x_insn_read_ai(struct comedi_device *dev, ...@@ -467,7 +467,6 @@ static int pci171x_insn_read_ai(struct comedi_device *dev,
ret = comedi_timeout(dev, s, insn, pci171x_ai_eoc, 0); ret = comedi_timeout(dev, s, insn, pci171x_ai_eoc, 0);
if (ret) { if (ret) {
comedi_error(dev, "A/D insn timeout");
outb(0, dev->iobase + PCI171x_CLRFIFO); outb(0, dev->iobase + PCI171x_CLRFIFO);
outb(0, dev->iobase + PCI171x_CLRINT); outb(0, dev->iobase + PCI171x_CLRINT);
data[n] = 0; data[n] = 0;
......
...@@ -140,10 +140,8 @@ static int aio_aio12_8_ai_read(struct comedi_device *dev, ...@@ -140,10 +140,8 @@ static int aio_aio12_8_ai_read(struct comedi_device *dev,
/* Wait for conversion to complete */ /* Wait for conversion to complete */
ret = comedi_timeout(dev, s, insn, aio_aio12_8_ai_eoc, 0); ret = comedi_timeout(dev, s, insn, aio_aio12_8_ai_eoc, 0);
if (ret) { if (ret)
dev_err(dev->class_dev, "ADC timeout\n");
return ret; return ret;
}
data[n] = inw(dev->iobase + AIO12_8_ADC_REG) & s->maxdata; data[n] = inw(dev->iobase + AIO12_8_ADC_REG) & s->maxdata;
} }
......
...@@ -895,10 +895,8 @@ static int pci230_ai_rinsn(struct comedi_device *dev, ...@@ -895,10 +895,8 @@ static int pci230_ai_rinsn(struct comedi_device *dev,
/* wait for conversion to end */ /* wait for conversion to end */
ret = comedi_timeout(dev, s, insn, pci230_ai_eoc, 0); ret = comedi_timeout(dev, s, insn, pci230_ai_eoc, 0);
if (ret) { if (ret)
dev_err(dev->class_dev, "timeout\n");
return ret; return ret;
}
/* read data */ /* read data */
data[n] = pci230_ai_read(dev); data[n] = pci230_ai_read(dev);
......
...@@ -152,10 +152,8 @@ static int das16cs_ai_rinsn(struct comedi_device *dev, ...@@ -152,10 +152,8 @@ static int das16cs_ai_rinsn(struct comedi_device *dev,
outw(0, dev->iobase + DAS16CS_ADC_DATA); outw(0, dev->iobase + DAS16CS_ADC_DATA);
ret = comedi_timeout(dev, s, insn, das16cs_ai_eoc, 0); ret = comedi_timeout(dev, s, insn, das16cs_ai_eoc, 0);
if (ret) { if (ret)
dev_dbg(dev->class_dev, "cb_das16_cs: ai timeout\n");
return ret; return ret;
}
data[i] = inw(dev->iobase + DAS16CS_ADC_DATA); data[i] = inw(dev->iobase + DAS16CS_ADC_DATA);
} }
......
...@@ -1792,10 +1792,8 @@ static int ai_rinsn(struct comedi_device *dev, struct comedi_subdevice *s, ...@@ -1792,10 +1792,8 @@ static int ai_rinsn(struct comedi_device *dev, struct comedi_subdevice *s,
/* wait for data */ /* wait for data */
ret = comedi_timeout(dev, s, insn, cb_pcidas64_ai_eoc, 0); ret = comedi_timeout(dev, s, insn, cb_pcidas64_ai_eoc, 0);
if (ret) { if (ret)
comedi_error(dev, " analog input read insn timed out");
return ret; return ret;
}
if (thisboard->layout == LAYOUT_4020) if (thisboard->layout == LAYOUT_4020)
data[n] = readl(devpriv->dio_counter_iobase + data[n] = readl(devpriv->dio_counter_iobase +
......
...@@ -257,10 +257,8 @@ static int das08_ai_rinsn(struct comedi_device *dev, struct comedi_subdevice *s, ...@@ -257,10 +257,8 @@ static int das08_ai_rinsn(struct comedi_device *dev, struct comedi_subdevice *s,
outb_p(0, dev->iobase + DAS08_TRIG_12BIT); outb_p(0, dev->iobase + DAS08_TRIG_12BIT);
ret = comedi_timeout(dev, s, insn, das08_ai_eoc, 0); ret = comedi_timeout(dev, s, insn, das08_ai_eoc, 0);
if (ret) { if (ret)
dev_err(dev->class_dev, "timeout\n");
return ret; return ret;
}
msb = inb(dev->iobase + DAS08_MSB); msb = inb(dev->iobase + DAS08_MSB);
lsb = inb(dev->iobase + DAS08_LSB); lsb = inb(dev->iobase + DAS08_LSB);
......
...@@ -370,10 +370,8 @@ static int das16m1_ai_rinsn(struct comedi_device *dev, ...@@ -370,10 +370,8 @@ static int das16m1_ai_rinsn(struct comedi_device *dev,
outb(0, dev->iobase); outb(0, dev->iobase);
ret = comedi_timeout(dev, s, insn, das16m1_ai_eoc, 0); ret = comedi_timeout(dev, s, insn, das16m1_ai_eoc, 0);
if (ret) { if (ret)
comedi_error(dev, "timeout");
return ret; return ret;
}
data[n] = munge_sample(inw(dev->iobase)); data[n] = munge_sample(inw(dev->iobase));
} }
......
...@@ -108,22 +108,14 @@ static int dt2815_ao_insn(struct comedi_device *dev, struct comedi_subdevice *s, ...@@ -108,22 +108,14 @@ static int dt2815_ao_insn(struct comedi_device *dev, struct comedi_subdevice *s,
hi = (data[i] & 0xff0) >> 4; hi = (data[i] & 0xff0) >> 4;
ret = comedi_timeout(dev, s, insn, dt2815_ao_status, 0x00); ret = comedi_timeout(dev, s, insn, dt2815_ao_status, 0x00);
if (ret) { if (ret)
dev_dbg(dev->class_dev,
"failed to write low byte on %d\n",
chan);
return ret; return ret;
}
outb(lo, dev->iobase + DT2815_DATA); outb(lo, dev->iobase + DT2815_DATA);
ret = comedi_timeout(dev, s, insn, dt2815_ao_status, 0x10); ret = comedi_timeout(dev, s, insn, dt2815_ao_status, 0x10);
if (ret) { if (ret)
dev_dbg(dev->class_dev,
"failed to write high byte on %d\n",
chan);
return ret; return ret;
}
devpriv->ao_readback[chan] = data[i]; devpriv->ao_readback[chan] = data[i];
} }
......
...@@ -554,10 +554,8 @@ static int dt282x_ai_insn_read(struct comedi_device *dev, ...@@ -554,10 +554,8 @@ static int dt282x_ai_insn_read(struct comedi_device *dev,
outw(devpriv->supcsr | DT2821_PRLD, dev->iobase + DT2821_SUPCSR); outw(devpriv->supcsr | DT2821_PRLD, dev->iobase + DT2821_SUPCSR);
ret = comedi_timeout(dev, s, insn, dt282x_ai_timeout, DT2821_MUXBUSY); ret = comedi_timeout(dev, s, insn, dt282x_ai_timeout, DT2821_MUXBUSY);
if (ret) { if (ret)
comedi_error(dev, "timeout\n");
return ret; return ret;
}
for (i = 0; i < insn->n; i++) { for (i = 0; i < insn->n; i++) {
outw(devpriv->supcsr | DT2821_STRIG, outw(devpriv->supcsr | DT2821_STRIG,
...@@ -565,10 +563,8 @@ static int dt282x_ai_insn_read(struct comedi_device *dev, ...@@ -565,10 +563,8 @@ static int dt282x_ai_insn_read(struct comedi_device *dev,
ret = comedi_timeout(dev, s, insn, dt282x_ai_timeout, ret = comedi_timeout(dev, s, insn, dt282x_ai_timeout,
DT2821_ADDONE); DT2821_ADDONE);
if (ret) { if (ret)
comedi_error(dev, "timeout\n");
return ret; return ret;
}
data[i] = data[i] =
inw(dev->iobase + inw(dev->iobase +
...@@ -704,10 +700,8 @@ static int dt282x_ai_cmd(struct comedi_device *dev, struct comedi_subdevice *s) ...@@ -704,10 +700,8 @@ static int dt282x_ai_cmd(struct comedi_device *dev, struct comedi_subdevice *s)
outw(devpriv->supcsr | DT2821_PRLD, dev->iobase + DT2821_SUPCSR); outw(devpriv->supcsr | DT2821_PRLD, dev->iobase + DT2821_SUPCSR);
ret = comedi_timeout(dev, s, NULL, dt282x_ai_timeout, DT2821_MUXBUSY); ret = comedi_timeout(dev, s, NULL, dt282x_ai_timeout, DT2821_MUXBUSY);
if (ret) { if (ret)
comedi_error(dev, "timeout\n");
return ret; return ret;
}
if (cmd->scan_begin_src == TRIG_FOLLOW) { if (cmd->scan_begin_src == TRIG_FOLLOW) {
outw(devpriv->supcsr | DT2821_STRIG, outw(devpriv->supcsr | DT2821_STRIG,
......
...@@ -95,8 +95,6 @@ static int dyna_pci10xx_insn_read_ai(struct comedi_device *dev, ...@@ -95,8 +95,6 @@ static int dyna_pci10xx_insn_read_ai(struct comedi_device *dev,
ret = comedi_timeout(dev, s, insn, dyna_pci10xx_ai_eoc, 0); ret = comedi_timeout(dev, s, insn, dyna_pci10xx_ai_eoc, 0);
if (ret) { if (ret) {
data[n] = 0; data[n] = 0;
dev_dbg(dev->class_dev,
"timeout reading analog input\n");
break; break;
} }
......
...@@ -216,7 +216,6 @@ static int icp_multi_insn_read_ai(struct comedi_device *dev, ...@@ -216,7 +216,6 @@ static int icp_multi_insn_read_ai(struct comedi_device *dev,
/* Wait for conversion to complete, or get fed up waiting */ /* Wait for conversion to complete, or get fed up waiting */
ret = comedi_timeout(dev, s, insn, icp_multi_ai_eoc, 0); ret = comedi_timeout(dev, s, insn, icp_multi_ai_eoc, 0);
if (ret) { if (ret) {
comedi_error(dev, "A/D insn timeout");
/* Clear data received */ /* Clear data received */
data[n] = 0; data[n] = 0;
break; break;
...@@ -287,8 +286,6 @@ static int icp_multi_insn_write_ao(struct comedi_device *dev, ...@@ -287,8 +286,6 @@ static int icp_multi_insn_write_ao(struct comedi_device *dev,
* ready for new data, or get fed up waiting */ * ready for new data, or get fed up waiting */
ret = comedi_timeout(dev, s, insn, icp_multi_ao_eoc, 0); ret = comedi_timeout(dev, s, insn, icp_multi_ao_eoc, 0);
if (ret) { if (ret) {
comedi_error(dev, "D/A insn timeout");
/* Disable interrupt */ /* Disable interrupt */
devpriv->IntEnable &= ~DAC_READY; devpriv->IntEnable &= ~DAC_READY;
writew(devpriv->IntEnable, writew(devpriv->IntEnable,
......
...@@ -305,10 +305,8 @@ static int me_ai_insn_read(struct comedi_device *dev, ...@@ -305,10 +305,8 @@ static int me_ai_insn_read(struct comedi_device *dev,
/* wait for ADC fifo not empty flag */ /* wait for ADC fifo not empty flag */
ret = comedi_timeout(dev, s, insn, me_ai_eoc, 0); ret = comedi_timeout(dev, s, insn, me_ai_eoc, 0);
if (ret) { if (ret)
dev_err(dev->class_dev, "Cannot get single value\n");
return ret; return ret;
}
/* get value from ADC fifo */ /* get value from ADC fifo */
val = readw(dev_private->me_regbase + ME_READ_AD_FIFO); val = readw(dev_private->me_regbase + ME_READ_AD_FIFO);
......
...@@ -538,10 +538,8 @@ static int a2150_ai_rinsn(struct comedi_device *dev, struct comedi_subdevice *s, ...@@ -538,10 +538,8 @@ static int a2150_ai_rinsn(struct comedi_device *dev, struct comedi_subdevice *s,
*/ */
for (n = 0; n < 36; n++) { for (n = 0; n < 36; n++) {
ret = comedi_timeout(dev, s, insn, a2150_ai_eoc, 0); ret = comedi_timeout(dev, s, insn, a2150_ai_eoc, 0);
if (ret) { if (ret)
comedi_error(dev, "timeout");
return ret; return ret;
}
inw(dev->iobase + FIFO_DATA_REG); inw(dev->iobase + FIFO_DATA_REG);
} }
...@@ -549,10 +547,8 @@ static int a2150_ai_rinsn(struct comedi_device *dev, struct comedi_subdevice *s, ...@@ -549,10 +547,8 @@ static int a2150_ai_rinsn(struct comedi_device *dev, struct comedi_subdevice *s,
/* read data */ /* read data */
for (n = 0; n < insn->n; n++) { for (n = 0; n < insn->n; n++) {
ret = comedi_timeout(dev, s, insn, a2150_ai_eoc, 0); ret = comedi_timeout(dev, s, insn, a2150_ai_eoc, 0);
if (ret) { if (ret)
comedi_error(dev, "timeout");
return ret; return ret;
}
data[n] = inw(dev->iobase + FIFO_DATA_REG); data[n] = inw(dev->iobase + FIFO_DATA_REG);
data[n] ^= 0x8000; data[n] ^= 0x8000;
......
...@@ -150,22 +150,8 @@ static int daq700_ai_rinsn(struct comedi_device *dev, ...@@ -150,22 +150,8 @@ static int daq700_ai_rinsn(struct comedi_device *dev,
/* wait for conversion to end */ /* wait for conversion to end */
ret = comedi_timeout(dev, s, insn, daq700_ai_eoc, 0); ret = comedi_timeout(dev, s, insn, daq700_ai_eoc, 0);
if (ret) { if (ret)
switch (ret) {
case -EOVERFLOW:
dev_info(dev->class_dev,
"Overflow/run Error\n");
break;
case -ENODATA:
dev_info(dev->class_dev, "Data Error\n");
break;
default:
dev_info(dev->class_dev,
"timeout during ADC conversion\n");
break;
}
return ret; return ret;
}
/* read data */ /* read data */
d = inw(dev->iobase + ADFIFO_R); d = inw(dev->iobase + ADFIFO_R);
......
...@@ -434,10 +434,8 @@ static int pcl812_ai_insn_read(struct comedi_device *dev, ...@@ -434,10 +434,8 @@ static int pcl812_ai_insn_read(struct comedi_device *dev,
udelay(5); udelay(5);
ret = comedi_timeout(dev, s, insn, pcl812_ai_eoc, 0); ret = comedi_timeout(dev, s, insn, pcl812_ai_eoc, 0);
if (ret) { if (ret)
dev_dbg(dev->class_dev, "A/D insn read timeout\n");
break; break;
}
hi = inb(dev->iobase + PCL812_AD_HI); hi = inb(dev->iobase + PCL812_AD_HI);
data[n] = ((hi & 0xf) << 8) | inb(dev->iobase + PCL812_AD_LO); data[n] = ((hi & 0xf) << 8) | inb(dev->iobase + PCL812_AD_LO);
...@@ -464,10 +462,8 @@ static int acl8216_ai_insn_read(struct comedi_device *dev, ...@@ -464,10 +462,8 @@ static int acl8216_ai_insn_read(struct comedi_device *dev,
udelay(5); udelay(5);
ret = comedi_timeout(dev, s, insn, pcl812_ai_eoc, 0); ret = comedi_timeout(dev, s, insn, pcl812_ai_eoc, 0);
if (ret) { if (ret)
dev_dbg(dev->class_dev, "A/D insn read timeout\n");
break; break;
}
data[n] = data[n] =
(inb(dev->iobase + (inb(dev->iobase +
......
...@@ -196,7 +196,6 @@ static int pcl816_ai_insn_read(struct comedi_device *dev, ...@@ -196,7 +196,6 @@ static int pcl816_ai_insn_read(struct comedi_device *dev,
ret = comedi_timeout(dev, s, insn, pcl816_ai_eoc, 0); ret = comedi_timeout(dev, s, insn, pcl816_ai_eoc, 0);
if (ret) { if (ret) {
comedi_error(dev, "A/D insn timeout\n");
data[0] = 0; data[0] = 0;
/* clear INT (conversion end) flag */ /* clear INT (conversion end) flag */
outb(0, dev->iobase + PCL816_CLRINT); outb(0, dev->iobase + PCL816_CLRINT);
......
...@@ -375,7 +375,6 @@ static int pcl818_ai_insn_read(struct comedi_device *dev, ...@@ -375,7 +375,6 @@ static int pcl818_ai_insn_read(struct comedi_device *dev,
ret = comedi_timeout(dev, s, insn, pcl818_ai_eoc, 0); ret = comedi_timeout(dev, s, insn, pcl818_ai_eoc, 0);
if (ret) { if (ret) {
comedi_error(dev, "A/D insn timeout");
/* clear INT (conversion end) flag */ /* clear INT (conversion end) flag */
outb(0, dev->iobase + PCL818_CLRINT); outb(0, dev->iobase + PCL818_CLRINT);
return ret; return ret;
......
...@@ -190,10 +190,8 @@ static int skel_ai_rinsn(struct comedi_device *dev, struct comedi_subdevice *s, ...@@ -190,10 +190,8 @@ static int skel_ai_rinsn(struct comedi_device *dev, struct comedi_subdevice *s,
/* wait for conversion to end */ /* wait for conversion to end */
ret = comedi_timeout(dev, s, insn, skel_ai_eoc, 0); ret = comedi_timeout(dev, s, insn, skel_ai_eoc, 0);
if (ret) { if (ret)
dev_warn(dev->class_dev, "ai timeout\n");
return ret; return ret;
}
/* read data */ /* read data */
/* d = inw(dev->iobase + SKEL_AI_DATA); */ /* d = inw(dev->iobase + SKEL_AI_DATA); */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment