From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932087AbdABHcA (ORCPT ); Mon, 2 Jan 2017 02:32:00 -0500 Received: from mail-pf0-f175.google.com ([209.85.192.175]:33887 "EHLO mail-pf0-f175.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754801AbdABHb6 (ORCPT ); Mon, 2 Jan 2017 02:31:58 -0500 Date: Mon, 2 Jan 2017 13:01:54 +0530 From: Viresh Kumar To: Frederic Weisbecker Cc: Thomas Gleixner , LKML , Borislav Petkov , Wanpeng Li , Ingo Molnar Subject: Re: [PATCH] x86/apic: Implement set_state_oneshot_stopped() callback Message-ID: <20170102073154.GB13679@vireshk-i7> References: <1483029949-6925-1-git-send-email-fweisbec@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1483029949-6925-1-git-send-email-fweisbec@gmail.com> User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 29-12-16, 17:45, Frederic Weisbecker wrote: > 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: > > -0 [002] d..2 2248.557659: hrtimer_cancel: hrtimer=ffff88021fa92d80 > -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. > > Cc: Thomas Gleixner > Cc: Borislav Petkov > Cc: Ingo Molnar > Cc: Wanpeng Li > Cc: Viresh Kumar > Signed-off-by: Frederic Weisbecker > --- > arch/x86/kernel/apic/apic.c | 25 +++++++++++++------------ > 1 file changed, 13 insertions(+), 12 deletions(-) I didn't try updating anything other than the ARM subsystem as I was afraid of getting crushed by Thomas :) Though, I do remember from one of the email (from Thomas), where he mentioned that disabling the timer on some platforms may have bigger penalties. Perhaps its fast enough for apic.. Reviewed-by: Viresh Kumar -- viresh