From: Benjamin Herrenschmidt <benh@kernel.crashing.org>
To: Christoph Hellwig <hch@infradead.org>
Cc: Bjorn Helgaas <helgaas@kernel.org>,
linux-pci@vger.kernel.org, linux-arch@vger.kernel.org
Subject: Re: Archs using generic PCI controller drivers vs. resource policy
Date: Mon, 24 Jun 2019 21:11:04 +1000 [thread overview]
Message-ID: <41b68d14c2805da16e8b563236232c22e9203ec0.camel@kernel.crashing.org> (raw)
In-Reply-To: <20190624110206.GA6541@infradead.org>
On Mon, 2019-06-24 at 04:02 -0700, Christoph Hellwig wrote:
> On Sun, Jun 23, 2019 at 10:30:42AM +1000, Benjamin Herrenschmidt wrote:
> > This is wrong. I want to move it to the architecture (initially,
> > eventually it should be platform driven, but the default will start
> > with architecture specific to avoid changing the existing behaviours
> > while consolidating the code).
>
> Doing this per arch sounds fundamentally wrong. At best per firmware
> type, but hopefully firmware messing with PCIe setup is slowly going
> away, at least outside of x86.
No it's actually the other way around. UEFI/ACPI is growing outside of
x86 and it *is* essing with PCIe in ways we need to deal with better
(it's somewhat broken on arm64 today).
That said, the policy doesn't belong in the host bridge driver. It's
platform (or firmware) driven. At the moment, those platform/firmware
type decisions are done in the architecture. This can change, but I
won't change everything in one day.
Keep in mind that what I'm doing is a clean up keeping existing
behaviours as much as possible. Once we don't have 36 different ways of
doing the same thing, we can look at whether we want to change the
actual policies for some platforms/firmware/arch combinations.
Today, it's a practical fact that the resource allocation policy is
driven by the arch/platform code.
The fact that some host bridge drivers in drivers/pci/controller
effectively implement a resource allocation policy by diretly calling
stuff they shouldn't be calling is what I'm trying to fix.
So I just want to make the arch (today) set a default policy and have
the controller drivers call a generic function that performs the
resource management according to said policy.
> > To do that right, I want to understand which archs can potentially use
> > the code in drivers/pci/controller today so I can change those archs to
> > explicitely set the default to "reassign everything" (and take the
> > policy out of the drivers themselves).
> >
> > So far I've counted arm, arm64 (DT, not ACPI) and nios2. Any other ?
>
> riscv at least and probably anything that can be synthesized to common
> FPGAs with PCIe support.
Ok. I'll set riscv default policy to reassign all like arm and arm64
for now.
Cheers,
Ben.
next prev parent reply other threads:[~2019-06-24 11:11 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-06-23 0:30 Archs using generic PCI controller drivers vs. resource policy Benjamin Herrenschmidt
2019-06-23 23:49 ` Benjamin Herrenschmidt
2019-06-24 11:02 ` Christoph Hellwig
2019-06-24 11:11 ` Benjamin Herrenschmidt [this message]
2019-07-02 13:24 ` Greg Ungerer
2019-07-02 14:17 ` Benjamin Herrenschmidt
2019-07-02 20:19 ` Bjorn Helgaas
2019-07-03 0:16 ` Benjamin Herrenschmidt
2019-07-03 3:08 ` Bjorn Helgaas
2019-07-03 5:31 ` Benjamin Herrenschmidt
2019-07-03 13:17 ` 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=41b68d14c2805da16e8b563236232c22e9203ec0.camel@kernel.crashing.org \
--to=benh@kernel.crashing.org \
--cc=hch@infradead.org \
--cc=helgaas@kernel.org \
--cc=linux-arch@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox