[U-Boot] time: fix usec_to_tick()
Tom Rini
trini at ti.com
Mon Dec 16 15:16:10 CET 2013
On Thu, Dec 05, 2013 at 12:08:09PM -0700, Stephen Warren wrote:
> From: Stephen Warren <swarren at nvidia.com>
>
> Commit 8dfafdde88eb ("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 at nvidia.com>
> Acked-by: Rob Herring <rob.herring at calxeda.com>
Applied to u-boot/master, thanks!
--
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20131216/442298a2/attachment.pgp>
More information about the U-Boot
mailing list