[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAAhV-H7PXUd6BaoKqgJ-3g=+m9wLnXqEzya8++c5RM3c6Kafhg@mail.gmail.com>
Date: Fri, 31 Jan 2025 22:46:33 +0800
From: Huacai Chen <chenhuacai@...nel.org>
To: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
Cc: Huacai Chen <chenhuacai@...ngson.cn>, Alan Stern <stern@...land.harvard.edu>,
linux-usb@...r.kernel.org, linux-kernel@...r.kernel.org,
stable@...r.kernel.org
Subject: Re: [PATCH] USB: core: Enable root_hub's remote wakeup for wakeup sources
Hi, Greg,
On Fri, Jan 31, 2025 at 6:49 PM Greg Kroah-Hartman
<gregkh@...uxfoundation.org> wrote:
>
> On Fri, Jan 31, 2025 at 06:06:30PM +0800, Huacai Chen wrote:
> > Now we only enable the remote wakeup function for the USB wakeup source
> > itself at usb_port_suspend(). But on pre-XHCI controllers this is not
> > enough to enable the S3 wakeup function for USB keyboards, so we also
> > enable the root_hub's remote wakeup (and disable it on error). Frankly
> > this is unnecessary for XHCI, but enable it unconditionally make code
> > simple and seems harmless.
> >
> > Cc: stable@...r.kernel.org
> > Signed-off-by: Huacai Chen <chenhuacai@...ngson.cn>
>
> What commit id does this fix?
It seems this problem exist from the first place (at least >=4.19).
>
> > ---
> > drivers/usb/core/hub.c | 5 ++++-
> > 1 file changed, 4 insertions(+), 1 deletion(-)
> >
> > diff --git a/drivers/usb/core/hub.c b/drivers/usb/core/hub.c
> > index c3f839637cb5..efd6374ccd1d 100644
> > --- a/drivers/usb/core/hub.c
> > +++ b/drivers/usb/core/hub.c
> > @@ -3480,6 +3480,7 @@ int usb_port_suspend(struct usb_device *udev, pm_message_t msg)
> > if (PMSG_IS_AUTO(msg))
> > goto err_wakeup;
> > }
> > + usb_enable_remote_wakeup(udev->bus->root_hub);
> > }
> >
> > /* disable USB2 hardware LPM */
> > @@ -3543,8 +3544,10 @@ int usb_port_suspend(struct usb_device *udev, pm_message_t msg)
> > /* Try to enable USB2 hardware LPM again */
> > usb_enable_usb2_hardware_lpm(udev);
> >
> > - if (udev->do_remote_wakeup)
> > + if (udev->do_remote_wakeup) {
> > (void) usb_disable_remote_wakeup(udev);
> > + (void) usb_disable_remote_wakeup(udev->bus->root_hub);
>
> This feels wrong, what about all of the devices inbetween this device
> and the root hub?
Yes, if there are other hubs between the root hub and keyboard, this
patch still cannot fix the wakeup problem. I have tried to enable
every hub in the link, but failed. Because I found many hubs lost
power during suspend. So this patch can only fixes the most usual
cases.
Huacai
>
> thanks,
>
> greg k-h
Powered by blists - more mailing lists