projects
/
firefly-linux-kernel-4.4.55.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
x86, apic: Handle a bad TSC more gracefully
[firefly-linux-kernel-4.4.55.git]
/
arch
/
x86
/
kernel
/
apic
/
apic.c
diff --git
a/arch/x86/kernel/apic/apic.c
b/arch/x86/kernel/apic/apic.c
index 67760275544b4f548f98c5b18c098d481637995d..24b5894396a06c76b073435f52143f5ca420748f 100644
(file)
--- a/
arch/x86/kernel/apic/apic.c
+++ b/
arch/x86/kernel/apic/apic.c
@@
-1297,7
+1297,7
@@
void setup_local_APIC(void)
unsigned int value, queued;
int i, j, acked = 0;
unsigned long long tsc = 0, ntsc;
unsigned int value, queued;
int i, j, acked = 0;
unsigned long long tsc = 0, ntsc;
- long long max_loops = cpu_khz;
+ long long max_loops = cpu_khz
? cpu_khz : 1000000
;
if (cpu_has_tsc)
rdtscll(tsc);
if (cpu_has_tsc)
rdtscll(tsc);
@@
-1383,7
+1383,7
@@
void setup_local_APIC(void)
break;
}
if (queued) {
break;
}
if (queued) {
- if (cpu_has_tsc) {
+ if (cpu_has_tsc
&& cpu_khz
) {
rdtscll(ntsc);
max_loops = (cpu_khz << 10) - (ntsc - tsc);
} else
rdtscll(ntsc);
max_loops = (cpu_khz << 10) - (ntsc - tsc);
} else