Received: by 2002:ac0:b08d:0:0:0:0:0 with SMTP id l13csp2450378imc; Sat, 23 Feb 2019 03:46:42 -0800 (PST) X-Google-Smtp-Source: AHgI3IZw0DyDrMcJbOiQw/xBdQwsFx+9GYF2vebrk4fZUsBYaopIYMuNASYVaGllYNHXs52ME306 X-Received: by 2002:a63:2c8a:: with SMTP id s132mr8527068pgs.440.1550922402737; Sat, 23 Feb 2019 03:46:42 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1550922402; cv=none; d=google.com; s=arc-20160816; b=ob/m3BOYMUscSfy6UwgBNWLwVY12uqJWChizL3FMxgpXKDoIi7HdlSdJ+elqn0sgGW 5icp9b0bZbvWUlZS6QQSPl2NVXAlykF3iGZmqyV7EJopMY98ZLG3ZpLX059LA2rl4y4L d1kAfqQE9YzO/O8xXEk+g70KRuqTnYt8RJUHTkP1JsJKGp5aaKY/GOSt4v3uZzcEFPpS 3Xf037kok2tHvFpDE3Z6eC2k57cNKM5Dg4LtFRRa3+ijEzigCgGXv3vgLE2AzYTXAd4v KHgf+QA2A2i7LPlQPb3QepP2s/E++n1RRgpWnCaNcEIB43aDKR5hXLGLWnBUcgS9bQH0 +Keg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=q463to0hMzV8Rx9EsQ8VOmvHDEhyCrcJI0Y0ZMUD8F8=; b=RPb+nzXhXgaXtM3+LZKNYHiHesN5IcqtrNpwgniGWTC7YCa1lUDrmvzXRqt5XabXO7 33VGhP8j927dws1qvpAmYonL9cIVwjGxrgMYz733DIK7MZ6fLwtol/OUNxB2dF7xBHWu +hmxZqYnA/9ioTLHbql7RKG/jkY0GoesfjWV6B6lvTQiZYQgHRizGrTZ+OQP8C+gNmrB kPrYzQv3RJa6Ms10DwY5p/1BQRLDc98J27pzd3iPtCAu6Ix1rkphaOs9D0XGEXG08ykp DEJzjcM544mhgLZvIBgBbaeI/SCpDcmiNirPfRb+BeydNPK/Pp2BqM1I4OIT1NYnslQz 9N1Q== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id j66si3919442pfb.182.2019.02.23.03.45.52; Sat, 23 Feb 2019 03:46:42 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727164AbfBWLo7 (ORCPT + 99 others); Sat, 23 Feb 2019 06:44:59 -0500 Received: from elvis.franken.de ([193.175.24.41]:48184 "EHLO elvis.franken.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726271AbfBWLo7 (ORCPT ); Sat, 23 Feb 2019 06:44:59 -0500 X-Greylist: delayed 2413 seconds by postgrey-1.27 at vger.kernel.org; Sat, 23 Feb 2019 06:44:58 EST Received: from uucp (helo=alpha) by elvis.franken.de with local-bsmtp (Exim 3.36 #1) id 1gxV6v-00021Q-00; Sat, 23 Feb 2019 12:04:49 +0100 Received: by alpha.franken.de (Postfix, from userid 1000) id CCA96C004D; Sat, 23 Feb 2019 12:04:32 +0100 (CET) Date: Sat, 23 Feb 2019 12:04:32 +0100 From: Thomas Bogendoerfer To: Bjorn Helgaas Cc: linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2 07/10] PCI: call add_bus method also for root bus Message-ID: <20190223110432.GA8782@alpha.franken.de> References: <20190219155728.19163-1-tbogendoerfer@suse.de> <20190219155728.19163-8-tbogendoerfer@suse.de> <20190221233708.GC219879@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190221233708.GC219879@google.com> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Feb 21, 2019 at 05:37:08PM -0600, Bjorn Helgaas wrote: > On Tue, Feb 19, 2019 at 04:57:21PM +0100, Thomas Bogendoerfer wrote: > > pci-xtalk controller code uses the add_bus method to set node of > > the bus device, which then is used for pcibus_to_node() implementation. > > > > Signed-off-by: Thomas Bogendoerfer > > --- > > drivers/pci/probe.c | 6 ++++++ > > 1 file changed, 6 insertions(+) > > > > diff --git a/drivers/pci/probe.c b/drivers/pci/probe.c > > index 257b9f6f2ebb..456448d5f46d 100644 > > --- a/drivers/pci/probe.c > > +++ b/drivers/pci/probe.c > > @@ -837,6 +837,12 @@ static int pci_register_host_bridge(struct pci_host_bridge *bridge) > > > > pcibios_add_bus(bus); > > > > + if (bus->ops->add_bus) { > > + err = bus->ops->add_bus(bus); > > + if (WARN_ON(err < 0)) > > + dev_err(&bus->dev, "failed to add bus: %d\n", err); > > + } > > Is there something special about pci-xtalk that prevents it from > setting the node the way other platforms do, without using the > add_bus() method? x86: uses node in common struct pci_sysdata ia64: uses node in common struct pci_controller powerpc: uses node in common struct pci_controller sparc: uses numa_node in common struct pci_pbm_info arm64: uses dev_to_node(&bus->dev) and node is set via pcibios_add_bus() MIPS right now has no common struct, which is reachable via bus->sysdata, if CONFIG_PCI_DRIVERS_LEGACY is not selected (and I want to get away with that option). So I liked the arm64 way, but I didn't want to implement pcibios_add_bus just for SGI-IP27 and noticed, that pcibios_add_bus is called for child and root bus, while add_bus method only for child buses. So my patch gives add_bus the same power as pcibios_add_bus already have. Is this good enough as argument ? > I haven't researched the details of how other platforms do it, but if > it would be possible for pci-xtalk to do it the same way, that would > be ideal. there is always a different way of course. If you don't like my patch I'll find one ;-) Thomas. -- Crap can work. Given enough thrust pigs will fly, but it's not necessarily a good idea. [ RFC1925, 2.3 ]