Re: [PATCH V3] xhci: Reset TI USB controller on xhci shutdown

From: Wen Xiong

Date: Wed Oct 28 2026 - 11:48:21 EST




I tried to make this code a bit more "proper", by moving the
pci_reset_function_locked() call to xhci-pci.c from xhci.c.

I found that when I actually run this, I get a warning from PCI:

unlocked secondary bus reset via: __pci_reset_function_locked


Thanks for your reviewing!
Can we do?
if device is TI/0x8241 device, we just reset it in xhci-pci.c.
We don't need to bother other USB devices.

Thanks,
Wendy
Bjorn, any tips what would be a proper way to whack a malfunctioning
PCI device with a heavy hammer to ensure it will work after kexec?
Seems we have pci_reset_function(), which locks the parent bridge for
us, but it also preserves some "state". Do we want that?

I'm also starting to wonder if we shouldn't do this reset after kexec,
to cover for kdump. Or maybe both, because shutdown() is supposed to
quiesce the chip and keep it from doing DMA, and we have no idea what
such chip is doing (if anything) when it refuses to halt.

Thanks,
Michal

[...]
+ /*
+ * TI xHCI controllers fail to initialize in a kexec
+ * kernel without a PCI function reset
+ */
+ if (err && (xhci->quirks & XHCI_RESET_ON_SHUTDOWN))
+ pci_reset_function_locked(to_pci_dev(hcd->self.sysdev));
[...]