Re: [PATCH v2] r8152: Suspend USB device before shutdown when WoL is enabled
From: Alexandru Gagniuc
Date: Thu Aug 10 2023 - 18:52:37 EST
On Thu, Aug 10, 2023 at 01:34:39PM -0400, Alan Stern wrote:
> On Thu, Aug 10, 2023 at 04:22:16PM +0000, Alexandru Gagniuc wrote:
> > On Wed, Aug 02, 2023 at 11:23:46AM -0400, Alan Stern wrote:
> > >
> > > Indeed. And I am asking how you can be sure the host controller driver
> > > (or some other part of the software stack) doesn't have this bug.
> >
> > The only way that I have to show that is empirical. I observe that WoL from S5
> > does not work on a device with an r8153 chip. I apply the change, and verify
> > that WoL from S5 now works in this scenario. What are you thinking of in terms
> > of being sure no current or future bug exists?
>
> I was thinking that the host controller driver's shutdown method might
> turn off power to all of the ports.
>
> For example, in the ehci-hcd driver, ehci_shutdown() calls
> ehci_silence_controller(), which calls ehci_turn_off_all_ports(). I
> don't know if xhci-hcd does anything similar.
EHCI is a different beast. I don't think EHCI (USB2.0) has the U3 link state.
The equivalent for would be xhci_shutdown(). It makes a call to
usb_disable_xhci_ports() for XHCI_SPURIOUS_REBOOT quirk. As I have not
encountered it, I don't know how it will affect the link state of other ports.
The quirk appears to switch ports to EHCI mode, rather than turn off power.
Alex