Skip to contentSkip to conversation

net: ftmac100: add an opportunity to get ethaddr from the platform

PATCH Applied Sergei Antonov 3 participants 5 messages Aug 24, 2022 – Aug 27, 2022

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 net: ftmac100: add an opportunity to get ethaddr from the platform

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.

---
 drivers/net/ethernet/faraday/ftmac100.c | 5 +++++
 1 file changed, 5 insertions(+)
drivers/net/ethernet/faraday/ftmac100.c +5 -0
index 2e6524009b19..a9af5b4c45b6 100644
@@ -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;
Signature · 1 line
2.34.1
Reviewed-by on v1 1/1
#1 lore raw
Quoted 4 lines · 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.

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

Andrew

#2 lore raw
Quoted 10 lines · Andrew Lunn
Quoted 4 lines · 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.

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.

#3 lore raw
Quoted 10 lines · Sergei Antonov
Quoted 9 lines · Andrew Lunn
Quoted 4 lines · 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.

Hi Sergei

Quoted 7 lines
Quoted 1 line

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

#4 lore raw
In reply to Sergei Antonov
This patch was applied to netdev/net-next.git (master) by Jakub Kicinski <[email protected]>:

Hello:

This patch was applied to netdev/net-next.git (master) by Jakub Kicinski <[email protected]>:

Quoted 8 lines · 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.

[...]

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!

Signature · 2 lines
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html