aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/clocksource/i8253.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/clocksource/i8253.c')
-rw-r--r--drivers/clocksource/i8253.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/drivers/clocksource/i8253.c b/drivers/clocksource/i8253.c
index 9c38895542f4..d4350bb10b83 100644
--- a/drivers/clocksource/i8253.c
+++ b/drivers/clocksource/i8253.c
@@ -20,6 +20,13 @@
20DEFINE_RAW_SPINLOCK(i8253_lock); 20DEFINE_RAW_SPINLOCK(i8253_lock);
21EXPORT_SYMBOL(i8253_lock); 21EXPORT_SYMBOL(i8253_lock);
22 22
23/*
24 * Handle PIT quirk in pit_shutdown() where zeroing the counter register
25 * restarts the PIT, negating the shutdown. On platforms with the quirk,
26 * platform specific code can set this to false.
27 */
28bool i8253_clear_counter_on_shutdown __ro_after_init = true;
29
23#ifdef CONFIG_CLKSRC_I8253 30#ifdef CONFIG_CLKSRC_I8253
24/* 31/*
25 * Since the PIT overflows every tick, its not very useful 32 * Since the PIT overflows every tick, its not very useful
@@ -109,8 +116,11 @@ static int pit_shutdown(struct clock_event_device *evt)
109 raw_spin_lock(&i8253_lock); 116 raw_spin_lock(&i8253_lock);
110 117
111 outb_p(0x30, PIT_MODE); 118 outb_p(0x30, PIT_MODE);
112 outb_p(0, PIT_CH0); 119
113 outb_p(0, PIT_CH0); 120 if (i8253_clear_counter_on_shutdown) {
121 outb_p(0, PIT_CH0);
122 outb_p(0, PIT_CH0);
123 }
114 124
115 raw_spin_unlock(&i8253_lock); 125 raw_spin_unlock(&i8253_lock);
116 return 0; 126 return 0;