public inbox for linux-tegra@vger.kernel.org
 help / color / mirror / Atom feed
From: Arnd Bergmann <arnd@arndb.de>
To: Liviu Dudau <liviu.dudau@arm.com>
Cc: Thierry Reding <thierry.reding@gmail.com>,
	Bjorn Helgaas <bhelgaas@google.com>,
	Tomasz Nowicki <tn@semihalf.com>,
	linux-pci@vger.kernel.org, linux-tegra@vger.kernel.org
Subject: Re: [PATCH v2 1/2] PCI: Add new method for registering PCI hosts
Date: Fri, 01 Jul 2016 18:30:24 +0200	[thread overview]
Message-ID: <3872522.jdXcQClxV5@wuerfel> (raw)
In-Reply-To: <20160701160923.GF8609@e106497-lin.cambridge.arm.com>

On Friday, July 1, 2016 5:09:23 PM CEST Liviu Dudau wrote:
> > > > 
> > > > The main idea is to pull the allocation of 'struct pci_host_bridge' out
> > > > of the registration, and let individual host drivers and architecture
> > > > code fill the members before calling the registration function.
> > > 
> > > That's how we got into the arch/arm mess that we currently have. The host driver
> > > should not drive the instantiation of the pci_host_bridge structure because it
> > > will prevent you from having two drivers running at the same time.
> > 
> > Can you clarify that? I don't see what prevents two drivers from each
> > creating a pci_host_bridge structure and passing it into
> > pci_host_bridge_register().
> 
> Maybe I'm exagerating a bit, but I always disliked the pci_common_init() function and
> the way it is creating a pci_host_bridge while relying on hw_pci hooks to get
> things ready. I'm pretty sure there are still issues around the fact that a lot of
> platform drivers have a subsys_initcall() function that calls pci_common_init(). I
> don't want us to go down that path again.

I see what you mean now, and I agree we don't want to do this like
pci_common_init(), but the patch here does a number of things very
differently:

- it's not architecture specific
- it is not tied into architecture specific pcibios_* functions
- it does not create multiple bridges at once
- it does not have three levels of callbacks going back and forth,
  the idea is to eventually end up with one structure for the
  callback pointers including those that today are done as __weak
  functions.

Today we only have four callers of pci_common_init_dev that probe the
PCI host from DT: cns3xxx, versatile, mvebu and rcar-gen2. I hope
we can replace all of them with the new method here directly and
not take any intermediate steps.

The users of pci_common_init() (not _dev) are limited to board files
on really old platforms that are either not getting updated (ixp, iop,
footbridge, ks8695, mv78xx0, sa1100) or that have DT based replacement
code coming (dove, orion5x, cns3xxx, integrator).

> Don't get me wrong, clearly someone needs to create an instance of pci_host_bridge.
> What I want people to accept is that in the PCI(e) architecture there is nothing that
> stops a piece of HW that used to be the bridge between host and underlying bus into
> becoming the bridge between a higher PCI(e) bus and the bus underneath. If the writes
> to the configuration registers happens somehow, the Host Bridge doesn't even know if
> it is talking to the actual host. Can the driver in that case make sure it did not made
> assumptions that were tied to a specific SoC implementation?

Sorry, I'm not really following what you mean with that, or what the
consequence is for the Linux implementation. Can you try to rephrase this?

	Arnd

  reply	other threads:[~2016-07-01 16:30 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-06-30 15:19 [PATCH v2 1/2] PCI: Add new method for registering PCI hosts Thierry Reding
2016-06-30 15:19 ` [PATCH v2 2/2] PCI: tegra: Use new pci_register_host() interface Thierry Reding
     [not found] ` <20160630151931.29216-1-thierry.reding-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2016-06-30 15:37   ` [PATCH v2 1/2] PCI: Add new method for registering PCI hosts Arnd Bergmann
2016-07-01 14:14     ` Liviu Dudau
     [not found]       ` <20160701141447.GB8609-2JSQmVVBSi7ZROr8t4l/smS4ubULX0JqMm0uRHvK7Nw@public.gmane.org>
2016-07-01 14:24         ` Arnd Bergmann
2016-07-01 14:52           ` Liviu Dudau
     [not found]             ` <20160701145244.GD8609-2JSQmVVBSi7ZROr8t4l/smS4ubULX0JqMm0uRHvK7Nw@public.gmane.org>
2016-07-01 15:17               ` Arnd Bergmann
2016-07-01 15:40                 ` Liviu Dudau
     [not found]                   ` <20160701154046.GE8609-2JSQmVVBSi7ZROr8t4l/smS4ubULX0JqMm0uRHvK7Nw@public.gmane.org>
2016-07-01 15:58                     ` Arnd Bergmann
2016-07-01 14:46   ` Liviu Dudau
     [not found]     ` <20160701144648.GC8609-2JSQmVVBSi7ZROr8t4l/smS4ubULX0JqMm0uRHvK7Nw@public.gmane.org>
2016-07-01 15:44       ` Arnd Bergmann
2016-07-01 16:09         ` Liviu Dudau
2016-07-01 16:30           ` Arnd Bergmann [this message]
2016-07-04  9:56             ` Liviu Dudau
2016-07-04 13:46               ` Arnd Bergmann
2016-07-28 20:43   ` Bjorn Helgaas

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=3872522.jdXcQClxV5@wuerfel \
    --to=arnd@arndb.de \
    --cc=bhelgaas@google.com \
    --cc=linux-pci@vger.kernel.org \
    --cc=linux-tegra@vger.kernel.org \
    --cc=liviu.dudau@arm.com \
    --cc=thierry.reding@gmail.com \
    --cc=tn@semihalf.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox