]> git.baikalelectronics.ru Git - kernel.git/commit
x86: HPET fix moronic 32/64bit thinko
authorThomas Gleixner <tglx@linutronix.de>
Sat, 6 Sep 2008 01:03:32 +0000 (03:03 +0200)
committerThomas Gleixner <tglx@linutronix.de>
Sat, 6 Sep 2008 05:21:17 +0000 (07:21 +0200)
commitab42d4b756bf3051fb651162d1e16510c94b300f
tree23074b023b683fa9940ff6543192eff2b6019350
parentc191209769c3ab5378110fe32824600ab3d9e891
x86: HPET fix moronic 32/64bit thinko

We use the HPET only in 32bit mode because:
1) some HPETs are 32bit only
2) on i386 there is no way to read/write the HPET atomic 64bit wide

The HPET code unification done by the "moron of the year" did
not take into account that unsigned long is different on 32 and
64 bit.

This thinko results in a possible endless loop in the clockevents
code, when the return comparison fails due to the 64bit/332bit
unawareness.

unsigned long cnt = (u32) hpet_read() + delta can wrap over 32bit.
but the final compare will fail and return -ETIME causing endless
loops.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
arch/x86/kernel/hpet.c