diff mbox series

net: eth-uclass: Do not return error when no MAC is found

Message ID 20200109182802.26121-1-festevam@gmail.com
State New
Headers show
Series net: eth-uclass: Do not return error when no MAC is found | expand

Commit Message

Fabio Estevam Jan. 9, 2020, 6:28 p.m. UTC
On some i.MX8QXP MEK boards with no MAC address stored, the following
hang is seen:

Error: ethernet at 5b040000 address not set.

(Board hangs)

One way to avoid this issue is to select CONFIG_NET_RANDOM_ETHADDR, so
that a random MAC is provided and boot proceeds, but the lack of MAC
should not hang the entire system.

Fix the hang by removing the propagation of error when no MAC is found.

In this case there are already messages indicating that something
is not correct:

Error: ethernet at 5b040000 address not set.

Error: ethernet at 5b040000 address 00:00:00:00:00:00 illegal value
eth0: ethernet at 5b040000
Error: ethernet at 5b040000 address 00:00:00:00:00:00 illegal value

Signed-off-by: Fabio Estevam <festevam at gmail.com>
---
 net/eth-uclass.c | 1 -
 1 file changed, 1 deletion(-)

Comments

Joe Hershberger March 5, 2020, 11:21 p.m. UTC | #1
On Thu, Jan 9, 2020 at 12:29 PM Fabio Estevam <festevam at gmail.com> wrote:
>
> On some i.MX8QXP MEK boards with no MAC address stored, the following
> hang is seen:
>
> Error: ethernet at 5b040000 address not set.
>
> (Board hangs)
>
> One way to avoid this issue is to select CONFIG_NET_RANDOM_ETHADDR, so
> that a random MAC is provided and boot proceeds, but the lack of MAC
> should not hang the entire system.
>
> Fix the hang by removing the propagation of error when no MAC is found.
>
> In this case there are already messages indicating that something
> is not correct:
>
> Error: ethernet at 5b040000 address not set.
>
> Error: ethernet at 5b040000 address 00:00:00:00:00:00 illegal value
> eth0: ethernet at 5b040000
> Error: ethernet at 5b040000 address 00:00:00:00:00:00 illegal value
>
> Signed-off-by: Fabio Estevam <festevam at gmail.com>

Acked-by: Joe Hershberger <joe.hershberger at ni.com>
Joe Hershberger March 10, 2020, 5:44 p.m. UTC | #2
Hi Fabio,

On Thu, Jan 9, 2020 at 12:29 PM Fabio Estevam <festevam at gmail.com> wrote:
>
> On some i.MX8QXP MEK boards with no MAC address stored, the following
> hang is seen:
>
> Error: ethernet at 5b040000 address not set.
>
> (Board hangs)
>
> One way to avoid this issue is to select CONFIG_NET_RANDOM_ETHADDR, so
> that a random MAC is provided and boot proceeds, but the lack of MAC
> should not hang the entire system.
>
> Fix the hang by removing the propagation of error when no MAC is found.
>
> In this case there are already messages indicating that something
> is not correct:
>
> Error: ethernet at 5b040000 address not set.
>
> Error: ethernet at 5b040000 address 00:00:00:00:00:00 illegal value
> eth0: ethernet at 5b040000
> Error: ethernet at 5b040000 address 00:00:00:00:00:00 illegal value
>
> Signed-off-by: Fabio Estevam <festevam at gmail.com>

I tried to apply this but it breaks the unit tests. I guess you didn't
try "ut dm" in sandbox?

https://travis-ci.org/jhershbe/u-boot/builds/660395782

Please test those and update the tests to pass with your change.

Thanks,
-Joe
diff mbox series

Patch

diff --git a/net/eth-uclass.c b/net/eth-uclass.c
index ed81cbd537..bc2b0aac00 100644
--- a/net/eth-uclass.c
+++ b/net/eth-uclass.c
@@ -554,7 +554,6 @@  static int eth_post_probe(struct udevice *dev)
 #else
 		printf("\nError: %s address not set.\n",
 		       dev->name);
-		return -EINVAL;
 #endif
 	}