Bug 219540

Summary: [Bisected] [Regression] "PCI: Distribute available resources for root buses, too"
Product: Drivers Reporter: Kai-Heng Feng (kaihengf)
Component: PCIAssignee: drivers_pci (drivers_pci)
Status: NEW ---    
Severity: normal CC: mika.westerberg
Priority: P3    
Hardware: All   
OS: Linux   
Kernel Version: Subsystem:
Regression: No Bisected commit-id:
Attachments: dmesg
dmesg, commit reverted
lspci
lspci, commit reverted
iomem
iomem, commit reverted

Description Kai-Heng Feng 2024-11-28 08:33:32 UTC
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
Comment 1 Kai-Heng Feng 2024-11-28 08:34:15 UTC
Created attachment 307294 [details]
dmesg
Comment 2 Kai-Heng Feng 2024-11-28 08:34:52 UTC
Created attachment 307295 [details]
dmesg, commit reverted
Comment 3 Kai-Heng Feng 2024-11-28 08:35:35 UTC
Created attachment 307296 [details]
lspci
Comment 4 Kai-Heng Feng 2024-11-28 08:35:55 UTC
Created attachment 307297 [details]
lspci, commit reverted
Comment 5 Kai-Heng Feng 2024-11-28 08:36:20 UTC
Created attachment 307298 [details]
iomem
Comment 6 Kai-Heng Feng 2024-11-28 08:36:41 UTC
Created attachment 307299 [details]
iomem, commit reverted
Comment 7 Artem S. Tashkinov 2024-11-28 18:27:47 UTC
Mika,

Could you take a look please?

Looks like this is your patch.
Comment 8 Mika Westerberg 2024-11-29 07:24:31 UTC
There is already a patch from Kai-Heng:

https://lore.kernel.org/linux-pci/20241128084039.54972-1-kaihengf@nvidia.com/