* [PATCH net-next] net: ftmac100: add an opportunity to get ethaddr from the platform
@ 2022-08-24 15:17 Sergei Antonov
2022-08-24 15:32 ` Andrew Lunn
2022-08-27 2:40 ` patchwork-bot+netdevbpf
0 siblings, 2 replies; 5+ messages in thread
From: Sergei Antonov @ 2022-08-24 15:17 UTC (permalink / raw)
To: netdev
Cc: andrew, olteanv, davem, edumazet, kuba, pabeni, tangbin,
caizhichao, Sergei Antonov
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(+)
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;
--
2.34.1
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH net-next] net: ftmac100: add an opportunity to get ethaddr from the platform
2022-08-24 15:17 [PATCH net-next] net: ftmac100: add an opportunity to get ethaddr from the platform Sergei Antonov
@ 2022-08-24 15:32 ` Andrew Lunn
2022-08-24 15:40 ` Sergei Antonov
2022-08-27 2:40 ` patchwork-bot+netdevbpf
1 sibling, 1 reply; 5+ messages in thread
From: Andrew Lunn @ 2022-08-24 15:32 UTC (permalink / raw)
To: Sergei Antonov
Cc: netdev, olteanv, davem, edumazet, kuba, pabeni, tangbin, caizhichao
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
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH net-next] net: ftmac100: add an opportunity to get ethaddr from the platform
2022-08-24 15:32 ` Andrew Lunn
@ 2022-08-24 15:40 ` Sergei Antonov
2022-08-24 16:14 ` Andrew Lunn
0 siblings, 1 reply; 5+ messages in thread
From: Sergei Antonov @ 2022-08-24 15:40 UTC (permalink / raw)
To: Andrew Lunn
Cc: netdev, Vladimir Oltean, David S . Miller, Eric Dumazet,
Jakub Kicinski, Paolo Abeni, tangbin, caizhichao
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.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH net-next] net: ftmac100: add an opportunity to get ethaddr from the platform
2022-08-24 15:40 ` Sergei Antonov
@ 2022-08-24 16:14 ` Andrew Lunn
0 siblings, 0 replies; 5+ messages in thread
From: Andrew Lunn @ 2022-08-24 16:14 UTC (permalink / raw)
To: Sergei Antonov
Cc: netdev, Vladimir Oltean, David S . Miller, Eric Dumazet,
Jakub Kicinski, Paolo Abeni, tangbin, caizhichao
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
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH net-next] net: ftmac100: add an opportunity to get ethaddr from the platform
2022-08-24 15:17 [PATCH net-next] net: ftmac100: add an opportunity to get ethaddr from the platform Sergei Antonov
2022-08-24 15:32 ` Andrew Lunn
@ 2022-08-27 2:40 ` patchwork-bot+netdevbpf
1 sibling, 0 replies; 5+ messages in thread
From: patchwork-bot+netdevbpf @ 2022-08-27 2:40 UTC (permalink / raw)
To: Sergei Antonov
Cc: netdev, andrew, olteanv, davem, edumazet, kuba, pabeni, tangbin,
caizhichao
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!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2022-08-27 2:40 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-08-24 15:17 [PATCH net-next] net: ftmac100: add an opportunity to get ethaddr from the platform Sergei Antonov
2022-08-24 15:32 ` Andrew Lunn
2022-08-24 15:40 ` Sergei Antonov
2022-08-24 16:14 ` Andrew Lunn
2022-08-27 2:40 ` patchwork-bot+netdevbpf
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).