]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
usb: dwc3: core: Avoid redundant system suspend/resume callbacks
authorRoy Luo <royluo@google.com>
Wed, 12 Mar 2025 22:34:34 +0000 (22:34 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 11 Apr 2025 14:08:32 +0000 (16:08 +0200)
commit850e634006f453d57fffe86ca07da15713dea3b8
tree19bee7c97e9753a078df7a60d5e669086c6effaf
parentb4b38ffb38c91afd4dc387608db26f6fc34ed40b
usb: dwc3: core: Avoid redundant system suspend/resume callbacks

dwc3 device suspend/resume callbacks were being triggered during system
suspend and resume even if the device was already runtime-suspended.
This is redundant for device mode because the suspend and resume routines
are essentially identical for system PM and runtime PM.

To prevent these unnecessary callbacks, indicate to the PM core that it
can safely leave the device in runtime suspend if it's already
runtime-suspended in device mode by returning a positive value in
prepare() callback. This optimization only applies to devices without
pinctrl, as pinctrl has distinct logic tied to system suspend/resume.

Signed-off-by: Roy Luo <royluo@google.com>
Acked-by: Thinh Nguyen <Thinh.Nguyen@synopsys.com>
Link: https://lore.kernel.org/r/20250312223434.3071598-1-royluo@google.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/dwc3/core.c