]> git.baikalelectronics.ru Git - kernel.git/commit
x86/hpet: Use the FSEC_PER_SEC constant for femto-second periods
authorChris Wilson <chris@chris-wilson.co.uk>
Mon, 9 Aug 2010 21:20:10 +0000 (14:20 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Thu, 12 Aug 2010 16:53:39 +0000 (09:53 -0700)
commit97354fba98b9dc43c385fcb6e13c360d9f11f124
treeab4fb288fd00bb50b5aebcc93fa476cc2c1d53be
parentc0c798b7da28ffcdb9a1634577b2a140c1a64733
x86/hpet: Use the FSEC_PER_SEC constant for femto-second periods

The current computation, introduced with 3800fe87fa, of FSEC_PER_SEC using
the multiplication of (FSEC_PER_NSEC * NSEC_PER_SEC) is performed only
with 32bit integers on small machines, resulting in an overflow and a
*very* short intervals being programmed.  An interrupt storm follows.

Note that we also have to specify FSEC_PER_SEC as being long long to
overcome the same limitations.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: John Stultz <johnstul@us.ibm.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Acked-by: Ingo Molnar <mingo@elte.hu>
Acked-by: H. Peter Anvin <hpa@zytor.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
arch/x86/kernel/hpet.c
include/linux/time.h