aboutsummaryrefslogtreecommitdiffstats
path: root/include/uapi/linux/usb
diff options
context:
space:
mode:
authorDave Penkler <dpenkler@gmail.com>2020-12-15 16:56:18 +0100
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2020-12-28 15:50:30 +0100
commit3c1037e2b6a94898f81ed1a68bea146a9db750a5 (patch)
tree08f35a7e902f118ec7f31b0f47c18586c388c147 /include/uapi/linux/usb
parentkcov, usbip: collect coverage from vhci_rx_loop (diff)
downloadlinux-dev-3c1037e2b6a94898f81ed1a68bea146a9db750a5.tar.xz
linux-dev-3c1037e2b6a94898f81ed1a68bea146a9db750a5.zip
USB: usbtmc: Fix reading stale status byte
The ioctl USBTMC488_IOCTL_READ_STB either returns a cached status byte (STB) sent by the device due to a service request (SRQ) condition or the STB obtained from a query to the device with a READ_STATUS_BYTE control message. When the query is interrupted by an SRQ message on the interrupt pipe, the ioctl still returns the requested STB while the STB of the out-of-band SRQ message is cached for the next call of this ioctl. However the cached SRQ STB represents a state that was previous to the last returned STB. Furthermore the cached SRQ STB can be stale and not reflect the current state of the device. The fixed ioctl now always reads the STB from the device and if the associated file descriptor has the srq_asserted bit set it ors in the RQS bit to the returned STB and clears the srq_asserted bit conformant to subclass USB488 devices. Tested-by: Jian-Wei Wu <jian-wei_wu@keysight.com> Reviewed-by: Guido Kiener <guido.kiener@rohde-schwarz.com> Signed-off-by: Dave Penkler <dpenkler@gmail.com> Link: https://lore.kernel.org/r/20201215155621.9592-2-dpenkler@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'include/uapi/linux/usb')
0 files changed, 0 insertions, 0 deletions