From patchwork Thu May 8 16:44:18 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Suravee Suthikulpanit X-Patchwork-Id: 4137801 X-Patchwork-Delegate: bhelgaas@google.com Return-Path: X-Original-To: patchwork-linux-pci@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 07FDEBFF02 for ; Thu, 8 May 2014 16:44:41 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 283C020270 for ; Thu, 8 May 2014 16:44:40 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 40EF72024D for ; Thu, 8 May 2014 16:44:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753348AbaEHQoi (ORCPT ); Thu, 8 May 2014 12:44:38 -0400 Received: from mail-bn1lp0145.outbound.protection.outlook.com ([207.46.163.145]:22825 "EHLO na01-bn1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1753156AbaEHQoh (ORCPT ); Thu, 8 May 2014 12:44:37 -0400 Received: from BY2PR02CA011.namprd02.prod.outlook.com (10.242.234.139) by BY2PR02MB124.namprd02.prod.outlook.com (10.242.43.149) with Microsoft SMTP Server (TLS) id 15.0.934.12; Thu, 8 May 2014 16:44:34 +0000 Received: from BN1BFFO11FD035.protection.gbl (2a01:111:f400:7c10::1:175) by BY2PR02CA011.outlook.office365.com (2a01:111:e400:2c2c::11) with Microsoft SMTP Server (TLS) id 15.0.939.12 via Frontend Transport; Thu, 8 May 2014 16:44:34 +0000 Received: from atltwp02.amd.com (165.204.84.222) by BN1BFFO11FD035.mail.protection.outlook.com (10.58.144.98) with Microsoft SMTP Server id 15.0.929.8 via Frontend Transport; Thu, 8 May 2014 16:44:33 +0000 X-WSS-ID: 0N59L67-08-6SQ-02 X-M-MSG: Received: from satlvexedge02.amd.com (satlvexedge02.amd.com [10.177.96.29]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) by atltwp02.amd.com (Axway MailGate 5.3.1) with ESMTPS id 21443BD88DD; Thu, 8 May 2014 11:44:30 -0500 (CDT) Received: from SATLEXDAG06.amd.com (10.181.40.13) by SATLVEXEDGE02.amd.com (10.177.96.29) with Microsoft SMTP Server (TLS) id 14.2.328.9; Thu, 8 May 2014 11:45:01 -0500 Received: from ssuthiku-fedora-lt.amd.com (10.180.168.240) by satlexdag06.amd.com (10.181.40.13) with Microsoft SMTP Server id 14.2.328.9; Thu, 8 May 2014 12:44:32 -0400 From: To: , CC: , Aravind Gopalakrishnan , Borislav Petkov , "Robert Richter" , Daniel J Blueman , Andreas Herrmann , Suravee Suthikulpanit , Myron Stowe Subject: [PATCH V4 1/4] x86/PCI: Fix PCI root numa_node info on AMD family15h Date: Thu, 8 May 2014 11:44:18 -0500 Message-ID: <1399567461-15928-2-git-send-email-suravee.suthikulpanit@amd.com> X-Mailer: git-send-email 1.9.0 In-Reply-To: <1399567461-15928-1-git-send-email-suravee.suthikulpanit@amd.com> References: <1399567461-15928-1-git-send-email-suravee.suthikulpanit@amd.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-Forefront-Antispam-Report: CIP:165.204.84.222; CTRY:US; IPV:NLI; IPV:NLI; EFV:NLI; SFV:NSPM; SFS:(10009001)(6009001)(428001)(199002)(189002)(33646001)(84676001)(2009001)(99396002)(80022001)(4396001)(50466002)(50226001)(68736004)(48376002)(97736001)(50986999)(64706001)(19580395003)(87286001)(62966002)(20776003)(19580405001)(76176999)(87936001)(83322001)(89996001)(83072002)(85852003)(53416003)(93916002)(46102001)(86362001)(92566001)(86152002)(47776003)(21056001)(77982001)(101416001)(74662001)(77156001)(36756003)(81542001)(31966008)(76482001)(88136002)(44976005)(92726001)(79102001)(81342001)(74502001); DIR:OUT; SFP:1101; SCL:1; SRVR:BY2PR02MB124; H:atltwp02.amd.com; FPR:; MLV:sfv; PTR:InfoDomainNonexistent; A:1; MX:1; LANG:en; X-Forefront-PRVS: 0205EDCD76 Received-SPF: None (: amd.com does not designate permitted sender hosts) Authentication-Results: spf=none (sender IP is 165.204.84.222) smtp.mailfrom=Suravee.Suthikulpanit@amd.com; X-OriginatorOrg: amd4.onmicrosoft.com 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.5 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham 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 From: Suravee Suthikulpanit This patch fixes the numa_node information in sysfs for PCI root on AMD family15h platforms (currently showing -1) by adding the hostbridge in the list of probed devices to be used for initializing pci_root_info structue. Signed-off-by: Suravee Suthikulpanit Signed-off-by: Myron Stowe Tested-by: Aravind Gopalakrishnan Cc: Borislav Petkov Cc: Robert Richter Cc: Daniel J Blueman Cc: Andreas Herrmann --- arch/x86/pci/amd_bus.c | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/arch/x86/pci/amd_bus.c b/arch/x86/pci/amd_bus.c index e88f4c5..330dbfe 100644 --- a/arch/x86/pci/amd_bus.c +++ b/arch/x86/pci/amd_bus.c @@ -24,10 +24,11 @@ struct pci_hostbridge_probe { }; static struct pci_hostbridge_probe pci_probes[] __initdata = { - { 0, 0x18, PCI_VENDOR_ID_AMD, 0x1100 }, - { 0, 0x18, PCI_VENDOR_ID_AMD, 0x1200 }, - { 0xff, 0, PCI_VENDOR_ID_AMD, 0x1200 }, - { 0, 0x18, PCI_VENDOR_ID_AMD, 0x1300 }, + { 0, 0x18, PCI_VENDOR_ID_AMD, 0x1100 }, /* K8 */ + { 0, 0x18, PCI_VENDOR_ID_AMD, 0x1200 }, /* Fam10h */ + { 0xff, 0, PCI_VENDOR_ID_AMD, 0x1200 }, /* Fam10h */ + { 0, 0x18, PCI_VENDOR_ID_AMD, 0x1300 }, /* Fam11h */ + { 0, 0x18, PCI_VENDOR_ID_AMD, 0x1600 }, /* Fam15h */ }; #define RANGE_NUM 16 @@ -113,6 +114,13 @@ static int __init early_fill_mp_bus_info(void) info = alloc_pci_root_info(min_bus, max_bus, node, link); } + /* + * The following code is only supported until Fam11h. + * Newer processors will depend on ACPI MCFG table instead. + */ + if (boot_cpu_data.x86 > 0x11) + return 0; + /* get the default node and link for left over res */ reg = read_pci_config(bus, slot, 0, 0x60); def_node = (reg >> 8) & 0x07;