From: Arbab Haider <arbabhaider649@gmail.com>
To: stable@vger.kernel.org
Cc: linux-kernel@vger.kernel.org, Rosen Penev <rosenp@gmail.com>,
Simon Horman <horms@kernel.org>, Jakub Kicinski <kuba@kernel.org>
Subject: [PATCH 7.0.y 2/5] net: mvneta: support EPROBE_DEFER when reading MAC address
Date: Wed, 5 Aug 2026 15:01:33 +0500 [thread overview]
Message-ID: <20260805100136.59101-2-arbabhaider649@gmail.com> (raw)
In-Reply-To: <20260805100136.59101-1-arbabhaider649@gmail.com>
From: Rosen Penev <rosenp@gmail.com>
If nvmem loads after the ethernet driver, mac address assignments will
not take effect. of_get_ethdev_address returns EPROBE_DEFER in such a
case so we need to handle that to avoid eth_hw_addr_random.
Add extra goto section to just free stats as they are allocated right
above.
Signed-off-by: Rosen Penev <rosenp@gmail.com>
Reviewed-by: Simon Horman <horms@kernel.org>
Link: https://patch.msgid.link/20260307031709.640141-1-rosenp@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
[ Upstream commit 73a864352570fd30d942652f05bfe9340d7a2055 ]
---
drivers/net/ethernet/marvell/mvneta.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/drivers/net/ethernet/marvell/mvneta.c b/drivers/net/ethernet/marvell/mvneta.c
index 22da95d46bef..744d6585a949 100644
--- a/drivers/net/ethernet/marvell/mvneta.c
+++ b/drivers/net/ethernet/marvell/mvneta.c
@@ -5620,6 +5620,8 @@ static int mvneta_probe(struct platform_device *pdev)
}
err = of_get_ethdev_address(dn, dev);
+ if (err == -EPROBE_DEFER)
+ goto err_free_stats;
if (!err) {
mac_from = "device tree";
} else {
@@ -5755,6 +5757,7 @@ static int mvneta_probe(struct platform_device *pdev)
1 << pp->id);
mvneta_bm_put(pp->bm_priv);
}
+err_free_stats:
free_percpu(pp->stats);
err_free_ports:
free_percpu(pp->ports);
--
2.53.0
next prev parent reply other threads:[~2026-08-05 10:01 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-05 10:01 [PATCH 7.0.y 1/5] net: mvneta: re-enable percpu interrupt on resume Arbab Haider
2026-08-05 10:01 ` Arbab Haider [this message]
2026-08-05 10:01 ` [PATCH 7.0.y 3/5] net: macb: drop in-flight Tx SKBs on close Arbab Haider
2026-08-05 10:01 ` [PATCH 7.0.y 4/5] net: cpsw_new: unregister devlink on port registration failure Arbab Haider
2026-08-05 10:01 ` [PATCH 7.0.y 5/5] net: stmmac: fix transmit interrupt coalescing Arbab Haider
2026-08-05 16:41 ` [PATCH 7.0.y 1/5] net: mvneta: re-enable percpu interrupt on resume Sasha Levin
2026-08-05 18:37 ` Arbab Haider
2026-08-05 18:38 ` Arbab Haider
2026-08-06 4:44 ` Greg KH
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=20260805100136.59101-2-arbabhaider649@gmail.com \
--to=arbabhaider649@gmail.com \
--cc=horms@kernel.org \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=rosenp@gmail.com \
--cc=stable@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 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.