From: Olivier Fourdan Fix the PM Timer by using the proper acpi_pmtmr_ioport variable. Cc: Andi Kleen Cc: "Brown, Len" Cc: john stultz Signed-off-by: Andrew Morton --- arch/x86_64/kernel/apic.c | 2 +- arch/x86_64/kernel/pmtimer.c | 19 +++++++------------ arch/x86_64/kernel/time.c | 6 +++--- include/asm-x86_64/proto.h | 2 +- 4 files changed, 12 insertions(+), 17 deletions(-) diff -puN arch/x86_64/kernel/apic.c~time-i386-conversion-part-5-acpi-pm-variable-renaming-and-config-change-x86_64-fix arch/x86_64/kernel/apic.c --- devel/arch/x86_64/kernel/apic.c~time-i386-conversion-part-5-acpi-pm-variable-renaming-and-config-change-x86_64-fix 2006-02-13 12:20:09.000000000 -0800 +++ devel-akpm/arch/x86_64/kernel/apic.c 2006-02-13 12:20:09.000000000 -0800 @@ -768,7 +768,7 @@ static int __init calibrate_APIC_clock(v apic_start = apic_read(APIC_TMCCT); #ifdef CONFIG_X86_PM_TIMER - if (apic_calibrate_pmtmr && pmtmr_ioport) { + if (apic_calibrate_pmtmr && acpi_pmtmr_ioport) { pmtimer_wait(5000); /* 5ms wait */ apic = apic_read(APIC_TMCCT); result = (apic_start - apic) * 1000L / 5; diff -puN arch/x86_64/kernel/pmtimer.c~time-i386-conversion-part-5-acpi-pm-variable-renaming-and-config-change-x86_64-fix arch/x86_64/kernel/pmtimer.c --- devel/arch/x86_64/kernel/pmtimer.c~time-i386-conversion-part-5-acpi-pm-variable-renaming-and-config-change-x86_64-fix 2006-02-13 12:20:09.000000000 -0800 +++ devel-akpm/arch/x86_64/kernel/pmtimer.c 2006-02-13 12:20:09.000000000 -0800 @@ -24,11 +24,6 @@ #include #include -/* The I/O port the PMTMR resides at. - * The location is detected during setup_arch(), - * in arch/i386/kernel/acpi/boot.c */ -u32 pmtmr_ioport; - /* value of the Power timer at last timer interrupt */ static u32 offset_delay; static u32 last_pmtmr_tick; @@ -54,7 +49,7 @@ int pmtimer_mark_offset(void) unsigned long tsc; u32 lost; - u32 tick = inl(pmtmr_ioport); + u32 tick = inl(acpi_pmtmr_ioport); u32 delta; delta = cyc2us((tick - last_pmtmr_tick) & ACPI_PM_MASK); @@ -83,9 +78,9 @@ int pmtimer_mark_offset(void) static unsigned pmtimer_wait_tick(void) { u32 a, b; - for (a = b = inl(pmtmr_ioport) & ACPI_PM_MASK; + for (a = b = inl(acpi_pmtmr_ioport) & ACPI_PM_MASK; a == b; - b = inl(pmtmr_ioport) & ACPI_PM_MASK) + b = inl(acpi_pmtmr_ioport) & ACPI_PM_MASK) cpu_relax(); return b; } @@ -96,14 +91,14 @@ void pmtimer_wait(unsigned us) u32 a, b; a = pmtimer_wait_tick(); do { - b = inl(pmtmr_ioport); + b = inl(acpi_pmtmr_ioport); cpu_relax(); } while (cyc2us(b - a) < us); } void pmtimer_resume(void) { - last_pmtmr_tick = inl(pmtmr_ioport); + last_pmtmr_tick = inl(acpi_pmtmr_ioport); } unsigned int do_gettimeoffset_pm(void) @@ -111,7 +106,7 @@ unsigned int do_gettimeoffset_pm(void) u32 now, offset, delta = 0; offset = last_pmtmr_tick; - now = inl(pmtmr_ioport); + now = inl(acpi_pmtmr_ioport); delta = (now - offset) & ACPI_PM_MASK; return offset_delay + cyc2us(delta); @@ -120,7 +115,7 @@ unsigned int do_gettimeoffset_pm(void) static int __init nopmtimer_setup(char *s) { - pmtmr_ioport = 0; + acpi_pmtmr_ioport = 0; return 0; } diff -puN arch/x86_64/kernel/time.c~time-i386-conversion-part-5-acpi-pm-variable-renaming-and-config-change-x86_64-fix arch/x86_64/kernel/time.c --- devel/arch/x86_64/kernel/time.c~time-i386-conversion-part-5-acpi-pm-variable-renaming-and-config-change-x86_64-fix 2006-02-13 12:20:09.000000000 -0800 +++ devel-akpm/arch/x86_64/kernel/time.c 2006-02-13 12:20:09.000000000 -0800 @@ -373,7 +373,7 @@ void main_timer_handler(struct pt_regs * */ offset = hpet_readl(HPET_T0_CMP) - hpet_tick; delay = hpet_readl(HPET_COUNTER) - offset; - } else if (!pmtmr_ioport) { + } else if (!acpi_pmtmr_ioport) { spin_lock(&i8253_lock); outb_p(0x00, 0x43); delay = inb_p(0x40); @@ -933,7 +933,7 @@ void __init time_init(void) cpu_khz = hpet_calibrate_tsc(); timename = "HPET"; #ifdef CONFIG_X86_PM_TIMER - } else if (pmtmr_ioport && !vxtime.hpet_address) { + } else if (acpi_pmtmr_ioport && !vxtime.hpet_address) { vxtime_hz = PM_TIMER_FREQUENCY; timename = "PM"; pit_init(); @@ -1000,7 +1000,7 @@ void __init time_init_gtod(void) #ifdef CONFIG_X86_PM_TIMER /* Using PM for gettimeofday is quite slow, but we have no other choice because the TSC is too unreliable on some systems. */ - } else if (pmtmr_ioport && !vxtime.hpet_address && notsc) { + } else if (acpi_pmtmr_ioport && !vxtime.hpet_address && notsc) { timetype = "PM"; do_gettimeoffset = do_gettimeoffset_pm; vxtime.mode = VXTIME_PMTMR; diff -puN include/asm-x86_64/proto.h~time-i386-conversion-part-5-acpi-pm-variable-renaming-and-config-change-x86_64-fix include/asm-x86_64/proto.h --- devel/include/asm-x86_64/proto.h~time-i386-conversion-part-5-acpi-pm-variable-renaming-and-config-change-x86_64-fix 2006-02-13 12:20:09.000000000 -0800 +++ devel-akpm/include/asm-x86_64/proto.h 2006-02-13 12:20:09.000000000 -0800 @@ -45,7 +45,7 @@ extern void pmtimer_resume(void); extern void pmtimer_wait(unsigned); extern unsigned int do_gettimeoffset_pm(void); #ifdef CONFIG_X86_PM_TIMER -extern u32 pmtmr_ioport; +extern u32 acpi_pmtmr_ioport; #else #define pmtmr_ioport 0 #endif _