diff options
author | Paul Gortmaker <paul.gortmaker@windriver.com> | 2008-07-10 20:30:48 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2008-07-10 21:04:43 -0400 |
commit | 61ca9daa2ca3022dc9cb22bd98e69c1b61e412ad (patch) | |
tree | 3f89080946e9ab1fa01f81b3189c32432154c475 | |
parent | ac310bb5db057963548e067037d68c9be41d0dd0 (diff) |
rtc: fix reported IRQ rate for when HPET is enabled
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>
-rw-r--r-- | drivers/char/rtc.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/char/rtc.c b/drivers/char/rtc.c index 5f80a9dff573..909cac93fa2a 100644 --- a/drivers/char/rtc.c +++ b/drivers/char/rtc.c | |||
@@ -678,12 +678,13 @@ static int rtc_do_ioctl(unsigned int cmd, unsigned long arg, int kernel) | |||
678 | if (arg != (1<<tmp)) | 678 | if (arg != (1<<tmp)) |
679 | return -EINVAL; | 679 | return -EINVAL; |
680 | 680 | ||
681 | rtc_freq = arg; | ||
682 | |||
681 | spin_lock_irqsave(&rtc_lock, flags); | 683 | spin_lock_irqsave(&rtc_lock, flags); |
682 | if (hpet_set_periodic_freq(arg)) { | 684 | if (hpet_set_periodic_freq(arg)) { |
683 | spin_unlock_irqrestore(&rtc_lock, flags); | 685 | spin_unlock_irqrestore(&rtc_lock, flags); |
684 | return 0; | 686 | return 0; |
685 | } | 687 | } |
686 | rtc_freq = arg; | ||
687 | 688 | ||
688 | val = CMOS_READ(RTC_FREQ_SELECT) & 0xf0; | 689 | val = CMOS_READ(RTC_FREQ_SELECT) & 0xf0; |
689 | val |= (16 - tmp); | 690 | val |= (16 - tmp); |