From: Praveen Talari <praveen.talari@oss.qualcomm.com>
To: Bjorn Andersson <andersson@kernel.org>
Cc: Andi Shyti <andi.shyti@kernel.org>, Rob Herring <robh@kernel.org>,
Krzysztof Kozlowski <krzk+dt@kernel.org>,
Conor Dooley <conor+dt@kernel.org>,
Mukesh Kumar Savaliya <mukesh.savaliya@oss.qualcomm.com>,
Viken Dadhaniya <viken.dadhaniya@oss.qualcomm.com>,
Konrad Dybcio <konradybcio@kernel.org>,
linux-arm-msm@vger.kernel.org, linux-i2c@vger.kernel.org,
devicetree@vger.kernel.org, linux-kernel@vger.kernel.org,
psodagud@quicinc.com, djaggi@quicinc.com,
quic_msavaliy@quicinc.com, quic_vtanuku@quicinc.com,
quic_arandive@quicinc.com, quic_shazhuss@quicinc.com,
Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>
Subject: Re: [PATCH v1 01/12] soc: qcom: geni-se: Refactor geni_icc_get() and make qup-memory ICC path optional
Date: Thu, 27 Nov 2025 19:19:34 +0530 [thread overview]
Message-ID: <a5392c29-1097-4b7d-a8c1-3536c8f46bea@oss.qualcomm.com> (raw)
In-Reply-To: <c4qgjg3npsi6dkvqyj2z5drd7mfg2w2o4cjjcgepxdsrgiyiic@qdpkcic56iwv>
Hi Bjorn,
Thank you for review
On 11/26/2025 8:37 PM, Bjorn Andersson wrote:
> On Sat, Nov 22, 2025 at 10:30:07AM +0530, Praveen Talari wrote:
>> Refactor the geni_icc_get() function to replace the loop-based ICC path
>> initialization with explicit handling of each interconnect path. This
>> improves code readability and allows for different error handling per
>> path type.
>
> I don't think this "improves code readability", IMO you're turning a
> clean loop into a unrolled mess.
>
>
> But then comes the least significant portion of your "problem
> description" (i.e. the last words of it), where you indicate that this
> would allow you to have different error handling for "qup-memory".
>
> This is actually a valid reason to make this change, so say that!
>
>
>>
>> The "qup-core" and "qup-config" paths remain mandatory, while "qup-memory"
>> is now optional and skipped if not defined in DT.
>>
>
> Please rewrite this message to _start_ with the problem description.
> Make it clear on the first line/sentence why the change should be done.
>
> E.g. compare with something like this:
>
> """
> "qup-memory" is an optional interconnect path, unroll the geni_icc_get()
> loop in order to allow specific error handling for this path.
> """
>
> You only need to read 4 words to understand exactly why this patch
> exists.
The "qup-memory" interconnect path is optional and may not be defined
in all device trees. Unroll the loop-based ICC path initialization to
allow specific error handling for each path type.
The "qup-core" and "qup-config" paths remain mandatory and will fail
probe if missing, while "qup-memory" is now handled as optional and
skipped when not present in the device tree.
I hope the commit text above should be appropriate
Thanks,
Praveen
>
>> Co-developed-by: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>
>> Signed-off-by: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>
>> Signed-off-by: Praveen Talari <praveen.talari@oss.qualcomm.com>
>> ---
>> drivers/soc/qcom/qcom-geni-se.c | 36 +++++++++++++++++----------------
>> 1 file changed, 19 insertions(+), 17 deletions(-)
>>
>> diff --git a/drivers/soc/qcom/qcom-geni-se.c b/drivers/soc/qcom/qcom-geni-se.c
>> index cd1779b6a91a..b6167b968ef6 100644
>> --- a/drivers/soc/qcom/qcom-geni-se.c
>> +++ b/drivers/soc/qcom/qcom-geni-se.c
>> @@ -899,30 +899,32 @@ EXPORT_SYMBOL_GPL(geni_se_rx_dma_unprep);
>>
>> int geni_icc_get(struct geni_se *se, const char *icc_ddr)
>> {
>> - int i, err;
>> - const char *icc_names[] = {"qup-core", "qup-config", icc_ddr};
>> + struct geni_icc_path *icc_paths = se->icc_paths;
>>
>> if (has_acpi_companion(se->dev))
>> return 0;
>>
>> - for (i = 0; i < ARRAY_SIZE(se->icc_paths); i++) {
>> - if (!icc_names[i])
>> - continue;
>> -
>> - se->icc_paths[i].path = devm_of_icc_get(se->dev, icc_names[i]);
>> - if (IS_ERR(se->icc_paths[i].path))
>> - goto err;
>> + icc_paths[GENI_TO_CORE].path = devm_of_icc_get(se->dev, "qup-core");
>> + if (IS_ERR(icc_paths[GENI_TO_CORE].path))
>> + return dev_err_probe(se->dev, PTR_ERR(icc_paths[GENI_TO_CORE].path),
>> + "Failed to get 'qup-core' ICC path\n");
>
> To taste, but I think a local variable would be helpful to make this
> less dense.
Sure, will do it in next version.
Thanks,
Praveen
>
> path = devm_of_icc_get(se->dev, "qup-core");
> if (IS_ERR(path))
> return dev_err_probe(se->dev, PTR_ERR(path), "Failed to get 'qup-core' ICC path\n");
> icc_paths[GENI_TO_CORE].path = path;
>
> Regards,
> Bjorn
>
>> +
>> + icc_paths[CPU_TO_GENI].path = devm_of_icc_get(se->dev, "qup-config");
>> + if (IS_ERR(icc_paths[CPU_TO_GENI].path))
>> + return dev_err_probe(se->dev, PTR_ERR(icc_paths[CPU_TO_GENI].path),
>> + "Failed to get 'qup-config' ICC path\n");
>> +
>> + /* The DDR path is optional, depending on protocol and hw capabilities */
>> + icc_paths[GENI_TO_DDR].path = devm_of_icc_get(se->dev, "qup-memory");
>> + if (IS_ERR(icc_paths[GENI_TO_DDR].path)) {
>> + if (PTR_ERR(icc_paths[GENI_TO_DDR].path) == -ENODATA)
>> + icc_paths[GENI_TO_DDR].path = NULL;
>> + else
>> + return dev_err_probe(se->dev, PTR_ERR(icc_paths[GENI_TO_DDR].path),
>> + "Failed to get 'qup-memory' ICC path\n");
>> }
>>
>> return 0;
>> -
>> -err:
>> - err = PTR_ERR(se->icc_paths[i].path);
>> - if (err != -EPROBE_DEFER)
>> - dev_err_ratelimited(se->dev, "Failed to get ICC path '%s': %d\n",
>> - icc_names[i], err);
>> - return err;
>> -
>> }
>> EXPORT_SYMBOL_GPL(geni_icc_get);
>>
>> --
>> 2.34.1
>>
next prev parent reply other threads:[~2025-11-27 13:49 UTC|newest]
Thread overview: 30+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-11-22 5:00 [PATCH v1 00/12] Enable I2C on SA8255p Qualcomm platforms Praveen Talari
2025-11-22 5:00 ` [PATCH v1 01/12] soc: qcom: geni-se: Refactor geni_icc_get() and make qup-memory ICC path optional Praveen Talari
2025-11-26 15:07 ` Bjorn Andersson
2025-11-27 13:49 ` Praveen Talari [this message]
2025-11-22 5:00 ` [PATCH v1 02/12] soc: qcom: geni-se: Add geni_icc_set_bw_ab() function Praveen Talari
2025-11-22 5:00 ` [PATCH v1 03/12] soc: qcom: geni-se: Introduce helper API for resource initialization Praveen Talari
2025-11-23 10:23 ` kernel test robot
2025-11-22 5:00 ` [PATCH v1 04/12] soc: qcom: geni-se: Add geni_se_resource_state() helper Praveen Talari
2025-11-26 15:19 ` Bjorn Andersson
2025-11-28 4:42 ` Praveen Talari
2025-11-22 5:00 ` [PATCH v1 05/12] soc: qcom: geni-se: Introduce helper API for attaching power domains Praveen Talari
2025-11-22 5:00 ` [PATCH v1 06/12] soc: qcom: geni-se: Introduce helper APIs for performance control Praveen Talari
2025-11-22 5:00 ` [PATCH v1 07/12] dt-bindings: i2c: Describe SA8255p Praveen Talari
2025-11-22 11:40 ` Krzysztof Kozlowski
2025-11-25 4:03 ` Praveen Talari
2025-11-25 7:25 ` Krzysztof Kozlowski
2025-11-26 5:02 ` Praveen Talari
2025-12-02 3:42 ` Praveen Talari
2025-11-22 5:00 ` [PATCH v1 08/12] i2c: qcom-geni: Isolate serial engine setup Praveen Talari
2025-11-26 15:30 ` Bjorn Andersson
2025-11-28 6:22 ` Praveen Talari
2025-11-22 5:00 ` [PATCH v1 09/12] i2c: qcom-geni: Move resource initialization to separate function Praveen Talari
2025-11-22 5:00 ` [PATCH v1 10/12] i2c: qcom-geni: Use geni_se_resources_state() API in runtime PM functions Praveen Talari
2025-11-26 15:38 ` Bjorn Andersson
2025-12-01 16:33 ` Praveen Talari
2025-11-22 5:00 ` [PATCH v1 11/12] i2c: qcom-geni: Store of_device_id data in driver private struct Praveen Talari
2025-11-22 5:00 ` [PATCH v1 12/12] i2c: qcom-geni: Enable I2C on SA8255p Qualcomm platforms Praveen Talari
2025-11-23 11:46 ` kernel test robot
2025-11-26 15:52 ` Bjorn Andersson
2025-12-01 17:24 ` Praveen Talari
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=a5392c29-1097-4b7d-a8c1-3536c8f46bea@oss.qualcomm.com \
--to=praveen.talari@oss.qualcomm.com \
--cc=andersson@kernel.org \
--cc=andi.shyti@kernel.org \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=djaggi@quicinc.com \
--cc=konrad.dybcio@oss.qualcomm.com \
--cc=konradybcio@kernel.org \
--cc=krzk+dt@kernel.org \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-i2c@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mukesh.savaliya@oss.qualcomm.com \
--cc=psodagud@quicinc.com \
--cc=quic_arandive@quicinc.com \
--cc=quic_msavaliy@quicinc.com \
--cc=quic_shazhuss@quicinc.com \
--cc=quic_vtanuku@quicinc.com \
--cc=robh@kernel.org \
--cc=viken.dadhaniya@oss.qualcomm.com \
/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®