Message ID | 20240824200249.137209-1-rosenp@gmail.com (mailing list archive) |
---|---|
State | Accepted |
Commit | be04024a24a93f761a7b2c5f2de46db0f3acdc74 |
Delegated to: | Netdev Maintainers |
Headers | show |
Series | [net-next] net: ag71xx: support probe defferal for getting MAC address | expand |
On Sat, Aug 24, 2024 at 01:02:37PM -0700, Rosen Penev 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_DEFER and defer the ag71xx > probe in that case until the underlying NVMEM device is live. > > Signed-off-by: Robert Marko <robimarko@gmail.com> > Signed-off-by: Rosen Penev <rosenp@gmail.com> Reviewed-by: Oleksij Rempel <o.rempel@pengutronix.de> Thank you!
On Sat, Aug 24, 2024 at 01:02:37PM -0700, Rosen Penev 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_DEFER and defer the ag71xx > probe in that case until the underlying NVMEM device is live. > > Signed-off-by: Robert Marko <robimarko@gmail.com> > Signed-off-by: Rosen Penev <rosenp@gmail.com> Reviewed-by: Andrew Lunn <andrew@lunn.ch> Andrew
Hello: This patch was applied to netdev/net-next.git (main) by Jakub Kicinski <kuba@kernel.org>: 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_DEFER and 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!
diff --git a/drivers/net/ethernet/atheros/ag71xx.c b/drivers/net/ethernet/atheros/ag71xx.c index d81aa0ccd572..5ef76f3d3f1a 100644 --- a/drivers/net/ethernet/atheros/ag71xx.c +++ b/drivers/net/ethernet/atheros/ag71xx.c @@ -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);