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

From: Michal Pecio

Date: Wed Oct 28 2026 - 05:38:09 EST


On Wed, 21 Oct 2026 12:06:08 -0400, wenxiong@xxxxxxxxxxxxx wrote:
> From: Wen Xiong <wenxiong@xxxxxxxxxxxxx>
>
> Fixes kexec boot. Without a hard reset, TI pci usb chips will fail to
> initialize in a kexec booted kernel.
>
> Signed-off-by: Wen Xiong <wenxiong@xxxxxxxxxxxxx>

[ Adding linux-pci and Bjorn Helgaas ]

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

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));
> [...]