USB: serial: keyspan_pda: fix write implementation
authorJohan Hovold <johan@kernel.org>
Sun, 25 Oct 2020 17:45:54 +0000 (18:45 +0100)
committerJohan Hovold <johan@kernel.org>
Wed, 4 Nov 2020 10:01:36 +0000 (11:01 +0100)
commit7184933b52a6b3e64171819b77f0bab018696cb2
tree08ab9a8ad9391c8f6d266caa7a9c891205bd186c
parent79fe6826a5ebee2724d432a736ec04d8dca143ba
USB: serial: keyspan_pda: fix write implementation

Fix stalled writes by checking the available buffer space after
requesting an unthrottle notification in case the device buffer is
already empty so that no notification is ever sent (e.g. when doing
single character writes).

This also means we can drop the room query from write() which was
conditioned on in_interrupt() and prevented writing using this driver
from atomic contexts (e.g. PPP).

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