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.
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.
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.
--
Best wishes,
Vladimir