* [PATCH 0/1] xhci fix for usb-linus
@ 2025-03-04 11:31 Mathias Nyman
2025-03-04 11:31 ` [PATCH 1/1] usb: xhci: Fix host controllers "dying" after suspend and resume Mathias Nyman
0 siblings, 1 reply; 6+ messages in thread
From: Mathias Nyman @ 2025-03-04 11:31 UTC (permalink / raw)
To: gregkh; +Cc: linux-usb, linux-kernel, Mathias Nyman
Hi Greg
Michal found and fixed a regression introduced in 6.13
If possible it would be nice to get this into 6.14 still
Thanks
Mathias
Michal Pecio (1):
usb: xhci: Fix host controllers "dying" after suspend and resume
drivers/usb/host/xhci.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
--
2.43.0
^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH 1/1] usb: xhci: Fix host controllers "dying" after suspend and resume
2025-03-04 11:31 [PATCH 0/1] xhci fix for usb-linus Mathias Nyman
@ 2025-03-04 11:31 ` Mathias Nyman
0 siblings, 0 replies; 6+ messages in thread
From: Mathias Nyman @ 2025-03-04 11:31 UTC (permalink / raw)
To: gregkh; +Cc: linux-usb, linux-kernel, Michal Pecio, stable, Mathias Nyman
From: Michal Pecio <michal.pecio@gmail.com>
A recent cleanup went a bit too far and dropped clearing the cycle bit
of link TRBs, so it stays different from the rest of the ring half of
the time. Then a race occurs: if the xHC reaches such link TRB before
more commands are queued, the link's cycle bit unintentionally matches
the xHC's cycle so it follows the link and waits for further commands.
If more commands are queued before the xHC gets there, inc_enq() flips
the bit so the xHC later sees a mismatch and stops executing commands.
This function is called before suspend and 50% of times after resuming
the xHC is doomed to get stuck sooner or later. Then some Stop Endpoint
command fails to complete in 5 seconds and this shows up
xhci_hcd 0000:00:10.0: xHCI host not responding to stop endpoint command
xhci_hcd 0000:00:10.0: xHCI host controller not responding, assume dead
xhci_hcd 0000:00:10.0: HC died; cleaning up
followed by loss of all USB decives on the affected bus. That's if you
are lucky, because if Set Deq gets stuck instead, the failure is silent.
Likely responsible for kernel bug 219824. I found this while searching
for possible causes of that regression and reproduced it locally before
hearing back from the reporter. To repro, simply wait for link cycle to
become set (debugfs), then suspend, resume and wait. To accelerate the
failure I used a script which repeatedly starts and stops a UVC camera.
Some HCs get fully reinitialized on resume and they are not affected.
Link: https://bugzilla.kernel.org/show_bug.cgi?id=219824
Fixes: 36b972d4b7ce ("usb: xhci: improve xhci_clear_command_ring()")
Cc: stable@vger.kernel.org
Signed-off-by: Michal Pecio <michal.pecio@gmail.com>
Signed-off-by: Mathias Nyman <mathias.nyman@linux.intel.com>
---
drivers/usb/host/xhci.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/drivers/usb/host/xhci.c b/drivers/usb/host/xhci.c
index 45653114ccd7..1a90ebc8a30e 100644
--- a/drivers/usb/host/xhci.c
+++ b/drivers/usb/host/xhci.c
@@ -780,8 +780,12 @@ static void xhci_clear_command_ring(struct xhci_hcd *xhci)
struct xhci_segment *seg;
ring = xhci->cmd_ring;
- xhci_for_each_ring_seg(ring->first_seg, seg)
+ xhci_for_each_ring_seg(ring->first_seg, seg) {
+ /* erase all TRBs before the link */
memset(seg->trbs, 0, sizeof(union xhci_trb) * (TRBS_PER_SEGMENT - 1));
+ /* clear link cycle bit */
+ seg->trbs[TRBS_PER_SEGMENT - 1].link.control &= cpu_to_le32(~TRB_CYCLE);
+ }
xhci_initialize_ring_info(ring);
/*
--
2.43.0
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH 0/1] xhci fix for usb-linus
@ 2025-02-25 9:59 Mathias Nyman
0 siblings, 0 replies; 6+ messages in thread
From: Mathias Nyman @ 2025-02-25 9:59 UTC (permalink / raw)
To: gregkh; +Cc: linux-usb, Mathias Nyman
Hi Greg
One small patch to cope with VIA VL805 xHC hosts reading past the DMA area
given to them.
Thanks
Mathias
Michal Pecio (1):
usb: xhci: Enable the TRB overfetch quirk on VIA VL805
drivers/usb/host/xhci-mem.c | 3 ++-
drivers/usb/host/xhci-pci.c | 10 +++++++---
drivers/usb/host/xhci.h | 2 +-
3 files changed, 10 insertions(+), 5 deletions(-)
--
2.43.0
^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH 0/1] xhci fix for usb-linus
@ 2024-08-15 14:11 Mathias Nyman
0 siblings, 0 replies; 6+ messages in thread
From: Mathias Nyman @ 2024-08-15 14:11 UTC (permalink / raw)
To: linux-usb, gregkh; +Cc: Mathias Nyman
Hi Greg
One xhci patch for usb-linus to solve a NULL pointer dereference found recently
Thanks
Mathias
Mathias Nyman (1):
xhci: Fix Panther point NULL pointer deref at full-speed
re-enumeration
drivers/usb/host/xhci.c | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
--
2.25.1
^ permalink raw reply [flat|nested] 6+ messages in thread* [PATCH 0/1] xhci fix for usb-linus
@ 2021-12-21 11:28 Mathias Nyman
0 siblings, 0 replies; 6+ messages in thread
From: Mathias Nyman @ 2021-12-21 11:28 UTC (permalink / raw)
To: gregkh; +Cc: linux-usb, Mathias Nyman
Hi Greg
One small patch, remove an extra quirk set for Fresco FL1100 controllers.
External docks with this controller have issues enumerating usb devices.
Nice if it could still make 5.16, if not then 5.17 is fine
Thanks
-Mathias
Mathias Nyman (1):
xhci: Fresco FL1100 controller should not have BROKEN_MSI quirk set.
drivers/usb/host/xhci-pci.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
--
2.25.1
^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH 0/1] xhci fix for usb-linus
@ 2021-07-15 15:06 Mathias Nyman
0 siblings, 0 replies; 6+ messages in thread
From: Mathias Nyman @ 2021-07-15 15:06 UTC (permalink / raw)
To: gregkh; +Cc: linux-usb, Mathias Nyman
Hi Greg
One small xhci fix resolving a missed usb 2 device-intiated wake.
I'll be out on vacation for two weeks, starting monday, so any response
will be delayed.
Thanks
-Mathias
Mathias Nyman (1):
xhci: Fix lost USB 2 remote wake
drivers/usb/host/xhci-hub.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
--
2.25.1
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2025-03-04 11:30 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-03-04 11:31 [PATCH 0/1] xhci fix for usb-linus Mathias Nyman
2025-03-04 11:31 ` [PATCH 1/1] usb: xhci: Fix host controllers "dying" after suspend and resume Mathias Nyman
-- strict thread matches above, loose matches on Subject: below --
2025-02-25 9:59 [PATCH 0/1] xhci fix for usb-linus Mathias Nyman
2024-08-15 14:11 Mathias Nyman
2021-12-21 11:28 Mathias Nyman
2021-07-15 15:06 Mathias Nyman
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox