On 2014-09-12 00:07, H Hartley Sweeten wrote:
The comedi async commands should stop if an error/overflow happens or when
the end-of-acquisition for the command is detected. Some of the drivers
do this correctly but many don't.

The cfc_handle_events() function automatically detects the events that would
terminate a command. If the events are set it calls the subdevice (*cancel)
operation to stop the command.

Convert all the drivers that still use comedi_event() to use cfc_handle_events()
instead. This allows removing the unnecessary cancel in the driver, if present,
and ensures that all the drivers terminate the commands if necessary.

The only drivers that still use comedi_event() directly are the usbdux drivers.
These have a "cancel" in the urb completion routines that does not do what the
(*cancel) does. I'm waiting for a reply from the author to see if this can
be changed.

H Hartley Sweeten (25):
   staging: comedi: hwdrv_apci3120: use cfc_handle_events()
   staging: comedi: hwdrv_apci3120: do cfc_handle_events() at end of interrupt
   staging: comedi: hwdrv_apci3200: use cfc_handle_events()
   staging: comedi: addi_apci_1032: use cfc_handle_events()
   staging: comedi: addi_apci_1564: use cfc_handle_events()
   staging: comedi: addi_apci_2032: use cfc_handle_events()
   staging: comedi: addi_apci_3xxx: use cfc_handle_events()
   staging: comedi: amplc_dio200_common: use cfc_handle_events()
   staging: comedi: amplc_pc2360_common: use cfc_handle_events()
   staging: comedi: comedi_parport: use cfc_handle_events()
   staging: comedi: comedi_test: use cfc_handle_events()
   staging: comedi: dmm32at: use cfc_handle_events()
   staging: comedi: dt2814: use cfc_handle_events()
   staging: comedi: me4000: use cfc_handle_events()
   staging: comedi: ni_6527: use cfc_handle_events()
   staging: comedi: ni_65xx: use cfc_handle_events()
   staging: comedi: ni_atmio16d: use cfc_handle_events()
   staging: comedi: pcl711: use cfc_handle_events()
   staging: comedi: pcl726: use cfc_handle_events()
   staging: comedi: pcmmio: use cfc_handle_events()
   staging: comedi: pcmuio: use cfc_handle_events()
   staging: comedi: s626: use cfc_handle_events()
   staging: comedi: rtd520: clear FIFO when canceling async command
   staging: comedi: rtd520: use cfc_handle_events()
   staging: comedi: amplc_pci230: use cfc_handle_events()

  .../comedi/drivers/addi-data/hwdrv_apci3120.c      | 15 +-----
  .../comedi/drivers/addi-data/hwdrv_apci3200.c      |  3 +-
  drivers/staging/comedi/drivers/addi_apci_1032.c    |  2 +-
  drivers/staging/comedi/drivers/addi_apci_1564.c    |  2 +-
  drivers/staging/comedi/drivers/addi_apci_2032.c    |  8 +---
  drivers/staging/comedi/drivers/addi_apci_3xxx.c    |  2 +-
  .../staging/comedi/drivers/amplc_dio200_common.c   | 10 +---
  .../staging/comedi/drivers/amplc_pc236_common.c    |  2 +-
  drivers/staging/comedi/drivers/amplc_pci230.c      | 48 +++++++------------
  drivers/staging/comedi/drivers/comedi_parport.c    |  2 +-
  drivers/staging/comedi/drivers/comedi_test.c       |  7 +--
  drivers/staging/comedi/drivers/dmm32at.c           |  3 +-
  drivers/staging/comedi/drivers/dt2814.c            |  2 +-
  drivers/staging/comedi/drivers/me4000.c            |  3 +-
  drivers/staging/comedi/drivers/ni_6527.c           |  2 +-
  drivers/staging/comedi/drivers/ni_65xx.c           |  2 +-
  drivers/staging/comedi/drivers/ni_atmio16d.c       |  2 +-
  drivers/staging/comedi/drivers/pcl711.c            |  6 +--
  drivers/staging/comedi/drivers/pcl726.c            |  2 +-
  drivers/staging/comedi/drivers/pcmmio.c            | 16 ++-----
  drivers/staging/comedi/drivers/pcmuio.c            | 16 ++-----
  drivers/staging/comedi/drivers/rtd520.c            | 56 +++-------------------
  drivers/staging/comedi/drivers/s626.c              | 14 +-----
  23 files changed, 57 insertions(+), 168 deletions(-)


Several of these patches require changes to Kconfig to make the driver options select COMEDI_FC. I was toying with the idea of merging the comedi_fc module into the core comedi module anyway, at which point those Kconfig changes would be moot.

Also, all the descriptions have a typo: cfc_handler_events() should be cfc_handle_events().

Also, the summary line for patch 15 says amplc_pc2360_common instead of amplc_pc236_common.

--
-=( Ian Abbott @ MEV Ltd.    E-mail: <abbo...@mev.co.uk>        )=-
-=( Tel: +44 (0)161 477 1898   FAX: +44 (0)161 718 3587         )=-
_______________________________________________
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

Reply via email to