* [PATCH] nvmem: layouts: u-boot-env: remove ethaddr check
@ 2026-04-28 21:26 Rosen Penev
2026-04-29 7:39 ` Miquel Raynal
0 siblings, 1 reply; 4+ messages in thread
From: Rosen Penev @ 2026-04-28 21:26 UTC (permalink / raw)
To: linux-kernel; +Cc: Rafał Miłecki, Miquel Raynal, Srinivas Kandagatla
Manufacturers use various names for MAC addresses in u-boot.
Stuff like:
eth1addr
RADIOADDR0
RADIOADDR1
wmac1
wmac2
wanaddr
wlanmac
lanmac
wanmac
and many others. Don't restruct to just ethaddr in order to handle the
various names.
Signed-off-by: Rosen Penev <rosenp@gmail.com>
---
drivers/nvmem/layouts/u-boot-env.c | 8 +++-----
1 file changed, 3 insertions(+), 5 deletions(-)
diff --git a/drivers/nvmem/layouts/u-boot-env.c b/drivers/nvmem/layouts/u-boot-env.c
index f27f387bb52a..afa196be4161 100644
--- a/drivers/nvmem/layouts/u-boot-env.c
+++ b/drivers/nvmem/layouts/u-boot-env.c
@@ -75,11 +75,9 @@ static int u_boot_env_parse_cells(struct device *dev, struct nvmem_device *nvmem
info.offset = data_offset + value - data;
info.bytes = strlen(value);
info.np = of_get_child_by_name(dev->of_node, info.name);
- if (!strcmp(var, "ethaddr")) {
- info.raw_len = strlen(value);
- info.bytes = ETH_ALEN;
- info.read_post_process = u_boot_env_read_post_process_ethaddr;
- }
+ info.raw_len = strlen(value);
+ info.bytes = ETH_ALEN;
+ info.read_post_process = u_boot_env_read_post_process_ethaddr;
nvmem_add_one_cell(nvmem, &info);
}
--
2.54.0
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] nvmem: layouts: u-boot-env: remove ethaddr check
2026-04-28 21:26 [PATCH] nvmem: layouts: u-boot-env: remove ethaddr check Rosen Penev
@ 2026-04-29 7:39 ` Miquel Raynal
2026-04-29 7:44 ` Miquel Raynal
0 siblings, 1 reply; 4+ messages in thread
From: Miquel Raynal @ 2026-04-29 7:39 UTC (permalink / raw)
To: Rosen Penev; +Cc: linux-kernel, Rafał Miłecki, Srinivas Kandagatla
Hi Rosen,
> --- a/drivers/nvmem/layouts/u-boot-env.c
> +++ b/drivers/nvmem/layouts/u-boot-env.c
> @@ -75,11 +75,9 @@ static int u_boot_env_parse_cells(struct device *dev, struct nvmem_device *nvmem
> info.offset = data_offset + value - data;
> info.bytes = strlen(value);
> info.np = of_get_child_by_name(dev->of_node, info.name);
> - if (!strcmp(var, "ethaddr")) {
> - info.raw_len = strlen(value);
> - info.bytes = ETH_ALEN;
> - info.read_post_process = u_boot_env_read_post_process_ethaddr;
> - }
> + info.raw_len = strlen(value);
> + info.bytes = ETH_ALEN;
How do you know this is a MAC address?
Thanks,
Miquèl
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] nvmem: layouts: u-boot-env: remove ethaddr check
2026-04-29 7:39 ` Miquel Raynal
@ 2026-04-29 7:44 ` Miquel Raynal
2026-04-29 21:41 ` Rosen Penev
0 siblings, 1 reply; 4+ messages in thread
From: Miquel Raynal @ 2026-04-29 7:44 UTC (permalink / raw)
To: Rosen Penev; +Cc: linux-kernel, Rafał Miłecki, Srinivas Kandagatla
On 29/04/2026 at 09:39:53 +02, Miquel Raynal <miquel.raynal@bootlin.com> wrote:
> Hi Rosen,
>
>> --- a/drivers/nvmem/layouts/u-boot-env.c
>> +++ b/drivers/nvmem/layouts/u-boot-env.c
>> @@ -75,11 +75,9 @@ static int u_boot_env_parse_cells(struct device *dev, struct nvmem_device *nvmem
>> info.offset = data_offset + value - data;
>> info.bytes = strlen(value);
>> info.np = of_get_child_by_name(dev->of_node, info.name);
>> - if (!strcmp(var, "ethaddr")) {
>> - info.raw_len = strlen(value);
>> - info.bytes = ETH_ALEN;
>> - info.read_post_process = u_boot_env_read_post_process_ethaddr;
>> - }
>> + info.raw_len = strlen(value);
>> + info.bytes = ETH_ALEN;
>
> How do you know this is a MAC address?
You are overwriting info.bytes above. I am sorry but this change has
only been tested with your very own settings and does not look like
something we could accept.
You cannot attach the "process ethaddr" subprocess to any node, that
would not make any sense.
I guess we can extend a bit the condition with thinks like "eth%daddr",
but that must remain limited.
Thanks,
Miquèl
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] nvmem: layouts: u-boot-env: remove ethaddr check
2026-04-29 7:44 ` Miquel Raynal
@ 2026-04-29 21:41 ` Rosen Penev
0 siblings, 0 replies; 4+ messages in thread
From: Rosen Penev @ 2026-04-29 21:41 UTC (permalink / raw)
To: Miquel Raynal; +Cc: linux-kernel, Rafał Miłecki, Srinivas Kandagatla
On Wed, Apr 29, 2026 at 12:44 AM Miquel Raynal
<miquel.raynal@bootlin.com> wrote:
>
> On 29/04/2026 at 09:39:53 +02, Miquel Raynal <miquel.raynal@bootlin.com> wrote:
>
> > Hi Rosen,
> >
> >> --- a/drivers/nvmem/layouts/u-boot-env.c
> >> +++ b/drivers/nvmem/layouts/u-boot-env.c
> >> @@ -75,11 +75,9 @@ static int u_boot_env_parse_cells(struct device *dev, struct nvmem_device *nvmem
> >> info.offset = data_offset + value - data;
> >> info.bytes = strlen(value);
> >> info.np = of_get_child_by_name(dev->of_node, info.name);
> >> - if (!strcmp(var, "ethaddr")) {
> >> - info.raw_len = strlen(value);
> >> - info.bytes = ETH_ALEN;
> >> - info.read_post_process = u_boot_env_read_post_process_ethaddr;
> >> - }
> >> + info.raw_len = strlen(value);
> >> + info.bytes = ETH_ALEN;
> >
> > How do you know this is a MAC address?
>
> You are overwriting info.bytes above. I am sorry but this change has
> only been tested with your very own settings and does not look like
> something we could accept.
>
> You cannot attach the "process ethaddr" subprocess to any node, that
> would not make any sense.
>
> I guess we can extend a bit the condition with thinks like "eth%daddr",
> but that must remain limited.
how about a static array of the names and strcmp over that?
>
> Thanks,
> Miquèl
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2026-04-29 21:41 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-04-28 21:26 [PATCH] nvmem: layouts: u-boot-env: remove ethaddr check Rosen Penev
2026-04-29 7:39 ` Miquel Raynal
2026-04-29 7:44 ` Miquel Raynal
2026-04-29 21:41 ` Rosen Penev
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox