diff options
author | Mathias Nyman <mathias.nyman@linux.intel.com> | 2024-10-16 16:00:00 +0200 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2024-10-17 08:45:36 +0200 |
commit | 30c9ae5ece8ecd69d36e6912c2c0896418f2468c (patch) | |
tree | 368814ab8dd650f1547c4ac19aab597cf1383a3c /drivers/irqchip/irq-sifive-plic.c | |
parent | usb: xhci: Fix handling errors mid TD followed by other errors (diff) | |
download | linux-30c9ae5ece8ecd69d36e6912c2c0896418f2468c.tar.xz linux-30c9ae5ece8ecd69d36e6912c2c0896418f2468c.zip |
xhci: dbc: honor usb transfer size boundaries.
Treat each completed full size write to /dev/ttyDBC0 as a separate usb
transfer. Make sure the size of the TRBs matches the size of the tty
write by first queuing as many max packet size TRBs as possible up to
the last TRB which will be cut short to match the size of the tty write.
This solves an issue where userspace writes several transfers back to
back via /dev/ttyDBC0 into a kfifo before dbgtty can find available
request to turn that kfifo data into TRBs on the transfer ring.
The boundary between transfer was lost as xhci-dbgtty then turned
everyting in the kfifo into as many 'max packet size' TRBs as possible.
DbC would then send more data to the host than intended for that
transfer, causing host to issue a babble error.
Refuse to write more data to kfifo until previous tty write data is
turned into properly sized TRBs with data size boundaries matching tty
write size
Tested-by: Uday M Bhat <uday.m.bhat@intel.com>
Tested-by: Ćukasz Bartosik <ukaszb@chromium.org>
Cc: stable@vger.kernel.org
Signed-off-by: Mathias Nyman <mathias.nyman@linux.intel.com>
Link: https://lore.kernel.org/r/20241016140000.783905-5-mathias.nyman@linux.intel.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/irqchip/irq-sifive-plic.c')
0 files changed, 0 insertions, 0 deletions