linux-pci.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Benjamin Herrenschmidt <benh@kernel.crashing.org>
To: "Koenig, Christian" <Christian.Koenig@amd.com>
Cc: "Deucher, Alexander" <Alexander.Deucher@amd.com>,
	"linux-pci@vger.kernel.org" <linux-pci@vger.kernel.org>
Subject: Re: Question about call to pci_assign_unassigned_bus_resources in amdgpu
Date: Mon, 24 Jun 2019 18:56:42 +1000	[thread overview]
Message-ID: <5a259297eeca3484565faf3166b2e4019047b478.camel@kernel.crashing.org> (raw)
In-Reply-To: <ea9f770c373ad9c6a998edbd603972014e4b7fea.camel@kernel.crashing.org>

On Mon, 2019-06-24 at 18:47 +1000, Benjamin Herrenschmidt wrote:
> On Mon, 2019-06-24 at 08:42 +0000, Koenig, Christian wrote:
> > Then we resize the VRAM BAR by calling pci_resize_resource(). That in 
> > turn tries to resize and shuffle around the parent bridge resources 
> > using pci_reassign_bridge_resources().
> > 
> > But pci_reassign_bridge_resources() does not assign any device 
> > resources, it just tries to make sure the upstream bridges have enough 
> > space to fit everything in.

Hrm... are you sure of this ? Maybe it has changed... or I'm missing
something. Because right in the middle of it I see:


 	__pci_bus_size_bridges(bridge->subordinate, &added);
	__pci_bridge_assign_resources(bridge, &added, &failed);

Now the second of these will call __pci_bus_assign_resources() on the
bridge->subordinate, which will recursively assign all devices below
the bridge.

Or am I overlooking something ?

It could be that if it fails, then you need to restore your device
resources indeed... but the normal case should work from my reading of
the code.

Cheers,
Ben.


  reply	other threads:[~2019-06-24  8:56 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-06-24  4:27 Question about call to pci_assign_unassigned_bus_resources in amdgpu Benjamin Herrenschmidt
2019-06-24  8:42 ` Koenig, Christian
2019-06-24  8:47   ` Benjamin Herrenschmidt
2019-06-24  8:56     ` Benjamin Herrenschmidt [this message]
2019-06-24  9:10       ` Koenig, Christian
2019-06-24  9:08     ` Koenig, Christian
2019-06-24  9:15       ` Benjamin Herrenschmidt
2019-06-24  9:42         ` Koenig, Christian
2019-06-24 10:27           ` Benjamin Herrenschmidt

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=5a259297eeca3484565faf3166b2e4019047b478.camel@kernel.crashing.org \
    --to=benh@kernel.crashing.org \
    --cc=Alexander.Deucher@amd.com \
    --cc=Christian.Koenig@amd.com \
    --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;
as well as URLs for NNTP newsgroup(s).