Messages in this thread Patch in this message | | | Date | Tue, 8 May 2007 02:46:28 -0700 | From | Chris Wright <> | Subject | [PATCH 4/5] i386: i8253 clockevent shutdown and unused using pit |
| |
Disable by programming pit directly when performing CLOCK_EVT_MODE_UNUSED or CLOCK_EVT_MODE_SHUTDOWN transitions. (A variant) tested successfully by Joachim Deguara on a Geode that exhibited BZ 8027 behaviour (with bad bogomips).
Signed-off-by: Chris Wright <chrisw@sous-sol.org> Cc: Joachim Deguara <joachim.deguara@amd.com> --- arch/i386/kernel/i8253.c | 25 ++++--------------------- 1 file changed, 4 insertions(+), 21 deletions(-)
--- tglx.orig/arch/i386/kernel/i8253.c +++ tglx/arch/i386/kernel/i8253.c @@ -29,24 +29,6 @@ EXPORT_SYMBOL(i8253_lock); */ struct clock_event_device *global_clock_event; -/* Status of the PIT interrupt */ -static int pit_irq_disabled; - -/* - * Control pit interrupt enable / disable - */ -static void pit_control_irq(int disable) -{ - if (pit_irq_disabled == disable) - return; - - pit_irq_disabled = disable; - if (disable) - disable_irq(0); - else - enable_irq(0); -} - /* * Initialize the PIT timer. * @@ -65,17 +47,18 @@ static void init_pit_timer(enum clock_ev outb_p(0x34, PIT_MODE); outb_p(LATCH & 0xff , PIT_CH0); /* LSB */ outb(LATCH >> 8 , PIT_CH0); /* MSB */ - pit_control_irq(0); break; case CLOCK_EVT_MODE_SHUTDOWN: case CLOCK_EVT_MODE_UNUSED: - pit_control_irq(1); + outb_p(0x30, PIT_MODE); + outb_p(0, PIT_CH0); /* LSB */ + outb_p(0, PIT_CH0); /* MSB */ break; + case CLOCK_EVT_MODE_ONESHOT: /* One shot setup */ outb_p(0x38, PIT_MODE); - pit_control_irq(0); break; case CLOCK_EVT_MODE_RESUME: - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
| |