Sophie

Sophie

distrib > CentOS > 5 > x86_64 > by-pkgid > 7fcbc17135a4a201b45eb212120086b3 > files > 16

kernel-2.6.18-274.7.1.el5.centos.plus.src.rpm

rtc: fix reported IRQ rate for when HPET is enabled
https://github.com/torvalds/linux/commit/61ca9daa2ca3022dc9cb22bd98e69c1b61e412ad#drivers/char/rtc.c

The IRQ rate reported back by the RTC is incorrect when HPET is enabled.

Newer hardware that has HPET to emulate the legacy RTC device gets this value
wrong since after it sets the rate, it returns before setting the variable
used to report the IRQ rate back to users of the device -- so the set rate and
the reported rate get out of sync.

Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: David Brownell <david-b@pacbell.net>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: <stable@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

Applied by: Akemi Yagi <toracat@centos.org> - centos bug #5064

--- a/drivers/char/rtc.c	2011-09-06 20:27:26.000000000 -0700
+++ b/drivers/char/rtc.c	2011-10-20 12:49:58.000000000 -0700
@@ -656,12 +656,13 @@
 		if (arg != (1<<tmp))
 			return -EINVAL;
 
+		rtc_freq = arg;
+
 		spin_lock_irqsave(&rtc_lock, flags);
 		if (hpet_set_periodic_freq(arg)) {
 			spin_unlock_irqrestore(&rtc_lock, flags);
 			return 0;
 		}
-		rtc_freq = arg;
 
 		val = CMOS_READ(RTC_FREQ_SELECT) & 0xf0;
 		val |= (16 - tmp);