summaryrefslogtreecommitdiffstats
path: root/include/linux/time.h
diff options
context:
space:
mode:
authorChris Wilson2010-08-09 23:20:10 +0200
committerLinus Torvalds2010-08-12 18:53:39 +0200
commit4936a3b90d79dd8775c6ac23c2cf2dcebe29abde (patch)
treeab4fb288fd00bb50b5aebcc93fa476cc2c1d53be /include/linux/time.h
parenttimekeeping: Fix overflow in rawtime tv_nsec on 32 bit archs (diff)
downloadkernel-qcow2-linux-4936a3b90d79dd8775c6ac23c2cf2dcebe29abde.tar.gz
kernel-qcow2-linux-4936a3b90d79dd8775c6ac23c2cf2dcebe29abde.tar.xz
kernel-qcow2-linux-4936a3b90d79dd8775c6ac23c2cf2dcebe29abde.zip
x86/hpet: Use the FSEC_PER_SEC constant for femto-second periods
The current computation, introduced with f12a15be63, 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>
Diffstat (limited to 'include/linux/time.h')
-rw-r--r--include/linux/time.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/include/linux/time.h b/include/linux/time.h
index cb34e35fabac..12612701b1ae 100644
--- a/include/linux/time.h
+++ b/include/linux/time.h
@@ -38,7 +38,7 @@ extern struct timezone sys_tz;
#define NSEC_PER_MSEC 1000000L
#define USEC_PER_SEC 1000000L
#define NSEC_PER_SEC 1000000000L
-#define FSEC_PER_SEC 1000000000000000L
+#define FSEC_PER_SEC 1000000000000000LL
#define TIME_T_MAX (time_t)((1UL << ((sizeof(time_t) << 3) - 1)) - 1)