driverdev-devel.linuxdriverproject.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/6] staging: comedi: dt2814: Fix broken AI command support
@ 2021-03-01 16:57 Ian Abbott
  2021-03-01 16:57 ` [PATCH 1/6] staging: comedi: dt2814: Clear stale AI data before operation Ian Abbott
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: Ian Abbott @ 2021-03-01 16:57 UTC (permalink / raw)
  To: devel; +Cc: Greg Kroah-Hartman, Ian Abbott

The DT2814 board is an old analog-to-digital ISA card supported by the
Comedi "dt2814" driver.  The board has a timed acquisition mode, and an
end-of-conversion interrupt.  The interrupt can be disabled by removing
the jumper that sets the IRQ level.  In Comedi, the board is a manually
configured "legacy" device with an optional IRQ setting.

The Comedi driver has some broken support for asynchronous streaming
commands when the optional IRQ setting has been configured.  The main
problems are:

* It doesn't write any samples to the Comedi buffer to be read by the
  user application.
* The IRQ handler gets called at the end of any conversion, including
  during non-streaming, software-triggered acquisitions, but will
  interfere with these acquisitions because it reads the A/D Data
  register.

This series of patches attempts to support the asynchronous commands
properly so that it only reads the A/D Data register if the asynchronous
command has been set up, and actually writes it to the Comedi buffer.

Stopping the asynchronous command triggers an unwanted conversion.  The
interrupt handler used to wait for that to finish, but this series of
patches changes that so that other places in the code outside the
interrupt handler wait for a stale conversion to finish and/or read the
stale data before starting a new conversion.

1) staging: comedi: dt2814: Clear stale AI data before operation
2) staging: comedi: dt2814: Don't wait for conversion in interrupt handler
3) staging: comedi: dt2814: Call dt2814_ai_clear() during initialization
4) staging: comedi: dt2814: Fix asynchronous command interrupt handling
5) staging: comedi: dt2814: Remove struct dt2814_private
6) staging: comedi: dt2814: Clear stale AI data on detach

 drivers/staging/comedi/drivers/dt2814.c | 153 +++++++++++++++++++++++++-------
 1 file changed, 120 insertions(+), 33 deletions(-)

_______________________________________________
devel mailing list
devel@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2021-03-01 16:59 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-01 16:57 [PATCH 0/6] staging: comedi: dt2814: Fix broken AI command support Ian Abbott
2021-03-01 16:57 ` [PATCH 1/6] staging: comedi: dt2814: Clear stale AI data before operation Ian Abbott
2021-03-01 16:57 ` [PATCH 2/6] staging: comedi: dt2814: Don't wait for conversion in interrupt handler Ian Abbott
2021-03-01 16:57 ` [PATCH 3/6] staging: comedi: dt2814: Call dt2814_ai_clear() during initialization Ian Abbott
2021-03-01 16:57 ` [PATCH 4/6] staging: comedi: dt2814: Fix asynchronous command interrupt handling Ian Abbott
2021-03-01 16:57 ` [PATCH 5/6] staging: comedi: dt2814: Remove struct dt2814_private Ian Abbott
2021-03-01 16:57 ` [PATCH 6/6] staging: comedi: dt2814: Clear stale AI data on detach Ian Abbott

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).