]> git.proxmox.com Git - mirror_ubuntu-hirsute-kernel.git/commitdiff
USB: serial: keyspan_pda: fix stalled writes
authorJohan Hovold <johan@kernel.org>
Sun, 25 Oct 2020 17:45:49 +0000 (18:45 +0100)
committerPaolo Pisati <paolo.pisati@canonical.com>
Mon, 4 Jan 2021 15:47:28 +0000 (16:47 +0100)
BugLink: https://bugs.launchpad.net/bugs/1910111
commit c01d2c58698f710c9e13ba3e2d296328606f74fd upstream.

Make sure to clear the write-busy flag also in case no new data was
submitted due to lack of device buffer space so that writing is
resumed once space again becomes available.

Fixes: 507ca9bc0476 ("[PATCH] USB: add ability for usb-serial drivers to determine if their write urb is currently being used.")
Cc: stable <stable@vger.kernel.org> # 2.6.13
Acked-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Johan Hovold <johan@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Paolo Pisati <paolo.pisati@canonical.com>
drivers/usb/serial/keyspan_pda.c

index 17b60e5a9f1fe453c5e908b3663bd308df06d4d3..d6ebde779e85428cbf8310bae6c8ce1759ca8b6e 100644 (file)
@@ -548,7 +548,7 @@ static int keyspan_pda_write(struct tty_struct *tty,
 
        rc = count;
 exit:
-       if (rc < 0)
+       if (rc <= 0)
                set_bit(0, &port->write_urbs_free);
        return rc;
 }