summaryrefslogtreecommitdiffstats
path: root/arch/x86/lib/delay.c
diff options
context:
space:
mode:
authorIngo Molnar <mingo@kernel.org>2015-08-03 11:04:00 +0200
committerIngo Molnar <mingo@kernel.org>2015-08-03 11:04:00 +0200
commitf320ead76a87a9c533f681ecce3bf3241d07c47d (patch)
tree76ae437119088b180737670cb99a307e163a1ca0 /arch/x86/lib/delay.c
parent76695af20c015206cffb84b15912be6797d0cca2 (diff)
parentdecd275e62d5eef4b947fab89652fa6afdadf2f2 (diff)
downloadlinux-f320ead76a87a9c533f681ecce3bf3241d07c47d.tar.bz2
Merge branch 'x86/asm' into locking/core
Upcoming changes to static keys is interacting/conflicting with the following pending TSC commits in tip:x86/asm: 4ea1636b04db x86/asm/tsc: Rename native_read_tsc() to rdtsc() ... So merge it into the locking tree to have a smoother resolution. Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'arch/x86/lib/delay.c')
-rw-r--r--arch/x86/lib/delay.c13
1 files changed, 5 insertions, 8 deletions
diff --git a/arch/x86/lib/delay.c b/arch/x86/lib/delay.c
index 39d6a3db0b96..4453d52a143d 100644
--- a/arch/x86/lib/delay.c
+++ b/arch/x86/lib/delay.c
@@ -49,16 +49,14 @@ static void delay_loop(unsigned long loops)
/* TSC based delay: */
static void delay_tsc(unsigned long __loops)
{
- u32 bclock, now, loops = __loops;
+ u64 bclock, now, loops = __loops;
int cpu;
preempt_disable();
cpu = smp_processor_id();
- rdtsc_barrier();
- rdtscl(bclock);
+ bclock = rdtsc_ordered();
for (;;) {
- rdtsc_barrier();
- rdtscl(now);
+ now = rdtsc_ordered();
if ((now - bclock) >= loops)
break;
@@ -79,8 +77,7 @@ static void delay_tsc(unsigned long __loops)
if (unlikely(cpu != smp_processor_id())) {
loops -= (now - bclock);
cpu = smp_processor_id();
- rdtsc_barrier();
- rdtscl(bclock);
+ bclock = rdtsc_ordered();
}
}
preempt_enable();
@@ -100,7 +97,7 @@ void use_tsc_delay(void)
int read_current_timer(unsigned long *timer_val)
{
if (delay_fn == delay_tsc) {
- rdtscll(*timer_val);
+ *timer_val = rdtsc();
return 0;
}
return -1;