From patchwork Wed Apr 26 10:06:18 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lorenzo Pieralisi X-Patchwork-Id: 755363 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 3wCbM859fwz9s8c for ; Wed, 26 Apr 2017 20:06:12 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1437422AbdDZKGF (ORCPT ); Wed, 26 Apr 2017 06:06:05 -0400 Received: from foss.arm.com ([217.140.101.70]:52664 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1956720AbdDZKFg (ORCPT ); Wed, 26 Apr 2017 06:05:36 -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 C03321650; Wed, 26 Apr 2017 03:05:35 -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 9BAED3F3E1; Wed, 26 Apr 2017 03:05:34 -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 Subject: [RFC/RFT PATCH 2/3] PCI: Add call to set-up NUMA node for struct pci_bus devices Date: Wed, 26 Apr 2017 11:06:18 +0100 Message-Id: <20170426100619.31758-2-lorenzo.pieralisi@arm.com> X-Mailer: git-send-email 2.10.0 In-Reply-To: <20170426100619.31758-1-lorenzo.pieralisi@arm.com> References: <20170426100619.31758-1-lorenzo.pieralisi@arm.com> Sender: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org 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 dfc9a27..5739a993 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.