Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

acpi_pm: Clear pmtmr_ioport if acpi_pm initialization fails

If the acpi pm timer throws invalid data, clear pmtmr_ioport
so the pm timer won't accidentally be used.

This was found when using Xen where there is a acpi pm reported,
but gives bogus values, and other code was continuing to try
to use the pm timer after the initialization failed.

[jstultz: Catch additional failure and reword changelog message. ]

Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Signed-off-by: John Stultz <johnstul@us.ibm.com>
LKML-Reference: <1295027246-11110-1-git-send-email-johnstul@us.ibm.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>

authored by

Konrad Rzeszutek Wilk and committed by
Thomas Gleixner
db6b175f 1daeddd5

+5 -1
+5 -1
drivers/clocksource/acpi_pm.c
··· 202 202 printk(KERN_INFO "PM-Timer had inconsistent results:" 203 203 " 0x%#llx, 0x%#llx - aborting.\n", 204 204 value1, value2); 205 + pmtmr_ioport = 0; 205 206 return -EINVAL; 206 207 } 207 208 if (i == ACPI_PM_READ_CHECKS) { 208 209 printk(KERN_INFO "PM-Timer failed consistency check " 209 210 " (0x%#llx) - aborting.\n", value1); 211 + pmtmr_ioport = 0; 210 212 return -ENODEV; 211 213 } 212 214 } 213 215 214 - if (verify_pmtmr_rate() != 0) 216 + if (verify_pmtmr_rate() != 0){ 217 + pmtmr_ioport = 0; 215 218 return -ENODEV; 219 + } 216 220 217 221 return clocksource_register_hz(&clocksource_acpi_pm, 218 222 PMTMR_TICKS_PER_SEC);