linux/drivers/usb/class
Robert Foss c1da59dad0 cdc-wdm: Clear read pipeline in case of error
Implemented queued response handling. This queue is processed every time the
WDM_READ flag is cleared.

In case of a read error, userspace may not actually read the data, since the
driver returns an error through wdm_poll. After this, the underlying device may
attempt to send us more data, but the queue is not processed. While userspace is
also blocked, because the read error is never cleared.

After this patch, we proactively process the queue on a read error. If there was
an outstanding response to handle, that will clear the error (or go through the
same logic again, if another read error occurs). If there was no outstanding
response, this will bring the queue size back to 0, unblocking a future response
from the underlying device.

Signed-off-by: Robert Foss <robert.foss@collabora.com>
Tested-by: Robert Foss <robert.foss@collabora.com>
Acked-by: Oliver Neukum <oneukum@suse.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-08-10 10:15:30 +02:00
..
cdc-acm.c cdc-acm: beautify probe() 2016-07-18 08:46:57 -07:00
cdc-acm.h cdc-acm: implement put_char() and flush_chars() 2016-02-14 17:06:43 -08:00
cdc-wdm.c cdc-wdm: Clear read pipeline in case of error 2016-08-10 10:15:30 +02:00
Kconfig USB: regroup all depends on USB within an if USB block 2013-04-09 16:49:07 -07:00
Makefile USB: add USB test and measurement class driver 2008-10-17 14:40:51 -07:00
usblp.c usblp: do not set TASK_INTERRUPTIBLE before lock 2015-11-19 16:31:42 -08:00
usbtmc.c usb: usbtmc: Fix disconnect/poll interaction 2016-02-20 20:21:53 -08:00