1
0
mirror of https://xff.cz/git/u-boot/ synced 2025-09-01 00:32:04 +02:00
Files
u-boot-megous/lib
Stephen Warren 2cd1b57220 time: fix usec_to_tick()
Commit 8dfafdde88 ("Introduce common timer functions") created a
common definition of usec_to_tick() which had a couple problems:

static unsigned long long usec_to_tick(unsigned long usec)
{
       uint64_t tick = usec * get_tbclk();

That likely overflows.

       usec *= get_tbclk();

That was an attempt to fix it by performing the multiply after the
promotion of usec to 64-bit, but was applied to the wrong variable,
which was never used.

This patch fixes these issues. A user-visible symptom of the problem was
the e.g. "dhcp zImage" using an ASIX USB Ethernet dongle would print:

Waiting for Ethernet connection... unable to connect.

... with no delay before "unable to connect". There are likely other
symptoms.

Signed-off-by: Stephen Warren <swarren@nvidia.com>
Acked-by: Rob Herring <rob.herring@calxeda.com>
2013-12-13 09:15:33 -05:00
..
2010-04-13 09:13:04 +02:00
2010-04-13 09:13:04 +02:00
2010-04-13 09:13:04 +02:00
2010-04-13 09:13:04 +02:00
2010-04-13 09:13:04 +02:00
2010-04-13 09:13:04 +02:00
2011-01-18 23:38:08 +01:00
2010-04-21 23:42:38 +02:00
2010-09-19 19:29:47 +02:00
2013-11-08 15:25:14 -05:00
2012-04-29 14:14:08 +02:00
2013-12-13 09:15:33 -05:00