From: Alexander Motin <mav@ixsystems.com>
To: Mika Westerberg <mika.westerberg@linux.intel.com>
Cc: Bjorn Helgaas <bhelgaas@google.com>,
Nicholas Johnson <nicholas.johnson-opensource@outlook.com.au>,
Nick Wolff <nwolff@ixsystems.com>,
Bjorn Helgaas <bjorn@helgaas.com>,
linux-pci@vger.kernel.org
Subject: Re: pci_bus_distribute_available_resources() is wrong?
Date: Tue, 13 Dec 2022 09:11:12 -0500 [thread overview]
Message-ID: <35208ffe-0aee-b055-0ed7-99b6414af6da@ixsystems.com> (raw)
In-Reply-To: <Y5gSfJd0H4rKXe9H@black.fi.intel.com>
On 13.12.2022 00:49, Mika Westerberg wrote:
> On Mon, Dec 12, 2022 at 04:10:16PM -0500, Alexander Motin wrote:
>> On 12.12.2022 15:32, Bjorn Helgaas wrote:
>>> On Mon, Dec 12, 2022 at 1:36 PM Alexander Motin <mav@ixsystems.com> wrote:
>>>> In my AMD NTB case PCI topology looks this way:
>>>>
>>>> +-[0000:80]-+-00.0
>>>> | +-01.1-[81-83]----00.0-[82-83]----00.0-[83]--+-00.0 Dummy
>>>> | | \-00.1 NTB
>>>>
>>>> 80:01.1 is the root bridge where the hot-plug happens. The 81:00.0
>>>> bridge in addition to memory windows has small 16KB BAR. But since it
>>>> is the only bridge on the bus, the function passes all available
>>>> resources down to its children. As result, that BAR fails to allocate.
>>>> And while that BAR seems not really needed, in some cases the
>>>> allocation error makes whole memory window to be disabled, that ends up
>>>> in NTB device driver attach failure.
>
> Just out of the curiosity, is this PCIe or PCI topology?
All PCIe: hot-plug root <-> upstream <-> downstream <-> two endpoints.
>>> Mika is working on what sounds like the same problem. His current
>>> patch series is at
>>> https://lore.kernel.org/linux-pci/20221130112221.66612-1-mika.westerberg@linux.intel.com/
>>>
>>> We would appreciate your comments and testing as that series is developed.
>>
>> Thank you, Bjorn. This definitely looks related, but as you've already
>> noted in your review there, present patch does not handle BARs of the bridge
>> itself, that I have in my case. I'd be happy to test the updated patch.
>> Please keep me in a loop.
>>
>> I also agree with your comment that the same should be done in case of
>> multiple bridges. I am generally not sure the cases of single bridge or not
>> having hot-plug on this level should be any specific.
>
> Yeah, I'm working on a new version of the patch series that should take
> these into consideration. The challenge is that the code has been used
> with the Thunderbolt/USB4 PCIe tunneling for some time already and we
> don't want to break that either.
>
> I'm also more than happy to test any patches regarding this if someone
> else wants to work on it ;-)
I was kind of ready to dive in, I hate hacks and tunables to workaround
bugs. But as I have told, I see this code first time, so my solutions
may appear not right. But I'll help as I can, if needed.
--
Alexander Motin
next prev parent reply other threads:[~2022-12-13 14:13 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <2ec11223-edb3-5f5c-62cd-3532d92de0a4@ixsystems.com>
[not found] ` <CAErSpo7WrAg5D4xyv0SycoDc1etSspU_TL6XMAK4STYrXDrGNQ@mail.gmail.com>
2022-12-12 21:10 ` pci_bus_distribute_available_resources() is wrong? Alexander Motin
2022-12-13 5:49 ` Mika Westerberg
2022-12-13 14:11 ` Alexander Motin [this message]
2022-12-13 14:48 ` Mika Westerberg
2022-12-13 15:00 ` Alexander Motin
2022-12-13 15:10 ` Mika Westerberg
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=35208ffe-0aee-b055-0ed7-99b6414af6da@ixsystems.com \
--to=mav@ixsystems.com \
--cc=bhelgaas@google.com \
--cc=bjorn@helgaas.com \
--cc=linux-pci@vger.kernel.org \
--cc=mika.westerberg@linux.intel.com \
--cc=nicholas.johnson-opensource@outlook.com.au \
--cc=nwolff@ixsystems.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