[patch -mm 14/28] i386: PIT stop only, when in periodic or oneshot mode

Thomas Gleixner
2007-06-23T13:26:43Z

[-- Attachment #1: i386-add-another-pit-quirk.patch --]
[-- Type: text/plain, Size: 1004 bytes --]

The patch is necessary on one of my boxen, where programming the stop
sequence twice leads to PIT malfunction.

Sigh !

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
---
arch/i386/kernel/i8253.c | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)

Index: linux-2.6.22-rc4-mm/arch/i386/kernel/i8253.c
===================================================================
--- linux-2.6.22-rc4-mm.orig/arch/i386/kernel/i8253.c 2007-06-23 14:38:58.000000000 +0200
+++ linux-2.6.22-rc4-mm/arch/i386/kernel/i8253.c 2007-06-23 14:38:59.000000000 +0200
@@ -48,9 +48,12 @@ static void init_pit_timer(enum clock_ev

case CLOCK_EVT_MODE_SHUTDOWN:
case CLOCK_EVT_MODE_UNUSED:
- outb_p(0x30, PIT_MODE);
- outb_p(0, PIT_CH0); /* LSB */
- outb_p(0, PIT_CH0); /* MSB */
+ if (evt->mode == CLOCK_EVT_MODE_PERIODIC ||
+ evt->mode == CLOCK_EVT_MODE_ONESHOT) {
+ outb_p(0x30, PIT_MODE);
+ outb_p(0, PIT_CH0);
+ outb_p(0, PIT_CH0);
+ }
break;

case CLOCK_EVT_MODE_ONESHOT:

--