Commit 2b3a645
committed
PM: sleep: core: Fix runtime PM enabling in device_resume_early()
JIRA: https://issues.redhat.com/browse/RHEL-109251
commit f384497
Author: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Date: Tue Nov 18 15:16:04 2025 +0100
Runtime PM should only be enabled in device_resume_early() if it has
been disabled for the given device by device_suspend_late(). Otherwise,
it may cause runtime PM callbacks to run prematurely in some cases
which leads to further functional issues.
Make two changes to address this problem.
First, reorder device_suspend_late() to only disable runtime PM for a
device when it is going to look for the device's callback or if the
device is a "syscore" one. In all of the other cases, disabling runtime
PM for the device is not in fact necessary. However, if the device's
callback returns an error and the power.is_late_suspended flag is not
going to be set, enable runtime PM so it only remains disabled when
power.is_late_suspended is set.
Second, make device_resume_early() only enable runtime PM for the
devices with the power.is_late_suspended flag set.
Fixes: 443046d ("PM: sleep: Make suspend of devices more asynchronous")
Reported-by: Rose Wu <ya-jou.wu@mediatek.com>
Closes: https://lore.kernel.org/linux-pm/70b25dca6f8c2756d78f076f4a7dee7edaaffc33.camel@mediatek.com/
Cc: 6.16+ <stable@vger.kernel.org> # 6.16+
Reviewed-by: Ulf Hansson <ulf.hansson@linaro.org>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Link: https://patch.msgid.link/12784270.O9o76ZdvQC@rafael.j.wysocki
Signed-off-by: Mark Langsdorf <mlangsdo@redhat.com>1 parent b103eec commit 2b3a645
1 file changed
+16
-9
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
878 | 878 | | |
879 | 879 | | |
880 | 880 | | |
881 | | - | |
| 881 | + | |
882 | 882 | | |
883 | 883 | | |
884 | 884 | | |
885 | 885 | | |
886 | 886 | | |
| 887 | + | |
| 888 | + | |
| 889 | + | |
887 | 890 | | |
888 | 891 | | |
889 | 892 | | |
| |||
916 | 919 | | |
917 | 920 | | |
918 | 921 | | |
| 922 | + | |
919 | 923 | | |
920 | 924 | | |
921 | 925 | | |
922 | 926 | | |
923 | | - | |
924 | 927 | | |
925 | 928 | | |
926 | 929 | | |
| |||
1604 | 1607 | | |
1605 | 1608 | | |
1606 | 1609 | | |
1607 | | - | |
1608 | | - | |
1609 | | - | |
1610 | | - | |
1611 | | - | |
1612 | | - | |
1613 | 1610 | | |
1614 | 1611 | | |
1615 | 1612 | | |
| |||
1620 | 1617 | | |
1621 | 1618 | | |
1622 | 1619 | | |
1623 | | - | |
| 1620 | + | |
1624 | 1621 | | |
1625 | 1622 | | |
| 1623 | + | |
| 1624 | + | |
| 1625 | + | |
| 1626 | + | |
| 1627 | + | |
| 1628 | + | |
| 1629 | + | |
| 1630 | + | |
| 1631 | + | |
1626 | 1632 | | |
1627 | 1633 | | |
1628 | 1634 | | |
| |||
1653 | 1659 | | |
1654 | 1660 | | |
1655 | 1661 | | |
| 1662 | + | |
1656 | 1663 | | |
1657 | 1664 | | |
1658 | 1665 | | |
| |||
0 commit comments