From: Conor Dooley <conor@kernel.org>
To: Andrew Lunn <andrew@lunn.ch>
Cc: "Leon M. Busch-George" <leon@georgemail.de>,
linux-kernel@vger.kernel.org,
"David S. Miller" <davem@davemloft.net>,
devicetree@vger.kernel.org, netdev@vger.kernel.org,
Matthias Brugger <matthias.bgg@gmail.com>
Subject: Re: [PATCH 1/2] net: add option to ignore 'local-mac-address' property
Date: Fri, 17 May 2024 17:13:18 +0100 [thread overview]
Message-ID: <20240517-unscrew-handsfree-c0fe02c67b3d@spud> (raw)
In-Reply-To: <7471f037-f396-4924-8c8d-e704507de361@lunn.ch>
[-- Attachment #1: Type: text/plain, Size: 2214 bytes --]
On Fri, May 17, 2024 at 04:07:08PM +0200, Andrew Lunn wrote:
> On Fri, May 17, 2024 at 02:39:07PM +0200, Leon M. Busch-George wrote:
> > From: "Leon M. Busch-George" <leon@georgemail.eu>
> >
> > Here is the definition of a mac that looks like its address would be
> > loaded from nvmem:
> >
> > mac@0 {
> > compatible = "mediatek,eth-mac";
> > reg = <0>;
> > phy-mode = "2500base-x";
> > phy-handle = <&rtl8221b_phy>;
> >
> > nvmem-cell-names = "mac-address";
> > nvmem-cells = <&macaddr_bdinfo_de00 1>; /* this is ignored */
> > };
> >
> > Because the boot program inserts a 'local-mac-address', which is preferred
> > over other detection methods, the definition using nvmem is ignored.
> > By itself, that is only a mild annoyance when dealing with device trees.
> > After all, the 'local-mac-address' property exists primarily to pass MAC
> > addresses to the kernel.
> >
> > But it is also possible for this address to be randomly generated (on each
> > boot), which turns an annoyance into a hindrance. In such a case, it is no
> > longer possible to set the correct address from the device tree. This
> > behaviour has been observed on two types of MT7981B devices from different
> > vendors (Cudy M3000, Yuncore AX835).
> >
> > Restore the ability to set addresses through the device tree by adding an
> > option to ignore the 'local-mac-address' property.
>
> I'm not convinced you are fixing the right thing here.
>
> To me, this is the bootloader which is broken. You should be fixing
> the bootloader.
IMO this is firmly in the "setting software policy" category of
properties and is therefore not really welcome.
If we can patch the DT provided to the kernel with this property, how
come the bootloader cannot be changed to stop patching the random MAC
address in the first place?
> One concession might be, does the bootloader correctly generate a
> random MAC address? i.e. does it have the locally administered bit
> set? If that bit is set, and there are other sources of a MAC address,
> then it seems worth while checking them to see if there is a better
> MAC address available, which as global scope.
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]
next prev parent reply other threads:[~2024-05-17 16:13 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-05-17 12:39 [PATCH 1/2] net: add option to ignore 'local-mac-address' property Leon M. Busch-George
2024-05-17 12:39 ` [PATCH 2/2] dt-bindings: net: add option to ignore local-mac-address Leon M. Busch-George
2024-05-17 14:07 ` [PATCH 1/2] net: add option to ignore 'local-mac-address' property Andrew Lunn
2024-05-17 16:13 ` Conor Dooley [this message]
2024-05-17 21:15 ` Leon Busch-George
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=20240517-unscrew-handsfree-c0fe02c67b3d@spud \
--to=conor@kernel.org \
--cc=andrew@lunn.ch \
--cc=davem@davemloft.net \
--cc=devicetree@vger.kernel.org \
--cc=leon@georgemail.de \
--cc=linux-kernel@vger.kernel.org \
--cc=matthias.bgg@gmail.com \
--cc=netdev@vger.kernel.org \
/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