Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752199AbdGCCeq (ORCPT ); Sun, 2 Jul 2017 22:34:46 -0400 Received: from cn.fujitsu.com ([59.151.112.132]:26795 "EHLO heian.cn.fujitsu.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1751983AbdGCCep (ORCPT ); Sun, 2 Jul 2017 22:34:45 -0400 X-IronPort-AV: E=Sophos;i="5.22,518,1449504000"; d="scan'208";a="20760931" Subject: Re: [PATCH v5 07/12] x86/apic: Unify interrupt mode setup for UP system To: Thomas Gleixner References: <1fa26228fa94779d12d4089b83a43fe157b110fe.1498795030.git.douly.fnst@cn.fujitsu.com> CC: , , , , , , , , , From: Dou Liyang Message-ID: Date: Mon, 3 Jul 2017 10:34:40 +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: C8E0246B53F3.AC1A1 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: 1228 Lines: 54 Hi Thomas, At 07/03/2017 02:19 AM, Thomas Gleixner wrote: > On Fri, 30 Jun 2017, Dou Liyang wrote: >> static inline int apic_force_enable(unsigned long addr) >> diff --git a/arch/x86/kernel/apic/apic.c b/arch/x86/kernel/apic/apic.c >> index 0601054..9bf7e95 100644 >> --- a/arch/x86/kernel/apic/apic.c >> +++ b/arch/x86/kernel/apic/apic.c >> @@ -1198,6 +1198,10 @@ static int __init apic_intr_mode_select(int *upmode) >> } >> #endif >> >> +#ifdef CONFIG_UP_LATE_INIT >> + *upmode = true; >> +#endif > > This is really wrong. The upmode decision, which is required for calling > apic_bsp_setup() should not happen here, really. As I told you in the > previous patch, use the return code and then you can make further decisions > in apic_intr_mode_init(). Really thanks for your detail explaining, I learned more than i read from books about the programming skill. > > And you do it there w/o any ifdeffery: > > static void apic_intr_mode_init(void) > { > bool upmode = IS_ENABLED(CONFIG_UP_LATE_INIT); > > switch (....) { > case XXXX: > upmode = true; > .... > } > apic_bsp_setup(upmode); > } This looks more beautiful than mine. I will use it in the next version. Thanks, dou. > > Thanks, > > tglx > > >