Received: by 10.223.185.116 with SMTP id b49csp3874692wrg; Tue, 13 Feb 2018 09:02:52 -0800 (PST) X-Google-Smtp-Source: AH8x2278mWxikzKLGKQ94NwD5BsCMUyDBNvLeEJ00lIp5TiDzgJgvdYAqfI9KtUvIlQdIpf+JUud X-Received: by 10.99.0.139 with SMTP id 133mr1486430pga.267.1518541371930; Tue, 13 Feb 2018 09:02:51 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1518541371; cv=none; d=google.com; s=arc-20160816; b=jC6v3GpvYnhbU9aUcEBfO2fmwoE9oSVcw1kBQCO+nsQ+gPcv7w+Jy/qIEHwwIDUVvO FIWJY49XC10BRp6EpeBDwA5APemM9hw48lso8iPy8j80Q1zmH6QrC1meuq7QlJt2vS/D jg0UsPA65YuU5Bva8pqduDzpS2iylgMNr+4cnnyOs6Mtd7QH5r6iiZjyzfQNwbxFcWa5 z/7HqblC1JGznjDvfxW3qXxDt78vKe7RuZA9nTnbh+ZJgEngjVwVJvHdk9vIsn9KcmTB qSxltV6KrmQLWInb+O0t/+kXQ7xcS9rKqG7y88a0G4pYFTyWKzwE3vnGueQgiZRxJTch bBzA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-disposition :content-transfer-encoding:mime-version:robot-unsubscribe:robot-id :git-commit-id:subject:to:references:in-reply-to:reply-to:cc :message-id:from:date:arc-authentication-results; bh=+hE9qmp0JggUdfHpssHWJyumF3RP1Fcu3KN5z76Wlsw=; b=mikGe4++2qz/7WE5bRrdW6Tv8luo3+o6KiYrQIcZSD3fT/MZGvmzV5Yiu6wOUbshXs 3BuuygE1XHu+jF1uV0hda1nKxjnPcXLKbBQUOjxdls0HY1Mu5QOa1Hq8QY3hapZKtH3c 4PworQLCFWqiSfwnVJP/HQn051XZFaeF6ND8MUAwa4H+nnjfZUfccPwikf5DK2q0vRSt 4Qgmg2DzDGEIrQEpppeU6OpPEdoDfeBjdehqhRhFZnqmjmXGJx9AwpQG9Ndo7xJcPui2 +AnNCMV4HCCbhhzjzFOcJVbT6PuQTMlM5fl3vnirLdFUT8QKPfja1q+sUMtsa4m52rNY Gqow== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 94-v6si44926ple.298.2018.02.13.09.01.55; Tue, 13 Feb 2018 09:02:51 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S965326AbeBMQ7b (ORCPT + 99 others); Tue, 13 Feb 2018 11:59:31 -0500 Received: from terminus.zytor.com ([198.137.202.136]:49811 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S964939AbeBMQ72 (ORCPT ); Tue, 13 Feb 2018 11:59:28 -0500 Received: from terminus.zytor.com (localhost [127.0.0.1]) by terminus.zytor.com (8.15.2/8.15.2) with ESMTP id w1DGx5iw006113; Tue, 13 Feb 2018 08:59:05 -0800 Received: (from tipbot@localhost) by terminus.zytor.com (8.15.2/8.15.2/Submit) id w1DGx4vs006110; Tue, 13 Feb 2018 08:59:04 -0800 Date: Tue, 13 Feb 2018 08:59:04 -0800 X-Authentication-Warning: terminus.zytor.com: tipbot set sender to tipbot@zytor.com using -f From: tip-bot for Dou Liyang Message-ID: Cc: mingo@kernel.org, torvalds@linux-foundation.org, linux-kernel@vger.kernel.org, peterz@infradead.org, tglx@linutronix.de, douly.fnst@cn.fujitsu.com, hpa@zytor.com Reply-To: hpa@zytor.com, tglx@linutronix.de, douly.fnst@cn.fujitsu.com, peterz@infradead.org, linux-kernel@vger.kernel.org, torvalds@linux-foundation.org, mingo@kernel.org In-Reply-To: <20180117073748.23905-1-douly.fnst@cn.fujitsu.com> References: <20180117073748.23905-1-douly.fnst@cn.fujitsu.com> To: linux-tip-commits@vger.kernel.org Subject: [tip:x86/apic] x86/apic: Simplify init_bsp_APIC() usage Git-Commit-ID: ccf5355d05cd891522267f04b2723002e7f061de X-Mailer: tip-git-log-daemon Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=UTF-8 Content-Disposition: inline X-Spam-Status: No, score=-2.9 required=5.0 tests=ALL_TRUSTED,BAYES_00 autolearn=ham autolearn_force=no version=3.4.1 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on terminus.zytor.com Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Commit-ID: ccf5355d05cd891522267f04b2723002e7f061de Gitweb: https://git.kernel.org/tip/ccf5355d05cd891522267f04b2723002e7f061de Author: Dou Liyang AuthorDate: Wed, 17 Jan 2018 15:37:48 +0800 Committer: Ingo Molnar CommitDate: Tue, 13 Feb 2018 17:30:38 +0100 x86/apic: Simplify init_bsp_APIC() usage Since CONFIG_X86_64 selects CONFIG_X86_LOCAL_APIC, the following condition: #if defined(CONFIG_X86_64) || defined(CONFIG_X86_LOCAL_APIC) is equivalent to: #if defined(CONFIG_X86_LOCAL_APIC) ... and we can eliminate that #ifdef by providing an empty init_bsp_APIC() stub in the !CONFIG_X86_LOCAL_APIC case. Also add some comments to explain why we call init_bsp_APIC(). Signed-off-by: Dou Liyang Cc: Linus Torvalds Cc: Peter Zijlstra Cc: Thomas Gleixner Cc: mroos@linux.ee Cc: ville.syrjala@linux.intel.com Link: http://lkml.kernel.org/r/20180117073748.23905-1-douly.fnst@cn.fujitsu.com Signed-off-by: Ingo Molnar --- arch/x86/include/asm/apic.h | 1 + arch/x86/kernel/irqinit.c | 9 +++++++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/arch/x86/include/asm/apic.h b/arch/x86/include/asm/apic.h index 9872277..6e1990d 100644 --- a/arch/x86/include/asm/apic.h +++ b/arch/x86/include/asm/apic.h @@ -183,6 +183,7 @@ static inline void disable_local_APIC(void) { } # define setup_boot_APIC_clock x86_init_noop # define setup_secondary_APIC_clock x86_init_noop static inline void lapic_update_tsc_freq(void) { } +static inline void init_bsp_APIC(void) { } static inline void apic_intr_mode_init(void) { } static inline void lapic_assign_system_vectors(void) { } static inline void lapic_assign_legacy_vector(unsigned int i, bool r) { } diff --git a/arch/x86/kernel/irqinit.c b/arch/x86/kernel/irqinit.c index a539410..772196c 100644 --- a/arch/x86/kernel/irqinit.c +++ b/arch/x86/kernel/irqinit.c @@ -61,9 +61,14 @@ void __init init_ISA_irqs(void) struct irq_chip *chip = legacy_pic->chip; int i; -#if defined(CONFIG_X86_64) || defined(CONFIG_X86_LOCAL_APIC) + /* + * Try to set up the through-local-APIC virtual wire mode earlier. + * + * On some 32-bit UP machines, whose APIC has been disabled by BIOS + * and then got re-enabled by "lapic", it hangs at boot time without this. + */ init_bsp_APIC(); -#endif + legacy_pic->init(0); for (i = 0; i < nr_legacy_irqs(); i++)