From: "Johan Alvarado" <contact@c127.dev>
To: <me@ziyao.cc>,<davem@davemloft.net>,<kuba@kernel.org>,<pabeni@redhat.com>,<edumazet@google.com>
Cc: <ggo@tuxedocomputers.com>, <andrew+netdev@lunn.ch>,
<netdev@vger.kernel.org>, <linux-kernel@vger.kernel.org>
Subject: [PATCH net] net: stmmac: dwmac-motorcomm: fix eFUSE MAC address read failure
Date: Mon, 6 Apr 2026 07:44:25 +0000 [thread overview]
Message-ID: <22e2a606-ce4c-4e96-ae97-dbe29c3583e7@smtp-relay.sendinblue.com> (raw)
In-Reply-To: <24cfefff-1233-4745-8c47-812b502d5d19@tuxedocomputers.com>
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.
Fixes: 02ff155ea281 ("net: stmmac: Add glue driver for Motorcomm YT6801 ethernet controller")
Reported-by: Georg Gottleuber <ggo@tuxedocomputers.com>
Closes: https://lore.kernel.org/all/24cfefff-1233-4745-8c47-812b502d5d19@tuxedocomputers.com/
Signed-off-by: Johan Alvarado <contact@c127.dev>
---
drivers/net/ethernet/stmicro/stmmac/dwmac-motorcomm.c | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-motorcomm.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-motorcomm.c
index 8b45b9cf7202..663d87ccfa0f 100644
--- a/drivers/net/ethernet/stmicro/stmmac/dwmac-motorcomm.c
+++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-motorcomm.c
@@ -6,6 +6,7 @@
*/
#include <linux/bits.h>
+#include <linux/delay.h>
#include <linux/dev_printk.h>
#include <linux/io.h>
#include <linux/iopoll.h>
@@ -334,6 +335,13 @@ static int motorcomm_probe(struct pci_dev *pdev, const struct pci_device_id *id)
motorcomm_reset(priv);
+ /*
+ * After system reset, the eFuse controller needs time to load
+ * its internal data. Without this delay, eFuse reads return
+ * all zeros, causing MAC address detection to fail.
+ */
+ usleep_range(2000, 5000);
+
ret = motorcomm_efuse_read_mac(&pdev->dev, priv, res.mac);
if (ret == -ENOENT) {
dev_warn(&pdev->dev, "eFuse contains no valid MAC address\n");
--
2.53.0
next prev parent reply other threads:[~2026-04-06 7:46 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-01-09 9:34 [PATCH RESEND net-next v6 0/3] Add DWMAC glue driver for Motorcomm YT6801 Yao Zi
2026-01-09 9:34 ` [PATCH RESEND net-next v6 1/3] net: phy: motorcomm: Support YT8531S PHY in YT6801 Ethernet controller Yao Zi
2026-01-09 10:06 ` Russell King (Oracle)
2026-01-09 9:34 ` [PATCH RESEND net-next v6 2/3] net: stmmac: Add glue driver for Motorcomm YT6801 ethernet controller Yao Zi
2026-01-12 6:10 ` Sai Krishna Gajula
2026-01-12 7:51 ` Yao Zi
2026-01-12 10:17 ` Russell King (Oracle)
2026-01-09 9:34 ` [PATCH RESEND net-next v6 3/3] MAINTAINERS: Assign myself as maintainer of Motorcomm DWMAC glue driver Yao Zi
2026-01-13 3:30 ` [PATCH RESEND net-next v6 0/3] Add DWMAC glue driver for Motorcomm YT6801 patchwork-bot+netdevbpf
2026-01-19 15:33 ` Georg Gottleuber
2026-01-19 15:43 ` Russell King (Oracle)
2026-01-19 17:45 ` Georg Gottleuber
2026-01-19 17:57 ` Georg Gottleuber
2026-01-20 2:45 ` Yao Zi
2026-01-20 9:42 ` Georg Gottleuber
2026-01-20 11:52 ` Yao Zi
2026-01-21 7:10 ` Xi Ruoyao
2026-04-06 7:44 ` Johan Alvarado [this message]
[not found] ` <4aaa214c-4286-4c24-ab5c-b17a3a1a8f1e@smtp-relay.sendinblue.com>
2026-04-06 12:42 ` [PATCH net] net: stmmac: dwmac-motorcomm: fix eFUSE MAC address read failure Yao Zi
[not found] ` <fc5992a4-9532-49c3-8ec1-c2f8c5b84ca1@smtp-relay.sendinblue.com>
2026-04-06 13:41 ` Andrew Lunn
2026-04-08 1:30 ` patchwork-bot+netdevbpf
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=22e2a606-ce4c-4e96-ae97-dbe29c3583e7@smtp-relay.sendinblue.com \
--to=contact@c127.dev \
--cc=andrew+netdev@lunn.ch \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=ggo@tuxedocomputers.com \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=me@ziyao.cc \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®