All of lore.kernel.org
 help / color / mirror / Atom feed
From: Kai-Heng Feng <kaihengf@nvidia.com>
To: bhelgaas@google.com
Cc: Mika Westerberg <mika.westerberg@linux.intel.com>,
	linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org,
	Carol Soto <csoto@nvidia.com>,
	Jonathan Cameron <Jonathan.Cameron@huawei.com>,
	Chris Chiu <chris.chiu@canonical.com>,
	Chia-Lin Kao <acelan.kao@canonical.com>
Subject: Re: [PATCH v2] PCI: Use downstream bridges for distributing resources
Date: Wed, 18 Dec 2024 19:12:09 +0800	[thread overview]
Message-ID: <99a4ee84-e41d-472d-8935-8f2a2de837ec@nvidia.com> (raw)
In-Reply-To: <20241204054809.GD4955@black.fi.intel.com>

Hi Bjorn,

On 2024/12/4 1:48 PM, Mika Westerberg wrote:
> External email: Use caution opening links or attachments
> 
> 
> On Wed, Dec 04, 2024 at 10:24:57AM +0800, Kai-Heng Feng wrote:
>> Commit 7180c1d08639 ("PCI: Distribute available resources for root
>> buses, too") breaks BAR assignment on some devcies:
>> [   10.021193] pci 0006:03:00.0: BAR 0 [mem 0x6300c0000000-0x6300c1ffffff 64bit pref]: assigned
>> [   10.029880] pci 0006:03:00.1: BAR 0 [mem 0x6300c2000000-0x6300c3ffffff 64bit pref]: assigned
>> [   10.038561] pci 0006:03:00.2: BAR 0 [mem size 0x00800000 64bit pref]: can't assign; no space
>> [   10.047191] pci 0006:03:00.2: BAR 0 [mem size 0x00800000 64bit pref]: failed to assign
>> [   10.055285] pci 0006:03:00.0: VF BAR 0 [mem size 0x02000000 64bit pref]: can't assign; no space
>> [   10.064180] pci 0006:03:00.0: VF BAR 0 [mem size 0x02000000 64bit pref]: failed to assign
>> [   10.072543] pci 0006:03:00.1: VF BAR 0 [mem size 0x02000000 64bit pref]: can't assign; no space
>> [   10.081437] pci 0006:03:00.1: VF BAR 0 [mem size 0x02000000 64bit pref]: failed to assign
>>
>> The apertures of domain 0006 before the commit:
>> 6300c0000000-63ffffffffff : PCI Bus 0006:00
>>    6300c0000000-6300c9ffffff : PCI Bus 0006:01
>>      6300c0000000-6300c9ffffff : PCI Bus 0006:02
>>        6300c0000000-6300c8ffffff : PCI Bus 0006:03
>>          6300c0000000-6300c1ffffff : 0006:03:00.0
>>            6300c0000000-6300c1ffffff : mlx5_core
>>          6300c2000000-6300c3ffffff : 0006:03:00.1
>>            6300c2000000-6300c3ffffff : mlx5_core
>>          6300c4000000-6300c47fffff : 0006:03:00.2
>>          6300c4800000-6300c67fffff : 0006:03:00.0
>>          6300c6800000-6300c87fffff : 0006:03:00.1
>>        6300c9000000-6300c9bfffff : PCI Bus 0006:04
>>          6300c9000000-6300c9bfffff : PCI Bus 0006:05
>>            6300c9000000-6300c91fffff : PCI Bus 0006:06
>>            6300c9200000-6300c93fffff : PCI Bus 0006:07
>>            6300c9400000-6300c95fffff : PCI Bus 0006:08
>>            6300c9600000-6300c97fffff : PCI Bus 0006:09
>>
>> After the commit:
>> 6300c0000000-63ffffffffff : PCI Bus 0006:00
>>    6300c0000000-6300c9ffffff : PCI Bus 0006:01
>>      6300c0000000-6300c9ffffff : PCI Bus 0006:02
>>        6300c0000000-6300c43fffff : PCI Bus 0006:03
>>          6300c0000000-6300c1ffffff : 0006:03:00.0
>>            6300c0000000-6300c1ffffff : mlx5_core
>>          6300c2000000-6300c3ffffff : 0006:03:00.1
>>            6300c2000000-6300c3ffffff : mlx5_core
>>        6300c4400000-6300c4dfffff : PCI Bus 0006:04
>>          6300c4400000-6300c4dfffff : PCI Bus 0006:05
>>            6300c4400000-6300c45fffff : PCI Bus 0006:06
>>            6300c4600000-6300c47fffff : PCI Bus 0006:07
>>            6300c4800000-6300c49fffff : PCI Bus 0006:08
>>            6300c4a00000-6300c4bfffff : PCI Bus 0006:09
>>
>> We can see that the window of 0006:03 gets shrunken too much and 0006:04
>> eats away the window for 0006:03:00.2.
>>
>> The offending commit distributes the upstream bridge's resources
>> multiple times to every downstream bridges, hence makes the aperture
>> smaller than desired because calculation of io_per_b, mmio_per_b and
>> mmio_pref_per_b becomes incorrect.
>>
>> Instead, distributing downstream bridges' own resources to resolve the
>> issue.
>>
>> Link: https://bugzilla.kernel.org/show_bug.cgi?id=219540
>> Cc: Carol Soto <csoto@nvidia.com>
>> Cc: Jonathan Cameron <Jonathan.Cameron@huawei.com>
>> Cc: Chris Chiu <chris.chiu@canonical.com>
>> Cc: Mika Westerberg <mika.westerberg@linux.intel.com>
> 
> Reviewed-by: Mika Westerberg <mika.westerberg@linux.intel.com>

Is it possible to pickup this up in 6.13 window?

Kai-Heng

  reply	other threads:[~2024-12-18 11:12 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-12-04  2:24 [PATCH v2] PCI: Use downstream bridges for distributing resources Kai-Heng Feng
2024-12-04  5:48 ` Mika Westerberg
2024-12-18 11:12   ` Kai-Heng Feng [this message]
2025-01-20  6:39     ` Kai-Heng Feng
2025-02-13  5:08       ` Kai-Heng Feng
2025-02-13 21:21 ` 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=99a4ee84-e41d-472d-8935-8f2a2de837ec@nvidia.com \
    --to=kaihengf@nvidia.com \
    --cc=Jonathan.Cameron@huawei.com \
    --cc=acelan.kao@canonical.com \
    --cc=bhelgaas@google.com \
    --cc=chris.chiu@canonical.com \
    --cc=csoto@nvidia.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=mika.westerberg@linux.intel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.