[PATCH v3 0/3] USB: serial: kobil_sct: fix write path races

From: YuanZhe Liu

Date: Mon Nov 30 2026 - 07:06:09 EST


This series fixes the write path of the KOBIL USB serial driver.

Patch 1 waits for each interrupt-out chunk to complete instead of reusing
the URB while it is still active, and stops sending on errors.

Patch 2 serializes concurrent writers so that the transmit buffer cannot
be corrupted and the URB cannot be resubmitted by a second caller.

Patch 3 moves the chunked block transmission to a work item so the tty
write path no longer sleeps and the port private data cannot be freed
while the driver is waiting on a transfer.

---
v3:
- Restart the interrupt-in URB only when the whole block was sent.
- Add a patch to serialize concurrent writes.
- Add a patch to move the block transmission to a work item.

v2:
- Check urb->status and stop sending the block when the transfer fails
or the URB is killed.
- Only restart the interrupt-in URB once the block has been sent.
- Bail out if the port was disconnected while waiting.


YuanZhe Liu (3):
USB: serial: kobil_sct: fix URB submitted while active
USB: serial: kobil_sct: serialize concurrent writes
USB: serial: kobil_sct: move block transmission to a work queue

drivers/usb/serial/kobil_sct.c | 199 ++++++++++++++++++++++++++-------
1 file changed, 161 insertions(+), 38 deletions(-)

--
2.34.1