From: Konrad Dybcio <konrad.dybcio@linaro.org>
To: Georgi Djakov <djakov@kernel.org>, Andy Gross <agross@kernel.org>,
Bjorn Andersson <andersson@kernel.org>,
Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Cc: Bryan O'Donoghue <bryan.odonoghue@linaro.org>,
linux-arm-msm@vger.kernel.org, linux-pm@vger.kernel.org,
linux-kernel@vger.kernel.org,
Marijn Suijten <marijn.suijten@somainline.org>
Subject: Re: [PATCH v8 5/8] interconnect: qcom: rpm: Handle interface clocks
Date: Thu, 18 May 2023 21:55:20 +0200 [thread overview]
Message-ID: <bd722d46-4297-10bc-77fe-5285fc3b13ce@linaro.org> (raw)
In-Reply-To: <b1990459-4780-b139-9656-f00f34a2a375@kernel.org>
On 18.05.2023 17:59, Georgi Djakov wrote:
> Hi Konrad,
> Thanks for re-spinning the patches!
>
> On 7.04.23 23:14, Konrad Dybcio wrote:
>> Some (but not all) providers (or their specific nodes) require
>> specific clocks to be turned on before they can be accessed. Failure
>> to ensure that results in a seemingly random system crash (which
>> would usually happen at boot with the interconnect driver built-in),
>> resulting in the platform not booting up properly.
>>
>> Limit the number of bus_clocks to 2 (which is the maximum that SMD
>> RPM interconnect supports anyway) and handle non-scaling clocks
>> separately. Update MSM8996 and SDM660 drivers to make sure they do
>> not regress with this change.
>>
>> This unfortunately has to be done in one patch to prevent either
>> compile errors or broken bisect.
>>
>> Signed-off-by: Konrad Dybcio <konrad.dybcio@linaro.org>
>> ---
>> drivers/interconnect/qcom/icc-rpm.c | 40 ++++++++++++++++++++++++++++---------
>> drivers/interconnect/qcom/icc-rpm.h | 14 +++++++++++--
>> drivers/interconnect/qcom/msm8996.c | 22 +++++++++-----------
>> drivers/interconnect/qcom/sdm660.c | 16 ++++++---------
>> 4 files changed, 58 insertions(+), 34 deletions(-)
>>
>> diff --git a/drivers/interconnect/qcom/icc-rpm.c b/drivers/interconnect/qcom/icc-rpm.c
>> index d79e508cb717..419b2122bebd 100644
>> --- a/drivers/interconnect/qcom/icc-rpm.c
>> +++ b/drivers/interconnect/qcom/icc-rpm.c
>> @@ -424,21 +424,20 @@ int qnoc_probe(struct platform_device *pdev)
>> qnodes = desc->nodes;
>> num_nodes = desc->num_nodes;
>> - if (desc->num_bus_clocks) {
>> - cds = desc->bus_clocks;
>> - cd_num = desc->num_bus_clocks;
>> + if (desc->num_intf_clocks) {
>> + cds = desc->intf_clocks;
>> + cd_num = desc->num_intf_clocks;
>> } else {
>> - cds = bus_clocks;
>> - cd_num = ARRAY_SIZE(bus_clocks);
>> + /* 0 intf clocks is perfectly fine */
>> + cd_num = 0;
>> }
>> - qp = devm_kzalloc(dev, struct_size(qp, bus_clks, cd_num), GFP_KERNEL);
>> + qp = devm_kzalloc(dev, sizeof(*qp), GFP_KERNEL);
>> if (!qp)
>> return -ENOMEM;
>> - qp->bus_clk_rate = devm_kcalloc(dev, cd_num, sizeof(*qp->bus_clk_rate),
>> - GFP_KERNEL);
>> - if (!qp->bus_clk_rate)
>> + qp->intf_clks = devm_kzalloc(dev, sizeof(qp->intf_clks), GFP_KERNEL);
>> + if (!qp->intf_clks)
>> return -ENOMEM;
>> data = devm_kzalloc(dev, struct_size(data, nodes, num_nodes),
>> @@ -446,6 +445,18 @@ int qnoc_probe(struct platform_device *pdev)
>> if (!data)
>> return -ENOMEM;
>> + qp->num_intf_clks = cd_num;
>> + for (i = 0; i < cd_num; i++)
>> + qp->intf_clks[i].id = cds[i];
>
> Sadly, this is introducing a superfluous compiler warning, which is a bit annoying.
> Could you please add some initialization to silence it and re-send just this patch.
Ugh clang doesn't show it.. thanks
Konrad
>
> drivers/interconnect/qcom/icc-rpm.c: In function ‘qnoc_probe’:
> drivers/interconnect/qcom/icc-rpm.c:450:28: warning: ‘cds’ may be used uninitialized in this function [-Wmaybe-uninitialized]
> 450 | qp->intf_clks[i].id = cds[i];
> | ~~~^~~
>
> BR,
> Georgi
next prev parent reply other threads:[~2023-05-18 19:55 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-04-07 20:14 [PATCH v8 0/8] The great interconnecification fixation Konrad Dybcio
2023-04-07 20:14 ` [PATCH v8 1/8] interconnect: qcom: rpm: Rename icc desc clocks to bus_blocks Konrad Dybcio
2023-04-07 20:14 ` [PATCH v8 2/8] interconnect: qcom: rpm: Rename icc provider num_clocks to num_bus_clocks Konrad Dybcio
2023-04-07 20:14 ` [PATCH v8 3/8] interconnect: qcom: rpm: Drop unused parameters Konrad Dybcio
2023-04-07 20:14 ` [PATCH v8 4/8] interconnect: qcom: rpm: Set QoS registers only once Konrad Dybcio
2023-04-07 20:14 ` [PATCH v8 5/8] interconnect: qcom: rpm: Handle interface clocks Konrad Dybcio
2023-05-18 15:59 ` Georgi Djakov
2023-05-18 19:55 ` Konrad Dybcio [this message]
2023-04-07 20:14 ` [PATCH v8 6/8] interconnect: qcom: icc-rpm: Enforce 2 or 0 bus clocks Konrad Dybcio
2023-04-07 20:14 ` [PATCH v8 7/8] interconnect: qcom: rpm: Don't use clk_get_optional for bus clocks anymore Konrad Dybcio
2023-04-07 20:14 ` [PATCH v8 8/8] interconnect: qcom: msm8996: Promote to core_initcall Konrad Dybcio
2023-05-17 16:21 ` [PATCH v8 0/8] The great interconnecification fixation Konrad Dybcio
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=bd722d46-4297-10bc-77fe-5285fc3b13ce@linaro.org \
--to=konrad.dybcio@linaro.org \
--cc=agross@kernel.org \
--cc=andersson@kernel.org \
--cc=bryan.odonoghue@linaro.org \
--cc=djakov@kernel.org \
--cc=dmitry.baryshkov@linaro.org \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=marijn.suijten@somainline.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®