Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754581AbdDGHve (ORCPT ); Fri, 7 Apr 2017 03:51:34 -0400 Received: from cn.fujitsu.com ([59.151.112.132]:35538 "EHLO heian.cn.fujitsu.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1754096AbdDGHvS (ORCPT ); Fri, 7 Apr 2017 03:51:18 -0400 X-IronPort-AV: E=Sophos;i="5.22,518,1449504000"; d="scan'208";a="17474345" Subject: Re: [RFC PATCH 3/6] x86/apic: Extract APIC timer related code from apic_bsp_setup() To: Thomas Gleixner References: <1490799333-18242-1-git-send-email-douly.fnst@cn.fujitsu.com> <1490799333-18242-4-git-send-email-douly.fnst@cn.fujitsu.com> CC: , , , , , , From: Dou Liyang Message-ID: <174164c8-bca5-8c3b-d0f1-ae75a3a8a0d6@cn.fujitsu.com> Date: Fri, 7 Apr 2017 15:51:11 +0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.4.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset="windows-1252"; format=flowed Content-Transfer-Encoding: 7bit X-Originating-IP: [10.167.226.106] X-yoursite-MailScanner-ID: EB00247CE222.AA546 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 Content-Length: 1313 Lines: 50 Hi Thomas, At 04/05/2017 07:56 PM, Thomas Gleixner wrote: > On Wed, 29 Mar 2017, Dou Liyang wrote: >> +/* Setup local APIC timer and get the Id*/ >> +static int __init apic_bsp_timer_setup(void) > > This does not make sense. The id and the timers have nothing to do with > each other. Yes, Indeed. Here is more like the rest work for APIC setup, which can't be executed earlier, The name is not suitable. I will refactor it. >> +{ >> + int id; >> + >> + if (x2apic_mode) >> + id = apic_read(APIC_LDR); >> + else >> + id = GET_APIC_LOGICAL_ID(apic_read(APIC_LDR)); >> + >> + if (!skip_ioapic_setup && nr_ioapics && nr_legacy_irqs()) >> + check_timer(); > > Why are you moving this to the APIC? check_timer() has absolutely nothing Because, the jiffies is used in check_timer() for checking timer irq works(timer_irq_works()) and can't work at the beginning. So, keep check_timer() in IOAPIC setup function (setup_IO_APIC()) which has been moved to init_IRQ() will make the kernel not boot up. > to do with the apic timer. It's a IOAPIC only issue and required to test > that the IRQ0 interrupt delivery works through the IOAPIC. > Yes, I see, split check_timer() is not a good way, and move the APIC initialization to the end of init_IRQ() is also not well. Thanks, Liyang > Thanks, > > tglx > > >