On 10/20/2025 12:18 PM, Rafael J. Wysocki wrote:
On Mon, Oct 20, 2025 at 6:53 PM Mario Limonciello (AMD)
<[email protected]> wrote:
From: Mario Limonciello <[email protected]>
If a device resume returns -EBUSY the device resume sequence has
been skipped.
Is this actually demonstrably true in all of the cases?
And what about -EAGAIN?
I haven't audited codepaths of all drivers to guarantee it to be true
for all cases. That's the main reason I wanted to make it RFC - to
discuss the idea of a dedicated return code to indicate it was skipped.
Another idea I had is that we could make it return a positive number,
and PM core could recognize that as a skip.
So would like your thoughts against the ideas currently presented:
* -EAGAIN
* -EBUSY
* Some other return code
* > 0
Whichever is decided the PM core documentation would need to be updated
to match as well.
Don't show errors for this or pass it up to async
resume. If resume is run again in another stage the device should
try again.
Cc: Muhammad Usama Anjum <[email protected]>
Signed-off-by: Mario Limonciello (AMD) <[email protected]>
---
drivers/base/power/main.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/drivers/base/power/main.c b/drivers/base/power/main.c
index bf9c3d79c455f..f6bc7ef9a8371 100644
--- a/drivers/base/power/main.c
+++ b/drivers/base/power/main.c
@@ -1112,7 +1112,9 @@ static void device_resume(struct device *dev,
pm_message_t state, bool async)
TRACE_RESUME(error);
- if (error) {
+ if (error == -EBUSY)
+ pm_dev_dbg(dev, state, async ? " async" : "");
+ else if (error) {
WRITE_ONCE(async_error, error);
dpm_save_failed_dev(dev_name(dev));
pm_dev_err(dev, state, async ? " async" : "", error);
--
2.43.0