public inbox for linux-pci@vger.kernel.org
 help / color / mirror / Atom feed
From: "Koenig, Christian" <Christian.Koenig@amd.com>
To: Benjamin Herrenschmidt <benh@kernel.crashing.org>
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 09:42:09 +0000	[thread overview]
Message-ID: <0680ee65-5960-18b8-d7a2-eb87ec2056ef@amd.com> (raw)
In-Reply-To: <b873931988c7e6ccf61010e8ad03cf2d7f3e4b09.camel@kernel.crashing.org>

Am 24.06.19 um 11:15 schrieb Benjamin Herrenschmidt:
> On Mon, 2019-06-24 at 09:08 +0000, Koenig, Christian wrote:
>> Yeah, can't agree more :) It was one of the main challenges implementing
>> the resizing support.
>>
>> If you want to clean this up feel free to CC me and I can take a look as
>> well. But honestly I was scared of touching it when I worked on this,
>> because of all the little corner cases you have in PCI.
>>
>>> Question: Do you ever need to assign anything other than that one
>>> device though ? In my branch, I've added this typically for the case
>>> where a single device needs to be reassigned:
>>>
>>> +void pci_dev_assign_resources(struct pci_dev *dev)
>>> +{
>>> +	LIST_HEAD(head);
>>> +
>>> +	/* Assign non-fixed resources */
>>> +	__dev_sort_resources(dev, &head);
>>> +	__assign_resources_sorted(&head, NULL, NULL);
>>> +
>>> +	/* Assign fixed ones if any */
>>> +	pdev_assign_fixed_resources(dev);
>>> +}
>>> +EXPORT_SYMBOL(pci_dev_assign_resources);
>>>
>>> Would that work for you ?
>> That should work perfectly fine.
> Ok, Ill plumb it that way in my branch, I'll let you know when it's
> worth testing. BTW. Which GPUs typically are affected ? I'm pretty sure
> my old R9 290 isn't :-) But I was thinking of upgrading so...

Well in theory we have the functionality 10+ years now, but only 
activated it in all hardware versions recently.

Polaris and Vega should definitely have it, older hardware most likely not.

You can check the PCI capabilities and look for #15, if it's present 
then that should be supported.

Christian.

>
> Cheers,
> Ben.
>
>


  reply	other threads:[~2019-06-24  9:42 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
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 [this message]
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=0680ee65-5960-18b8-d7a2-eb87ec2056ef@amd.com \
    --to=christian.koenig@amd.com \
    --cc=Alexander.Deucher@amd.com \
    --cc=benh@kernel.crashing.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