All of lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot] [PATCH] net: Fix netretry condition
@ 2018-03-09 14:29 Leonid Iziumtsev
  2018-03-19 21:01 ` Joe Hershberger
  2018-03-26 19:26 ` [U-Boot] " Joe Hershberger
  0 siblings, 2 replies; 3+ messages in thread
From: Leonid Iziumtsev @ 2018-03-09 14:29 UTC (permalink / raw)
  To: u-boot

The "net_try_count" counter starts from "1".
And the "retrycnt" contains requested amount of retries.

With current logic, that means that the actual retry amount
will be one time less then what we set in "netretry" env.
For example setting "netretry" to "once" will make "retrycnt"
equal "1", so no retries will be triggered at all.

Fix the logic by changing the statement of "if" condition.

Signed-off-by: Leonid Iziumtsev <leonid.iziumtsev@se.atlascopco.com>
---
 net/net.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/net.c b/net/net.c
index 4259c9e..8a9b69c 100644
--- a/net/net.c
+++ b/net/net.c
@@ -683,7 +683,7 @@ int net_start_again(void)
                retry_forever = 0;
        }

-       if ((!retry_forever) && (net_try_count >= retrycnt)) {
+       if ((!retry_forever) && (net_try_count > retrycnt)) {
                eth_halt();
                net_set_state(NETLOOP_FAIL);
                /*
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [U-Boot] [PATCH] net: Fix netretry condition
  2018-03-09 14:29 [U-Boot] [PATCH] net: Fix netretry condition Leonid Iziumtsev
@ 2018-03-19 21:01 ` Joe Hershberger
  2018-03-26 19:26 ` [U-Boot] " Joe Hershberger
  1 sibling, 0 replies; 3+ messages in thread
From: Joe Hershberger @ 2018-03-19 21:01 UTC (permalink / raw)
  To: u-boot

On Fri, Mar 9, 2018 at 8:29 AM, Leonid Iziumtsev
<leonid.iziumtsev@gmail.com> wrote:
> The "net_try_count" counter starts from "1".
> And the "retrycnt" contains requested amount of retries.
>
> With current logic, that means that the actual retry amount
> will be one time less then what we set in "netretry" env.
> For example setting "netretry" to "once" will make "retrycnt"
> equal "1", so no retries will be triggered at all.
>
> Fix the logic by changing the statement of "if" condition.
>
> Signed-off-by: Leonid Iziumtsev <leonid.iziumtsev@se.atlascopco.com>

Acked-by: Joe Hershberger <joe.hershberger@ni.com>

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [U-Boot] net: Fix netretry condition
  2018-03-09 14:29 [U-Boot] [PATCH] net: Fix netretry condition Leonid Iziumtsev
  2018-03-19 21:01 ` Joe Hershberger
@ 2018-03-26 19:26 ` Joe Hershberger
  1 sibling, 0 replies; 3+ messages in thread
From: Joe Hershberger @ 2018-03-26 19:26 UTC (permalink / raw)
  To: u-boot

Hi Leonid,

https://patchwork.ozlabs.org/patch/883696/ was applied to http://git.denx.de/?p=u-boot/u-boot-net.git

Thanks!
-Joe

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2018-03-26 19:26 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-03-09 14:29 [U-Boot] [PATCH] net: Fix netretry condition Leonid Iziumtsev
2018-03-19 21:01 ` Joe Hershberger
2018-03-26 19:26 ` [U-Boot] " Joe Hershberger

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.