1
0
Fork 0
alistair23-linux/drivers/usb/class
Romain Izard 93e1c8a638 usb: cdc-acm: fix race during wakeup blocking TX traffic
When the kernel is compiled with preemption enabled, the URB completion
handler can run in parallel with the work responsible for waking up the
tty layer. If the URB handler sets the EVENT_TTY_WAKEUP bit during the
call to tty_port_tty_wakeup() to signal that there is room for additional
input, it will be cleared at the end of this call. As a result, TX traffic
on the upper layer will be blocked.

This can be seen with a kernel configured with CONFIG_PREEMPT, and a fast
modem connected with PPP running over a USB CDC-ACM port.

Use test_and_clear_bit() instead, which ensures that each wakeup requested
by the URB completion code will trigger a call to tty_port_tty_wakeup().

Fixes: 1aba579f3c cdc-acm: handle read pipe errors
Signed-off-by: Romain Izard <romain.izard.pro@gmail.com>
Cc: stable <stable@vger.kernel.org>
Acked-by: Oliver Neukum <oneukum@suse.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-03-28 00:08:49 +09:00
..
Kconfig USB: add missing SPDX lines to Kconfig and Makefiles 2019-01-22 09:08:17 +01:00
Makefile USB: add SPDX identifiers to all remaining Makefiles 2017-11-07 15:53:48 +01:00
cdc-acm.c usb: cdc-acm: fix race during wakeup blocking TX traffic 2019-03-28 00:08:49 +09:00
cdc-acm.h cdc-acm: fix abnormal DATA RX issue for Mediatek Preloader. 2018-12-20 16:38:52 +01:00
cdc-wdm.c cdc-wdm: pass return value of recover_from_urb_loss 2019-02-19 14:41:38 +01:00
usblp.c usb: usblp: use irqsave() in USB's complete callback 2018-06-28 19:36:06 +09:00
usbtmc.c usb: usbtmc: uninitialized symbol 'actual' in usbtmc_ioctl_abort_bulk_in_tag 2018-09-28 15:12:08 +02:00