Re: [PATCH v2] r8152: Suspend USB device before shutdown when WoL is enabled

From: Alan Stern
Date: Wed Jul 19 2023 - 14:36:33 EST


On Wed, Jul 19, 2023 at 05:37:56PM +0000, Alexandru Gagniuc wrote:
> For Wake-on-LAN to work from S5 (shutdown), the USB link must be put
> in U3 state. If it is not, and the host "disappears", the chip will
> no longer respond to WoL triggers.
>
> To resolve this, add a notifier block and register it as a reboot
> notifier. When WoL is enabled, work through the usb_device struct to
> get to the suspend function. Calling this function puts the link in
> the correct state for WoL to function.

How do you know that the link will _remain_ in the correct state?

That is, how do you know that the shutdown processing for the USB host
controller won't disable the link entirely, thereby preventing WoL from
working?

Alan Stern