From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753410AbdEJNpg (ORCPT ); Wed, 10 May 2017 09:45:36 -0400 Received: from cn.fujitsu.com ([59.151.112.132]:29124 "EHLO heian.cn.fujitsu.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1753140AbdEJNpd (ORCPT ); Wed, 10 May 2017 09:45:33 -0400 X-IronPort-AV: E=Sophos;i="5.22,518,1449504000"; d="scan'208";a="18692961" From: Dou Liyang To: , CC: , , , , , , Dou Liyang Subject: [RFC PATCH v3 04/12] x86/time: Initialize interrupt mode behind timer init Date: Wed, 10 May 2017 21:44:41 +0800 Message-ID: <1494423889-25799-5-git-send-email-douly.fnst@cn.fujitsu.com> X-Mailer: git-send-email 2.5.5 In-Reply-To: <1494423889-25799-1-git-send-email-douly.fnst@cn.fujitsu.com> References: <1494423889-25799-1-git-send-email-douly.fnst@cn.fujitsu.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.167.226.106] X-yoursite-MailScanner-ID: 3408747C6109.AD088 X-yoursite-MailScanner: Found to be clean X-yoursite-MailScanner-From: douly.fnst@cn.fujitsu.com Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org In start_kernel(), firstly, it works on the default interrupy mode, then switch to the final mode. Normally, Booting with BIOS reset is OK. But, At dump-capture kernel, it boot up without BIOS reset, default mode may not be compatible with the actual registers, that causes the delivery interrupt to fail. Try to set up the final mode as soon as possible. according to the parts which split from that initialization: 1) Set up the APIC/IOAPIC (including testing whether the timer interrupt works) 2) Calibrate TSC 3) Set up the local APIC timer -- From Thomas Gleixner Initializing the mode should be earlier than calibrating TSC as soon as possible and needs testing whether the timer interrupt works at the same time. Add apic_interrupt_mode_init() just behind timers init, which meet the above conditions. Signed-off-by: Dou Liyang --- arch/x86/kernel/time.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/arch/x86/kernel/time.c b/arch/x86/kernel/time.c index d39c091..23b074e 100644 --- a/arch/x86/kernel/time.c +++ b/arch/x86/kernel/time.c @@ -21,6 +21,7 @@ #include #include #include +#include #ifdef CONFIG_X86_64 __visible volatile unsigned long jiffies __cacheline_aligned = INITIAL_JIFFIES; @@ -84,6 +85,13 @@ void __init hpet_time_init(void) static __init void x86_late_time_init(void) { x86_init.timers.timer_init(); + + /* + * After PIT/HPET timers init, select and setup + * the final interrupt mode for delivering IRQs. + */ + apic_interrupt_mode_init(); + tsc_init(); } -- 2.5.5