All of lore.kernel.org
 help / color / mirror / Atom feed
From: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
To: Bjorn Helgaas <helgaas@kernel.org>
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
Date: Sat, 23 Feb 2019 12:04:32 +0100	[thread overview]
Message-ID: <20190223110432.GA8782@alpha.franken.de> (raw)
In-Reply-To: <20190221233708.GC219879@google.com>

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 <tbogendoerfer@suse.de>
> > ---
> >  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 ]

  reply	other threads:[~2019-02-23 11:45 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-02-19 15:57 [PATCH v2 00/10] MIPS: SGI-IP27 rework Thomas Bogendoerfer
2019-02-19 15:57 ` [PATCH v2 01/10] MIPS: SGI-IP27: get rid of volatile and hubreg_t Thomas Bogendoerfer
2019-02-25 19:08   ` Paul Burton
2019-02-19 15:57 ` [PATCH v2 02/10] MIPS: SGI-IP27: clean up bridge access and header files Thomas Bogendoerfer
2019-02-25 19:08   ` Paul Burton
2019-02-19 15:57 ` [PATCH v2 03/10] MIPS: SGI-IP27: use pr_info/pr_emerg and pr_cont to fix output Thomas Bogendoerfer
2019-02-25 19:08   ` Paul Burton
2019-02-19 15:57 ` [PATCH v2 04/10] MIPS: SGI-IP27: do xtalk scanning later Thomas Bogendoerfer
2019-02-25 19:08   ` Paul Burton
2019-02-19 15:57 ` [PATCH v2 05/10] MIPS: SGI-IP27: do boot CPU init later Thomas Bogendoerfer
2019-02-25 19:08   ` Paul Burton
2019-02-19 15:57 ` [PATCH v2 06/10] MIPS: SGI-IP27: rework HUB interrupts Thomas Bogendoerfer
2019-02-25 19:08   ` Paul Burton
2019-02-19 15:57 ` [PATCH v2 07/10] PCI: call add_bus method also for root bus Thomas Bogendoerfer
2019-02-21 23:37   ` Bjorn Helgaas
2019-02-23 11:04     ` Thomas Bogendoerfer [this message]
2019-02-28 13:03     ` Thomas Bogendoerfer
2019-02-19 15:57 ` [PATCH v2 08/10] MIPS: SGI-IP27: use generic PCI driver Thomas Bogendoerfer
2019-02-22 14:46   ` Christoph Hellwig
2019-02-27 17:10     ` Thomas Bogendoerfer
2019-02-19 15:57 ` [PATCH v2 09/10] genirq/irqdomain: fall back to default domain when creating hierarchy domain Thomas Bogendoerfer
2019-02-19 16:27   ` Marc Zyngier
2019-02-19 16:48     ` Thomas Bogendoerfer
2019-02-20  9:15       ` Marc Zyngier
2019-02-20 15:00         ` Thomas Bogendoerfer
2019-02-20 15:07           ` Marc Zyngier
2019-02-19 15:57 ` [PATCH v2 10/10] MIPS: SGI-IP27: abstract chipset irq from bridge Thomas Bogendoerfer
2019-02-21 20:50 ` [PATCH v2 00/10] MIPS: SGI-IP27 rework Paul Burton
2019-02-22  8:14   ` Thomas Bogendoerfer
2019-02-22 14:49     ` Christoph Hellwig
2019-02-25 19:17     ` Paul Burton

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190223110432.GA8782@alpha.franken.de \
    --to=tsbogend@alpha.franken.de \
    --cc=helgaas@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pci@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.