public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot] [PATCH] net: bugfix: NetSetTimeout assumes CONFIG_SYS_HZ=1000
@ 2012-06-25 12:37 Tetsuyuki Kobayashi
  2012-07-08 19:58 ` Wolfgang Denk
  2012-09-28 15:50 ` Joe Hershberger
  0 siblings, 2 replies; 5+ messages in thread
From: Tetsuyuki Kobayashi @ 2012-06-25 12:37 UTC (permalink / raw)
  To: u-boot

NetSetTimeout sets incorrect value to timeDelta when CONFIG_SYS_HZ != 1000.

Signed-off-by: Tetsuyuki Kobayashi <koba@kmckk.co.jp>
---
 net/net.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/net.c b/net/net.c
index 9de7d92..ac9c2c8 100644
--- a/net/net.c
+++ b/net/net.c
@@ -653,7 +653,7 @@ NetSetTimeout(ulong iv, thand_f *f)
 			"--- NetLoop timeout handler set (%p)\n", f);
 		timeHandler = f;
 		timeStart = get_timer(0);
-		timeDelta = iv;
+		timeDelta = iv * CONFIG_SYS_HZ / 1000;
 	}
 }
 
-- 
1.7.9.5

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

* [U-Boot] [PATCH] net: bugfix: NetSetTimeout assumes CONFIG_SYS_HZ=1000
  2012-06-25 12:37 [U-Boot] [PATCH] net: bugfix: NetSetTimeout assumes CONFIG_SYS_HZ=1000 Tetsuyuki Kobayashi
@ 2012-07-08 19:58 ` Wolfgang Denk
  2012-07-09  2:42   ` Tetsuyuki Kobayashi
  2012-07-10 18:24   ` Joe Hershberger
  2012-09-28 15:50 ` Joe Hershberger
  1 sibling, 2 replies; 5+ messages in thread
From: Wolfgang Denk @ 2012-07-08 19:58 UTC (permalink / raw)
  To: u-boot

Dear Tetsuyuki Kobayashi,

In message <4FE85B87.6090302@kmckk.co.jp> you wrote:
> NetSetTimeout sets incorrect value to timeDelta when CONFIG_SYS_HZ != 1000.

Your patch is OK per se, but please note that it is a mandatory
requirement that CONFIG_SYS_HZ == 1000.  So if you have any board
where this is not the case, this board needs to be fixed, too.

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
The management question ... is not _whether_ to build a pilot  system
and  throw  it away. You _will_ do that. The only question is whether
to plan in advance to build a throwaway, or to promise to deliver the
throwaway to customers.       - Fred Brooks, "The Mythical Man Month"

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

* [U-Boot] [PATCH] net: bugfix: NetSetTimeout assumes CONFIG_SYS_HZ=1000
  2012-07-08 19:58 ` Wolfgang Denk
@ 2012-07-09  2:42   ` Tetsuyuki Kobayashi
  2012-07-10 18:24   ` Joe Hershberger
  1 sibling, 0 replies; 5+ messages in thread
From: Tetsuyuki Kobayashi @ 2012-07-09  2:42 UTC (permalink / raw)
  To: u-boot

Dear Wolfgang Denk,

(07/09/2012 04:58 AM), Wolfgang Denk wrote:
> Dear Tetsuyuki Kobayashi,
> 
> In message <4FE85B87.6090302@kmckk.co.jp> you wrote:
>> NetSetTimeout sets incorrect value to timeDelta when CONFIG_SYS_HZ != 1000.
> 
> Your patch is OK per se, but please note that it is a mandatory
> requirement that CONFIG_SYS_HZ == 1000.  So if you have any board
> where this is not the case, this board needs to be fixed, too.

Thank you for reviewing my patch.

I didn't know that it is a mandatory requirement that CONFIG_SYS_HZ == 1000.
I grep'ed for CONFIG_SYS_HZ in README and under doc/, but I could not find any description about it.

  $ grep -r CONFIG_SYS_HZ README doc/*
  doc/README.LED:(CONFIG_SYS_HZ / <N>) where <N> is the frequency of the blink. Typical values

And I couldn't find that what value should be return in ulong get_timer(ulong base);
I hope "how to implement system timer" documented.

Best regards,

Tetsuyuki Kobayashi

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

* [U-Boot] [PATCH] net: bugfix: NetSetTimeout assumes CONFIG_SYS_HZ=1000
  2012-07-08 19:58 ` Wolfgang Denk
  2012-07-09  2:42   ` Tetsuyuki Kobayashi
@ 2012-07-10 18:24   ` Joe Hershberger
  1 sibling, 0 replies; 5+ messages in thread
From: Joe Hershberger @ 2012-07-10 18:24 UTC (permalink / raw)
  To: u-boot

Hi Wolfgang,

On Sun, Jul 8, 2012 at 2:58 PM, Wolfgang Denk <wd@denx.de> wrote:
> Dear Tetsuyuki Kobayashi,
>
> In message <4FE85B87.6090302@kmckk.co.jp> you wrote:
>> NetSetTimeout sets incorrect value to timeDelta when CONFIG_SYS_HZ != 1000.
>
> Your patch is OK per se, but please note that it is a mandatory
> requirement that CONFIG_SYS_HZ == 1000.  So if you have any board
> where this is not the case, this board needs to be fixed, too.

If that is a hard requirement, then I don't see a point to applying
this patch.  I also don't know why the CONFIG_SYS_HZ variable exists.

Thanks,
-Joe

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

* [U-Boot] [PATCH] net: bugfix: NetSetTimeout assumes CONFIG_SYS_HZ=1000
  2012-06-25 12:37 [U-Boot] [PATCH] net: bugfix: NetSetTimeout assumes CONFIG_SYS_HZ=1000 Tetsuyuki Kobayashi
  2012-07-08 19:58 ` Wolfgang Denk
@ 2012-09-28 15:50 ` Joe Hershberger
  1 sibling, 0 replies; 5+ messages in thread
From: Joe Hershberger @ 2012-09-28 15:50 UTC (permalink / raw)
  To: u-boot

Hi Tetsuyuki,

On Mon, Jun 25, 2012 at 7:37 AM, Tetsuyuki Kobayashi <koba@kmckk.co.jp> wrote:
> NetSetTimeout sets incorrect value to timeDelta when CONFIG_SYS_HZ != 1000.
>
> Signed-off-by: Tetsuyuki Kobayashi <koba@kmckk.co.jp>
> ---

I decided this doesn't hurt and it sort-of documents what "must be" (tm).

Applied, thanks.

-Joe

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

end of thread, other threads:[~2012-09-28 15:50 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-06-25 12:37 [U-Boot] [PATCH] net: bugfix: NetSetTimeout assumes CONFIG_SYS_HZ=1000 Tetsuyuki Kobayashi
2012-07-08 19:58 ` Wolfgang Denk
2012-07-09  2:42   ` Tetsuyuki Kobayashi
2012-07-10 18:24   ` Joe Hershberger
2012-09-28 15:50 ` Joe Hershberger

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox