Commit f384497
committed
PM: sleep: core: Fix runtime PM enabling in device_resume_early()
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 <[email protected]>
Closes: https://lore.kernel.org/linux-pm/[email protected]/
Cc: 6.16+ <[email protected]> # 6.16+
Reviewed-by: Ulf Hansson <[email protected]>
Signed-off-by: Rafael J. Wysocki <[email protected]>
Link: https://patch.msgid.link/[email protected]1 parent 6a23ae0 commit f384497
1 file changed
+16
-9
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
888 | 888 | | |
889 | 889 | | |
890 | 890 | | |
891 | | - | |
| 891 | + | |
892 | 892 | | |
893 | 893 | | |
894 | 894 | | |
895 | 895 | | |
896 | 896 | | |
| 897 | + | |
| 898 | + | |
| 899 | + | |
897 | 900 | | |
898 | 901 | | |
899 | 902 | | |
| |||
926 | 929 | | |
927 | 930 | | |
928 | 931 | | |
| 932 | + | |
929 | 933 | | |
930 | 934 | | |
931 | 935 | | |
932 | 936 | | |
933 | | - | |
934 | 937 | | |
935 | 938 | | |
936 | 939 | | |
| |||
1615 | 1618 | | |
1616 | 1619 | | |
1617 | 1620 | | |
1618 | | - | |
1619 | | - | |
1620 | | - | |
1621 | | - | |
1622 | | - | |
1623 | | - | |
1624 | 1621 | | |
1625 | 1622 | | |
1626 | 1623 | | |
| |||
1631 | 1628 | | |
1632 | 1629 | | |
1633 | 1630 | | |
1634 | | - | |
| 1631 | + | |
1635 | 1632 | | |
1636 | 1633 | | |
| 1634 | + | |
| 1635 | + | |
| 1636 | + | |
| 1637 | + | |
| 1638 | + | |
| 1639 | + | |
| 1640 | + | |
| 1641 | + | |
| 1642 | + | |
1637 | 1643 | | |
1638 | 1644 | | |
1639 | 1645 | | |
| |||
1664 | 1670 | | |
1665 | 1671 | | |
1666 | 1672 | | |
| 1673 | + | |
1667 | 1674 | | |
1668 | 1675 | | |
1669 | 1676 | | |
| |||
0 commit comments