From: David Collins <collinsd@codeaurora.org>
To: Rajendra Nayak <rnayak@codeaurora.org>,
viresh.kumar@linaro.org, sboyd@kernel.org, andy.gross@linaro.org,
ulf.hansson@linaro.org
Cc: devicetree@vger.kernel.org, linux-arm-msm@vger.kernel.org,
linux-kernel@vger.kernel.org, Lina Iyer <ilina@codeaurora.org>
Subject: Re: [PATCH v2 5/6] soc: qcom: rpmh powerdomain driver
Date: Tue, 29 May 2018 12:03:26 -0700 [thread overview]
Message-ID: <06684883-43d8-be4b-b6ec-7f128c680d50@codeaurora.org> (raw)
In-Reply-To: <6f8e5fe2-199d-ba1f-19d7-2faf276075f3@codeaurora.org>
Hello Rajendra,
On 05/29/2018 03:19 AM, Rajendra Nayak wrote:
> On 05/26/2018 06:38 AM, David Collins wrote:
>> On 05/25/2018 03:01 AM, Rajendra Nayak wrote:
>>> The RPMh powerdomain driver aggregates the corner votes from various
...
>>> diff --git a/drivers/soc/qcom/Kconfig b/drivers/soc/qcom/Kconfig
>>> index a7a405178967..1faed239701d 100644
>>> --- a/drivers/soc/qcom/Kconfig
>>> +++ b/drivers/soc/qcom/Kconfig
>>> @@ -74,6 +74,15 @@ config QCOM_RMTFS_MEM
>>>
>>> Say y here if you intend to boot the modem remoteproc.
>>>
>>> +config QCOM_RPMHPD
>>> + tristate "Qualcomm RPMh Powerdomain driver"
>>
>> s/Qualcomm/Qualcomm Technologies, Inc./
>
> All other config options in qcom/Kconfig use 'Qualcomm XYZ feature'
> for the comment. Maybe I will leave it that way for consistency?
I don't have a strong opinion about it. I just want the legal folks to be
happy. I'm fine with whatever achieves that goal.
>>> +
>>> +struct rpmhpd_desc {
>>> + struct rpmhpd **rpmhpds;
>>> + size_t num_pds;
>>> +};
>>
>> This struct could be removed and the per-platform arrays could instead be
>> NULL terminated.
>
> Yes, but I would prefer it this way unless you have strong objections.
> Just makes it easier to do the allocations at probe for genpd_onecell_data structures.
I'm fine if you keep it as-is. I mentioned the alternative because
Stephen had requested the same modification on my qcom-rpmh-regulator
driver patch [1]. Other reviewers may care about this point.
>> Is there an API to determine the currently operating performance state of
>> a given power domain? Is this information accessible from userspace? We
>> will definitely need this for general debugging.
>
> A quick look shows me its not. I agree its a necessary feature for debug.
> I will add a patch to expose it via debugfs
Thanks
>>> +static int rpmhpd_probe(struct platform_device *pdev)
>>> +{
>>> + int i, ret;
>>> + size_t num;
>>> + struct genpd_onecell_data *data;
>>> + struct rpmhpd **rpmhpds;
>>> + const struct rpmhpd_desc *desc;
>>> +
>>> + desc = of_device_get_match_data(&pdev->dev);
>>> + if (!desc)
>>> + return -EINVAL;
>>> +
>>> + rpmhpds = desc->rpmhpds;
>>> + num = desc->num_pds;
>>> +
>>> + data = devm_kzalloc(&pdev->dev, sizeof(*data), GFP_KERNEL);
>>> + if (!data)
>>> + return -ENOMEM;
>>> +
>>> + data->domains = devm_kcalloc(&pdev->dev, num, sizeof(*data->domains),
>>> + GFP_KERNEL);
>>> + data->num_domains = num;
>>> +
>>> + ret = cmd_db_ready();
>>> + if (ret) {
>>> + if (ret != -EPROBE_DEFER)
>>> + dev_err(&pdev->dev, "Command DB unavailable, ret=%d\n",
>>> + ret);
>>> + return ret;
>>> + }
>>> +
>>> + for (i = 0; i < num; i++) {
>>> + if (!rpmhpds[i])
>>> + continue;
>>
>> Why is this check needed?
>
> Just to check/ignore if there are any holes.
> maybe I should atleast throw a warning instead of silently ignoring it?
A warning message might be a good idea if this condition should ever be
reached but also doesn't necessarily imply that probing must be ceased.
It looks like of_genpd_add_provider_onecell() ignores the NULL initialized
data->domains[i] values so it should be safe to leave the holes in and not
decrement num_domains accordingly.
Take care,
David
[1]: https://lkml.org/lkml/2018/3/21/681
--
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
a Linux Foundation Collaborative Project
next prev parent reply other threads:[~2018-05-29 19:03 UTC|newest]
Thread overview: 29+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-05-25 10:01 [PATCH v2 0/6] Add powerdomain driver for corners on msm8996/sdm845 Rajendra Nayak
2018-05-25 10:01 ` [PATCH v2 1/6] soc: qcom: rpmpd: Add a powerdomain driver to model corners Rajendra Nayak
2018-05-30 9:17 ` Ulf Hansson
2018-05-30 10:14 ` Rajendra Nayak
2018-05-30 12:44 ` Ulf Hansson
2018-05-31 4:20 ` Rajendra Nayak
2018-05-31 11:09 ` Ulf Hansson
2018-05-30 18:27 ` David Collins
2018-05-31 3:53 ` Rajendra Nayak
2018-05-31 3:27 ` Rob Herring
2018-05-31 4:14 ` Rajendra Nayak
2018-05-25 10:01 ` [PATCH v2 2/6] dt-bindings: opp: Introduce qcom-opp bindings Rajendra Nayak
2018-05-25 22:33 ` David Collins
2018-05-29 9:49 ` Rajendra Nayak
2018-05-25 10:01 ` [PATCH v2 3/6] soc: qcom: rpmpd: Add support for get/set performance state Rajendra Nayak
2018-05-25 10:01 ` [PATCH v2 4/6] arm64: dts: msm8996: Add rpmpd device node Rajendra Nayak
2018-05-25 10:01 ` [PATCH v2 5/6] soc: qcom: rpmh powerdomain driver Rajendra Nayak
2018-05-26 1:08 ` David Collins
2018-05-29 10:19 ` Rajendra Nayak
2018-05-29 19:03 ` David Collins [this message]
2018-05-30 8:55 ` Rajendra Nayak
2018-05-30 9:44 ` Viresh Kumar
2018-05-30 10:07 ` Rajendra Nayak
2018-06-01 8:48 ` Rajendra Nayak
2018-06-01 19:19 ` David Collins
2018-06-13 18:29 ` Lina Iyer
2018-05-31 3:31 ` Rob Herring
2018-05-31 4:15 ` Rajendra Nayak
2018-05-25 10:01 ` [PATCH v2 6/6] soc: qcom: rpmpd/rpmhpd: Add a max vote on all corners at init Rajendra Nayak
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=06684883-43d8-be4b-b6ec-7f128c680d50@codeaurora.org \
--to=collinsd@codeaurora.org \
--cc=andy.gross@linaro.org \
--cc=devicetree@vger.kernel.org \
--cc=ilina@codeaurora.org \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=rnayak@codeaurora.org \
--cc=sboyd@kernel.org \
--cc=ulf.hansson@linaro.org \
--cc=viresh.kumar@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;
as well as URLs for NNTP newsgroup(s).