Skip to content

Commit 9ab84d2

Browse files
chenhuacaiKexyBiscuit
authored andcommitted
FROMLIST: USB: core: Enable root_hub's remote wakeup for wakeup sources
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> Link: https://lore.kernel.org/all/20250131100630.342995-1-chenhuacai@loongson.cn/ Signed-off-by: Kexy Biscuit <kexybiscuit@aosc.io>
1 parent 23c78b8 commit 9ab84d2

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

drivers/usb/core/hub.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3522,6 +3522,7 @@ int usb_port_suspend(struct usb_device *udev, pm_message_t msg)
35223522
if (PMSG_IS_AUTO(msg))
35233523
goto err_wakeup;
35243524
}
3525+
usb_enable_remote_wakeup(udev->bus->root_hub);
35253526
}
35263527

35273528
/* disable USB2 hardware LPM */
@@ -3585,8 +3586,10 @@ int usb_port_suspend(struct usb_device *udev, pm_message_t msg)
35853586
/* Try to enable USB2 hardware LPM again */
35863587
usb_enable_usb2_hardware_lpm(udev);
35873588

3588-
if (udev->do_remote_wakeup)
3589+
if (udev->do_remote_wakeup) {
35893590
(void) usb_disable_remote_wakeup(udev);
3591+
(void) usb_disable_remote_wakeup(udev->bus->root_hub);
3592+
}
35903593
err_wakeup:
35913594

35923595
/* System sleep transitions should never fail */

0 commit comments

Comments
 (0)