** Also affects: linux (Ubuntu)
   Importance: Undecided
       Status: New

** Changed in: canonical-kernel-snaps
       Status: New => Invalid

-- 
You received this bug notification because you are a member of Kernel
Packages, which is subscribed to linux in Ubuntu.
https://bugs.launchpad.net/bugs/2122060

Title:
  Please backport 1a596ad00ffe9b37fc60a93cbdd4daead3bf95f3 to 6.8, 6.11
  kernels

Status in canonical-kernel-snaps:
  Invalid
Status in linux package in Ubuntu:
  New

Bug description:
  Please backport 1a596ad00ffe9b37fc60a93cbdd4daead3bf95f3 to your 6.8 and 6.11 
kernels.
  This is generic.
  The problem manifested on hardware that was a PCIe bridge that also had a 
endpoint (a management interface BAR).
  It has impacted customers using yourv6.8 kernel.

  
  author        Kai-Heng Feng <[email protected]>     2024-12-04 10:24:57 
+0800
  committer     Bjorn Helgaas <[email protected]>     2025-02-18 14:46:55 
-0600
  commit        1a596ad00ffe9b37fc60a93cbdd4daead3bf95f3 (patch)
  tree  4483304ec3fc0135852eb91f0b9e57fc7bf48063
  parent        addb30c5bd2755770e617e68bdcc0bf2a21770fa (diff)
  download      linux-1a596ad00ffe9b37fc60a93cbdd4daead3bf95f3.tar.gz
  PCI: Use downstream bridges for distributing resources
  7180c1d08639 ("PCI: Distribute available resources for root buses, too")
  breaks BAR assignment on some devices:

    pci 0006:03:00.0: BAR 0 [mem 0x6300c0000000-0x6300c1ffffff 64bit pref]: 
assigned
    pci 0006:03:00.1: BAR 0 [mem 0x6300c2000000-0x6300c3ffffff 64bit pref]: 
assigned
    pci 0006:03:00.2: BAR 0 [mem size 0x00800000 64bit pref]: can't assign; no 
space
    pci 0006:03:00.0: VF BAR 0 [mem size 0x02000000 64bit pref]: can't assign; 
no space
    pci 0006:03:00.1: VF BAR 0 [mem size 0x02000000 64bit pref]: can't assign; 
no space

  The apertures of domain 0006 before 7180c1d08639:

    6300c0000000-63ffffffffff : PCI Bus 0006:00
      6300c0000000-6300c9ffffff : PCI Bus 0006:01
        6300c0000000-6300c9ffffff : PCI Bus 0006:02        # 160MB
          6300c0000000-6300c8ffffff : PCI Bus 0006:03      #   144MB
            6300c0000000-6300c1ffffff : 0006:03:00.0       #     32MB
            6300c2000000-6300c3ffffff : 0006:03:00.1       #     32MB
            6300c4000000-6300c47fffff : 0006:03:00.2       #      8MB
            6300c4800000-6300c67fffff : 0006:03:00.0       #     32MB
            6300c6800000-6300c87fffff : 0006:03:00.1       #     32MB
          6300c9000000-6300c9bfffff : PCI Bus 0006:04      #    12MB
            6300c9000000-6300c9bfffff : PCI Bus 0006:05    #    12MB
              6300c9000000-6300c91fffff : PCI Bus 0006:06  #      2MB
              6300c9200000-6300c93fffff : PCI Bus 0006:07  #      2MB
              6300c9400000-6300c95fffff : PCI Bus 0006:08  #      2MB
              6300c9600000-6300c97fffff : PCI Bus 0006:09  #      2MB

  After 7180c1d08639:

    6300c0000000-63ffffffffff : PCI Bus 0006:00
      6300c0000000-6300c9ffffff : PCI Bus 0006:01
        6300c0000000-6300c9ffffff : PCI Bus 0006:02        # 160MB
          6300c0000000-6300c43fffff : PCI Bus 0006:03      #    68MB
            6300c0000000-6300c1ffffff : 0006:03:00.0       #      32MB
            6300c2000000-6300c3ffffff : 0006:03:00.1       #      32MB
                --- no space ---      : 0006:03:00.2       #       8MB
                --- no space ---      : 0006:03:00.0       #      32MB
                --- no space ---      : 0006:03:00.1       #      32MB
          6300c4400000-6300c4dfffff : PCI Bus 0006:04      #    10MB
            6300c4400000-6300c4dfffff : PCI Bus 0006:05    #      10MB
              6300c4400000-6300c45fffff : PCI Bus 0006:06  #        2MB
              6300c4600000-6300c47fffff : PCI Bus 0006:07  #        2MB
              6300c4800000-6300c49fffff : PCI Bus 0006:08  #        2MB
              6300c4a00000-6300c4bfffff : PCI Bus 0006:09  #        2MB

  We can see that the window to 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 bridge, hence makes the aperture smaller than
  desired because calculation of io_per_b, mmio_per_b and mmio_pref_per_b
  becomes incorrect.

  Instead, distribute downstream bridges' own resources to resolve the
  issue.

  Link: https://lore.kernel.org/r/[email protected]
  Fixes: 7180c1d08639 ("PCI: Distribute available resources for root buses, 
too")
  Link: https://bugzilla.kernel.org/show_bug.cgi?id=219540
  Signed-off-by: Kai-Heng Feng <[email protected]>
  Signed-off-by: Bjorn Helgaas <[email protected]>
  Tested-by: Chia-Lin Kao (AceLan) <[email protected]>
  Reviewed-by: Mika Westerberg <[email protected]>
  Cc: Carol Soto <[email protected]>
  Cc: Jonathan Cameron <[email protected]>
  Cc: Chris Chiu <[email protected]>
  Diffstat
  -rw-r--r--    drivers/pci/setup-bus.c 3       
  1 files changed, 1 insertions, 2 deletions
  diff --git a/drivers/pci/setup-bus.c b/drivers/pci/setup-bus.c
  index 5e00cecf1f1af3..3d876d493faf2d 100644
  --- a/drivers/pci/setup-bus.c
  +++ b/drivers/pci/setup-bus.c
  @@ -2102,8 +2102,7 @@ pci_root_bus_distribute_available_resources(struct 
pci_bus *bus,
                 * in case of root bus.
                 */
                if (bridge && pci_bridge_resources_not_assigned(dev))
  -                     pci_bridge_distribute_available_resources(bridge,
  -                                                               add_list);
  +                     pci_bridge_distribute_available_resources(dev, 
add_list);
                else
                        pci_root_bus_distribute_available_resources(b, 
add_list);
        }

To manage notifications about this bug go to:
https://bugs.launchpad.net/canonical-kernel-snaps/+bug/2122060/+subscriptions


-- 
Mailing list: https://launchpad.net/~kernel-packages
Post to     : [email protected]
Unsubscribe : https://launchpad.net/~kernel-packages
More help   : https://help.launchpad.net/ListHelp

Reply via email to