From: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
To: Yassine Oudjana <yassine.oudjana@gmail.com>
Cc: Robert Foss <rfoss@kernel.org>, Todor Tomov <todor.too@gmail.com>,
Andy Gross <agross@kernel.org>,
Bjorn Andersson <andersson@kernel.org>,
Konrad Dybcio <konrad.dybcio@linaro.org>,
Mauro Carvalho Chehab <mchehab@kernel.org>,
Rob Herring <robh+dt@kernel.org>,
Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>,
Hans Verkuil <hansverk@cisco.com>,
Yassine Oudjana <y.oudjana@protonmail.com>,
Vladimir Zapolskiy <vladimir.zapolskiy@linaro.org>,
linux-media@vger.kernel.org, linux-arm-msm@vger.kernel.org,
devicetree@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2 3/3] media: camss: Link CAMSS power domain
Date: Sat, 27 May 2023 12:13:27 +0100 [thread overview]
Message-ID: <b7e1d035-ee79-77c9-e81f-56fa8c2cf1df@linaro.org> (raw)
In-Reply-To: <GFZAVR.8RI43MBQZ4HN3@gmail.com>
On 27/05/2023 07:02, Yassine Oudjana wrote:
>> Konrad pointed this out.
>>
>> Are you 100% sure you want to do this. We already have a way to count
>> the # of power-domains in camss_configure_pd().
>>
>> Your series is now adding a dependency on power-domain-names.
>>
>> Is there a good reason to add that dependency ? If not, then lets just
>> take the code from camss_configure_pd() and make it so that it can be
>> used/reused here.
>
> Is there a good reason not to?I found that using the existing
> index-based method would unnecessarily complicate things since an extra
> layer of checks would be needed to differentiate between MSM8996 and
> TITAN SoCs, since those have the TITAN GDSC at the same index where the
> CAMSS GDSC is now added for MSM8996. The same checks will also have to
> be repeated in error paths and during cleanup.
>
> I guessed the only reason we were still using this method for the
> existing PDs was to remain compatible with old DT as Konrad mentioned,
> and since this CAMSS PD is only added now, I thought it'd be a good
> opportunity to introduce power-domain-names and simplify things a bit.
I think actually I agree with you but, I don't think you've gone far
enough with this patch.
Now that I look at this code a bit more, it looks like we need to place
the TITAN/CAMSS GDSC last in the list of power-domains or the magic
indices won't work. So my suggestion to you to place the CAMSS_GDSC in
the power-domain list wouldn't work, unless it was the last entry,..
Having magic indices doesn't make much sense to me. Aside from anything
else we don't document or require that indexing behavior in our
Documentation.
In fact, I'm wondering what is the use case of a vfe_lite on its own -
without the TITAN_TOP GDSC switched on ? I'm looking at the block
diagram of the clocks for the sm8250 the IFE_LITE is buried well inside
of a series of other components..
The reverse OTOH holds. Full fat VFE can be collapsed individually,
which is why they have their own GDSCs...
OK, we should get away from magic indices ASAP.
This is a good find, thank you for bringing it up.
Could you take a named pointer for the CAMSS/TITAN instead of an index ?
camss->genpd_camss_top * =
camss->genpd_vfe[] =
These have a very obvious meaning. We can read a top-level struct camss
{} and immediately understand what is meant, whereas index = 0 doesn't
mean anything and isn't obvious from the code anyway.
1. You're right we should introduce some kind of naming to
break the bonds of magic indices.
So lets do as you suggest and name the power-domains.
However we should refactor the code to drop magic indices.
2. If and only if named power-domains are absent, fall back on
legacy indexing. In this case we will assume legacy indexing
assigns to our new named pointers.
3. New CAMSS dts will need to have named power-domains as a result.
---
bod
next prev parent reply other threads:[~2023-05-27 11:13 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-05-26 18:07 [PATCH v2 0/3] media: camss: Link CAMSS power domain on MSM8996 Yassine Oudjana
2023-05-26 18:07 ` [PATCH v2 1/3] dt-bindings: media: camss: qcom,msm8996-camss: Add CAMSS power domain Yassine Oudjana
2023-05-26 19:46 ` Conor Dooley
2023-05-26 20:05 ` Bryan O'Donoghue
2023-05-26 20:19 ` Conor Dooley
2023-05-26 20:21 ` Bryan O'Donoghue
2023-05-26 20:36 ` Konrad Dybcio
2023-05-26 20:40 ` Bryan O'Donoghue
2023-05-26 20:43 ` Konrad Dybcio
2023-05-26 20:47 ` Bryan O'Donoghue
2023-05-27 6:05 ` Yassine Oudjana
2023-05-27 15:52 ` Konrad Dybcio
2023-05-26 18:07 ` [PATCH v2 2/3] arm64: dts: qcom: msm8996: Add CAMSS power domain and power-domain-names to CAMSS Yassine Oudjana
2023-05-26 18:07 ` [PATCH v2 3/3] media: camss: Link CAMSS power domain Yassine Oudjana
2023-05-26 20:49 ` Bryan O'Donoghue
2023-05-26 20:57 ` Konrad Dybcio
2023-05-26 21:17 ` Bryan O'Donoghue
2023-05-26 21:28 ` Konrad Dybcio
2023-05-26 21:38 ` Bryan O'Donoghue
2023-05-27 6:02 ` Yassine Oudjana
2023-05-27 11:13 ` Bryan O'Donoghue [this message]
2023-05-26 20:57 ` Bryan O'Donoghue
2026-03-29 13:00 ` [PATCH v2 0/3] media: camss: Link CAMSS power domain on MSM8996 Christopher Obbard
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=b7e1d035-ee79-77c9-e81f-56fa8c2cf1df@linaro.org \
--to=bryan.odonoghue@linaro.org \
--cc=agross@kernel.org \
--cc=andersson@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=hansverk@cisco.com \
--cc=konrad.dybcio@linaro.org \
--cc=krzysztof.kozlowski+dt@linaro.org \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-media@vger.kernel.org \
--cc=mchehab@kernel.org \
--cc=rfoss@kernel.org \
--cc=robh+dt@kernel.org \
--cc=todor.too@gmail.com \
--cc=vladimir.zapolskiy@linaro.org \
--cc=y.oudjana@protonmail.com \
--cc=yassine.oudjana@gmail.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