forked from pool/u-boot
8bb7d3f247
- Enable new RPi3 B+ (bsc#1085262) - Fix network boot (bsc#1070775) - Patch queue updated from git://github.com/openSUSE/u-boot.git tumbleweed-2018.03 * Patches added: 0005-rpi3-Enable-lan78xx-driver.patch 0006-net-Only-access-network-devices-aft.patch 0007-rpi-Add-identifier-for-the-new-RPi3.patch 0008-efi_loader-Fix-network-DP-with-DM_E.patch OBS-URL: https://build.opensuse.org/request/show/587586 OBS-URL: https://build.opensuse.org/package/show/hardware:boot/u-boot?expand=0&rev=5
40 lines
1.2 KiB
Diff
40 lines
1.2 KiB
Diff
From 18d741c98c7fdeca3c8ed1df40bd35fbebaa8571 Mon Sep 17 00:00:00 2001
|
|
From: Alexander Graf <agraf@suse.de>
|
|
Date: Thu, 15 Mar 2018 11:02:33 +0100
|
|
Subject: [PATCH] net: Only access network devices after init
|
|
|
|
In the efi_loader main loop we call eth_rx() occasionally. This rx function
|
|
might end up calling into devices that haven't been initialized yet,
|
|
potentially resulting in a lot of transfer timeouts.
|
|
|
|
Instead, let's make sure the ethernet device is actually initialized before
|
|
reading from or writing to it.
|
|
|
|
Signed-off-by: Alexander Graf <agraf@suse.de>
|
|
---
|
|
net/eth-uclass.c | 4 ++--
|
|
1 file changed, 2 insertions(+), 2 deletions(-)
|
|
|
|
diff --git a/net/eth-uclass.c b/net/eth-uclass.c
|
|
index d30b04ba86..240b596534 100644
|
|
--- a/net/eth-uclass.c
|
|
+++ b/net/eth-uclass.c
|
|
@@ -336,7 +336,7 @@ int eth_send(void *packet, int length)
|
|
if (!current)
|
|
return -ENODEV;
|
|
|
|
- if (!device_active(current))
|
|
+ if (!eth_is_active(current))
|
|
return -EINVAL;
|
|
|
|
ret = eth_get_ops(current)->send(current, packet, length);
|
|
@@ -359,7 +359,7 @@ int eth_rx(void)
|
|
if (!current)
|
|
return -ENODEV;
|
|
|
|
- if (!device_active(current))
|
|
+ if (!eth_is_active(current))
|
|
return -EINVAL;
|
|
|
|
/* Process up to 32 packets at one time */
|