[U-Boot] [PATCH] nfs: NfsTimeout() updates

From: Evan Samanas esamanas@xes-inc.com
- NfsTimeout() does not correctly update the NFS timeout value which results in NfsTimeout() only being called once in certain situations. This can result in the 'nfs' command hanging indefinetly. For example, the command:
nfs 192.168.0.1:/home/user/file
will not exit until ctrl-c is pressed if 192.168.0.1 does not have an NFS server running.
This issue is resolved by reinitializting the NFS timeout value inside NfsTimeout() when a timeout occurs.
- Make the 'nfs' command print the 'T' character when a timeout occurs. Previously there was no indication that timeouts were occuring.
- Mimic the 'tftpboot' command and when a download fails print "Retry count exceeded; starting again", and restart the download taking the 'netretry' environment variable into account.
Signed-off-by: Evan Samanas esamanas@xes-inc.com Signed-off-by: Peter Tyser ptyser@xes-inc.com --- net/nfs.c | 11 ++++++----- 1 files changed, 6 insertions(+), 5 deletions(-)
diff --git a/net/nfs.c b/net/nfs.c index 27395fb..51b17c7 100644 --- a/net/nfs.c +++ b/net/nfs.c @@ -571,13 +571,14 @@ Interfaces of U-BOOT static void NfsTimeout (void) { - if ( NfsTimeoutCount++ < NFS_RETRY_COUNT ) { + if ( ++NfsTimeoutCount > NFS_RETRY_COUNT ) { + puts ("\nRetry count exceeded; starting again\n"); + NetStartAgain (); + } else { + puts("T "); + NetSetTimeout (NFS_TIMEOUT, NfsTimeout); NfsSend (); - return; } - puts ("Timeout\n"); - NetState = NETLOOP_FAIL; - return; }
static void

Dear Peter Tyser,
In message 1257818916-30673-1-git-send-email-ptyser@xes-inc.com you wrote:
From: Evan Samanas esamanas@xes-inc.com
NfsTimeout() does not correctly update the NFS timeout value which results in NfsTimeout() only being called once in certain situations. This can result in the 'nfs' command hanging indefinetly. For example, the command:
nfs 192.168.0.1:/home/user/file
will not exit until ctrl-c is pressed if 192.168.0.1 does not have an NFS server running.
This issue is resolved by reinitializting the NFS timeout value inside NfsTimeout() when a timeout occurs.
Make the 'nfs' command print the 'T' character when a timeout occurs. Previously there was no indication that timeouts were occuring.
Mimic the 'tftpboot' command and when a download fails print "Retry count exceeded; starting again", and restart the download taking the 'netretry' environment variable into account.
Signed-off-by: Evan Samanas esamanas@xes-inc.com Signed-off-by: Peter Tyser ptyser@xes-inc.com
Tested on TQM8xxL.
Tested by: Wolfgang Denk wd@denx.de
Best regards,
Wolfgang Denk

From: Peter Tyser
Sent: Monday, November 09, 2009 8:09 PM Subject: [U-Boot] [PATCH] nfs: NfsTimeout() updates
Tested on MPC8527DS.
Tested by: Ed Swarthout Ed.Swarthout@freescale.com

Dear Peter Tyser,
In message 1257818916-30673-1-git-send-email-ptyser@xes-inc.com you wrote:
From: Evan Samanas esamanas@xes-inc.com
NfsTimeout() does not correctly update the NFS timeout value which results in NfsTimeout() only being called once in certain situations. This can result in the 'nfs' command hanging indefinetly. For example, the command:
nfs 192.168.0.1:/home/user/file
will not exit until ctrl-c is pressed if 192.168.0.1 does not have an NFS server running.
This issue is resolved by reinitializting the NFS timeout value inside NfsTimeout() when a timeout occurs.
Make the 'nfs' command print the 'T' character when a timeout occurs. Previously there was no indication that timeouts were occuring.
Mimic the 'tftpboot' command and when a download fails print "Retry count exceeded; starting again", and restart the download taking the 'netretry' environment variable into account.
Signed-off-by: Evan Samanas esamanas@xes-inc.com Signed-off-by: Peter Tyser ptyser@xes-inc.com
net/nfs.c | 11 ++++++----- 1 files changed, 6 insertions(+), 5 deletions(-)
Applied, thanks.
Ben, I hope ... etc. :-)
Best regards,
Wolfgang Denk
participants (3)
-
Peter Tyser
-
Swarthout Edward L-SWARTHOU
-
Wolfgang Denk