[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <359c32a1-3ffb-4bb2-9a46-802dff3812c4@lunn.ch>
Date: Wed, 24 Jan 2024 19:08:29 +0100
From: Andrew Lunn <andrew@...n.ch>
To: Conor Dooley <conor@...nel.org>
Cc: Philippe Schenker <dev@...henker.ch>, netdev@...r.kernel.org,
Paolo Abeni <pabeni@...hat.com>, Conor Dooley <conor+dt@...nel.org>,
Woojung Huh <woojung.huh@...rochip.com>,
Vladimir Oltean <olteanv@...il.com>, linux-kernel@...r.kernel.org,
UNGLinuxDriver@...rochip.com, Marek Vasut <marex@...x.de>,
Florian Fainelli <f.fainelli@...il.com>, devicetree@...r.kernel.org,
Eric Dumazet <edumazet@...gle.com>,
"David S . Miller" <davem@...emloft.net>,
Krzysztof Kozlowski <krzysztof.kozlowski+dt@...aro.org>,
Jakub Kicinski <kuba@...nel.org>, Rob Herring <robh+dt@...nel.org>
Subject: Re: [PATCH net-next v1 1/2] dt-bindings: net: dsa: Add KSZ8567
switch support
> That sounds counter productive to be honest. Why does the driver not
> trust that the dt is correct? I saw this recently in some IIO drivers,
> but it was shot down for this sort of reason.
DT is software, therefore it contains bugs.
Say we ignore that the compatible does not match the hardware on the
board and just accept the DT has a bug in it and keep going.
That then makes the compatible pointless, and unusable for anything,
since there are boards out in the wild with incorrect compatibles. If
we later actually use the compatible for something, it might cause
regressions for those buggy DT blobs.
By erroring out then the compatible does not match the hardware avoids
such bugs.
The marvell mv88e6xxx driver takes a different approach. All the
compatible does is tell the driver where to find the ID
register. Marvell keeps moving it around, so there are three different
compatibles for the three different locations. If you use the wrong
compatible, its not going to find a device is knows about and errors
out. So this also avoids bugs in the compatible.
Andrew
Powered by blists - more mailing lists