Skip to content

Commit

Permalink
acpi_pm: Clear pmtmr_ioport if acpi_pm initialization fails
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Konrad Rzeszutek Wilk authored and Thomas Gleixner committed Jan 21, 2011
1 parent 1daeddd commit db6b175
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion drivers/clocksource/acpi_pm.c
Original file line number Diff line number Diff line change
Expand Up @@ -202,17 +202,21 @@ static int __init init_acpi_pm_clocksource(void)
printk(KERN_INFO "PM-Timer had inconsistent results:"
" 0x%#llx, 0x%#llx - aborting.\n",
value1, value2);
pmtmr_ioport = 0;
return -EINVAL;
}
if (i == ACPI_PM_READ_CHECKS) {
printk(KERN_INFO "PM-Timer failed consistency check "
" (0x%#llx) - aborting.\n", value1);
pmtmr_ioport = 0;
return -ENODEV;
}
}

if (verify_pmtmr_rate() != 0)
if (verify_pmtmr_rate() != 0){
pmtmr_ioport = 0;
return -ENODEV;
}

return clocksource_register_hz(&clocksource_acpi_pm,
PMTMR_TICKS_PER_SEC);
Expand Down

0 comments on commit db6b175

Please sign in to comment.