Re: [PATCH net] net: stmmac: dwmac-motorcomm: fix eFUSE MAC address read failure

From: Yao Zi

Date: Mon Apr 06 2026 - 08:44:00 EST


On Mon, Apr 06, 2026 at 07:44:25AM +0000, Johan Alvarado wrote:
>
> This patch fixes an issue where reading the MAC address from the eFUSE
> fails due to a race condition.
>
> The root cause was identified by comparing the driver's behavior with a
> custom U-Boot port. In U-Boot, the MAC address was read successfully
> every time because the driver was loaded later in the boot process, giving
> the hardware ample time to initialize. In Linux, reading the eFUSE
> immediately returns all zeros, resulting in a fallback to a random MAC address.
>
> Hardware cold-boot testing revealed that the eFUSE controller requires a
> short settling time to load its internal data. Adding a 2000-5000us
> delay after the reset ensures the hardware is fully ready, allowing the
> native MAC address to be read consistently.

Sounds like a reasonable explanation. The vendor driver reads MAC
address from eFuse before issuing a system reset, which explains why
this doesn't reproduce on it. However, I'd prefer your approach which
ensures a clean hardware state before any operations are performed.

I'm currently on travel thus couldn't verify it against real hardware,
but here's mine tag,

Reviewed-by: Yao Zi <me@xxxxxxxx>

Much thanks for investigating into it.

Best regards,
Yao Zi

> Fixes: 02ff155ea281 ("net: stmmac: Add glue driver for Motorcomm YT6801 ethernet controller")
> Reported-by: Georg Gottleuber <ggo@xxxxxxxxxxxxxxxxxxx>
> Closes: https://lore.kernel.org/all/24cfefff-1233-4745-8c47-812b502d5d19@xxxxxxxxxxxxxxxxxxx/
> Signed-off-by: Johan Alvarado <contact@xxxxxxxx>