From patchwork Sun Nov 2 08:10:11 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel J Blueman X-Patchwork-Id: 5211301 X-Patchwork-Delegate: bhelgaas@google.com Return-Path: X-Original-To: patchwork-linux-pci@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id AA5D49F380 for ; Sun, 2 Nov 2014 08:11:46 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 19074201C7 for ; Sun, 2 Nov 2014 08:11:45 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 457C12012D for ; Sun, 2 Nov 2014 08:11:44 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751932AbaKBIKz (ORCPT ); Sun, 2 Nov 2014 03:10:55 -0500 Received: from numascale.com ([213.162.240.84]:52370 "EHLO numascale.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751332AbaKBIKw (ORCPT ); Sun, 2 Nov 2014 03:10:52 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=numascale.com; s=default; h=References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From; bh=GrNFwLeCG0LsLgSUEBbCUMoY1wNiVjVVzch7NypPO5s=; b=XbCV25JWveMdrEDIkn+e9XJhAG9JfZe8KYwv70gf7++8xSare1ALxeRAXibGhjaHVdVwl5AsSB5nuMQsyHcA4UKwBsg97mWEdZ/g7YZhXEEVwQCvX2I0Q3BbUbhIwzjTAwhQ+ChSQjucWd9c8eYqghm5LRc+4IhIx0DGDNhMoUU=; Received: from [115.42.131.38] (port=59192 helo=meiko.int.numascale.com) by cpanel21.proisp.no with esmtpsa (UNKNOWN:AES128-SHA256:128) (Exim 4.82) (envelope-from ) id 1XkqFI-003GZW-E6; Sun, 02 Nov 2014 09:10:44 +0100 From: Daniel J Blueman To: Thomas Gleixner , Ingo Molnar , "H. Peter Anvin" , Bjorn Helgaas Cc: Daniel J Blueman , x86@kernel.org, linux-kernel@vger.kernel.org, linux-pci@vger.kernel.org, Steffen Persvold Subject: [PATCH v3 3/5] Numachip: Add safe is-present function Date: Sun, 2 Nov 2014 16:10:11 +0800 Message-Id: <1414915813-2462-3-git-send-email-daniel@numascale.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1414915813-2462-1-git-send-email-daniel@numascale.com> References: <1414915813-2462-1-git-send-email-daniel@numascale.com> X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - cpanel21.proisp.no X-AntiAbuse: Original Domain - vger.kernel.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - numascale.com X-Get-Message-Sender-Via: cpanel21.proisp.no: authenticated_id: daniel@numascale.com X-Source: X-Source-Args: X-Source-Dir: Sender: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org X-Spam-Status: No, score=-7.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,RP_MATCHES_RCVD,T_DKIM_INVALID,UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Add safe function to check if Numachip is detected, to be used elsewhere. Signed-off-by: Daniel J Blueman --- arch/x86/include/asm/numachip/numachip.h | 9 +++++++++ arch/x86/kernel/apic/apic_numachip.c | 9 +++++++-- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/arch/x86/include/asm/numachip/numachip.h b/arch/x86/include/asm/numachip/numachip.h index 1c6f7f6..3e1f4f9 100644 --- a/arch/x86/include/asm/numachip/numachip.h +++ b/arch/x86/include/asm/numachip/numachip.h @@ -16,4 +16,13 @@ extern int __init pci_numachip_init(void); +#ifdef CONFIG_X86_NUMACHIP +extern bool is_numachip_system(void); +#else +static inline bool is_numachip_system(void) +{ + return 0; +} +#endif + #endif /* _ASM_X86_NUMACHIP_NUMACHIP_H */ diff --git a/arch/x86/kernel/apic/apic_numachip.c b/arch/x86/kernel/apic/apic_numachip.c index bd083c0..c965b69 100644 --- a/arch/x86/kernel/apic/apic_numachip.c +++ b/arch/x86/kernel/apic/apic_numachip.c @@ -30,7 +30,7 @@ #include #include -static int numachip_system __read_mostly; +static bool numachip_system __read_mostly; static const struct apic apic_numachip __refconst; @@ -173,11 +173,16 @@ static void fixup_cpu_id(struct cpuinfo_x86 *c, int node) } } +bool is_numachip_system(void) +{ + return numachip_system; +} + static int __init numachip_system_init(void) { unsigned int val; - if (!numachip_system) + if (!is_numachip_system()) return 0; x86_cpuinit.fixup_cpu_id = fixup_cpu_id;