From: Mikko Perttunen <mperttunen@nvidia.com>
To: Ulf Hansson <ulf.hansson@linaro.org>
Cc: "Rafael J. Wysocki" <rjw@rjwysocki.net>,
Kevin Hilman <khilman@kernel.org>,
"linux-pm@vger.kernel.org" <linux-pm@vger.kernel.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] PM / Domains: Call driver's noirq callbacks
Date: Tue, 20 Jun 2017 16:04:03 +0300 [thread overview]
Message-ID: <f0c65f8d-2357-59a0-f3ea-9edefd506382@nvidia.com> (raw)
In-Reply-To: <CAPDyKFpgXCwErOUBcXwOVycYpro6=-vxoQeGnTMwsn0ji8iXJQ@mail.gmail.com>
On 20.06.2017 15:47, Ulf Hansson wrote:
> On 20 June 2017 at 14:05, Mikko Perttunen <mperttunen@nvidia.com> wrote:
>> Currently genpd installs its own suspend_noirq and resume_noirq
>> callbacks, but never calls down to the driver's corresponding
>> callbacks. Add these calls.
>>
>> Signed-off-by: Mikko Perttunen <mperttunen@nvidia.com>
>> ---
>>
>> drivers/base/power/domain.c | 8 ++++++++
>> 1 file changed, 8 insertions(+)
>>
>> diff --git a/drivers/base/power/domain.c b/drivers/base/power/domain.c
>> index d3f1d96f75e9..c3b6e6018c02 100644
>> --- a/drivers/base/power/domain.c
>> +++ b/drivers/base/power/domain.c
>> @@ -925,6 +925,10 @@ static int pm_genpd_suspend_noirq(struct device *dev)
>> return ret;
>> }
>>
>> + ret = pm_generic_suspend_noirq(dev);
>> + if (ret)
>> + return ret;
>
> Two things:
> 1) I would move this a couple of lines further above, as to avoid
> pm_runtime_force_suspend() from being called before, as it may suspend
> the device before the noirq callbacks gets to run.
Sure.
> 2) pm_genpd_suspend_noirq() is also assigned to the ->poweroff_noirq()
> callback. Certainly we don't want run the *suspend* variants of the
> callback, but rather the *poweroff* variants in that case.
Ah, didn't notice this. Will fix.
Thanks for the comments, I'll post a v2.
Mikko
>
>> +
>> genpd_lock(genpd);
>> genpd->suspended_count++;
>> genpd_sync_power_off(genpd, true, 0);
>> @@ -958,6 +962,10 @@ static int pm_genpd_resume_noirq(struct device *dev)
>> genpd->suspended_count--;
>> genpd_unlock(genpd);
>>
>> + ret = pm_generic_resume_noirq(dev);
>> + if (ret)
>> + return ret;
>> +
>> if (genpd->dev_ops.stop && genpd->dev_ops.start)
>> ret = pm_runtime_force_resume(dev);
>>
>> --
>> 2.1.4
>>
>
> Kind regards
> Uffe
>
next prev parent reply other threads:[~2017-06-20 13:04 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-06-20 12:05 Mikko Perttunen
2017-06-20 12:47 ` Ulf Hansson
2017-06-20 13:04 ` Mikko Perttunen [this message]
2017-06-20 13:38 ` [PATCH v2] " Mikko Perttunen
2017-06-20 14:18 ` Ulf Hansson
2017-06-21 7:06 ` Mikko Perttunen
2017-06-22 7:18 ` [PATCH v3] " Mikko Perttunen
2017-06-27 22:46 ` Rafael J. Wysocki
2017-06-28 9:00 ` Ulf Hansson
2017-06-21 14:52 ` [PATCH v2] " kbuild test robot
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=f0c65f8d-2357-59a0-f3ea-9edefd506382@nvidia.com \
--to=mperttunen@nvidia.com \
--cc=khilman@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=rjw@rjwysocki.net \
--cc=ulf.hansson@linaro.org \
/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®