USB: serial: keyspan_pda: fix write unthrottling
authorJohan Hovold <johan@kernel.org>
Sun, 25 Oct 2020 17:45:52 +0000 (18:45 +0100)
committerJohan Hovold <johan@kernel.org>
Wed, 4 Nov 2020 10:01:28 +0000 (11:01 +0100)
commit320f9028c7873c3c7710e8e93e5c979f4c857490
tree4d960fd102c614927b8fac566c5c8a065affa55e
parent49fbb8e37a961396a5b6c82937c70df91de45e9d
USB: serial: keyspan_pda: fix write unthrottling

The driver did not update its view of the available device buffer space
until write() was called in task context. This meant that write_room()
would return 0 even after the device had sent a write-unthrottle
notification, something which could lead to blocked writers not being
woken up (e.g. when using OPOST).

Note that we must also request an unthrottle notification is case a
write() request fills the device buffer exactly.

Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
Cc: stable <stable@vger.kernel.org>
Acked-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Johan Hovold <johan@kernel.org>
drivers/usb/serial/keyspan_pda.c