Commit 96e0a2cc authored by Rafael J. Wysocki's avatar Rafael J. Wysocki Committed by Treehugger Robot
Browse files

UPSTREAM: PM: sleep: Fix power.is_suspended cleanup for direct-complete devices

[ Upstream commit d46c4c83 ]

Commit 03f14440 ("PM: sleep: Fix handling devices with direct_complete
set on errors") caused power.is_suspended to be set for devices with
power.direct_complete set, but it forgot to ensure the clearing of that
flag for them in device_resume(), so power.is_suspended is still set for
them during the next system suspend-resume cycle.

If that cycle is aborted in dpm_suspend(), the subsequent invocation of
dpm_resume() will trigger a device_resume() call for every device and
because power.is_suspended is set for the devices in question, they will
not be skipped by device_resume() as expected which causes scary error
messages to be logged (as appropriate).

To address this issue, move the clearing of power.is_suspended in
device_resume() immediately after the power.is_suspended check so it
will be always cleared for all devices processed by that function.

Fixes: 03f14440 ("PM: sleep: Fix handling devices with direct_complete set on errors")
Closes: https://gitlab.freedesktop.org/drm/amd/-/issues/4280


Reported-and-tested-by: default avatarChris Bainbridge <chris.bainbridge@gmail.com>
Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
Reviewed-by: default avatarMario Limonciello <mario.limonciello@amd.com>
Link: https://patch.msgid.link/4990586.GXAFRqVoOG@rjwysocki.net



Bug: 437386825
Bug: 438115265
Bug: 452155839
Change-Id: Ia9c8e01bbddf2a79a8c7e5efc65d390d91ce1ec1
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
Signed-off-by: default avatarWeihua Li <weihua.li2@unisoc.com>
Signed-off-by: default avatarwei li <sirius.liwei@honor.corp-partner.google.com>
parent c038c294
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment