Message ID | 20220824151724.2698107-1-saproj@gmail.com (mailing list archive) |
---|---|
State | Accepted |
Commit | f7650d82e7dc501dfc5920c698bcc0591791a57c |
Delegated to: | Netdev Maintainers |
Headers | show |
Series | [net-next] net: ftmac100: add an opportunity to get ethaddr from the platform | expand |
On Wed, Aug 24, 2022 at 06:17:24PM +0300, Sergei Antonov wrote: > This driver always generated a random ethernet address. Leave it as a > fallback solution, but add a call to platform_get_ethdev_address(). > Handle EPROBE_DEFER returned from platform_get_ethdev_address() to > retry when EEPROM is ready. Hi Sergei This is version 2 correct, you added -EPROBE_DEFER handling? Please add a v2 into the Subject "[PATCH v2 net-next]" so we can keep track of the different versions. Also, list briefly under the --- what you changed with each version. It is worth reading: https://www.kernel.org/doc/html/latest/process/submitting-patches.html and https://www.kernel.org/doc/html/latest/process/maintainer-netdev.html#netdev-faq Reviewed-by: Andrew Lunn <andrew@lunn.ch> Andrew
On Wed, 24 Aug 2022 at 18:32, Andrew Lunn <andrew@lunn.ch> wrote: > > On Wed, Aug 24, 2022 at 06:17:24PM +0300, Sergei Antonov wrote: > > This driver always generated a random ethernet address. Leave it as a > > fallback solution, but add a call to platform_get_ethdev_address(). > > Handle EPROBE_DEFER returned from platform_get_ethdev_address() to > > retry when EEPROM is ready. > > Hi Sergei > > This is version 2 correct, you added -EPROBE_DEFER handling? No, that's v1 for drivers/net/ethernet/moxa/ftmac100.c driver and -EPROBE_DEFER handling is present from the start. I previously submitted an analogous patch for another driver: drivers/net/ethernet/moxa/moxart_ether.c. And yes, there were v1 and v2.
On Wed, Aug 24, 2022 at 06:40:44PM +0300, Sergei Antonov wrote: > On Wed, 24 Aug 2022 at 18:32, Andrew Lunn <andrew@lunn.ch> wrote: > > > > On Wed, Aug 24, 2022 at 06:17:24PM +0300, Sergei Antonov wrote: > > > This driver always generated a random ethernet address. Leave it as a > > > fallback solution, but add a call to platform_get_ethdev_address(). > > > Handle EPROBE_DEFER returned from platform_get_ethdev_address() to > > > retry when EEPROM is ready. > > > > Hi Sergei > > > > This is version 2 correct, you added -EPROBE_DEFER handling? > > No, that's v1 for drivers/net/ethernet/moxa/ftmac100.c driver and > -EPROBE_DEFER handling is present from the start. > I previously submitted an analogous patch for another driver: > drivers/net/ethernet/moxa/moxart_ether.c. And yes, there were v1 and > v2. Ah, sorry. Getting the different moxa drivers mixed up. Andrew
Hello: This patch was applied to netdev/net-next.git (master) by Jakub Kicinski <kuba@kernel.org>: On Wed, 24 Aug 2022 18:17:24 +0300 you wrote: > This driver always generated a random ethernet address. Leave it as a > fallback solution, but add a call to platform_get_ethdev_address(). > Handle EPROBE_DEFER returned from platform_get_ethdev_address() to > retry when EEPROM is ready. > > Signed-off-by: Sergei Antonov <saproj@gmail.com> > > [...] Here is the summary with links: - [net-next] net: ftmac100: add an opportunity to get ethaddr from the platform https://git.kernel.org/netdev/net-next/c/f7650d82e7dc You are awesome, thank you!
diff --git a/drivers/net/ethernet/faraday/ftmac100.c b/drivers/net/ethernet/faraday/ftmac100.c index 2e6524009b19..a9af5b4c45b6 100644 --- a/drivers/net/ethernet/faraday/ftmac100.c +++ b/drivers/net/ethernet/faraday/ftmac100.c @@ -1077,6 +1077,10 @@ static int ftmac100_probe(struct platform_device *pdev) netdev->netdev_ops = &ftmac100_netdev_ops; netdev->max_mtu = MAX_PKT_SIZE; + err = platform_get_ethdev_address(&pdev->dev, netdev); + if (err == -EPROBE_DEFER) + goto defer_get_mac; + platform_set_drvdata(pdev, netdev); /* setup private data */ @@ -1138,6 +1142,7 @@ static int ftmac100_probe(struct platform_device *pdev) release_resource(priv->res); err_req_mem: netif_napi_del(&priv->napi); +defer_get_mac: free_netdev(netdev); err_alloc_etherdev: return err;
This driver always generated a random ethernet address. Leave it as a fallback solution, but add a call to platform_get_ethdev_address(). Handle EPROBE_DEFER returned from platform_get_ethdev_address() to retry when EEPROM is ready. Signed-off-by: Sergei Antonov <saproj@gmail.com> --- drivers/net/ethernet/faraday/ftmac100.c | 5 +++++ 1 file changed, 5 insertions(+)