[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20221202193552.vehqk6u53n36zxwl@pali>
Date: Fri, 2 Dec 2022 20:35:52 +0100
From: Pali Rohár <pali@...nel.org>
To: Rob Herring <robh@...nel.org>
Cc: Michael Ellerman <mpe@...erman.id.au>,
Arınç ÜNAL <arinc.unal@...nc9.com>,
netdev@...r.kernel.org, devicetree@...r.kernel.org,
linux-kernel@...r.kernel.org, linuxppc-dev@...ts.ozlabs.org,
Marek Behún <kabel@...nel.org>
Subject: Re: [PATCH 5/5] powerpc: dts: remove label = "cpu" from DSA
dt-binding
On Thursday 01 December 2022 17:44:00 Rob Herring wrote:
> On Thu, Dec 01, 2022 at 06:39:02PM +0100, Pali Rohár wrote:
> > On Thursday 01 December 2022 21:40:03 Michael Ellerman wrote:
> > > Arınç ÜNAL <arinc.unal@...nc9.com> writes:
> > > > This is not used by the DSA dt-binding, so remove it from all devicetrees.
> > > >
> > > > Signed-off-by: Arınç ÜNAL <arinc.unal@...nc9.com>
> > > > ---
> > > > arch/powerpc/boot/dts/turris1x.dts | 2 --
> > > > 1 file changed, 2 deletions(-)
> > >
> > > Adding Pali to Cc.
> > >
> > > These were only recently updated in commit:
> > >
> > > 8bf056f57f1d ("powerpc: dts: turris1x.dts: Fix labels in DSA cpu port nodes")
> > >
> > > Which said:
> > >
> > > DSA cpu port node has to be marked with "cpu" label.
> > >
> > > But if the binding doesn't use them then I'm confused why they needed to
> > > be updated.
> > >
> > > cheers
> >
> > I was told by Marek (CCed) that DSA port connected to CPU should have
> > label "cpu" and not "cpu<number>". Modern way for specifying CPU port is
> > by defining reference to network device, which there is already (&enet1
> > and &enet0). So that change just "fixed" incorrect naming cpu0 and cpu1.
> >
> > So probably linux kernel does not need label = "cpu" in DTS anymore. But
> > this is not the reason to remove this property. Linux kernel does not
> > use lot of other nodes and properties too... Device tree should describe
> > hardware and not its usage in Linux. "label" property is valid in device
> > tree and it exactly describes what or where is this node connected. And
> > it may be used for other systems.
> >
> > So I do not see a point in removing "label" properties from turris1x.dts
> > file, nor from any other dts file.
>
> Well, it seems like a bit of an abuse of 'label' to me. 'label' should
> be aligned with a sticker or other identifier identifying something to a
> human. Software should never care what the value of 'label' is.
>
> Rob
But it already does. "label" property is used for setting (initial)
network interface name for DSA drivers. And you can try to call e.g.
git grep '"cpu"' net/dsa drivers/net/dsa to see that cpu is still
present on some dsa places (probably relict or backward compatibility
before eth reference).
I agree with you that in this case it is abuse. But I would not say that
software should not care about "label". I think that software should
care about "label" but only in situation in which it presents
information to user. So if user wants to see device with labels *ABC*
(meaning show me anything which stickers contains substring ABC) then
software should filter devices and turns that with asked label.
The main problem here is _existing_ software. New software should really
do not use cpu label for deciding if network port is connected to cpu or
not and it should be designed correctly. But you cannot change nor fix
old / existing software...
The worst thing which can be done is breaking updated version of (old)
software. Prevention is always testing software and in this case testing
on the real hardware. I know, it is hard as developers do not have
such lot of hardware devices and configurations.
Powered by blists - more mailing lists