linux/drivers/usb/class
Simon Arlott 09867af369 USB: cdc-acm: support flushing write buffers (TCOFLUSH)
If the serial device never reads data written to it (because it is "output
only") then the write buffers will still be waiting for the URB to complete
on close(), which will hang for 30s until the closing_wait timeout expires.

This can happen with the ESP32-H2/ESP32-C6 USB serial interface. Changing
the port closing_wait timeout is a privileged operation but flushing the
output buffer is not a privileged operation.

Implement the flush_buffer tty operation to cancel in-progress writes so
that tcflush(fd, TCOFLUSH) can be used to unblock the serial port before
close.

Signed-off-by: Simon Arlott <simon@octiron.net>
Link: https://lore.kernel.org/r/555fbc4c-043b-8932-fb9b-a208d61ffbe4@0882a8b5-c6c3-11e9-b005-00805fc181fe.uuid.home.arpa
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2023-08-22 14:46:11 +02:00
..
cdc-acm.c USB: cdc-acm: support flushing write buffers (TCOFLUSH) 2023-08-22 14:46:11 +02:00
cdc-acm.h USB: cdc-acm: use CDC serial-state defines 2022-07-25 10:57:41 +02:00
cdc-wdm.c wwan: core: Support slicing in port TX flow of WWAN subsystem 2023-03-17 22:38:31 -07:00
Kconfig treewide: replace '---help---' in Kconfig files with 'help' 2020-06-14 01:57:21 +09:00
Makefile USB: add SPDX identifiers to all remaining Makefiles 2017-11-07 15:53:48 +01:00
usblp.c USB: make devnode() callback in usb_class_driver take a const * 2022-10-20 12:11:56 +02:00
usbtmc.c USB: usbtmc: Fix direction for 0-length ioctl control messages 2023-05-13 17:25:49 +09:00