Received: by 2002:a05:6a10:6006:0:0:0:0 with SMTP id w6csp1071254pxa; Fri, 28 Aug 2020 02:51:52 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx4Prc6UJcTzCm+HYJGeAnYBn0QA7oJqChYT0yCQihTb/KzO2qQgktNaN1SNCnx1rlGwEbk X-Received: by 2002:a50:ed17:: with SMTP id j23mr1009182eds.158.1598608311850; Fri, 28 Aug 2020 02:51:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1598608311; cv=none; d=google.com; s=arc-20160816; b=dhmyxmEa5E2NLk8saPYFErbujKI78P13Sh32k0KIQqxy82FmNAgxQ6s0Y3kzja0zjD axxqdRTsqZGqos42vrMMUdCOgcZNhcgWBr6c+nhAjagYqnxrOGMkkUdUlsAEviQTOw+A qOeYeCchGjCcgQDPj9IdIBTrDpbmH7W9ZRNMyT/UC89fhgm4HBMSKQ34rA9nTkQYm8Mq 6Iq3aXgizyERZlruVrv7jHT75OrXb7PXHBkqvLTq2TgJSbyxyZge1gSkK2lpLd1vNr0R yPl2NZ52s99MvAclwRzZXZ3RLI9S/xdUN4I7p0ZmkAbxQSa4HwWOxn4yoPPOiC2A6T5u Ob/g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :organization:references:in-reply-to:message-id:subject:cc:to:from :date; bh=RhDF5r1xKMivFsQGrgKl1GkVCDS+PyIah0Pp75jpZkg=; b=zekalvABXH3Y2Qi9rWWV8OhiB34umxxs6nAXIWculoL7Oc46uhIm7SARgt7T7BR/35 kvTxPinvKSuEt+eH14cbHW+p7XlYezLa2ArpVB7U7v6sBW8K5J7/r1As4ffnpfwI+Xzw J6YLCcNmVJGmmMjrpeCzafSY3pcJQ1atHVVO79enJJ5zRlKwBnfV0WahY70DQcjSsjBm 2OEwJXg4B0eHrdsITrQicsJ8vphpnGUziy0sbdP+o4xg8HWNFn/FNOJ3jL1ZLa/FuazN /lGpOSugC+uZvf9C1ywezAzMgRD7flPHQ19+Ocw/cbFDyuzSRESiSTBvvk/3f+QTNaFJ Lscg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id b15si285759edz.305.2020.08.28.02.51.27; Fri, 28 Aug 2020 02:51:51 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728811AbgH1JuM convert rfc822-to-8bit (ORCPT + 99 others); Fri, 28 Aug 2020 05:50:12 -0400 Received: from lhrrgout.huawei.com ([185.176.76.210]:2708 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728218AbgH1JuM (ORCPT ); Fri, 28 Aug 2020 05:50:12 -0400 Received: from lhreml710-chm.china.huawei.com (unknown [172.18.7.107]) by Forcepoint Email with ESMTP id F3FFD3C63C4F4B09F077; Fri, 28 Aug 2020 10:50:09 +0100 (IST) Received: from localhost (10.52.127.106) by lhreml710-chm.china.huawei.com (10.201.108.61) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1913.5; Fri, 28 Aug 2020 10:50:05 +0100 Date: Fri, 28 Aug 2020 10:48:30 +0100 From: Jonathan Cameron To: Atish Patra CC: , "Rafael J. Wysocki" , Catalin Marinas , Zong Li , , Will Deacon , , Rob Herring , "Lorenzo Pieralisi" , Ganapatrao Kulkarni , Steven Price , Greentime Hu , Albert Ou , Arnd Bergmann , Anshuman Khandual , "Paul Walmsley" , , Nick Hu , Greg Kroah-Hartman , Anup Patel , Palmer Dabbelt , Andrew Morton , Mike Rapoport , Bjorn Helgaas , Subject: Re: [RFC/RFT PATCH 3/6] arm64, numa: Move pcibus_to_node definition to generic numa code Message-ID: <20200828104830.000007bf@Huawei.com> In-Reply-To: <20200814214725.28818-4-atish.patra@wdc.com> References: <20200814214725.28818-1-atish.patra@wdc.com> <20200814214725.28818-4-atish.patra@wdc.com> Organization: Huawei Technologies Research and Development (UK) Ltd. X-Mailer: Claws Mail 3.17.4 (GTK+ 2.24.32; i686-w64-mingw32) MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 8BIT X-Originating-IP: [10.52.127.106] X-ClientProxiedBy: lhreml725-chm.china.huawei.com (10.201.108.76) To lhreml710-chm.china.huawei.com (10.201.108.61) X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, 14 Aug 2020 14:47:22 -0700 Atish Patra wrote: > pcibus_to_node is used only when numa is enabled and does not depend > on ISA. Thus, it can be moved the generic numa implementation. > > Signed-off-by: Atish Patra From a more general unification point of view, there seem to be two ways architectures implement this. Either bus->sysdata.node Or as here. There are weird other options, but let us ignore those :) That is going to take a bit of unwinding should we want to take this unification further and perhaps we want to think about doing this in pci generic code rather than here? Perhaps this is one we are better keeping architecture specific for now? +CC Bjorn and Linux-pci > --- > arch/arm64/kernel/pci.c | 10 ---------- > drivers/base/arch_numa.c | 11 +++++++++++ > 2 files changed, 11 insertions(+), 10 deletions(-) > > diff --git a/arch/arm64/kernel/pci.c b/arch/arm64/kernel/pci.c > index 1006ed2d7c60..07c122946c11 100644 > --- a/arch/arm64/kernel/pci.c > +++ b/arch/arm64/kernel/pci.c > @@ -54,16 +54,6 @@ int raw_pci_write(unsigned int domain, unsigned int bus, > return b->ops->write(b, devfn, reg, len, val); > } > > -#ifdef CONFIG_NUMA > - > -int pcibus_to_node(struct pci_bus *bus) > -{ > - return dev_to_node(&bus->dev); > -} > -EXPORT_SYMBOL(pcibus_to_node); > - > -#endif > - > #ifdef CONFIG_ACPI > > struct acpi_pci_generic_root_info { > diff --git a/drivers/base/arch_numa.c b/drivers/base/arch_numa.c > index 83341c807240..4ab1b20a615d 100644 > --- a/drivers/base/arch_numa.c > +++ b/drivers/base/arch_numa.c > @@ -11,6 +11,7 @@ > #include > #include > #include > +#include > #include > > #ifdef CONFIG_ARM64 > @@ -60,6 +61,16 @@ EXPORT_SYMBOL(cpumask_of_node); > > #endif > > +#ifdef CONFIG_PCI > + > +int pcibus_to_node(struct pci_bus *bus) > +{ > + return dev_to_node(&bus->dev); > +} > +EXPORT_SYMBOL(pcibus_to_node); > + > +#endif > + > static void numa_update_cpu(unsigned int cpu, bool remove) > { > int nid = cpu_to_node(cpu);