On Wed, Oct 30, 2024 at 9:20 AM Vladimir Zapolskiy <vladimir.zapolskiy@xxxxxxxxxx> 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? > > > 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. > >> 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. Rob