summaryrefslogtreecommitdiffstats
path: root/drivers/staging/vc04_services
diff options
context:
space:
mode:
authorIan Abbott <abbotti@mev.co.uk>2017-06-30 12:02:18 +0100
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2017-07-16 09:13:53 +0200
commit15d5193104a457d5151840247e3bce561c42e3e9 (patch)
treeb1d09c2550558ba0f93cf7ba6cf7ed020757d692 /drivers/staging/vc04_services
parent5771a8c08880cdca3bfb4a3fc6d309d6bba20877 (diff)
downloadlinux-stable-15d5193104a457d5151840247e3bce561c42e3e9.tar.gz
linux-stable-15d5193104a457d5151840247e3bce561c42e3e9.tar.bz2
linux-stable-15d5193104a457d5151840247e3bce561c42e3e9.zip
staging: comedi: ni_mio_common: fix AO timer off-by-one regression
As reported by Éric Piel on the Comedi mailing list (see <https://groups.google.com/forum/#!topic/comedi_list/ueZiR7vTLOU/discussion>), the analog output asynchronous commands are running too fast with a period 50 ns shorter than it should be. This affects all boards with AO command support that are supported by the "ni_pcimio", "ni_atmio", and "ni_mio_cs" drivers. This is a regression bug introduced by commit 080e6795cba3 ("staging: comedi: ni_mio_common: Cleans up/clarifies ni_ao_cmd"), specifically, this line in `ni_ao_cmd_set_update()`: /* following line: N-1 per STC */ ni_stc_writel(dev, trigvar - 1, NISTC_AO_UI_LOADA_REG); The `trigvar` variable value comes from a call to `ni_ns_to_timer()` which converts a timer period in nanoseconds to a hardware divisor value. The function already reduces the divisor by 1 as required by the hardware, so the above line should not reduce it further by 1. Fix it by replacing `trigvar` by `trigvar - 1` in the above line, and remove the misleading comment. Reported-by: Éric Piel <piel@delmic.com> Fixes: 080e6795cba3 ("staging: comedi: ni_mio_common: Cleans up/clarifies ni_ao_cmd") Cc: Éric Piel <piel@delmic.com> Cc: Spencer E. Olson <olsonse@umich.edu> Cc: <stable@vger.kernel.org> # 4.7+ Signed-off-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/vc04_services')
0 files changed, 0 insertions, 0 deletions