[patch 19/28] x86: HPET: read back compare register before reading counter

!MAILaRCHIVE_VOTE_RePLACE
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: <linux-kernel@...>, <stable@...>
Cc: Justin Forbes <jmforbes@...>, Zwane Mwaikambo <zwane@...>, Theodore Ts'o <tytso@...>, Randy Dunlap <rdunlap@...>, Dave Jones <davej@...>, Chuck Wolber <chuckw@...>, Chris Wedgwood <reviews@...>, Michael Krufky <mkrufky@...>, Chuck Ebbert <cebbert@...>, Domenico Andreoli <cavokz@...>, Willy Tarreau <w@...>, Rodrigo Rubira Branco <rbranco@...>, Jake Edge <jake@...>, Eugene Teo <eteo@...>, <torvalds@...>, <akpm@...>, <alan@...>, Thomas Gleixner <tglx@...>
Date: Monday, October 6, 2008 - 7:17 pm

2.6.25-stable review patch.  If anyone has any objections, please let us
know.

------------------
From: Thomas Gleixner <tglx@linutronix.de>

commit 72d43d9bc9210d24d09202eaf219eac09e17b339 upstream

After fixing the u32 thinko I sill had occasional hickups on ATI chipsets
with small deltas. There seems to be a delay between writing the compare
register and the transffer to the internal register which triggers the
interrupt. Reading back the value makes sure, that it hit the internal
match register befor we compare against the counter value.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

---
 arch/x86/kernel/hpet.c |    7 +++++++
 1 file changed, 7 insertions(+)

--- a/arch/x86/kernel/hpet.c
+++ b/arch/x86/kernel/hpet.c
@@ -290,6 +290,13 @@ static int hpet_legacy_next_event(unsign
 	cnt += (u32) delta;
 	hpet_writel(cnt, HPET_T0_CMP);
 
+	/*
+	 * 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.
+	 */
+	WARN_ON((u32)hpet_readl(HPET_T0_CMP) != cnt);
+
 	return (s32)((u32)hpet_readl(HPET_COUNTER) - cnt) >= 0 ? -ETIME : 0;
 }
 

-- 
--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[patch 00/28] 2.6.25-stable review, Greg KH, (Mon Oct 6, 7:16 pm)
[patch 28/28] udp: Fix rcv socket locking, Greg KH, (Mon Oct 6, 7:18 pm)
[patch 24/28] niu: panic on reset, Greg KH, (Mon Oct 6, 7:17 pm)
[patch 19/28] x86: HPET: read back compare register before r..., Greg KH, (Mon Oct 6, 7:17 pm)
[patch 09/28] rtc: fix deadlock, Greg KH, (Mon Oct 6, 7:17 pm)
[patch 07/28] ACPI: Fix thermal shutdowns, Greg KH, (Mon Oct 6, 7:17 pm)
[patch 03/28] pxa2xx_spi: chipselect bugfixes, Greg KH, (Mon Oct 6, 7:17 pm)
[patch 02/28] pxa2xx_spi: dma bugfixes, Greg KH, (Mon Oct 6, 7:17 pm)
Re: [patch 02/28] pxa2xx_spi: dma bugfixes, Ned Forrester, (Mon Oct 6, 8:15 pm)
[patch 01/28] USB: fix hcd interrupt disabling, Greg KH, (Mon Oct 6, 7:16 pm)