]> asedeno.scripts.mit.edu Git - linux.git/commit
x86/apic: Implement set_state_oneshot_stopped() callback
authorFrederic Weisbecker <fweisbec@gmail.com>
Thu, 29 Dec 2016 16:45:49 +0000 (17:45 +0100)
committerThomas Gleixner <tglx@linutronix.de>
Mon, 9 Jan 2017 10:48:42 +0000 (11:48 +0100)
commit914122c389d091a02f7b5476209af715e77ccb73
tree81ed6b6de516b558c801b1e1c65a70f2ef0a4de0
parent12bf98b91f7aa8a9a526309aba645ccdcc470cab
x86/apic: Implement set_state_oneshot_stopped() callback

When clock_event_device::set_state_oneshot_stopped() is not implemented,
hrtimer_cancel() can't stop the clock when there is no more timer in
the queue. So the ghost of the freshly cancelled hrtimer haunts us back
later with an extra interrupt:

          <idle>-0     [002] d..2  2248.557659: hrtimer_cancel: hrtimer=ffff88021fa92d80
          <idle>-0     [002] d.h1  2249.303659: local_timer_entry: vector=239

So let's implement this missing callback for the lapic clock. This
consist in calling its set_state_shutdown() callback. There don't seem
to be a lighter way to stop the clock. Simply writing 0 to APIC_TMICT
won't be enough to stop the clock and avoid the extra interrupt, as
opposed to what is specified in the specs. We must also mask the
timer interrupt in the device.

Signed-off-by: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Borislav Petkov <bp@alien8.de>
Reviewed-by: Wanpeng Li <wanpeng.li@hotmail.com>
Reviewed-by: Viresh Kumar <viresh.kumar@linaro.org>
Link: http://lkml.kernel.org/r/1483029949-6925-1-git-send-email-fweisbec@gmail.com
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
arch/x86/kernel/apic/apic.c