Linux USB
 help / color / mirror / Atom feed
* [PATCH] USB: serial: ti_usb_3410_5052: fix read urb resubmission at open
@ 2026-11-30 15:01 YuanZhe Liu
  2026-11-30 15:09 ` sashiko-bot
  0 siblings, 1 reply; 2+ messages in thread
From: YuanZhe Liu @ 2026-11-30 15:01 UTC (permalink / raw)
  To: Johan Hovold
  Cc: Greg Kroah-Hartman, linux-usb, linux-kernel, stable, Bin Yu,
	Cheng Wen

A port that has been throttled keeps TI_READ_URB_STOPPED across close as
the read urb state is never reset.

During the next open(), ti_set_termios() is called before the port has
been started and would therefore restart the read urb, which is then
submitted a second time at the end of open():

	URB 00000000b0fe02b4 submitted while active
	WARNING: CPU: 0 PID: 1840 at drivers/usb/core/urb.c:379 usb_submit_urb+0x14c5/0x1790
	ti_usb_3410_5052_2 ttyUSB0: ti_open - submit read urb failed, -16

The failed submit also leaves the read urb running after open() returns
and, as the port is never marked initialized, close() will not kill it.

Fix this by resetting the read urb state before termios is applied so
that the read urb is only submitted once, after the port has been
started.

Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
Cc: stable@vger.kernel.org	# 2.6.12
Co-developed-by: Bin Yu <byu@xidian.edu.cn>
Signed-off-by: Bin Yu <byu@xidian.edu.cn>
Co-developed-by: Cheng Wen <wencheng@xidian.edu.cn>
Signed-off-by: Cheng Wen <wencheng@xidian.edu.cn>
Signed-off-by: YuanZhe Liu <25031212351@stu.xidian.edu.cn>
---
 drivers/usb/serial/ti_usb_3410_5052.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/drivers/usb/serial/ti_usb_3410_5052.c b/drivers/usb/serial/ti_usb_3410_5052.c
index b3f00e315815..c71f1feac588 100644
--- a/drivers/usb/serial/ti_usb_3410_5052.c
+++ b/drivers/usb/serial/ti_usb_3410_5052.c
@@ -653,6 +653,12 @@ static int ti_open(struct tty_struct *tty, struct usb_serial_port *port)
 	if (mutex_lock_interruptible(&tdev->td_open_close_lock))
 		return -ERESTARTSYS;
 
+	/*
+	 * The read urb is only submitted after the port has been started;
+	 * make sure termios processing below does not restart it.
+	 */
+	tport->tp_read_urb_state = TI_READ_URB_RUNNING;
+
 	tport->tp_msr = 0;
 	tport->tp_shadow_mcr |= (TI_MCR_RTS | TI_MCR_DTR);
 
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] USB: serial: ti_usb_3410_5052: fix read urb resubmission at open
  2026-11-30 15:01 [PATCH] USB: serial: ti_usb_3410_5052: fix read urb resubmission at open YuanZhe Liu
@ 2026-11-30 15:09 ` sashiko-bot
  0 siblings, 0 replies; 2+ messages in thread
From: sashiko-bot @ 2026-11-30 15:09 UTC (permalink / raw)
  To: YuanZhe Liu; +Cc: linux-usb

> A port that has been throttled keeps TI_READ_URB_STOPPED across close as
> the read urb state is never reset.
> 
> During the next open(), ti_set_termios() is called before the port has
> been started and would therefore restart the read urb, which is then
> submitted a second time at the end of open():
> 
> 	URB 00000000b0fe02b4 submitted while active
> 	WARNING: CPU: 0 PID: 1840 at drivers/usb/core/urb.c:379 usb_submit_urb+0x14c5/0x1790
> 	ti_usb_3410_5052_2 ttyUSB0: ti_open - submit read urb failed, -16
> 
> The failed submit also leaves the read urb running after open() returns
> and, as the port is never marked initialized, close() will not kill it.
> 
> Fix this by resetting the read urb state before termios is applied so
> that the read urb is only submitted once, after the port has been
> started.
> 
> Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
> Cc: stable@vger.kernel.org	# 2.6.12
> Co-developed-by: Bin Yu <byu@xidian.edu.cn>
> Signed-off-by: Bin Yu <byu@xidian.edu.cn>
> Co-developed-by: Cheng Wen <wencheng@xidian.edu.cn>
> Signed-off-by: Cheng Wen <wencheng@xidian.edu.cn>
> Signed-off-by: YuanZhe Liu <25031212351@stu.xidian.edu.cn>

Sashiko has reviewed this patch and found no issues.

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261130150117.7301-1-25031212351@stu.xidian.edu.cn?part=1

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2026-11-30 15:09 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-30 15:01 [PATCH] USB: serial: ti_usb_3410_5052: fix read urb resubmission at open YuanZhe Liu
2026-11-30 15:09 ` sashiko-bot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox