diff options
Diffstat (limited to 'arch/mn10300/kernel/time.c')
-rw-r--r-- | arch/mn10300/kernel/time.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/arch/mn10300/kernel/time.c b/arch/mn10300/kernel/time.c index 8f7f6d22783..0b5c856b426 100644 --- a/arch/mn10300/kernel/time.c +++ b/arch/mn10300/kernel/time.c @@ -54,6 +54,9 @@ unsigned long long sched_clock(void) unsigned long tsc, tmp; unsigned product[3]; /* 96-bit intermediate value */ + /* cnt32_to_63() is not safe with preemption */ + preempt_disable(); + /* read the TSC value */ tsc = 0 - get_cycles(); /* get_cycles() counts down */ @@ -64,6 +67,8 @@ unsigned long long sched_clock(void) */ tsc64.ll = cnt32_to_63(tsc) & 0x7fffffffffffffffULL; + preempt_enable(); + /* scale the 64-bit TSC value to a nanosecond value via a 96-bit * intermediate */ |