]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
USB: serial: digi_acceleport: fix broken rx after throttle
authorJohan Hovold <johan@kernel.org>
Tue, 23 Jun 2026 15:08:15 +0000 (17:08 +0200)
committerJohan Hovold <johan@kernel.org>
Mon, 29 Jun 2026 09:40:34 +0000 (11:40 +0200)
If the port is closed while throttled, the read urb is never resubmitted
and the port will not receive any further data until the device is
reconnected (or the driver is rebound).

Clear the throttle flags and submit the urb if needed when opening the
port.

Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
Cc: stable@vger.kernel.org
Signed-off-by: Johan Hovold <johan@kernel.org>
drivers/usb/serial/digi_acceleport.c

index fa5c3539f806e2fdf7c82e3f1b438a36f07e342e..dea039163661b2e41e8b453cad8c740a1f094da3 100644 (file)
@@ -1076,6 +1076,7 @@ static int digi_open(struct tty_struct *tty, struct usb_serial_port *port)
        unsigned char buf[32];
        struct digi_port *priv = usb_get_serial_port_data(port);
        struct ktermios not_termios;
+       int throttled;
 
        /* be sure the device is started up */
        if (digi_startup_device(port->serial) != 0)
@@ -1103,6 +1104,21 @@ static int digi_open(struct tty_struct *tty, struct usb_serial_port *port)
                not_termios.c_iflag = ~tty->termios.c_iflag;
                digi_set_termios(tty, port, &not_termios);
        }
+
+       spin_lock_irq(&priv->dp_port_lock);
+       throttled = priv->dp_throttle_restart;
+       priv->dp_throttled = 0;
+       priv->dp_throttle_restart = 0;
+       spin_unlock_irq(&priv->dp_port_lock);
+
+       if (throttled) {
+               ret = usb_submit_urb(port->read_urb, GFP_KERNEL);
+               if (ret) {
+                       dev_err(&port->dev, "failed to submit read urb: %d\n", ret);
+                       return ret;
+               }
+       }
+
        return 0;
 }