From: Thomas Gleixner Date: Sat, 21 Jul 2007 11:37:38 +0000 (-0700) Subject: i386: PIT stop only, when in periodic or oneshot mode X-Git-Tag: v2.6.23-rc1~172 X-Git-Url: http://pilppa.com/gitweb/?a=commitdiff_plain;h=7671988b9cd31daf53fd38f8e75c8b881324842b;p=linux-2.6-omap-h63xx.git i386: PIT stop only, when in periodic or oneshot mode 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 Cc: Andi Kleen Cc: Ingo Molnar Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/arch/i386/kernel/i8253.c b/arch/i386/kernel/i8253.c index 931eabe1e56..bde249dda94 100644 --- a/arch/i386/kernel/i8253.c +++ b/arch/i386/kernel/i8253.c @@ -47,9 +47,12 @@ static void init_pit_timer(enum clock_event_mode mode, 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: