Power management fix for 6.18-rc7
Fix a regression introduced during the 6.16 development cycle that may cause runtime PM to be enabled by mistake for devices that do not support it (which may lead to some serious trouble) if there is a system wakeup event during the "late suspend" phase of system suspend. -----BEGIN PGP SIGNATURE----- iQFGBAABCAAwFiEEcM8Aw/RY0dgsiRUR7l+9nS/U47UFAmkfS9ASHHJqd0Byand5 c29ja2kubmV0AAoJEO5fvZ0v1OO1cKQH/RbZZcC/4q3lUgMfk0+C/6Y+4Nv7MxDR jT4fxYinFVSAVpcAIomB838C4PBuIilNKu2JUR62Rw2Pa5PSvVMZcpIHWMdb/QXn 7V5f0CQIGeWdzOBuXlzMWzko6D3CBBBHQMOBPFWD1w5DeT04DRDBAyqW+Osb6NEU aywA+qFkSSg+m+IzkNZGiIgKW9y6oponKetGTuB5b4C0c6WhMg9abc+isKC4yLXY NufuHokqSRn19RoKpzz1IBnHDE6yVoy9/O9QNY8yfKvLOr8MCRN6rbPwbMF3tcSk RQ+jASuIlEgExe0fsP+K1KTPh++EUOottirM9b1B6rj4UwHN+Yq95dk= =7MZg -----END PGP SIGNATURE----- Merge tag 'pm-6.18-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm Pull power management fix from Rafael Wysocki: "Fix a regression introduced during the 6.16 development cycle that may cause runtime PM to be enabled by mistake for devices that do not support it (which may lead to some serious trouble) if there is a system wakeup event during the "late suspend" phase of system suspend" * tag 'pm-6.18-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm: PM: sleep: core: Fix runtime PM enabling in device_resume_early()
This commit is contained in:
commit
07e09c3233
|
|
@ -888,12 +888,15 @@ static void device_resume_early(struct device *dev, pm_message_t state, bool asy
|
|||
TRACE_DEVICE(dev);
|
||||
TRACE_RESUME(0);
|
||||
|
||||
if (dev->power.syscore || dev->power.direct_complete)
|
||||
if (dev->power.direct_complete)
|
||||
goto Out;
|
||||
|
||||
if (!dev->power.is_late_suspended)
|
||||
goto Out;
|
||||
|
||||
if (dev->power.syscore)
|
||||
goto Skip;
|
||||
|
||||
if (!dpm_wait_for_superior(dev, async))
|
||||
goto Out;
|
||||
|
||||
|
|
@ -926,11 +929,11 @@ Run:
|
|||
|
||||
Skip:
|
||||
dev->power.is_late_suspended = false;
|
||||
pm_runtime_enable(dev);
|
||||
|
||||
Out:
|
||||
TRACE_RESUME(error);
|
||||
|
||||
pm_runtime_enable(dev);
|
||||
complete_all(&dev->power.completion);
|
||||
|
||||
if (error) {
|
||||
|
|
@ -1615,12 +1618,6 @@ static void device_suspend_late(struct device *dev, pm_message_t state, bool asy
|
|||
TRACE_DEVICE(dev);
|
||||
TRACE_SUSPEND(0);
|
||||
|
||||
/*
|
||||
* Disable runtime PM for the device without checking if there is a
|
||||
* pending resume request for it.
|
||||
*/
|
||||
__pm_runtime_disable(dev, false);
|
||||
|
||||
dpm_wait_for_subordinate(dev, async);
|
||||
|
||||
if (READ_ONCE(async_error))
|
||||
|
|
@ -1631,9 +1628,18 @@ static void device_suspend_late(struct device *dev, pm_message_t state, bool asy
|
|||
goto Complete;
|
||||
}
|
||||
|
||||
if (dev->power.syscore || dev->power.direct_complete)
|
||||
if (dev->power.direct_complete)
|
||||
goto Complete;
|
||||
|
||||
/*
|
||||
* Disable runtime PM for the device without checking if there is a
|
||||
* pending resume request for it.
|
||||
*/
|
||||
__pm_runtime_disable(dev, false);
|
||||
|
||||
if (dev->power.syscore)
|
||||
goto Skip;
|
||||
|
||||
if (dev->pm_domain) {
|
||||
info = "late power domain ";
|
||||
callback = pm_late_early_op(&dev->pm_domain->ops, state);
|
||||
|
|
@ -1664,6 +1670,7 @@ Run:
|
|||
WRITE_ONCE(async_error, error);
|
||||
dpm_save_failed_dev(dev_name(dev));
|
||||
pm_dev_err(dev, state, async ? " async late" : " late", error);
|
||||
pm_runtime_enable(dev);
|
||||
goto Complete;
|
||||
}
|
||||
dpm_propagate_wakeup_to_parent(dev);
|
||||
|
|
|
|||
Loading…
Reference in New Issue