Skip to content

Commit 3e6cb74

Browse files
bigguinessgregkh
authored andcommitted
staging: comedi: drivers: remove inappropriate COMEDI_CB_EOA events
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 <[email protected]> Reviewed-by: Ian Abbott <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent a3b2ee1 commit 3e6cb74

18 files changed

+36
-38
lines changed

drivers/staging/comedi/drivers/adl_pci9111.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -539,7 +539,7 @@ static irqreturn_t pci9111_interrupt(int irq, void *p_device)
539539
spin_unlock_irqrestore(&dev->spinlock, irq_flags);
540540
dev_dbg(dev->class_dev, "fifo overflow\n");
541541
outb(0, dev->iobase + PCI9111_INT_CLR_REG);
542-
async->events |= COMEDI_CB_ERROR | COMEDI_CB_EOA;
542+
async->events |= COMEDI_CB_ERROR;
543543
comedi_handle_events(dev, s);
544544

545545
return IRQ_HANDLED;

drivers/staging/comedi/drivers/adl_pci9118.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -749,13 +749,13 @@ static irqreturn_t pci9118_interrupt(int irq, void *d)
749749

750750
if (intcsr & MASTER_ABORT_INT) {
751751
dev_err(dev->class_dev, "AMCC IRQ - MASTER DMA ABORT!\n");
752-
s->async->events |= COMEDI_CB_ERROR | COMEDI_CB_EOA;
752+
s->async->events |= COMEDI_CB_ERROR;
753753
goto interrupt_exit;
754754
}
755755

756756
if (intcsr & TARGET_ABORT_INT) {
757757
dev_err(dev->class_dev, "AMCC IRQ - TARGET DMA ABORT!\n");
758-
s->async->events |= COMEDI_CB_ERROR | COMEDI_CB_EOA;
758+
s->async->events |= COMEDI_CB_ERROR;
759759
goto interrupt_exit;
760760
}
761761

drivers/staging/comedi/drivers/adv_pci1710.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -743,14 +743,14 @@ static void pci1710_handle_every_sample(struct comedi_device *dev,
743743
status = inw(dev->iobase + PCI171x_STATUS);
744744
if (status & Status_FE) {
745745
dev_dbg(dev->class_dev, "A/D FIFO empty (%4x)\n", status);
746-
s->async->events |= COMEDI_CB_EOA | COMEDI_CB_ERROR;
746+
s->async->events |= COMEDI_CB_ERROR;
747747
comedi_handle_events(dev, s);
748748
return;
749749
}
750750
if (status & Status_FF) {
751751
dev_dbg(dev->class_dev,
752752
"A/D FIFO Full status (Fatal Error!) (%4x)\n", status);
753-
s->async->events |= COMEDI_CB_EOA | COMEDI_CB_ERROR;
753+
s->async->events |= COMEDI_CB_ERROR;
754754
comedi_handle_events(dev, s);
755755
return;
756756
}
@@ -761,7 +761,7 @@ static void pci1710_handle_every_sample(struct comedi_device *dev,
761761
val = inw(dev->iobase + PCI171x_AD_DATA);
762762
ret = pci171x_ai_dropout(dev, s, s->async->cur_chan, val);
763763
if (ret) {
764-
s->async->events |= COMEDI_CB_EOA | COMEDI_CB_ERROR;
764+
s->async->events |= COMEDI_CB_ERROR;
765765
break;
766766
}
767767

@@ -795,7 +795,7 @@ static int move_block_from_fifo(struct comedi_device *dev,
795795

796796
ret = pci171x_ai_dropout(dev, s, s->async->cur_chan, val);
797797
if (ret) {
798-
s->async->events |= COMEDI_CB_EOA | COMEDI_CB_ERROR;
798+
s->async->events |= COMEDI_CB_ERROR;
799799
return ret;
800800
}
801801

@@ -816,14 +816,14 @@ static void pci1710_handle_fifo(struct comedi_device *dev,
816816
m = inw(dev->iobase + PCI171x_STATUS);
817817
if (!(m & Status_FH)) {
818818
dev_dbg(dev->class_dev, "A/D FIFO not half full! (%4x)\n", m);
819-
s->async->events |= COMEDI_CB_EOA | COMEDI_CB_ERROR;
819+
s->async->events |= COMEDI_CB_ERROR;
820820
comedi_handle_events(dev, s);
821821
return;
822822
}
823823
if (m & Status_FF) {
824824
dev_dbg(dev->class_dev,
825825
"A/D FIFO Full status (Fatal Error!) (%4x)\n", m);
826-
s->async->events |= COMEDI_CB_EOA | COMEDI_CB_ERROR;
826+
s->async->events |= COMEDI_CB_ERROR;
827827
comedi_handle_events(dev, s);
828828
return;
829829
}

drivers/staging/comedi/drivers/cb_pcidas.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1355,7 +1355,7 @@ static irqreturn_t cb_pcidas_interrupt(int irq, void *d)
13551355
outw(devpriv->adc_fifo_bits | LADFUL,
13561356
devpriv->control_status + INT_ADCFIFO);
13571357
spin_unlock_irqrestore(&dev->spinlock, flags);
1358-
async->events |= COMEDI_CB_EOA | COMEDI_CB_ERROR;
1358+
async->events |= COMEDI_CB_ERROR;
13591359
}
13601360

13611361
comedi_handle_events(dev, s);

drivers/staging/comedi/drivers/cb_pcidas64.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2804,7 +2804,7 @@ static void handle_ai_interrupt(struct comedi_device *dev,
28042804
/* check for fifo overrun */
28052805
if (status & ADC_OVERRUN_BIT) {
28062806
dev_err(dev->class_dev, "fifo overrun\n");
2807-
async->events |= COMEDI_CB_EOA | COMEDI_CB_ERROR;
2807+
async->events |= COMEDI_CB_ERROR;
28082808
}
28092809
/* spin lock makes sure no one else changes plx dma control reg */
28102810
spin_lock_irqsave(&dev->spinlock, flags);

drivers/staging/comedi/drivers/das16m1.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -455,7 +455,7 @@ static void das16m1_handler(struct comedi_device *dev, unsigned int status)
455455
/* this probably won't catch overruns since the card doesn't generate
456456
* overrun interrupts, but we might as well try */
457457
if (status & OVRUN) {
458-
async->events |= COMEDI_CB_EOA | COMEDI_CB_ERROR;
458+
async->events |= COMEDI_CB_ERROR;
459459
dev_err(dev->class_dev, "fifo overflow\n");
460460
}
461461

drivers/staging/comedi/drivers/das1800.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -611,7 +611,7 @@ static void das1800_ai_handler(struct comedi_device *dev)
611611
/* clear OVF interrupt bit */
612612
outb(CLEAR_INTR_MASK & ~OVF, dev->iobase + DAS1800_STATUS);
613613
dev_err(dev->class_dev, "FIFO overflow\n");
614-
async->events |= COMEDI_CB_ERROR | COMEDI_CB_EOA;
614+
async->events |= COMEDI_CB_ERROR;
615615
comedi_handle_events(dev, s);
616616
return;
617617
}

drivers/staging/comedi/drivers/das800.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -511,7 +511,7 @@ static irqreturn_t das800_interrupt(int irq, void *d)
511511

512512
if (fifo_overflow) {
513513
spin_unlock_irqrestore(&dev->spinlock, irq_flags);
514-
async->events |= COMEDI_CB_ERROR | COMEDI_CB_EOA;
514+
async->events |= COMEDI_CB_ERROR;
515515
comedi_handle_events(dev, s);
516516
return IRQ_HANDLED;
517517
}

drivers/staging/comedi/drivers/dt3000.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -355,7 +355,7 @@ static irqreturn_t dt3k_interrupt(int irq, void *d)
355355
dt3k_ai_empty_fifo(dev, s);
356356

357357
if (status & (DT3000_ADSWERR | DT3000_ADHWERR))
358-
s->async->events |= COMEDI_CB_ERROR | COMEDI_CB_EOA;
358+
s->async->events |= COMEDI_CB_ERROR;
359359

360360
debug_n_ints++;
361361
if (debug_n_ints >= 10)

drivers/staging/comedi/drivers/gsc_hpdi.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -261,12 +261,12 @@ static irqreturn_t gsc_hpdi_interrupt(int irq, void *d)
261261

262262
if (hpdi_board_status & RX_OVERRUN_BIT) {
263263
dev_err(dev->class_dev, "rx fifo overrun\n");
264-
async->events |= COMEDI_CB_EOA | COMEDI_CB_ERROR;
264+
async->events |= COMEDI_CB_ERROR;
265265
}
266266

267267
if (hpdi_board_status & RX_UNDERRUN_BIT) {
268268
dev_err(dev->class_dev, "rx fifo underrun\n");
269-
async->events |= COMEDI_CB_EOA | COMEDI_CB_ERROR;
269+
async->events |= COMEDI_CB_ERROR;
270270
}
271271

272272
if (devpriv->dio_count == 0)

drivers/staging/comedi/drivers/me4000.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1068,7 +1068,7 @@ static irqreturn_t me4000_ai_isr(int irq, void *dev_id)
10681068
ME4000_AI_CTRL_BIT_SC_IRQ);
10691069
outl(tmp, dev->iobase + ME4000_AI_CTRL_REG);
10701070

1071-
s->async->events |= COMEDI_CB_ERROR | COMEDI_CB_EOA;
1071+
s->async->events |= COMEDI_CB_ERROR;
10721072

10731073
dev_err(dev->class_dev, "FIFO overflow\n");
10741074
} else if ((tmp & ME4000_AI_STATUS_BIT_FF_DATA)
@@ -1089,7 +1089,7 @@ static irqreturn_t me4000_ai_isr(int irq, void *dev_id)
10891089
ME4000_AI_CTRL_BIT_SC_IRQ);
10901090
outl(tmp, dev->iobase + ME4000_AI_CTRL_REG);
10911091

1092-
s->async->events |= COMEDI_CB_ERROR | COMEDI_CB_EOA;
1092+
s->async->events |= COMEDI_CB_ERROR;
10931093

10941094
dev_err(dev->class_dev, "Undefined FIFO state\n");
10951095
}

drivers/staging/comedi/drivers/ni_at_a2150.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -175,12 +175,12 @@ static irqreturn_t a2150_interrupt(int irq, void *d)
175175
return IRQ_NONE;
176176

177177
if (status & OVFL_BIT) {
178-
async->events |= COMEDI_CB_ERROR | COMEDI_CB_EOA;
178+
async->events |= COMEDI_CB_ERROR;
179179
comedi_handle_events(dev, s);
180180
}
181181

182182
if ((status & DMA_TC_BIT) == 0) {
183-
async->events |= COMEDI_CB_ERROR | COMEDI_CB_EOA;
183+
async->events |= COMEDI_CB_ERROR;
184184
comedi_handle_events(dev, s);
185185
return IRQ_HANDLED;
186186
}

drivers/staging/comedi/drivers/ni_labpc_common.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -823,7 +823,7 @@ static int labpc_drain_fifo(struct comedi_device *dev)
823823
}
824824
if (i == timeout) {
825825
dev_err(dev->class_dev, "ai timeout, fifo never empties\n");
826-
async->events |= COMEDI_CB_ERROR | COMEDI_CB_EOA;
826+
async->events |= COMEDI_CB_ERROR;
827827
return -1;
828828
}
829829

@@ -875,7 +875,7 @@ static irqreturn_t labpc_interrupt(int irq, void *d)
875875
if (devpriv->stat1 & STAT1_OVERRUN) {
876876
/* clear error interrupt */
877877
devpriv->write_byte(dev, 0x1, ADC_FIFO_CLEAR_REG);
878-
async->events |= COMEDI_CB_ERROR | COMEDI_CB_EOA;
878+
async->events |= COMEDI_CB_ERROR;
879879
comedi_handle_events(dev, s);
880880
dev_err(dev->class_dev, "overrun\n");
881881
return IRQ_HANDLED;
@@ -895,7 +895,7 @@ static irqreturn_t labpc_interrupt(int irq, void *d)
895895
if (devpriv->stat1 & STAT1_OVERFLOW) {
896896
/* clear error interrupt */
897897
devpriv->write_byte(dev, 0x1, ADC_FIFO_CLEAR_REG);
898-
async->events |= COMEDI_CB_ERROR | COMEDI_CB_EOA;
898+
async->events |= COMEDI_CB_ERROR;
899899
comedi_handle_events(dev, s);
900900
dev_err(dev->class_dev, "overflow\n");
901901
return IRQ_HANDLED;

drivers/staging/comedi/drivers/ni_mio_common.c

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1478,7 +1478,7 @@ static void handle_a_interrupt(struct comedi_device *dev, unsigned short status,
14781478
dev_err(dev->class_dev,
14791479
"unknown mite interrupt (ai_mite_status=%08x)\n",
14801480
ai_mite_status);
1481-
s->async->events |= COMEDI_CB_ERROR | COMEDI_CB_EOA;
1481+
s->async->events |= COMEDI_CB_ERROR;
14821482
/* disable_irq(dev->irq); */
14831483
}
14841484
#endif
@@ -1491,8 +1491,7 @@ static void handle_a_interrupt(struct comedi_device *dev, unsigned short status,
14911491
/* we probably aren't even running a command now,
14921492
* so it's a good idea to be careful. */
14931493
if (comedi_is_subdevice_running(s)) {
1494-
s->async->events |=
1495-
COMEDI_CB_ERROR | COMEDI_CB_EOA;
1494+
s->async->events |= COMEDI_CB_ERROR;
14961495
comedi_handle_events(dev, s);
14971496
}
14981497
return;
@@ -1579,7 +1578,7 @@ static void handle_b_interrupt(struct comedi_device *dev,
15791578
dev_err(dev->class_dev,
15801579
"unknown mite interrupt (ao_mite_status=%08x)\n",
15811580
ao_mite_status);
1582-
s->async->events |= COMEDI_CB_EOA | COMEDI_CB_ERROR;
1581+
s->async->events |= COMEDI_CB_ERROR;
15831582
}
15841583
#endif
15851584

drivers/staging/comedi/drivers/ni_pcidio.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -418,7 +418,7 @@ static irqreturn_t nidio_interrupt(int irq, void *d)
418418
CHSR_DRQ1 | CHSR_MRDY)) {
419419
dev_dbg(dev->class_dev,
420420
"unknown mite interrupt, disabling IRQ\n");
421-
async->events |= COMEDI_CB_EOA | COMEDI_CB_ERROR;
421+
async->events |= COMEDI_CB_ERROR;
422422
disable_irq(dev->irq);
423423
}
424424
}
@@ -460,7 +460,7 @@ static irqreturn_t nidio_interrupt(int irq, void *d)
460460
break;
461461
} else if (flags & Waited) {
462462
writeb(ClearWaited, dev->mmio + Group_1_First_Clear);
463-
async->events |= COMEDI_CB_EOA | COMEDI_CB_ERROR;
463+
async->events |= COMEDI_CB_ERROR;
464464
break;
465465
} else if (flags & PrimaryTC) {
466466
writeb(ClearPrimaryTC,

drivers/staging/comedi/drivers/pcl812.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -797,7 +797,7 @@ static void pcl812_handle_eoc(struct comedi_device *dev,
797797

798798
if (pcl812_ai_eoc(dev, s, NULL, 0)) {
799799
dev_dbg(dev->class_dev, "A/D cmd IRQ without DRDY!\n");
800-
s->async->events |= COMEDI_CB_EOA | COMEDI_CB_ERROR;
800+
s->async->events |= COMEDI_CB_ERROR;
801801
return;
802802
}
803803

drivers/staging/comedi/drivers/pcl818.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -468,7 +468,7 @@ static bool pcl818_ai_dropout(struct comedi_device *dev,
468468
(devpriv->dma) ? "DMA" :
469469
(devpriv->usefifo) ? "FIFO" : "IRQ",
470470
chan, expected_chan);
471-
s->async->events |= COMEDI_CB_EOA | COMEDI_CB_ERROR;
471+
s->async->events |= COMEDI_CB_ERROR;
472472
return true;
473473
}
474474
return false;
@@ -501,7 +501,7 @@ static void pcl818_handle_eoc(struct comedi_device *dev,
501501

502502
if (pcl818_ai_eoc(dev, s, NULL, 0)) {
503503
dev_err(dev->class_dev, "A/D mode1/3 IRQ without DRDY!\n");
504-
s->async->events |= COMEDI_CB_EOA | COMEDI_CB_ERROR;
504+
s->async->events |= COMEDI_CB_ERROR;
505505
return;
506506
}
507507

@@ -558,14 +558,14 @@ static void pcl818_handle_fifo(struct comedi_device *dev,
558558

559559
if (status & 4) {
560560
dev_err(dev->class_dev, "A/D mode1/3 FIFO overflow!\n");
561-
s->async->events |= COMEDI_CB_EOA | COMEDI_CB_ERROR;
561+
s->async->events |= COMEDI_CB_ERROR;
562562
return;
563563
}
564564

565565
if (status & 1) {
566566
dev_err(dev->class_dev,
567567
"A/D mode1/3 FIFO interrupt without data!\n");
568-
s->async->events |= COMEDI_CB_EOA | COMEDI_CB_ERROR;
568+
s->async->events |= COMEDI_CB_ERROR;
569569
return;
570570
}
571571

drivers/staging/comedi/drivers/quatech_daqp_cs.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -210,8 +210,7 @@ static enum irqreturn daqp_interrupt(int irq, void *dev_id)
210210
unsigned short data;
211211

212212
if (status & DAQP_STATUS_DATA_LOST) {
213-
s->async->events |=
214-
COMEDI_CB_EOA | COMEDI_CB_OVERFLOW;
213+
s->async->events |= COMEDI_CB_OVERFLOW;
215214
dev_warn(dev->class_dev, "data lost\n");
216215
break;
217216
}
@@ -239,7 +238,7 @@ static enum irqreturn daqp_interrupt(int irq, void *dev_id)
239238
if (loop_limit <= 0) {
240239
dev_warn(dev->class_dev,
241240
"loop_limit reached in daqp_interrupt()\n");
242-
s->async->events |= COMEDI_CB_EOA | COMEDI_CB_ERROR;
241+
s->async->events |= COMEDI_CB_ERROR;
243242
}
244243

245244
comedi_handle_events(dev, s);

0 commit comments

Comments
 (0)