Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1670744

Re: [PATCH] PM / Domains: Call driver's noirq callbacks

From Mikko Perttunen <mperttunen@nvidia.com>
Newsgroups linux.kernel
Subject Re: [PATCH] PM / Domains: Call driver's noirq callbacks
Date 2017-06-20 15:10 +0200
Message-ID <tUr4U-Cl-63@gated-at.bofh.it> (permalink)
References <tUq8N-8qB-17@gated-at.bofh.it> <tUqLx-e7-59@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


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
>

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH] PM / Domains: Call driver's noirq callbacks Mikko Perttunen <mperttunen@nvidia.com> - 2017-06-20 14:10 +0200
  Re: [PATCH] PM / Domains: Call driver's noirq callbacks Ulf Hansson <ulf.hansson@linaro.org> - 2017-06-20 14:50 +0200
    Re: [PATCH] PM / Domains: Call driver's noirq callbacks Mikko Perttunen <mperttunen@nvidia.com> - 2017-06-20 15:10 +0200
    [PATCH v2] PM / Domains: Call driver's noirq callbacks Mikko Perttunen <mperttunen@nvidia.com> - 2017-06-20 15:40 +0200
      Re: [PATCH v2] PM / Domains: Call driver's noirq callbacks Ulf Hansson <ulf.hansson@linaro.org> - 2017-06-20 16:20 +0200
        Re: [PATCH v2] PM / Domains: Call driver's noirq callbacks Mikko Perttunen <mperttunen@nvidia.com> - 2017-06-21 09:10 +0200
        [PATCH v3] PM / Domains: Call driver's noirq callbacks Mikko Perttunen <mperttunen@nvidia.com> - 2017-06-22 09:20 +0200
          Re: [PATCH v3] PM / Domains: Call driver's noirq callbacks "Rafael J. Wysocki" <rjw@rjwysocki.net> - 2017-06-28 01:00 +0200
          Re: [PATCH v3] PM / Domains: Call driver's noirq callbacks Ulf Hansson <ulf.hansson@linaro.org> - 2017-06-28 11:10 +0200

csiph-web