Received: by 2002:a05:6a10:6006:0:0:0:0 with SMTP id w6csp1316540pxa; Fri, 28 Aug 2020 09:19:57 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwIb+LdSjYbSSx2LcEr9GUONZ6vLoQW1S9fYh4Fvr/jJMZr++dfSIBCdCkhS9M46/u+TZdf X-Received: by 2002:a05:6402:1591:: with SMTP id c17mr2701094edv.240.1598631597253; Fri, 28 Aug 2020 09:19:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1598631597; cv=none; d=google.com; s=arc-20160816; b=Z8Lia8djg2cyoMDo9IFv2jhC6Q5qYTJk6HTXaBu7eOPIbd9LS1x67oez80BRsPmKaR E8WAROyQA7RxE7MjPy6Tdi3W5M29NXnx1Ufv13Myijah1SAwIrG6/48aP04AOiwyYjYo 4biJZ6Uu4VVGungC2TiufF+K2Mw/ds1GpyzwHTYIrCo/9OnkbolUh8NHocwp88+BfyKB pNMMwUJbySlQ+brBYtwjnAmH1L0FB0VchzdpwUyO6zltlum1fYlc3Biuxt6jiZIdmEkO u3RzVPtxJNapxArHkKYjdxSTdnDBkRtvUwSDRUU3JOCGtorQlijoLzSYep90a1RFe5l3 uVtw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:message-id:subject:cc:to:from:date:dkim-signature; bh=iMfb6xhMKVY6DlY2sIEYUlz47cgxlQ4+4ryErycyAA8=; b=sqcjPcYnDJ78fnekok9eaiK0W2IWM/+KqnWqi9G8X+a2Y+YShiebPDAgnhBmjXgZPM 7Wfyvmr7BKmrRB/nvMRRdPgh62r6EhF5cvqSr2KIxuN/y+HPRvBeeWeBw3oOZZ01wEDZ 88XbxDWAqgNmf+lxtYgN8+PBafBKPkOFQ9BtEHxdS+/VKZr7WTcImeBwdqEMgxGEO2aq SrgV7rvzF8cjclt+sHyxeX5NZQx7PtJ2WrvONDX55flzbEec93Y2IbxLT7z+lG4HfGVa wJMxvljHy2tsrENGA2FAesxuzwCuPD/NzNgMYOjpauH60y1uNSfq891lmie+WmypL2vS FBwA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=XXzEkWMb; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id b10si886751edv.101.2020.08.28.09.19.32; Fri, 28 Aug 2020 09:19:57 -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; dkim=pass header.i=@kernel.org header.s=default header.b=XXzEkWMb; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728397AbgH1QPg (ORCPT + 99 others); Fri, 28 Aug 2020 12:15:36 -0400 Received: from mail.kernel.org ([198.145.29.99]:57898 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726197AbgH1QPZ (ORCPT ); Fri, 28 Aug 2020 12:15:25 -0400 Received: from localhost (104.sub-72-107-126.myvzw.com [72.107.126.104]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id B7DFA208D5; Fri, 28 Aug 2020 16:15:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1598631325; bh=WDy36I6Z4orTZPoGujoAX7lI0c2B80UVvjLy+uuLcNA=; h=Date:From:To:Cc:Subject:In-Reply-To:From; b=XXzEkWMbwa7hJsKl3WWxYs9ZIzvl4XBfLjgS8Mijz+ElFIFxllHByPMzK3VHEqITH 1D4I/umOYAh/U5wOHQaoIwJATfekh83VfUHN8EJZaCCfchYknTM4ZCIMFUd0DL6dnq F9ieOAP4skNybw+ZwBfOKkffDedrwcNXg5u8hBDU= Date: Fri, 28 Aug 2020 11:15:23 -0500 From: Bjorn Helgaas To: Jonathan Cameron Cc: Atish Patra , linux-kernel@vger.kernel.org, "Rafael J. Wysocki" , Catalin Marinas , Zong Li , linux-riscv@lists.infradead.org, Will Deacon , linux-arch@vger.kernel.org, Rob Herring , Lorenzo Pieralisi , Ganapatrao Kulkarni , Steven Price , Greentime Hu , Albert Ou , Arnd Bergmann , Anshuman Khandual , Paul Walmsley , linux-arm-kernel@lists.infradead.org, Nick Hu , Greg Kroah-Hartman , Anup Patel , Palmer Dabbelt , Andrew Morton , Mike Rapoport , Bjorn Helgaas , linux-pci@vger.kernel.org Subject: Re: [RFC/RFT PATCH 3/6] arm64, numa: Move pcibus_to_node definition to generic numa code Message-ID: <20200828161523.GA2158345@bjorn-Precision-5520> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200828104830.000007bf@Huawei.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Aug 28, 2020 at 10:48:30AM +0100, Jonathan Cameron wrote: > 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 I certainly agree that this should not be arch-specific, but I'm not really in favor of adding this PCI gunk in drivers/base. I think we can do better (eventually) by getting rid of pcibus_to_node() completely. It's not used very much except by cpumask_of_pcibus(), which itself is hardly used at all. > > static void numa_update_cpu(unsigned int cpu, bool remove) > > { > > int nid = cpu_to_node(cpu); > >