From: Konrad Dybcio <konrad.dybcio@linaro.org>
To: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>,
Bjorn Andersson <andersson@kernel.org>,
Liam Girdwood <lgirdwood@gmail.com>,
Mark Brown <broonie@kernel.org>
Cc: Marijn Suijten <marijn.suijten@somainline.org>,
linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] regulator: qcom_smd: Keep one rpm handle for all vregs
Date: Wed, 3 Jan 2024 11:03:49 +0100 [thread overview]
Message-ID: <8ef0364b-2649-4bef-81bf-30934afb1e38@linaro.org> (raw)
In-Reply-To: <ae1c1cb6-00f9-41ce-afd1-d557fbf3034f@linaro.org>
On 27.12.2023 12:48, Dmitry Baryshkov wrote:
> On 27/12/2023 03:29, Konrad Dybcio wrote:
>> For no apparent reason (as there's just one RPM per SoC), all vregs
>> currently store a copy of a pointer to smd_rpm. Introduce a single,
>> global one to save up on space in each definition.
>>
>> bloat-o-meter reports:
>>
>> Total: Before=43944, After=43924, chg -0.05%
>>
>> plus sizeof(ptr) on every dynamically allocated regulator :)
>>
>> Signed-off-by: Konrad Dybcio <konrad.dybcio@linaro.org>
>> ---
[...]
>> @@ -1440,11 +1438,10 @@ static int rpm_reg_probe(struct platform_device *pdev)
>> const struct rpm_regulator_data *vreg_data;
>> struct device_node *node;
>> struct qcom_rpm_reg *vreg;
>> - struct qcom_smd_rpm *rpm;
>> int ret;
>> - rpm = dev_get_drvdata(pdev->dev.parent);
>> - if (!rpm) {
>> + smd_vreg_rpm = dev_get_drvdata(pdev->dev.parent);
>> + if (!smd_vreg_rpm) {
>
> I thought about having a mutex around (I don't remember if secondary PMICs and/or chargers can be routed through RPM or not).
A mutex for assigning this?
Konrad
>
> Then I went on checking other RPM and SMD-RPM drivers.
>
> clk-rpm: global variable, field
> clk-smd-rpm: struct field
> regulator_qcom-smd-rpm: struct field
>
> Probably it's worth using the same approach in all four drivers?
next prev parent reply other threads:[~2024-01-03 10:03 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-12-27 1:29 Konrad Dybcio
2023-12-27 11:10 ` kernel test robot
2023-12-27 11:48 ` Dmitry Baryshkov
2024-01-03 10:03 ` Konrad Dybcio [this message]
2024-01-03 18:31 ` Dmitry Baryshkov
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=8ef0364b-2649-4bef-81bf-30934afb1e38@linaro.org \
--to=konrad.dybcio@linaro.org \
--cc=andersson@kernel.org \
--cc=broonie@kernel.org \
--cc=dmitry.baryshkov@linaro.org \
--cc=lgirdwood@gmail.com \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-kernel@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®