All of lore.kernel.org
 help / color / mirror / Atom feed
From: Johan Hovold <johan@kernel.org>
To: linux-usb@vger.kernel.org
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	linux-kernel@vger.kernel.org, Johan Hovold <johan@kernel.org>,
	stable@vger.kernel.org
Subject: [PATCH v2 01/12] USB: serial: digi_acceleport: fix broken rx after throttle
Date: Tue, 23 Jun 2026 17:08:15 +0200	[thread overview]
Message-ID: <20260623150826.314727-2-johan@kernel.org> (raw)
In-Reply-To: <20260623150826.314727-1-johan@kernel.org>

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 | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)

diff --git a/drivers/usb/serial/digi_acceleport.c b/drivers/usb/serial/digi_acceleport.c
index 6899aebfd6ae..097769525ca4 100644
--- a/drivers/usb/serial/digi_acceleport.c
+++ b/drivers/usb/serial/digi_acceleport.c
@@ -1069,6 +1069,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)
@@ -1096,6 +1097,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;
 }
 
-- 
2.53.0


  reply	other threads:[~2026-06-23 15:09 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-06-23 15:08 [PATCH v2 00/12] USB: serial: digi_acceleport: registration fix and cleanups Johan Hovold
2026-06-23 15:08 ` Johan Hovold [this message]
2026-06-23 15:08 ` [PATCH v2 02/12] USB: serial: digi_acceleport: fix port registration order Johan Hovold
2026-06-23 15:08 ` [PATCH v2 03/12] USB: serial: digi_acceleport: drop unused wait queue Johan Hovold
2026-06-23 15:08 ` [PATCH v2 04/12] USB: serial: digi_acceleport: always stop write urb on close Johan Hovold
2026-06-23 15:08 ` [PATCH v2 05/12] USB: serial: digi_acceleport: add oob port helper Johan Hovold
2026-06-23 15:08 ` [PATCH v2 06/12] USB: serial: digi_acceleport: clean up declarations and whitespace Johan Hovold
2026-06-23 15:08 ` [PATCH v2 07/12] USB: serial: digi_acceleport: drop redundant driver data sanity checks Johan Hovold
2026-06-23 15:08 ` [PATCH v2 08/12] USB: serial: digi_acceleport: stop OOB I/O when not in use Johan Hovold
2026-06-23 15:08 ` [PATCH v2 09/12] USB: serial: digi_acceleport: drop unused in-buf define Johan Hovold
2026-06-23 15:08 ` [PATCH v2 10/12] USB: serial: digi_acceleport: clean up xfer buf length expression Johan Hovold
2026-06-23 15:08 ` [PATCH v2 11/12] USB: serial: digi_acceleport: clean up write completion Johan Hovold
2026-06-23 15:08 ` [PATCH v2 12/12] USB: serial: digi_acceleport: clean up inb command submission Johan Hovold

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260623150826.314727-2-johan@kernel.org \
    --to=johan@kernel.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=stable@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.