mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] USB: core: Enable root_hub's remote wakeup for wakeup sources
@ 2025-01-31 10:06 Huacai Chen
  2025-01-31 10:49 ` Greg Kroah-Hartman
  2025-01-31 15:17 ` Alan Stern
  0 siblings, 2 replies; 19+ messages in thread
From: Huacai Chen @ 2025-01-31 10:06 UTC (permalink / raw)
  To: Huacai Chen, Greg Kroah-Hartman
  Cc: Alan Stern, linux-usb, linux-kernel, Huacai Chen, stable

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@vger.kernel.org
Signed-off-by: Huacai Chen <chenhuacai@loongson.cn>
---
 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);
+		}
  err_wakeup:
 
 		/* System sleep transitions should never fail */
-- 
2.47.1


^ permalink raw reply	[flat|nested] 19+ messages in thread

end of thread, other threads:[~2025-02-25 22:37 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-01-31 10:06 [PATCH] USB: core: Enable root_hub's remote wakeup for wakeup sources Huacai Chen
2025-01-31 10:49 ` Greg Kroah-Hartman
2025-01-31 14:46   ` Huacai Chen
2025-01-31 15:17 ` Alan Stern
2025-02-01  6:42   ` Huacai Chen
2025-02-01 16:55     ` Alan Stern
2025-02-03 14:44       ` Huacai Chen
2025-02-03 15:12       ` Alan Stern
2025-02-03 16:01         ` Mingcong Bai
2025-02-03 16:15           ` Alan Stern
2025-02-05  5:59             ` Mingcong Bai
2025-02-05 18:25               ` Alan Stern
2025-02-06  3:49                 ` Mingcong Bai
2025-02-06 21:20                   ` Alan Stern
2025-02-07  3:23                     ` Mingcong Bai
2025-02-09 10:19                       ` Mingcong Bai
2025-02-09 10:22                         ` Mingcong Bai
2025-02-25 17:41                           ` Mingcong Bai
2025-02-25 22:37                             ` Alan Stern

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®