Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 173127
b: refs/heads/master
c: 18ed61d
h: refs/heads/master
i:
  173125: d9380cd
  173123: fc0d468
  173119: ec6fb4d
v: v3
  • Loading branch information
Thomas Gleixner committed Nov 27, 2009
1 parent 22d532d commit a4b65d3
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 5 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: c8bc6f3c806f1fcbfdbf0b1ff6c52dba59192d3b
refs/heads/master: 18ed61da985c57eea3fe8038b13fa2837c9b3c3f
19 changes: 15 additions & 4 deletions trunk/arch/x86/kernel/hpet.c
Original file line number Diff line number Diff line change
Expand Up @@ -384,11 +384,22 @@ static int hpet_next_event(unsigned long delta,
hpet_writel(cnt, HPET_Tn_CMP(timer));

/*
* We need to read back the CMP register to make sure that
* what we wrote hit the chip before we compare it to the
* counter.
* We need to read back the CMP register on certain HPET
* implementations (ATI chipsets) which seem to delay the
* transfer of the compare register into the internal compare
* logic. With small deltas this might actually be too late as
* the counter could already be higher than the compare value
* at that point and we would wait for the next hpet interrupt
* forever. We found out that reading the CMP register back
* forces the transfer so we can rely on the comparison with
* the counter register below. If the read back from the
* compare register does not match the value we programmed
* then we might have a real hardware problem. We can not do
* much about it here, but at least alert the user/admin with
* a prominent warning.
*/
WARN_ON_ONCE(hpet_readl(HPET_Tn_CMP(timer)) != cnt);
WARN_ONCE(hpet_readl(HPET_Tn_CMP(timer)) != cnt,
KERN_WARNING "hpet: compare register read back failed.\n");

return (s32)(hpet_readl(HPET_COUNTER) - cnt) >= 0 ? -ETIME : 0;
}
Expand Down

0 comments on commit a4b65d3

Please sign in to comment.