Skip to content
Commit 036695a6 authored by Ian Abbott's avatar Ian Abbott Committed by Greg Kroah-Hartman
Browse files

staging: comedi: dt2814: Clear stale AI data on detach



When the Comedi "detach" handler is called, it is possible that an extra
A/D conversion (triggered during termination of a Comedi asynchronous
command) is still in progress.  In that case, the FINISH bit in the
Status register will eventually get set and there will be stale data
waiting to be read from the A/D Data register.  The interrupt handler
will also be called if still connected at the time.  That should all be
mostly harmless, but it would be better to wait for any such conversion
to complete and clear any stale data during the "detach".  Add a custom
"detach" handler `dt2814_detach()` to do that if an interrupt handler
has been set up.  (There is no need to do it if no interrupt handler was
set up because Comedi asynchronous command support is disabled in that
case.)

Signed-off-by: default avatarIan Abbott <abbotti@mev.co.uk>
Link: https://lore.kernel.org/r/20210301165757.243065-7-abbotti@mev.co.uk


Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 04b2dcca
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