Re: possible overflow in __udelay

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



>>>>> On Thu, 01 Jul 2004 21:14:56 +0900 (JST), Atsushi Nemoto <anemo@xxxxxxxxxxxxx> said:

anemo> Current __udelay implementation will cause internal overflow on
anemo> the first multiplication.

anemo> Basically, the multiplication is:

anemo> X = usecs * 2**64 / (100000 / HZ)

anemo> And maximum input usecs value is 5000 (MAX_UDELAY_MS * 1000).

anemo> If usecs == 5000 and HZ == 1000, X is 5 * 2**64.  Of course
anemo> this can not be held in 64bit variable.

anemo> How should we avoid the overflow?

anemo> ....

Don't you really have any comments?

I believe, for example, mdelay(10) does not work properly on most MIPS
ports (except for DECSTATION and JAZZ which have smaller HZ value).

---
Atsushi Nemoto


[Index of Archives]     [Linux MIPS Home]     [LKML Archive]     [Linux ARM Kernel]     [Linux ARM]     [Linux]     [Git]     [Yosemite News]     [Linux SCSI]     [Linux Hams]

  Powered by Linux