public inbox for linux-pm@vger.kernel.org
 help / color / mirror / Atom feed
From: "Mario Limonciello (AMD) (kernel.org)" <superm1@kernel.org>
To: "Rafael J. Wysocki" <rafael@kernel.org>
Cc: mario.limonciello@amd.com, airlied@gmail.com,
	alexander.deucher@amd.com, christian.koenig@amd.com,
	dakr@kernel.org, gregkh@linuxfoundation.org, lenb@kernel.org,
	pavel@kernel.org, simona@ffwll.ch,
	Muhammad Usama Anjum <usama.anjum@collabora.com>,
	amd-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org,
	linux-pm@vger.kernel.org
Subject: Re: [RFC 2/3] PM: Don't pass up device_resume() -EBUSY errors
Date: Mon, 20 Oct 2025 12:24:20 -0500	[thread overview]
Message-ID: <f44ec6c9-80f9-4e5b-9cdb-e92d4c6b72fc@kernel.org> (raw)
In-Reply-To: <CAJZ5v0g64Hu15k5sLVfxj-AADy2goyvseGGm_zTAqSPHXEaxOA@mail.gmail.com>



On 10/20/2025 12:18 PM, Rafael J. Wysocki wrote:
> On Mon, Oct 20, 2025 at 6:53 PM Mario Limonciello (AMD)
> <superm1@kernel.org> wrote:
>>
>> From: Mario Limonciello <mario.limonciello@amd.com>
>>
>> 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 <usama.anjum@collabora.com>
>> Signed-off-by: Mario Limonciello (AMD) <superm1@kernel.org>
>> ---
>>   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
>>


  reply	other threads:[~2025-10-20 17:24 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-10-20 16:50 [RFC 0/3] Fixups for cancelled hibernate Mario Limonciello (AMD)
2025-10-20 16:50 ` [RFC 1/3] PM: Mark device as suspended if it failed to resume Mario Limonciello (AMD)
2025-10-20 16:58   ` Muhammad Usama Anjum
2025-10-20 17:15     ` Rafael J. Wysocki
2025-10-20 16:50 ` [RFC 2/3] PM: Don't pass up device_resume() -EBUSY errors Mario Limonciello (AMD)
2025-10-20 16:58   ` Muhammad Usama Anjum
2025-10-20 17:18   ` Rafael J. Wysocki
2025-10-20 17:24     ` Mario Limonciello (AMD) (kernel.org) [this message]
2025-10-20 16:50 ` [RFC 3/3] drm/amd: Return -EBUSY for amdgpu_pmops_thaw() on success Mario Limonciello (AMD)
2025-10-20 16:59   ` Muhammad Usama Anjum
2025-10-20 17:21   ` Rafael J. Wysocki
2025-10-20 17:28     ` Mario Limonciello (AMD) (kernel.org)
2025-10-20 17:39       ` Rafael J. Wysocki
2025-10-20 18:32         ` Mario Limonciello (AMD) (kernel.org)
2025-10-20 18:50           ` Rafael J. Wysocki
2025-10-20 19:14             ` Mario Limonciello (AMD) (kernel.org)
2025-10-20 19:18               ` Rafael J. Wysocki
2025-10-20 19:34                 ` Mario Limonciello (AMD) (kernel.org)
2025-10-20 19:55                   ` Rafael J. Wysocki
2025-10-20 21:09                     ` Mario Limonciello (AMD) (kernel.org)
2025-10-21 13:25                       ` Rafael J. Wysocki
2025-10-21 14:19                         ` Mario Limonciello (AMD) (kernel.org)
2025-10-21 14:12           ` Muhammad Usama Anjum

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=f44ec6c9-80f9-4e5b-9cdb-e92d4c6b72fc@kernel.org \
    --to=superm1@kernel.org \
    --cc=airlied@gmail.com \
    --cc=alexander.deucher@amd.com \
    --cc=amd-gfx@lists.freedesktop.org \
    --cc=christian.koenig@amd.com \
    --cc=dakr@kernel.org \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=lenb@kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=mario.limonciello@amd.com \
    --cc=pavel@kernel.org \
    --cc=rafael@kernel.org \
    --cc=simona@ffwll.ch \
    --cc=usama.anjum@collabora.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox