From patchwork Mon May 15 13:22:04 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lorenzo Pieralisi X-Patchwork-Id: 9726935 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 0E2C360380 for ; Mon, 15 May 2017 13:21:55 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id F25E52897C for ; Mon, 15 May 2017 13:21:54 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E5A2C2898C; Mon, 15 May 2017 13:21:54 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 954D6286D5 for ; Mon, 15 May 2017 13:21:54 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933381AbdEONVc (ORCPT ); Mon, 15 May 2017 09:21:32 -0400 Received: from foss.arm.com ([217.140.101.70]:52456 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934158AbdEONVK (ORCPT ); Mon, 15 May 2017 09:21:10 -0400 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 6BB7415BF; Mon, 15 May 2017 06:21:09 -0700 (PDT) Received: from red-moon.cambridge.arm.com (red-moon.cambridge.arm.com [10.1.206.55]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id D578F3F23B; Mon, 15 May 2017 06:21:07 -0700 (PDT) From: Lorenzo Pieralisi To: linux-pci@vger.kernel.org Cc: linux-acpi@vger.kernel.org, linux-kernel@vger.kernel.org, Lorenzo Pieralisi , Bjorn Helgaas , Sergey Temerkhanov , Sinan Kaya , Zhou Wang , Vadim Lomovtsev Subject: [RFC/RFT PATCH v2 2/3] PCI: Add call to set-up NUMA node for struct pci_bus devices Date: Mon, 15 May 2017 14:22:04 +0100 Message-Id: <20170515132205.19622-3-lorenzo.pieralisi@arm.com> X-Mailer: git-send-email 2.10.0 In-Reply-To: <20170515132205.19622-1-lorenzo.pieralisi@arm.com> References: <20170515132205.19622-1-lorenzo.pieralisi@arm.com> Sender: linux-acpi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP The member dev in struct pci_bus represents the kernel struct device representation of a PCI bus, inclusive of its NUMA node. When a PCI host bridge is registered, initialize the corresponding struct pci_bus.dev member NUMA node and add code in pci_alloc_child_bus() to propagate the NUMA node set-up through the PCI bus hierarchy (ie child nodes are in the same NUMA node as the parent). Signed-off-by: Lorenzo Pieralisi Cc: Bjorn Helgaas --- drivers/pci/probe.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/pci/probe.c b/drivers/pci/probe.c index 19c8950..76c089f 100644 --- a/drivers/pci/probe.c +++ b/drivers/pci/probe.c @@ -770,6 +770,7 @@ int pci_register_host_bridge(struct pci_host_bridge *bridge) device_enable_async_suspend(bus->bridge); pci_set_bus_of_node(bus); pci_set_bus_msi_domain(bus); + set_dev_node(&bus->dev, pci_bus_find_numa_node(bus)); if (!parent) set_dev_node(bus->bridge, pcibus_to_node(bus)); @@ -861,7 +862,7 @@ static struct pci_bus *pci_alloc_child_bus(struct pci_bus *parent, */ child->dev.class = &pcibus_class; dev_set_name(&child->dev, "%04x:%02x", pci_domain_nr(child), busnr); - + set_dev_node(&child->dev, dev_to_node(&parent->dev)); /* * Set up the primary, secondary and subordinate * bus numbers.