From: Tudor Ambarus <tudor.ambarus@linaro.org>
To: "Rafael J. Wysocki" <rafael@kernel.org>
Cc: "Linux PM" <linux-pm@vger.kernel.org>,
LKML <linux-kernel@vger.kernel.org>,
"Alan Stern" <stern@rowland.harvard.edu>,
"Ulf Hansson" <ulf.hansson@linaro.org>,
"Johan Hovold" <johan@kernel.org>,
"Jon Hunter" <jonathanh@nvidia.com>,
"Saravana Kannan" <saravanak@google.com>,
"William McVicker" <willmcvicker@google.com>,
"Peter Griffin" <peter.griffin@linaro.org>,
"André Draszik" <andre.draszik@linaro.org>
Subject: Re: [PATCH v3 1/5] PM: sleep: Resume children after resuming the parent
Date: Mon, 14 Jul 2025 13:14:56 +0100 [thread overview]
Message-ID: <30a08478-824b-4ac5-91e7-c985adcf4d09@linaro.org> (raw)
In-Reply-To: <7186da1f-4d16-48f5-bdc0-cb04942b3a5e@linaro.org>
On 7/14/25 11:35 AM, Tudor Ambarus wrote:
>
>
> On 7/14/25 8:29 AM, Rafael J. Wysocki wrote:
>>> diff --git a/drivers/base/power/main.c b/drivers/base/power/main.c
>>> index d9d4fc58bc5a..0e186bc38a00 100644
>>> --- a/drivers/base/power/main.c
>>> +++ b/drivers/base/power/main.c
>>> @@ -1281,6 +1281,27 @@ static void dpm_async_suspend_parent(struct device *dev, async_func_t func)
>>> dpm_async_with_cleanup(dev->parent, func);
>>> }
>>>
>>> +static void dpm_async_suspend_complete_all(struct list_head *device_list)
>>> +{
>>> + struct device *dev;
>>> +
>>> +
>>> + pr_err("tudor: %s: enter\n", __func__);
>>> + guard(mutex)(&async_wip_mtx);
>>> +
>>> + list_for_each_entry_reverse(dev, device_list, power.entry) {
>>> + /*
>>> + * In case the device is being waited for and async processing
>>> + * has not started for it yet, let the waiters make progress.
>>> + */
>>> + pr_err("tudor: %s: in device list\n", __func__);
>>> + if (!dev->power.work_in_progress) {
>>> + pr_err("tudor: %s: call complete_all\n", __func__);
>>> + complete_all(&dev->power.completion);
>>> + }
>>> + }
>>> +}
>>> +
>>> /**
>>> * resume_event - Return a "resume" message for given "suspend" sleep state.
>>> * @sleep_state: PM message representing a sleep state.
>>> @@ -1459,6 +1480,7 @@ static int dpm_noirq_suspend_devices(pm_message_t state)
>>> mutex_lock(&dpm_list_mtx);
>>>
>>> if (error || async_error) {
>>> + dpm_async_suspend_complete_all(&dpm_late_early_list);
>>> /*
>>> * Move all devices to the target list to resume them
>>> * properly.
>>> @@ -1663,6 +1685,7 @@ int dpm_suspend_late(pm_message_t state)
>>> mutex_lock(&dpm_list_mtx);
>>>
>>> if (error || async_error) {
>>> + dpm_async_suspend_complete_all(&dpm_late_early_list);
>>> /*
>>> * Move all devices to the target list to resume them
>>> * properly.
>>> @@ -1959,6 +1982,7 @@ int dpm_suspend(pm_message_t state)
>>> mutex_lock(&dpm_list_mtx);
>>>
>>> if (error || async_error) {
>>> + dpm_async_suspend_complete_all(&dpm_late_early_list);
>> -> There is a bug here which is not present in the patch I've sent.
>
> My bad, I edited by hand, sorry.
>
>>
>> It should be
>>
>> dpm_async_suspend_complete_all(&dpm_prepared_list);
>
>
> Wonderful, it seems this makes suspend happy on downstream pixel6!
> I'm running some more tests and get back to you in a few hours.
>
Solves failures on pixel6 downstream:
Reported-and-tested-by: Tudor Ambarus <tudor.ambarus@linaro.org>
Thanks!
next prev parent reply other threads:[~2025-07-14 12:14 UTC|newest]
Thread overview: 48+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-03-14 12:46 [PATCH v3 0/5] PM: sleep: Improvements of async suspend and resume of devices Rafael J. Wysocki
2025-03-14 12:50 ` [PATCH v3 1/5] PM: sleep: Resume children after resuming the parent Rafael J. Wysocki
2025-05-01 9:51 ` Jon Hunter
2025-05-02 20:33 ` Rafael J. Wysocki
2025-05-07 13:21 ` Jon Hunter
2025-05-07 13:39 ` Rafael J. Wysocki
2025-05-07 14:25 ` Rafael J. Wysocki
2025-05-07 14:39 ` Jon Hunter
2025-05-07 14:56 ` Rafael J. Wysocki
2025-05-07 15:39 ` Jon Hunter
2025-05-07 16:43 ` Rafael J. Wysocki
2025-05-08 13:38 ` Jon Hunter
2025-05-08 18:06 ` Rafael J. Wysocki
2025-05-10 11:39 ` Rafael J. Wysocki
2025-05-10 11:50 ` Jon Hunter
2025-07-11 13:08 ` Tudor Ambarus
2025-07-11 13:38 ` Rafael J. Wysocki
2025-07-11 13:54 ` Rafael J. Wysocki
2025-07-11 18:30 ` Saravana Kannan
2025-07-12 7:57 ` Rafael J. Wysocki
2025-07-12 7:54 ` Rafael J. Wysocki
2025-07-14 7:09 ` Tudor Ambarus
2025-07-14 7:29 ` Rafael J. Wysocki
2025-07-14 10:35 ` Tudor Ambarus
2025-07-14 12:14 ` Tudor Ambarus [this message]
2025-03-14 13:13 ` [PATCH v3 2/5] PM: sleep: Suspend async parents after suspending children Rafael J. Wysocki
2025-06-02 12:11 ` Chris Bainbridge
2025-06-02 14:29 ` Rafael J. Wysocki
2025-06-02 15:21 ` Mario Limonciello
2025-06-02 19:58 ` Rafael J. Wysocki
2025-06-03 9:38 ` Rafael J. Wysocki
2025-06-03 10:17 ` Chris Bainbridge
2025-06-03 10:29 ` Rafael J. Wysocki
2025-06-03 10:30 ` Rafael J. Wysocki
2025-06-03 11:37 ` Rafael J. Wysocki
2025-06-03 11:39 ` Rafael J. Wysocki
2025-06-03 12:14 ` Chris Bainbridge
2025-06-03 12:23 ` Rafael J. Wysocki
2025-06-03 12:26 ` Chris Bainbridge
2025-06-03 13:04 ` Rafael J. Wysocki
2025-06-03 13:36 ` Chris Bainbridge
2025-06-03 13:59 ` Rafael J. Wysocki
2025-03-14 13:14 ` [PATCH v3 3/5] PM: sleep: Make suspend of devices more asynchronous Rafael J. Wysocki
2025-03-14 13:16 ` [PATCH v3 4/5] PM: sleep: Make async suspend handle suppliers like parents Rafael J. Wysocki
2025-03-14 13:17 ` [PATCH v3 5/5] PM: sleep: Make async resume handle consumers like children Rafael J. Wysocki
2025-03-14 21:06 ` [PATCH v3 0/5] PM: sleep: Improvements of async suspend and resume of devices Saravana Kannan
2025-03-15 14:57 ` Rafael J. Wysocki
2025-04-08 13:39 ` Rafael J. Wysocki
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=30a08478-824b-4ac5-91e7-c985adcf4d09@linaro.org \
--to=tudor.ambarus@linaro.org \
--cc=andre.draszik@linaro.org \
--cc=johan@kernel.org \
--cc=jonathanh@nvidia.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=peter.griffin@linaro.org \
--cc=rafael@kernel.org \
--cc=saravanak@google.com \
--cc=stern@rowland.harvard.edu \
--cc=ulf.hansson@linaro.org \
--cc=willmcvicker@google.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
all inboxes | Powered by JetHome®