net: ag71xx: support probe defferal for getting MAC address
Subsystems (3)
PATCH 1/1 net: ag71xx: support probe defferal for getting MAC address
Currently, of_get_ethdev_address() return is checked for any return error code which means that trying to get the MAC from NVMEM cells that is backed by MTD will fail if it was not probed before ag71xx.
So, lets check the return error code for EPROBE_DEFER and defer the ag71xx probe in that case until the underlying NVMEM device is live.
--- drivers/net/ethernet/atheros/ag71xx.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/net/ethernet/atheros/ag71xx.c +2 -0
@@ -1897,6 +1897,8 @@ static int ag71xx_probe(struct platform_device *pdev) ag->stop_desc->next = (u32 )ag->stop_desc_dma; err =of_get_ethdev_address (np, ndev); +if (err == -EPROBE_DEFER ) +return err;if (err) {netif_err (ag, probe, ndev,"invalid MAC address, using random address\n" );eth_hw_addr_random (ndev);
Signature · 1 line
2.46.0
Quoted 9 lines · Rosen Penev
Currently,
of_get_ethdev_address()return is checked for any return error code which means that trying to get the MAC from NVMEM cells that is backed by MTD will fail if it was not probed before ag71xx.So, lets check the return error code for
EPROBE_DEFERand defer the ag71xx probe in that case until the underlying NVMEM device is live.Signed-off-by Robert Marko <[email protected]>Signed-off-by Rosen Penev <[email protected]>
Thank you!
Signature · 4 lines
Pengutronix e.K. | | Steuerwalder Str. 21 | http://www.pengutronix.de/ | 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |
Quoted 9 lines · Rosen Penev
Currently,
of_get_ethdev_address()return is checked for any return error code which means that trying to get the MAC from NVMEM cells that is backed by MTD will fail if it was not probed before ag71xx.So, lets check the return error code for
EPROBE_DEFERand defer the ag71xx probe in that case until the underlying NVMEM device is live.Signed-off-by Robert Marko <[email protected]>Signed-off-by Rosen Penev <[email protected]>
Andrew
This patch was applied to netdev/net-next.git (main) by Jakub Kicinski <[email protected]>:
Hello:
This patch was applied to netdev/net-next.git (main) by Jakub Kicinski <[email protected]>:
Quoted 8 lines · On Sat, 24 Aug 2024 13:02:37 -0700 you wrote:
Currently,
of_get_ethdev_address()return is checked for any return error code which means that trying to get the MAC from NVMEM cells that is backed by MTD will fail if it was not probed before ag71xx.So, lets check the return error code for
EPROBE_DEFERand defer the ag71xx probe in that case until the underlying NVMEM device is live.[...]
Here is the summary with links:
- [net-next] net: ag71xx: support probe defferal for getting MAC address
https://git.kernel.org/netdev/net-next/c/be04024a24a9
You are awesome, thank you!
Signature · 2 lines
Deet-doot-dot, I am a bot. https://korg.docs.kernel.org/patchwork/pwbot.html