All of lore.kernel.org
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Manikandan Muralidharan" <manikandan.m@microchip.com>,
	pratyush@kernel.org, mwalle@kernel.org,
	takahiro.kuwano@infineon.com, miquel.raynal@bootlin.com,
	richard@nod.at, vigneshr@ti.com, robh@kernel.org,
	krzk+dt@kernel.org, conor+dt@kernel.org, srini@kernel.org,
	nicolas.ferre@microchip.com, alexandre.belloni@bootlin.com,
	claudiu.beznea@tuxon.dev, linux@armlinux.org.uk,
	richardcochran@gmail.com, linusw@kernel.org, arnd@arndb.de,
	pengpeng@iscas.ac.cn, gregkh@linuxfoundation.org,
	mathieu.dubois-briand@bootlin.com, michael@walle.cc,
	linux-mtd@lists.infradead.org, devicetree@vger.kernel.org
Subject: Re: [PATCH v9 7/8] ARM: dts: microchip: sama5d27_wlsom1: read MAC address from QSPI SFDP
Date: Sat, 17 Oct 2026 10:40:25 +0000	[thread overview]
Message-ID: <sashiko-outbox-175473@kernel.org> (raw)
In-Reply-To: <e756cb8a61a93caed4b68ff8e7c69c184ebfd47e.1792145382.git.manikandan.m@microchip.com>

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [High] nvmem: sst26vf-sfdp-eui: infinite probe deferral on missing EUI-48
--

commit 2233a3452b4615481340768cbd46d9b4bfaf12ac
Author: Manikandan Muralidharan <manikandan.m@microchip.com>

ARM: dts: microchip: sama5d27_wlsom1: read MAC address from QSPI SFDP

This commit configures the QSPI flash SFDP as an NVMEM provider on the
sama5d27_wlsom1_ek board to read the factory-programmed MAC address. It
adds the nvmem-cells property to the macb0 node so it can retrieve the
EUI-48 identifier.

> diff --git a/arch/arm/boot/dts/microchip/at91-sama5d27_wlsom1_ek.dts b/arch/arm/boot/dts/microchip/at91-sama5d27_wlsom1_ek.dts
> index 35a933eec5738..5e87bf04bc47c 100644
> --- a/arch/arm/boot/dts/microchip/at91-sama5d27_wlsom1_ek.dts
> +++ b/arch/arm/boot/dts/microchip/at91-sama5d27_wlsom1_ek.dts
> @@ -97,6 +97,8 @@ uart6: serial@200 {
>  
>  &macb0 {
>  	status = "okay";
> +	nvmem-cells = <&mac_address_eui48>;
> +	nvmem-cell-names = "mac-address";
>  };

[Severity: High]
Will this lead to an infinite probe deferral loop if the QSPI flash EUI-48
marker is unprogrammed, missing, or corrupted?

The commit message notes that boards without an EUI-programmed part simply
do not reference the cell. However, if the flash part is present but the
marker is missing or corrupted, it appears the macb0 interface will fail to
initialize entirely instead of falling back to a random MAC address.

Looking at the nvmem layout driver:

drivers/nvmem/layouts/sst26vf-sfdp-eui.c:sfdp_eui_add_cells() {
        if (marker != SFDP_MCHP_EUI48_MARKER) {
                dev_dbg(dev, "EUI-48 not programmed (marker 0x%02x)\n", marker);
                return 0;
        }
}

This silently returns 0 without adding the cell, which leaves the layout
bound.

When macb_probe() requests the cell, the nvmem core sees the bound layout
but missing cell:

drivers/nvmem/core.c:of_nvmem_cell_get() {
        ret = nvmem->layout ? -EPROBE_DEFER : -ENOENT;
}

This causes of_nvmem_cell_get() to return -EPROBE_DEFER indefinitely.

Then in the ethernet driver:

drivers/net/ethernet/cadence/macb_main.c:macb_probe() {
        err = of_get_ethdev_address(np, bp->netdev);
        if (err == -EPROBE_DEFER)
                goto err_out_free_netdev;
}

Because macb_probe() treats -EPROBE_DEFER as a fatal error that requires
deferring, it skips the fallback path and never brings up macb0.

Could the layout driver return -ENOENT instead when the marker is missing,
or is there another way to ensure the ethernet interface can fall back to a
random MAC address in this scenario?

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/cover.1792145382.git.manikandan.m@microchip.com?part=7

______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/

WARNING: multiple messages have this Message-ID (diff)
From: sashiko-bot@kernel.org
To: "Manikandan Muralidharan" <manikandan.m@microchip.com>,
	pratyush@kernel.org, mwalle@kernel.org,
	takahiro.kuwano@infineon.com, miquel.raynal@bootlin.com,
	richard@nod.at, vigneshr@ti.com, robh@kernel.org,
	krzk+dt@kernel.org, conor+dt@kernel.org, srini@kernel.org,
	nicolas.ferre@microchip.com, alexandre.belloni@bootlin.com,
	claudiu.beznea@tuxon.dev, linux@armlinux.org.uk,
	richardcochran@gmail.com, linusw@kernel.org, arnd@arndb.de,
	pengpeng@iscas.ac.cn, gregkh@linuxfoundation.org,
	mathieu.dubois-briand@bootlin.com, michael@walle.cc,
	linux-mtd@lists.infradead.org, devicetree@vger.kernel.org
Subject: Re: [PATCH v9 7/8] ARM: dts: microchip: sama5d27_wlsom1: read MAC address from QSPI SFDP
Date: Sat, 17 Oct 2026 10:40:25 +0000	[thread overview]
Message-ID: <sashiko-outbox-175473@kernel.org> (raw)
In-Reply-To: <e756cb8a61a93caed4b68ff8e7c69c184ebfd47e.1792145382.git.manikandan.m@microchip.com>

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [High] nvmem: sst26vf-sfdp-eui: infinite probe deferral on missing EUI-48
--

commit 2233a3452b4615481340768cbd46d9b4bfaf12ac
Author: Manikandan Muralidharan <manikandan.m@microchip.com>

ARM: dts: microchip: sama5d27_wlsom1: read MAC address from QSPI SFDP

This commit configures the QSPI flash SFDP as an NVMEM provider on the
sama5d27_wlsom1_ek board to read the factory-programmed MAC address. It
adds the nvmem-cells property to the macb0 node so it can retrieve the
EUI-48 identifier.

> diff --git a/arch/arm/boot/dts/microchip/at91-sama5d27_wlsom1_ek.dts b/arch/arm/boot/dts/microchip/at91-sama5d27_wlsom1_ek.dts
> index 35a933eec5738..5e87bf04bc47c 100644
> --- a/arch/arm/boot/dts/microchip/at91-sama5d27_wlsom1_ek.dts
> +++ b/arch/arm/boot/dts/microchip/at91-sama5d27_wlsom1_ek.dts
> @@ -97,6 +97,8 @@ uart6: serial@200 {
>  
>  &macb0 {
>  	status = "okay";
> +	nvmem-cells = <&mac_address_eui48>;
> +	nvmem-cell-names = "mac-address";
>  };

[Severity: High]
Will this lead to an infinite probe deferral loop if the QSPI flash EUI-48
marker is unprogrammed, missing, or corrupted?

The commit message notes that boards without an EUI-programmed part simply
do not reference the cell. However, if the flash part is present but the
marker is missing or corrupted, it appears the macb0 interface will fail to
initialize entirely instead of falling back to a random MAC address.

Looking at the nvmem layout driver:

drivers/nvmem/layouts/sst26vf-sfdp-eui.c:sfdp_eui_add_cells() {
        if (marker != SFDP_MCHP_EUI48_MARKER) {
                dev_dbg(dev, "EUI-48 not programmed (marker 0x%02x)\n", marker);
                return 0;
        }
}

This silently returns 0 without adding the cell, which leaves the layout
bound.

When macb_probe() requests the cell, the nvmem core sees the bound layout
but missing cell:

drivers/nvmem/core.c:of_nvmem_cell_get() {
        ret = nvmem->layout ? -EPROBE_DEFER : -ENOENT;
}

This causes of_nvmem_cell_get() to return -EPROBE_DEFER indefinitely.

Then in the ethernet driver:

drivers/net/ethernet/cadence/macb_main.c:macb_probe() {
        err = of_get_ethdev_address(np, bp->netdev);
        if (err == -EPROBE_DEFER)
                goto err_out_free_netdev;
}

Because macb_probe() treats -EPROBE_DEFER as a fatal error that requires
deferring, it skips the fallback path and never brings up macb0.

Could the layout driver return -ENOENT instead when the marker is missing,
or is there another way to ensure the ethernet interface can fall back to a
random MAC address in this scenario?

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/cover.1792145382.git.manikandan.m@microchip.com?part=7

  reply	other threads:[~2026-10-17 10:40 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-16 10:38 [PATCH v9 0/8] Read MAC address from SST vendor specific SFDP region Manikandan Muralidharan
2026-10-16 10:38 ` Manikandan Muralidharan
2026-10-16 10:38 ` [PATCH v9 1/8] dt-bindings: mtd: jedec,spi-nor: allow the SFDP to be exposed via NVMEM Manikandan Muralidharan
2026-10-16 10:38   ` Manikandan Muralidharan
2026-10-16 10:38 ` [PATCH v9 2/8] dt-bindings: nvmem: layouts: add Microchip/SST SFDP EUI layout Manikandan Muralidharan
2026-10-16 10:38   ` Manikandan Muralidharan
2026-10-16 10:38 ` [PATCH v9 3/8] nvmem: core: take a reference on dev.of_node in nvmem_register() Manikandan Muralidharan
2026-10-16 10:38   ` Manikandan Muralidharan
2026-10-16 10:38 ` [PATCH v9 4/8] mtd: spi-nor: sfdp: expose the SFDP as a read-only NVMEM device Manikandan Muralidharan
2026-10-16 10:38   ` Manikandan Muralidharan
2026-10-17 10:40   ` sashiko-bot
2026-10-17 10:40     ` sashiko-bot
2026-10-16 10:38 ` [PATCH v9 5/8] nvmem: layouts: add Microchip/SST SFDP EUI layout driver Manikandan Muralidharan
2026-10-16 10:38   ` Manikandan Muralidharan
2026-10-17 10:40   ` sashiko-bot
2026-10-17 10:40     ` sashiko-bot
2026-10-16 10:38 ` [PATCH v9 6/8] ARM: dts: microchip: sama5d27_wlsom1: use fixed-partitions for QSPI flash Manikandan Muralidharan
2026-10-16 10:38   ` Manikandan Muralidharan
2026-10-16 10:38 ` [PATCH v9 7/8] ARM: dts: microchip: sama5d27_wlsom1: read MAC address from QSPI SFDP Manikandan Muralidharan
2026-10-16 10:38   ` Manikandan Muralidharan
2026-10-17 10:40   ` sashiko-bot [this message]
2026-10-17 10:40     ` sashiko-bot
2026-10-16 10:38 ` [PATCH v9 8/8] ARM: configs: sama5: enable Microchip/SST SFDP EUI NVMEM layout Manikandan Muralidharan
2026-10-16 10:38   ` Manikandan Muralidharan

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=sashiko-outbox-175473@kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=alexandre.belloni@bootlin.com \
    --cc=arnd@arndb.de \
    --cc=claudiu.beznea@tuxon.dev \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=krzk+dt@kernel.org \
    --cc=linusw@kernel.org \
    --cc=linux-mtd@lists.infradead.org \
    --cc=linux@armlinux.org.uk \
    --cc=manikandan.m@microchip.com \
    --cc=mathieu.dubois-briand@bootlin.com \
    --cc=michael@walle.cc \
    --cc=miquel.raynal@bootlin.com \
    --cc=mwalle@kernel.org \
    --cc=nicolas.ferre@microchip.com \
    --cc=pengpeng@iscas.ac.cn \
    --cc=pratyush@kernel.org \
    --cc=richard@nod.at \
    --cc=richardcochran@gmail.com \
    --cc=robh@kernel.org \
    --cc=sashiko-reviews@lists.linux.dev \
    --cc=srini@kernel.org \
    --cc=takahiro.kuwano@infineon.com \
    --cc=vigneshr@ti.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.