Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

usb: xhci-plat: separate dev_pm_ops for each pm_event

Separate dev_pm_ops for different power events such as suspend, thaw,
and hibernation. This is crucial when xhci-plat driver needs to adapt
its behavior based on different power state changes.

Signed-off-by: Guan-Yu Lin <guanyulin@google.com>
Link: https://lore.kernel.org/r/20250911142051.90822-2-guanyulin@google.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Link: https://lore.kernel.org/r/20250911142051.90822-2-guanyulin@google.com

authored by

Guan-Yu Lin and committed by
Greg Kroah-Hartman
ddb473a5 6f9871b3

+19 -4
+19 -4
drivers/usb/host/xhci-plat.c
··· 454 454 } 455 455 EXPORT_SYMBOL_GPL(xhci_plat_remove); 456 456 457 - static int xhci_plat_suspend(struct device *dev) 457 + static int xhci_plat_suspend_common(struct device *dev) 458 458 { 459 459 struct usb_hcd *hcd = dev_get_drvdata(dev); 460 460 struct xhci_hcd *xhci = hcd_to_xhci(hcd); ··· 480 480 } 481 481 482 482 return 0; 483 + } 484 + 485 + static int xhci_plat_suspend(struct device *dev) 486 + { 487 + return xhci_plat_suspend_common(dev); 488 + } 489 + 490 + static int xhci_plat_freeze(struct device *dev) 491 + { 492 + return xhci_plat_suspend_common(dev); 483 493 } 484 494 485 495 static int xhci_plat_resume_common(struct device *dev, bool power_lost) ··· 539 529 return xhci_plat_resume_common(dev, false); 540 530 } 541 531 532 + static int xhci_plat_thaw(struct device *dev) 533 + { 534 + return xhci_plat_resume_common(dev, false); 535 + } 536 + 542 537 static int xhci_plat_restore(struct device *dev) 543 538 { 544 539 return xhci_plat_resume_common(dev, true); ··· 573 558 const struct dev_pm_ops xhci_plat_pm_ops = { 574 559 .suspend = pm_sleep_ptr(xhci_plat_suspend), 575 560 .resume = pm_sleep_ptr(xhci_plat_resume), 576 - .freeze = pm_sleep_ptr(xhci_plat_suspend), 577 - .thaw = pm_sleep_ptr(xhci_plat_resume), 578 - .poweroff = pm_sleep_ptr(xhci_plat_suspend), 561 + .freeze = pm_sleep_ptr(xhci_plat_freeze), 562 + .thaw = pm_sleep_ptr(xhci_plat_thaw), 563 + .poweroff = pm_sleep_ptr(xhci_plat_freeze), 579 564 .restore = pm_sleep_ptr(xhci_plat_restore), 580 565 581 566 SET_RUNTIME_PM_OPS(xhci_plat_runtime_suspend,