Re: [PATCH v2] usb: xhci: only set D3hot for pci device

From: Henry Lin
Date: Tue Nov 19 2019 - 02:46:21 EST


> The XHCI_SPURIOUS_WAKEUP quirk both resets the controller at shutdown
> and sets it to PCI D3 at remove/shutdown.

> Is it so that the NVIDIA Tegra xHC just needs to be reset at shutdown?
> The quirk is not set for Tegra xHC in current mainline kernel.
Some versions of NVIDIA Tegra xHC support VF on virtualization environment. In that case, they need reset at shutdown. For now, Tegra xHC's VF support has not been submitted to mainline kernel.

> Agree that we shouldn't call PCI specific functions in the generic shutdown code.
> Would be better if we could move the PCI parts to xhci-pci.c or hcd-pci.c

> Maybe we need to add a xhci_pci_shutdown() function for the xhci pci driver
> that could take care of the pci related shutdown quirks before calling
> usb_hcd_pci_shutdown(), and call that instead of directly calling
> usb_hcd_pci_shutdown().
To keep original code sequence, I implemented this in a similar way to set xhci_pci_shutdown() as hc_driver.shutdown(). In xhci_pci_shutdown(), it calls xhci_shutdown() first and then does XHCI_SPURIOUS_WAKEUP quirk. Will post it as v3 patch.