[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <2c12d7a0-3edb-48b3-abf7-135e1a8838ca@rowland.harvard.edu>
Date: Fri, 7 Jul 2023 21:51:27 -0400
From: Alan Stern <stern@...land.harvard.edu>
To: Jakub Kicinski <kuba@...nel.org>
Cc: Alexandru Gagniuc <alexandru.gagniuc@...com>,
linux-usb@...r.kernel.org, netdev@...r.kernel.org,
davem@...emloft.net, edumazet@...gle.com, pabeni@...hat.com,
hayeswang@...ltek.com, jflf_kernel@....com, bjorn@...k.no,
svenva@...omium.org, linux-kernel@...r.kernel.org,
eniac-xw.zhang@...com, stable@...r.kernel.org
Subject: Re: [PATCH] r8152: Suspend USB device before shutdown when WoL is
enabled
On Fri, Jul 07, 2023 at 05:12:25PM -0700, Jakub Kicinski wrote:
> On Thu, 6 Jul 2023 18:28:58 +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.
>
> Would be good to hear from USB experts on this one, to an outside seems
> like something that the bus should be doing, possibly based on some
> driver opt-in..
The USB spec does not include any discussion of what things should be
done when the system is turned off -- it doesn't even really acknowledge
the existence of different system-wide power states. As a result, the
USB subsystem never developed any support for power-off callbacks or
anything else of the sort.
Of course, this kind of thing can always be added. But I don't think
there's any way to distinguish (at the USB level) between wakeup from
S5-off and wakeup from any other low-power system state. And the PM
part of the device model doesn't have multiple types of "enable-wakeup"
flags -- either a device is enabled for wakeup or it isn't.
Alan Stern
Powered by blists - more mailing lists