devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Vladimir Zapolskiy <vladimir.zapolskiy@linaro.org>
To: 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: Thu, 31 Oct 2024 00:13:33 +0200	[thread overview]
Message-ID: <b9a467bd-ad2f-4b6b-a0c3-0d60960023c6@linaro.org> (raw)
In-Reply-To: <CAL_JsqKwaT4q-VHqfLXAabdGtKvRtnh7SFiELpyXDGVRRpOoYQ@mail.gmail.com>

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.

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.

>>
>>> This one in particular I have to wonder why csiphy is not a separate
>>> node.
>>
>> There were dicussions about it in the past, and kind of enforced outcome of
>> the discussions is to keep all CAMSS IP components together under one huge
>> plain device tree node. I personally dislike this approach, but obedience
>> is the way to get things merged.
> 
> Who are you saying would be in the way to get things merged? DT
> maintainers? I feel certain I would have pushed for separate blocks,
> but I'll defer to people that know the h/w. I can't learn the details
> of everyone's h/w. If they get it wrong, it's their problem not mine.

I had this discussion with Qualcomm/CAMSS maintainers long time ago, it
may be restarted, if there is a necessity.

>>>> Which means sorting reg by address and irq too.
>>>
>>> IRQs make little sense to sort IMO.
>>
>> For all non-reg properties with a present *-names property the sorting
>> order should be done by *-names property. Only 'reg' is very special.
> 
> No. If you had 'main' and 'error', I'd put 'main' first. If they are
> somewhat equal (e.g. rx, tx), then sure, sort them however you like
> (assuming no existing binding). The only real rules here are how new
> entries should be added (on the end). Otherwise, there is no policy.
> 

Here in the proposed terms the start of an IO region is 'main', while
some value in the middle of it (the first one in alphabetical sorting)
is too secondary to dictate the device tree node unit address, I believe.

--
Best wishes,
Vladimir

  reply	other threads:[~2024-10-30 22:13 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 [this message]
2024-11-01  9:47               ` Krzysztof Kozlowski
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=b9a467bd-ad2f-4b6b-a0c3-0d60960023c6@linaro.org \
    --to=vladimir.zapolskiy@linaro.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 \
    /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).