diff options
Diffstat (limited to 'arch/x86/kernel')
-rw-r--r-- | arch/x86/kernel/e820.c | 4 | ||||
-rw-r--r-- | arch/x86/kernel/tsc.c | 14 |
2 files changed, 8 insertions, 10 deletions
diff --git a/arch/x86/kernel/e820.c b/arch/x86/kernel/e820.c index 174d938d576b..62d61e9976eb 100644 --- a/arch/x86/kernel/e820.c +++ b/arch/x86/kernel/e820.c | |||
@@ -703,7 +703,7 @@ void __init e820_mark_nosave_regions(unsigned long limit_pfn) | |||
703 | } | 703 | } |
704 | #endif | 704 | #endif |
705 | 705 | ||
706 | #ifdef CONFIG_HIBERNATION | 706 | #ifdef CONFIG_ACPI |
707 | /** | 707 | /** |
708 | * Mark ACPI NVS memory region, so that we can save/restore it during | 708 | * Mark ACPI NVS memory region, so that we can save/restore it during |
709 | * hibernation and the subsequent resume. | 709 | * hibernation and the subsequent resume. |
@@ -716,7 +716,7 @@ static int __init e820_mark_nvs_memory(void) | |||
716 | struct e820entry *ei = &e820.map[i]; | 716 | struct e820entry *ei = &e820.map[i]; |
717 | 717 | ||
718 | if (ei->type == E820_NVS) | 718 | if (ei->type == E820_NVS) |
719 | suspend_nvs_register(ei->addr, ei->size); | 719 | acpi_nvs_register(ei->addr, ei->size); |
720 | } | 720 | } |
721 | 721 | ||
722 | return 0; | 722 | return 0; |
diff --git a/arch/x86/kernel/tsc.c b/arch/x86/kernel/tsc.c index c0dd5b603749..a62c201c97ec 100644 --- a/arch/x86/kernel/tsc.c +++ b/arch/x86/kernel/tsc.c | |||
@@ -290,14 +290,15 @@ static inline int pit_verify_msb(unsigned char val) | |||
290 | static inline int pit_expect_msb(unsigned char val, u64 *tscp, unsigned long *deltap) | 290 | static inline int pit_expect_msb(unsigned char val, u64 *tscp, unsigned long *deltap) |
291 | { | 291 | { |
292 | int count; | 292 | int count; |
293 | u64 tsc = 0; | 293 | u64 tsc = 0, prev_tsc = 0; |
294 | 294 | ||
295 | for (count = 0; count < 50000; count++) { | 295 | for (count = 0; count < 50000; count++) { |
296 | if (!pit_verify_msb(val)) | 296 | if (!pit_verify_msb(val)) |
297 | break; | 297 | break; |
298 | prev_tsc = tsc; | ||
298 | tsc = get_cycles(); | 299 | tsc = get_cycles(); |
299 | } | 300 | } |
300 | *deltap = get_cycles() - tsc; | 301 | *deltap = get_cycles() - prev_tsc; |
301 | *tscp = tsc; | 302 | *tscp = tsc; |
302 | 303 | ||
303 | /* | 304 | /* |
@@ -311,9 +312,9 @@ static inline int pit_expect_msb(unsigned char val, u64 *tscp, unsigned long *de | |||
311 | * How many MSB values do we want to see? We aim for | 312 | * How many MSB values do we want to see? We aim for |
312 | * a maximum error rate of 500ppm (in practice the | 313 | * a maximum error rate of 500ppm (in practice the |
313 | * real error is much smaller), but refuse to spend | 314 | * real error is much smaller), but refuse to spend |
314 | * more than 25ms on it. | 315 | * more than 50ms on it. |
315 | */ | 316 | */ |
316 | #define MAX_QUICK_PIT_MS 25 | 317 | #define MAX_QUICK_PIT_MS 50 |
317 | #define MAX_QUICK_PIT_ITERATIONS (MAX_QUICK_PIT_MS * PIT_TICK_RATE / 1000 / 256) | 318 | #define MAX_QUICK_PIT_ITERATIONS (MAX_QUICK_PIT_MS * PIT_TICK_RATE / 1000 / 256) |
318 | 319 | ||
319 | static unsigned long quick_pit_calibrate(void) | 320 | static unsigned long quick_pit_calibrate(void) |
@@ -383,15 +384,12 @@ success: | |||
383 | * | 384 | * |
384 | * As a result, we can depend on there not being | 385 | * As a result, we can depend on there not being |
385 | * any odd delays anywhere, and the TSC reads are | 386 | * any odd delays anywhere, and the TSC reads are |
386 | * reliable (within the error). We also adjust the | 387 | * reliable (within the error). |
387 | * delta to the middle of the error bars, just | ||
388 | * because it looks nicer. | ||
389 | * | 388 | * |
390 | * kHz = ticks / time-in-seconds / 1000; | 389 | * kHz = ticks / time-in-seconds / 1000; |
391 | * kHz = (t2 - t1) / (I * 256 / PIT_TICK_RATE) / 1000 | 390 | * kHz = (t2 - t1) / (I * 256 / PIT_TICK_RATE) / 1000 |
392 | * kHz = ((t2 - t1) * PIT_TICK_RATE) / (I * 256 * 1000) | 391 | * kHz = ((t2 - t1) * PIT_TICK_RATE) / (I * 256 * 1000) |
393 | */ | 392 | */ |
394 | delta += (long)(d2 - d1)/2; | ||
395 | delta *= PIT_TICK_RATE; | 393 | delta *= PIT_TICK_RATE; |
396 | do_div(delta, i*256*1000); | 394 | do_div(delta, i*256*1000); |
397 | printk("Fast TSC calibration using PIT\n"); | 395 | printk("Fast TSC calibration using PIT\n"); |