diff options
author | Clemens Ladisch <clemens@ladisch.de> | 2005-10-30 15:03:31 -0800 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2005-10-30 17:37:29 -0800 |
commit | ba3f213f8a31af953b7e86b1d102c919e9935cd4 (patch) | |
tree | 1056de1ccb2af403005aa05d5c52399aa36dd6ba /Makefile | |
parent | 9090e6db87e3bdb2a2c187ebc0f9175a9f9e5c6f (diff) | |
download | linux-stable-ba3f213f8a31af953b7e86b1d102c919e9935cd4.tar.gz linux-stable-ba3f213f8a31af953b7e86b1d102c919e9935cd4.tar.bz2 linux-stable-ba3f213f8a31af953b7e86b1d102c919e9935cd4.zip |
[PATCH] HPET: make frequency calculations 32 bit safe
On 32-bit architectures, the multiplication in the argument for
hpet_time_div() often overflows. In the typical case of a 14.32 MHz timer,
this happens when the desired frequency exceeds 61 Hz.
To avoid this multiplication, we can precompute and store the hardware
timer frequency, instead of the period, in the device structure, which
leaves us with a simple division when computing the number of timer ticks.
As a side effect, this also removes a theoretical bug where the timer
interpolator's frequency would be computed as a 32-bit value even if the
HPET frequency is greater than 2^32 Hz (the HPET spec allows up to 10 GHz).
Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'Makefile')
0 files changed, 0 insertions, 0 deletions