hpet: fix the possibility of insane return value of hpet_calibrate() against SMI
authorYasunori Goto <y-goto@jp.fujitsu.com>
Thu, 2 Apr 2009 23:58:31 +0000 (16:58 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Fri, 3 Apr 2009 02:05:01 +0000 (19:05 -0700)
commit303d379c54fc9ed553562e36c1cbd1791a3f5d17
treefa16886ba42f97af18eed3f2b791f54ce7ee2b09
parent1f80769ffd36e74357fe896dc43dddf1af1510f3
hpet: fix the possibility of insane return value of hpet_calibrate() against SMI

hpet_calibrate() has a possibility of miss-calibration due to SMI.  If SMI
interrupts in the while loop of calibration, then return value will be
big.  This change calibrates until stabilizing by the return value with a
small value.

[akpm@linux-foundation.org: trivial style tweaks]
Signed-off-by: Yasunori Goto <y-goto@jp.fujitsu.com>
Acked-by: Clemens Ladisch <clemens@ladisch.de>
Acked-by: Vojtech Pavlik <vojtech@suse.cz>
Cc: Robert Picco <Robert.Picco@hp.com>
Cc: Venkatesh Pallipadi <venkatesh.pallipadi@intel.com>
Cc: Ingo Molnar <mingo@elte.hu>
Acked-by: Paul Gortmaker <paul.gortmaker@windriver.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
drivers/char/hpet.c