aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/kernel/hpet.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/x86/kernel/hpet.c')
-rw-r--r--arch/x86/kernel/hpet.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/arch/x86/kernel/hpet.c b/arch/x86/kernel/hpet.c
index ee4fa1bfcb33..3d422da92100 100644
--- a/arch/x86/kernel/hpet.c
+++ b/arch/x86/kernel/hpet.c
@@ -399,9 +399,15 @@ static int hpet_next_event(unsigned long delta,
399 * then we might have a real hardware problem. We can not do 399 * then we might have a real hardware problem. We can not do
400 * much about it here, but at least alert the user/admin with 400 * much about it here, but at least alert the user/admin with
401 * a prominent warning. 401 * a prominent warning.
402 * An erratum on some chipsets (ICH9,..), results in comparator read
403 * immediately following a write returning old value. Workaround
404 * for this is to read this value second time, when first
405 * read returns old value.
402 */ 406 */
403 WARN_ONCE(hpet_readl(HPET_Tn_CMP(timer)) != cnt, 407 if (unlikely((u32)hpet_readl(HPET_Tn_CMP(timer)) != cnt)) {
408 WARN_ONCE(hpet_readl(HPET_Tn_CMP(timer)) != cnt,
404 KERN_WARNING "hpet: compare register read back failed.\n"); 409 KERN_WARNING "hpet: compare register read back failed.\n");
410 }
405 411
406 return (s32)(hpet_readl(HPET_COUNTER) - cnt) >= 0 ? -ETIME : 0; 412 return (s32)(hpet_readl(HPET_COUNTER) - cnt) >= 0 ? -ETIME : 0;
407} 413}