linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Maulik Shah <mkshah@codeaurora.org>
To: Stephen Boyd <swboyd@chromium.org>,
	bjorn.andersson@linaro.org, dianders@chromium.org,
	evgreen@chromium.org
Cc: linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org,
	agross@kernel.org, mka@chromium.org, rnayak@codeaurora.org,
	ilina@codeaurora.org, lsrao@codeaurora.org
Subject: Re: [PATCH v16 4/6] soc: qcom: rpmh: Invoke rpmh_flush() for dirty caches
Date: Wed, 8 Apr 2020 12:38:48 +0530	[thread overview]
Message-ID: <8553ce0f-6dda-b0e0-d67a-f76ce3c0f945@codeaurora.org> (raw)
In-Reply-To: <158631424318.216820.1843109743502322053@swboyd.mtv.corp.google.com>

Hi,

On 4/8/2020 8:20 AM, Stephen Boyd wrote:
> Quoting Maulik Shah (2020-04-05 23:32:19)
>> Add changes to invoke rpmh flush() from CPU PM notification.
>> This is done when the last the cpu is entering power collapse and
>> controller is not busy.
>>
>> Controllers that do have 'HW solver' mode do not need to register
> Controllers that have 'HW solver' mode don't need to register? The 'do
> have' is throwing me off.
Okay i will remove 'do' from this line.
>> for CPU PM notification. They may be in autonomous mode executing
>> low power mode and do not require rpmh_flush() to happen from CPU
>> PM notification.
>>
>> Signed-off-by: Maulik Shah <mkshah@codeaurora.org>
>> Reviewed-by: Douglas Anderson <dianders@chromium.org>
>> ---
>>   drivers/soc/qcom/rpmh-internal.h |  25 +++++---
>>   drivers/soc/qcom/rpmh-rsc.c      | 123 +++++++++++++++++++++++++++++++++++----
>>   drivers/soc/qcom/rpmh.c          |  26 +++------
>>   3 files changed, 137 insertions(+), 37 deletions(-)
>>
>> diff --git a/drivers/soc/qcom/rpmh-rsc.c b/drivers/soc/qcom/rpmh-rsc.c
>> index b718221..fbe1f3e 100644
>> --- a/drivers/soc/qcom/rpmh-rsc.c
>> +++ b/drivers/soc/qcom/rpmh-rsc.c
>> @@ -6,6 +6,7 @@
> [...]
>> +
>> +static int rpmh_rsc_cpu_pm_callback(struct notifier_block *nfb,
>> +                                   unsigned long action, void *v)
>> +{
>> +       struct rsc_drv *drv = container_of(nfb, struct rsc_drv, rsc_pm);
>> +       int ret = NOTIFY_OK;
>> +
>> +       spin_lock(&drv->pm_lock);
>> +
>> +       switch (action) {
>> +       case CPU_PM_ENTER:
> I thought CPU_PM notifiers weren't supposed to be used anymore? Or at
> least, the genpd work that has gone on for cpuidle could be used here in
> place of CPU_PM notifiers?

genpd was used in v3 and v4 of this series, where from pd's .power_off  
function, rpmh_flush() was invoked.

genpd can be useful if target firmware supports PSCI's OSI mode, while 
sc7180 is non-OSI target.

The current approch (using cpu pm notification) can be used for both OSI 
and non-OSI targets to invoke rpmh_flush() when last cpu goes to power down.

> And so this isn't actually any different
> than what was proposed originally to use genpd for this?
>
>> +               cpumask_set_cpu(raw_smp_processor_id(),
> Why do we need to use raw_smp_processor_id()? smp_processor_id() should
> work just as well?
Yes, seems it will work as well. I will change to use smp_processor_id().
>
>> +                               &drv->cpus_entered_pm);
>> +
>> +               if (!cpumask_equal(&drv->cpus_entered_pm, cpu_online_mask))
>> +                       goto exit;
>> +               break;
>> +       case CPU_PM_ENTER_FAILED:
>> +       case CPU_PM_EXIT:
>> +               cpumask_clear_cpu(raw_smp_processor_id(),
>> +                                 &drv->cpus_entered_pm);
>> +               goto exit;
>> +       }
>> +
>> +       ret = rpmh_rsc_ctrlr_is_busy(drv);
>> +       if (ret) {
>> +               ret = NOTIFY_BAD;
>> +               goto exit;
>> +       }
>> +
>> +       ret = rpmh_flush(&drv->client);
>> +       if (ret)
>> +               ret = NOTIFY_BAD;
>> +       else
>> +               ret = NOTIFY_OK;
>> +
>> +exit:
>> +       spin_unlock(&drv->pm_lock);
>> +       return ret;
>> +}
>> +
Thanks,
Maulik

-- 
QUALCOMM INDIA, on behalf of Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, hosted by The Linux Foundation

  reply	other threads:[~2020-04-08  7:09 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-06  6:32 [PATCH v16 0/6] Invoke rpmh_flush for non OSI targets Maulik Shah
2020-04-06  6:32 ` [PATCH v16 1/6] arm64: dts: qcom: sc7180: Add cpuidle low power states Maulik Shah
2020-04-06  6:32 ` [PATCH v16 2/6] soc: qcom: rpmh: Update dirty flag only when data changes Maulik Shah
2020-04-06  6:32 ` [PATCH v16 3/6] soc: qcom: rpmh: Invalidate SLEEP and WAKE TCSes before flushing new data Maulik Shah
2020-04-09 20:23   ` Stephen Boyd
2020-04-12 13:25     ` Maulik Shah
2020-04-06  6:32 ` [PATCH v16 4/6] soc: qcom: rpmh: Invoke rpmh_flush() for dirty caches Maulik Shah
2020-04-08  2:50   ` Stephen Boyd
2020-04-08  7:08     ` Maulik Shah [this message]
2020-04-09  8:16       ` Stephen Boyd
2020-04-12 13:51         ` Maulik Shah
2020-04-10  4:15   ` Stephen Boyd
2020-04-10 14:52     ` Doug Anderson
2020-04-12 14:10       ` Maulik Shah
2020-04-12 14:04     ` Maulik Shah
2020-04-06  6:32 ` [PATCH v16 5/6] soc: qcom: rpmh-rsc: Clear active mode configuration for wake TCS Maulik Shah
2020-04-06  6:32 ` [PATCH v16 6/6] soc: qcom: rpmh-rsc: Allow using free WAKE TCS for active request Maulik Shah

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=8553ce0f-6dda-b0e0-d67a-f76ce3c0f945@codeaurora.org \
    --to=mkshah@codeaurora.org \
    --cc=agross@kernel.org \
    --cc=bjorn.andersson@linaro.org \
    --cc=dianders@chromium.org \
    --cc=evgreen@chromium.org \
    --cc=ilina@codeaurora.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lsrao@codeaurora.org \
    --cc=mka@chromium.org \
    --cc=rnayak@codeaurora.org \
    --cc=swboyd@chromium.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;
as well as URLs for NNTP newsgroup(s).