]> git.kernelconcepts.de Git - karo-tx-uboot.git/commitdiff
net: Make netretry actually do something
authorJoe Hershberger <joe.hershberger@ni.com>
Sun, 22 Mar 2015 22:09:07 +0000 (17:09 -0500)
committerLothar Waßmann <LW@KARO-electronics.de>
Tue, 8 Sep 2015 19:47:30 +0000 (21:47 +0200)
netretry previously would only retry in one specific case (your MAC
address is not set) and no other. This is basically useless. In the DM
implementation for eth it turns this into a completely useless case
since an un-configured MAC address results in not even entering the
NetLoop. The behavior is now changed to retry any failed command
(rotating through the eth adapters if ethrotate != no).

It also defaulted to retry forever. It is now changed to default to not
retry

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
net/net.c

index e40e0969edafb51673c1986326d275d4d3852f54..c0028f06905aed953071a6ca52c87e9f879243c9 100644 (file)
--- a/net/net.c
+++ b/net/net.c
@@ -532,6 +532,8 @@ restart:
                        (*x)();
                }
 
                        (*x)();
                }
 
+               if (net_state == NETLOOP_FAIL)
+                       NetStartAgain();
 
                switch (net_state) {
 
 
                switch (net_state) {
 
@@ -608,8 +610,10 @@ void NetStartAgain(void)
                        retrycnt = 1;
                else
                        retrycnt = simple_strtoul(nretry, NULL, 0);
                        retrycnt = 1;
                else
                        retrycnt = simple_strtoul(nretry, NULL, 0);
-       } else
-               retry_forever = 1;
+       } else {
+               retrycnt = 0;
+               retry_forever = 0;
+       }
 
        if ((!retry_forever) && (NetTryCount >= retrycnt)) {
                eth_halt();
 
        if ((!retry_forever) && (NetTryCount >= retrycnt)) {
                eth_halt();