From: Krzysztof Kozlowski <krzk@kernel.org>
To: Vladimir Zapolskiy <vladimir.zapolskiy@linaro.org>,
Rob Herring <robh@kernel.org>
Cc: Bryan O'Donoghue <bryan.odonoghue@linaro.org>,
Richard Acayan <mailingradian@gmail.com>,
Bjorn Andersson <andersson@kernel.org>,
Michael Turquette <mturquette@baylibre.com>,
Stephen Boyd <sboyd@kernel.org>,
Krzysztof Kozlowski <krzk+dt@kernel.org>,
Conor Dooley <conor+dt@kernel.org>,
Robert Foss <rfoss@kernel.org>, Todor Tomov <todor.too@gmail.com>,
Mauro Carvalho Chehab <mchehab@kernel.org>,
Konrad Dybcio <konradybcio@kernel.org>,
linux-arm-msm@vger.kernel.org, linux-clk@vger.kernel.org,
devicetree@vger.kernel.org, linux-media@vger.kernel.org
Subject: Re: [PATCH v6 2/5] dt-bindings: media: camss: Add qcom,sdm670-camss
Date: Fri, 1 Nov 2024 10:47:38 +0100 [thread overview]
Message-ID: <364f2afb-fdaa-42b9-8921-70dbdc3f7085@kernel.org> (raw)
In-Reply-To: <b9a467bd-ad2f-4b6b-a0c3-0d60960023c6@linaro.org>
On 30/10/2024 23:13, Vladimir Zapolskiy wrote:
> On 10/30/24 23:06, Rob Herring wrote:
>> On Wed, Oct 30, 2024 at 9:20 AM Vladimir Zapolskiy
>> <vladimir.zapolskiy@linaro.org> wrote:
>>>
>>> Hi Rob.
>>>
>>> On 10/11/24 17:41, Rob Herring wrote:
>>>> On Fri, Oct 11, 2024 at 09:31:06AM +0100, Bryan O'Donoghue wrote:
>>>>> On 11/10/2024 08:14, Vladimir Zapolskiy wrote:
>>>>>>
>>>>>> Two most recently added CAMSS IP descriptions (qcom,sm8250-camss.yaml and
>>>>>> qcom,sc8280xp-camss.yaml) do implement sorting by reg values, I believe
>>>>>> from now on
>>>>>> it should be assumed that all subsequently added CAMSS IP descriptions
>>>>>> to follow
>>>>>> the same established policy.
>>>>>
>>>>> My preference is sort by address not sort by name => we sort the device
>>>>> nodes themselves by address so it seems more consistent to sort by address
>>>>> inside of the devices too.
>>>>
>>>> Strictly speaking, the values of addresses are unknown to the binding,
>>>> so you can't sort by address. However, if something is truly a single
>>>> block, then the offsets are probably fixed in order by offset makes
>>>> sense. But when a block is changed, any rule on sorting may go out
>>>> the window since we add new regions on the end.
>>>
>>> Exactly, and this is an argument why the sorting is a subject to a device
>>> driver policy, kind of any sorting order is equally bad. Sorting 'reg'
>>> values by addresses helps to avoid a notorious problem with unit addresses.
>>
>> What notorious problem?
>>
>
> Here the problem I reference to is the problem of an incorrespondence between
> device tree node unit address and the address of the first value of 'reg'
> values.
Sorting by unit address does not solve it. Sorting by anything else does
not cause it. You repeat this statement multiple times already. Sorry,
it's not true. You can sort by address and still put wrong unit address.
Tools address it already, not sorting.
>
> Having a sorting by addresses allows to grasp IO ranges easily, and setting
> device tree node unit addresses to some almost arbitrary chosen value from
> the middle of IP's IO range is suspicious and confusing in my opinion.
It's not arbitrary. It's the main, control address space often. At least
it should be. Your sorting rule enforces putting irrelevant address as
unit address, imagine:
isp@1000 {
reg = <0x1000 0x4>, <0x2000, 0x1000>;
reg-names = "reset-control-block-one-unimportant-register",
"main-control-block-with-99%-of-registers";
Sorry, this is just wrong coding style.
Best regards,
Krzysztof
next prev parent reply other threads:[~2024-11-01 9:47 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-10-11 2:37 [PATCH v6 0/5] Add SDM670 camera subsystem Richard Acayan
2024-10-11 2:37 ` [PATCH v6 1/5] dt-bindings: clock: qcom,sdm845-camcc: add sdm670 compatible Richard Acayan
2024-10-11 2:37 ` [PATCH v6 2/5] dt-bindings: media: camss: Add qcom,sdm670-camss Richard Acayan
2024-10-11 7:14 ` Vladimir Zapolskiy
2024-10-11 8:31 ` Bryan O'Donoghue
2024-10-11 14:41 ` Rob Herring
2024-10-11 15:56 ` Bryan O'Donoghue
2024-10-30 14:19 ` Vladimir Zapolskiy
2024-10-30 21:06 ` Rob Herring
2024-10-30 22:13 ` Vladimir Zapolskiy
2024-11-01 9:47 ` Krzysztof Kozlowski [this message]
2024-10-11 14:29 ` Krzysztof Kozlowski
2024-10-30 14:06 ` Vladimir Zapolskiy
2024-10-30 18:33 ` Krzysztof Kozlowski
2024-10-31 15:42 ` Bryan O'Donoghue
2024-11-01 9:17 ` Krzysztof Kozlowski
2024-11-01 9:36 ` Bryan O'Donoghue
2024-11-01 9:49 ` Krzysztof Kozlowski
2024-10-11 2:37 ` [PATCH v6 3/5] media: qcom: camss: add support for SDM670 camss Richard Acayan
2024-10-11 2:37 ` [PATCH v6 4/5] arm64: dts: qcom: sdm670: add camcc Richard Acayan
2024-10-11 2:37 ` [PATCH v6 5/5] arm64: dts: qcom: sdm670: add camss and cci Richard Acayan
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=364f2afb-fdaa-42b9-8921-70dbdc3f7085@kernel.org \
--to=krzk@kernel.org \
--cc=andersson@kernel.org \
--cc=bryan.odonoghue@linaro.org \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=konradybcio@kernel.org \
--cc=krzk+dt@kernel.org \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-clk@vger.kernel.org \
--cc=linux-media@vger.kernel.org \
--cc=mailingradian@gmail.com \
--cc=mchehab@kernel.org \
--cc=mturquette@baylibre.com \
--cc=rfoss@kernel.org \
--cc=robh@kernel.org \
--cc=sboyd@kernel.org \
--cc=todor.too@gmail.com \
--cc=vladimir.zapolskiy@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).