OSDN Git Service

staging: comedi: drivers: remove inappropriate COMEDI_CB_EOA events
authorH Hartley Sweeten <hsweeten@visionengravers.com>
Tue, 20 Jan 2015 19:06:02 +0000 (12:06 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 25 Jan 2015 11:59:09 +0000 (19:59 +0800)
Hardware errors should be reported with the COMEDI_CB_ERROR event. This event
will cause the async command to cancel. It's not necessary to also set the
COMEDI_CB_EOA event. Remove these events.

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>
18 files changed:
drivers/staging/comedi/drivers/adl_pci9111.c
drivers/staging/comedi/drivers/adl_pci9118.c
drivers/staging/comedi/drivers/adv_pci1710.c
drivers/staging/comedi/drivers/cb_pcidas.c
drivers/staging/comedi/drivers/cb_pcidas64.c
drivers/staging/comedi/drivers/das16m1.c
drivers/staging/comedi/drivers/das1800.c
drivers/staging/comedi/drivers/das800.c
drivers/staging/comedi/drivers/dt3000.c
drivers/staging/comedi/drivers/gsc_hpdi.c
drivers/staging/comedi/drivers/me4000.c
drivers/staging/comedi/drivers/ni_at_a2150.c
drivers/staging/comedi/drivers/ni_labpc_common.c
drivers/staging/comedi/drivers/ni_mio_common.c
drivers/staging/comedi/drivers/ni_pcidio.c
drivers/staging/comedi/drivers/pcl812.c
drivers/staging/comedi/drivers/pcl818.c
drivers/staging/comedi/drivers/quatech_daqp_cs.c

index 47f6c0e..f68dc99 100644 (file)
@@ -539,7 +539,7 @@ static irqreturn_t pci9111_interrupt(int irq, void *p_device)
                        spin_unlock_irqrestore(&dev->spinlock, irq_flags);
                        dev_dbg(dev->class_dev, "fifo overflow\n");
                        outb(0, dev->iobase + PCI9111_INT_CLR_REG);
-                       async->events |= COMEDI_CB_ERROR | COMEDI_CB_EOA;
+                       async->events |= COMEDI_CB_ERROR;
                        comedi_handle_events(dev, s);
 
                        return IRQ_HANDLED;
index 2660358..f61e392 100644 (file)
@@ -749,13 +749,13 @@ static irqreturn_t pci9118_interrupt(int irq, void *d)
 
        if (intcsr & MASTER_ABORT_INT) {
                dev_err(dev->class_dev, "AMCC IRQ - MASTER DMA ABORT!\n");
-               s->async->events |= COMEDI_CB_ERROR | COMEDI_CB_EOA;
+               s->async->events |= COMEDI_CB_ERROR;
                goto interrupt_exit;
        }
 
        if (intcsr & TARGET_ABORT_INT) {
                dev_err(dev->class_dev, "AMCC IRQ - TARGET DMA ABORT!\n");
-               s->async->events |= COMEDI_CB_ERROR | COMEDI_CB_EOA;
+               s->async->events |= COMEDI_CB_ERROR;
                goto interrupt_exit;
        }
 
index d02df7d..1b8715b 100644 (file)
@@ -743,14 +743,14 @@ static void pci1710_handle_every_sample(struct comedi_device *dev,
        status = inw(dev->iobase + PCI171x_STATUS);
        if (status & Status_FE) {
                dev_dbg(dev->class_dev, "A/D FIFO empty (%4x)\n", status);
-               s->async->events |= COMEDI_CB_EOA | COMEDI_CB_ERROR;
+               s->async->events |= COMEDI_CB_ERROR;
                comedi_handle_events(dev, s);
                return;
        }
        if (status & Status_FF) {
                dev_dbg(dev->class_dev,
                        "A/D FIFO Full status (Fatal Error!) (%4x)\n", status);
-               s->async->events |= COMEDI_CB_EOA | COMEDI_CB_ERROR;
+               s->async->events |= COMEDI_CB_ERROR;
                comedi_handle_events(dev, s);
                return;
        }
@@ -761,7 +761,7 @@ static void pci1710_handle_every_sample(struct comedi_device *dev,
                val = inw(dev->iobase + PCI171x_AD_DATA);
                ret = pci171x_ai_dropout(dev, s, s->async->cur_chan, val);
                if (ret) {
-                       s->async->events |= COMEDI_CB_EOA | COMEDI_CB_ERROR;
+                       s->async->events |= COMEDI_CB_ERROR;
                        break;
                }
 
@@ -795,7 +795,7 @@ static int move_block_from_fifo(struct comedi_device *dev,
 
                ret = pci171x_ai_dropout(dev, s, s->async->cur_chan, val);
                if (ret) {
-                       s->async->events |= COMEDI_CB_EOA | COMEDI_CB_ERROR;
+                       s->async->events |= COMEDI_CB_ERROR;
                        return ret;
                }
 
@@ -816,14 +816,14 @@ static void pci1710_handle_fifo(struct comedi_device *dev,
        m = inw(dev->iobase + PCI171x_STATUS);
        if (!(m & Status_FH)) {
                dev_dbg(dev->class_dev, "A/D FIFO not half full! (%4x)\n", m);
-               s->async->events |= COMEDI_CB_EOA | COMEDI_CB_ERROR;
+               s->async->events |= COMEDI_CB_ERROR;
                comedi_handle_events(dev, s);
                return;
        }
        if (m & Status_FF) {
                dev_dbg(dev->class_dev,
                        "A/D FIFO Full status (Fatal Error!) (%4x)\n", m);
-               s->async->events |= COMEDI_CB_EOA | COMEDI_CB_ERROR;
+               s->async->events |= COMEDI_CB_ERROR;
                comedi_handle_events(dev, s);
                return;
        }
index 669b170..dd0c65a 100644 (file)
@@ -1355,7 +1355,7 @@ static irqreturn_t cb_pcidas_interrupt(int irq, void *d)
                outw(devpriv->adc_fifo_bits | LADFUL,
                     devpriv->control_status + INT_ADCFIFO);
                spin_unlock_irqrestore(&dev->spinlock, flags);
-               async->events |= COMEDI_CB_EOA | COMEDI_CB_ERROR;
+               async->events |= COMEDI_CB_ERROR;
        }
 
        comedi_handle_events(dev, s);
index 569310a..5b43e4e 100644 (file)
@@ -2804,7 +2804,7 @@ static void handle_ai_interrupt(struct comedi_device *dev,
        /*  check for fifo overrun */
        if (status & ADC_OVERRUN_BIT) {
                dev_err(dev->class_dev, "fifo overrun\n");
-               async->events |= COMEDI_CB_EOA | COMEDI_CB_ERROR;
+               async->events |= COMEDI_CB_ERROR;
        }
        /*  spin lock makes sure no one else changes plx dma control reg */
        spin_lock_irqsave(&dev->spinlock, flags);
index 80f41b7..3666a68 100644 (file)
@@ -455,7 +455,7 @@ static void das16m1_handler(struct comedi_device *dev, unsigned int status)
        /* this probably won't catch overruns since the card doesn't generate
         * overrun interrupts, but we might as well try */
        if (status & OVRUN) {
-               async->events |= COMEDI_CB_EOA | COMEDI_CB_ERROR;
+               async->events |= COMEDI_CB_ERROR;
                dev_err(dev->class_dev, "fifo overflow\n");
        }
 
index 13ed31c..0790a28 100644 (file)
@@ -611,7 +611,7 @@ static void das1800_ai_handler(struct comedi_device *dev)
                /*  clear OVF interrupt bit */
                outb(CLEAR_INTR_MASK & ~OVF, dev->iobase + DAS1800_STATUS);
                dev_err(dev->class_dev, "FIFO overflow\n");
-               async->events |= COMEDI_CB_ERROR | COMEDI_CB_EOA;
+               async->events |= COMEDI_CB_ERROR;
                comedi_handle_events(dev, s);
                return;
        }
index e5bdc24..ff7f4be 100644 (file)
@@ -511,7 +511,7 @@ static irqreturn_t das800_interrupt(int irq, void *d)
 
        if (fifo_overflow) {
                spin_unlock_irqrestore(&dev->spinlock, irq_flags);
-               async->events |= COMEDI_CB_ERROR | COMEDI_CB_EOA;
+               async->events |= COMEDI_CB_ERROR;
                comedi_handle_events(dev, s);
                return IRQ_HANDLED;
        }
index 1d9a7a6..0aa5198 100644 (file)
@@ -355,7 +355,7 @@ static irqreturn_t dt3k_interrupt(int irq, void *d)
                dt3k_ai_empty_fifo(dev, s);
 
        if (status & (DT3000_ADSWERR | DT3000_ADHWERR))
-               s->async->events |= COMEDI_CB_ERROR | COMEDI_CB_EOA;
+               s->async->events |= COMEDI_CB_ERROR;
 
        debug_n_ints++;
        if (debug_n_ints >= 10)
index 0979f53..deada97 100644 (file)
@@ -261,12 +261,12 @@ static irqreturn_t gsc_hpdi_interrupt(int irq, void *d)
 
        if (hpdi_board_status & RX_OVERRUN_BIT) {
                dev_err(dev->class_dev, "rx fifo overrun\n");
-               async->events |= COMEDI_CB_EOA | COMEDI_CB_ERROR;
+               async->events |= COMEDI_CB_ERROR;
        }
 
        if (hpdi_board_status & RX_UNDERRUN_BIT) {
                dev_err(dev->class_dev, "rx fifo underrun\n");
-               async->events |= COMEDI_CB_EOA | COMEDI_CB_ERROR;
+               async->events |= COMEDI_CB_ERROR;
        }
 
        if (devpriv->dio_count == 0)
index 915685c..d120aa2 100644 (file)
@@ -1068,7 +1068,7 @@ static irqreturn_t me4000_ai_isr(int irq, void *dev_id)
                                 ME4000_AI_CTRL_BIT_SC_IRQ);
                        outl(tmp, dev->iobase + ME4000_AI_CTRL_REG);
 
-                       s->async->events |= COMEDI_CB_ERROR | COMEDI_CB_EOA;
+                       s->async->events |= COMEDI_CB_ERROR;
 
                        dev_err(dev->class_dev, "FIFO overflow\n");
                } else if ((tmp & ME4000_AI_STATUS_BIT_FF_DATA)
@@ -1089,7 +1089,7 @@ static irqreturn_t me4000_ai_isr(int irq, void *dev_id)
                                 ME4000_AI_CTRL_BIT_SC_IRQ);
                        outl(tmp, dev->iobase + ME4000_AI_CTRL_REG);
 
-                       s->async->events |= COMEDI_CB_ERROR | COMEDI_CB_EOA;
+                       s->async->events |= COMEDI_CB_ERROR;
 
                        dev_err(dev->class_dev, "Undefined FIFO state\n");
                }
index 2500148..a1ce0b0 100644 (file)
@@ -175,12 +175,12 @@ static irqreturn_t a2150_interrupt(int irq, void *d)
                return IRQ_NONE;
 
        if (status & OVFL_BIT) {
-               async->events |= COMEDI_CB_ERROR | COMEDI_CB_EOA;
+               async->events |= COMEDI_CB_ERROR;
                comedi_handle_events(dev, s);
        }
 
        if ((status & DMA_TC_BIT) == 0) {
-               async->events |= COMEDI_CB_ERROR | COMEDI_CB_EOA;
+               async->events |= COMEDI_CB_ERROR;
                comedi_handle_events(dev, s);
                return IRQ_HANDLED;
        }
index eea7f94..8fb5c1f 100644 (file)
@@ -823,7 +823,7 @@ static int labpc_drain_fifo(struct comedi_device *dev)
        }
        if (i == timeout) {
                dev_err(dev->class_dev, "ai timeout, fifo never empties\n");
-               async->events |= COMEDI_CB_ERROR | COMEDI_CB_EOA;
+               async->events |= COMEDI_CB_ERROR;
                return -1;
        }
 
@@ -875,7 +875,7 @@ static irqreturn_t labpc_interrupt(int irq, void *d)
        if (devpriv->stat1 & STAT1_OVERRUN) {
                /* clear error interrupt */
                devpriv->write_byte(dev, 0x1, ADC_FIFO_CLEAR_REG);
-               async->events |= COMEDI_CB_ERROR | COMEDI_CB_EOA;
+               async->events |= COMEDI_CB_ERROR;
                comedi_handle_events(dev, s);
                dev_err(dev->class_dev, "overrun\n");
                return IRQ_HANDLED;
@@ -895,7 +895,7 @@ static irqreturn_t labpc_interrupt(int irq, void *d)
        if (devpriv->stat1 & STAT1_OVERFLOW) {
                /*  clear error interrupt */
                devpriv->write_byte(dev, 0x1, ADC_FIFO_CLEAR_REG);
-               async->events |= COMEDI_CB_ERROR | COMEDI_CB_EOA;
+               async->events |= COMEDI_CB_ERROR;
                comedi_handle_events(dev, s);
                dev_err(dev->class_dev, "overflow\n");
                return IRQ_HANDLED;
index 11e7017..b6ddc01 100644 (file)
@@ -1478,7 +1478,7 @@ static void handle_a_interrupt(struct comedi_device *dev, unsigned short status,
                dev_err(dev->class_dev,
                        "unknown mite interrupt (ai_mite_status=%08x)\n",
                        ai_mite_status);
-               s->async->events |= COMEDI_CB_ERROR | COMEDI_CB_EOA;
+               s->async->events |= COMEDI_CB_ERROR;
                /* disable_irq(dev->irq); */
        }
 #endif
@@ -1491,8 +1491,7 @@ static void handle_a_interrupt(struct comedi_device *dev, unsigned short status,
                        /* we probably aren't even running a command now,
                         * so it's a good idea to be careful. */
                        if (comedi_is_subdevice_running(s)) {
-                               s->async->events |=
-                                   COMEDI_CB_ERROR | COMEDI_CB_EOA;
+                               s->async->events |= COMEDI_CB_ERROR;
                                comedi_handle_events(dev, s);
                        }
                        return;
@@ -1579,7 +1578,7 @@ static void handle_b_interrupt(struct comedi_device *dev,
                dev_err(dev->class_dev,
                        "unknown mite interrupt (ao_mite_status=%08x)\n",
                        ao_mite_status);
-               s->async->events |= COMEDI_CB_EOA | COMEDI_CB_ERROR;
+               s->async->events |= COMEDI_CB_ERROR;
        }
 #endif
 
index db7e8aa..db399fe 100644 (file)
@@ -418,7 +418,7 @@ static irqreturn_t nidio_interrupt(int irq, void *d)
                                 CHSR_DRQ1 | CHSR_MRDY)) {
                        dev_dbg(dev->class_dev,
                                "unknown mite interrupt, disabling IRQ\n");
-                       async->events |= COMEDI_CB_EOA | COMEDI_CB_ERROR;
+                       async->events |= COMEDI_CB_ERROR;
                        disable_irq(dev->irq);
                }
        }
@@ -460,7 +460,7 @@ static irqreturn_t nidio_interrupt(int irq, void *d)
                        break;
                } else if (flags & Waited) {
                        writeb(ClearWaited, dev->mmio + Group_1_First_Clear);
-                       async->events |= COMEDI_CB_EOA | COMEDI_CB_ERROR;
+                       async->events |= COMEDI_CB_ERROR;
                        break;
                } else if (flags & PrimaryTC) {
                        writeb(ClearPrimaryTC,
index f76601a..37cc5e4 100644 (file)
@@ -797,7 +797,7 @@ static void pcl812_handle_eoc(struct comedi_device *dev,
 
        if (pcl812_ai_eoc(dev, s, NULL, 0)) {
                dev_dbg(dev->class_dev, "A/D cmd IRQ without DRDY!\n");
-               s->async->events |= COMEDI_CB_EOA | COMEDI_CB_ERROR;
+               s->async->events |= COMEDI_CB_ERROR;
                return;
        }
 
index ba2e137..6e5d8bf 100644 (file)
@@ -468,7 +468,7 @@ static bool pcl818_ai_dropout(struct comedi_device *dev,
                        (devpriv->dma) ? "DMA" :
                        (devpriv->usefifo) ? "FIFO" : "IRQ",
                        chan, expected_chan);
-               s->async->events |= COMEDI_CB_EOA | COMEDI_CB_ERROR;
+               s->async->events |= COMEDI_CB_ERROR;
                return true;
        }
        return false;
@@ -501,7 +501,7 @@ static void pcl818_handle_eoc(struct comedi_device *dev,
 
        if (pcl818_ai_eoc(dev, s, NULL, 0)) {
                dev_err(dev->class_dev, "A/D mode1/3 IRQ without DRDY!\n");
-               s->async->events |= COMEDI_CB_EOA | COMEDI_CB_ERROR;
+               s->async->events |= COMEDI_CB_ERROR;
                return;
        }
 
@@ -558,14 +558,14 @@ static void pcl818_handle_fifo(struct comedi_device *dev,
 
        if (status & 4) {
                dev_err(dev->class_dev, "A/D mode1/3 FIFO overflow!\n");
-               s->async->events |= COMEDI_CB_EOA | COMEDI_CB_ERROR;
+               s->async->events |= COMEDI_CB_ERROR;
                return;
        }
 
        if (status & 1) {
                dev_err(dev->class_dev,
                        "A/D mode1/3 FIFO interrupt without data!\n");
-               s->async->events |= COMEDI_CB_EOA | COMEDI_CB_ERROR;
+               s->async->events |= COMEDI_CB_ERROR;
                return;
        }
 
index 9609811..dd06734 100644 (file)
@@ -210,8 +210,7 @@ static enum irqreturn daqp_interrupt(int irq, void *dev_id)
                        unsigned short data;
 
                        if (status & DAQP_STATUS_DATA_LOST) {
-                               s->async->events |=
-                                   COMEDI_CB_EOA | COMEDI_CB_OVERFLOW;
+                               s->async->events |= COMEDI_CB_OVERFLOW;
                                dev_warn(dev->class_dev, "data lost\n");
                                break;
                        }
@@ -239,7 +238,7 @@ static enum irqreturn daqp_interrupt(int irq, void *dev_id)
                if (loop_limit <= 0) {
                        dev_warn(dev->class_dev,
                                 "loop_limit reached in daqp_interrupt()\n");
-                       s->async->events |= COMEDI_CB_EOA | COMEDI_CB_ERROR;
+                       s->async->events |= COMEDI_CB_ERROR;
                }
 
                comedi_handle_events(dev, s);