• Ian Abbott's avatar
    staging: comedi: ni_mio_common: fix AO inttrig backwards compatibility · f0f4b0cc
    Ian Abbott authored
    Commit ebb657ba ("staging: comedi: ni_mio_common: clarify the
    cmd->start_arg validation and use") introduced a backwards compatibility
    issue in the use of asynchronous commands on the AO subdevice when
    `start_src` is `TRIG_EXT`.  Valid values for `start_src` are `TRIG_INT`
    (for internal, software trigger), and `TRIG_EXT` (for external trigger).
    When set to `TRIG_EXT`.  In both cases, the driver relies on an
    internal, software trigger to set things up (allowing the user
    application to write sufficient samples to the data buffer before the
    trigger), so it acts as a software "pre-trigger" in the `TRIG_EXT` case.
    The software trigger is handled by `ni_ao_inttrig()`.
    
    Prior to the above change, when `start_src` was `TRIG_INT`, `start_arg`
    was required to be 0, and `ni_ao_inttrig()` checked that the software
    trigger number was also 0.  After the above change, when `start_src` was
    `TRIG_INT`, any value was allowed for `start_arg`, and `ni_ao_inttrig()`
    checked that the software trigger number matched this `start_arg` value.
    The backwards compatibility issue is that the internal trigger number
    now has to match `start_arg` when `start_src` is `TRIG_EXT` when it
    previously had to be 0.
    
    Fix the backwards compatibility issue in `ni_ao_inttrig()` by always
    allowing software trigger number 0 when `start_src` is something other
    than `TRIG_INT`.
    
    Thanks to Spencer Olson for reporting the issue.
    Signed-off-by: default avatarIan Abbott <abbotti@mev.co.uk>
    Reported-by: default avatarSpencer Olson <olsonse@umich.edu>
    Fixes: ebb657ba ("staging: comedi: ni_mio_common: clarify the cmd->start_arg validation and use")
    Cc: stable <stable@vger.kernel.org>
    Reviewed-by: default avatarH Hartley Sweeten <hsweeten@visionengravers.com>
    Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
    f0f4b0cc
Name
Last commit
Last update
..
android Loading commit data...
board Loading commit data...
clocking-wizard Loading commit data...
comedi Loading commit data...
dgnc Loading commit data...
emxx_udc Loading commit data...
fbtft Loading commit data...
fsl-mc Loading commit data...
fwserial Loading commit data...
gdm724x Loading commit data...
goldfish Loading commit data...
gs_fpgaboot Loading commit data...
i4l Loading commit data...
iio Loading commit data...
ks7010 Loading commit data...
lustre Loading commit data...
media Loading commit data...
most Loading commit data...
mt29f_spinand Loading commit data...
netlogic Loading commit data...
nvec Loading commit data...
octeon Loading commit data...
octeon-usb Loading commit data...
olpc_dcon Loading commit data...
rtl8188eu Loading commit data...
rtl8192e Loading commit data...
rtl8192u Loading commit data...
rtl8712 Loading commit data...
rtl8723au Loading commit data...
rts5208 Loading commit data...
skein Loading commit data...
slicoss Loading commit data...
sm750fb Loading commit data...
speakup Loading commit data...
unisys Loading commit data...
vme Loading commit data...
vt6655 Loading commit data...
vt6656 Loading commit data...
wilc1000 Loading commit data...
wlan-ng Loading commit data...
xgifb Loading commit data...
Kconfig Loading commit data...
Makefile Loading commit data...