Skip to content

Commit d739a09

Browse files
committed
PCI: Don't add disabled subtractive decode bus resources
For a subtractive decode bridge, we previously added and printed all resources of the primary bus, even if they were not valid. In the example below, the bridge 00:1c.3 has no windows enabled, so there are no valid resources on bus 02. But since 02:00.0 is subtractive decode bridge, we add and print all those invalid resources, which don't really make sense: pci 0000:00:1c.3: PCI bridge to [bus 02-03] pci 0000:02:00.0: PCI bridge to [bus 03] (subtractive decode) pci 0000:02:00.0: bridge window [??? 0x00000000 flags 0x0] (subtractive decode) Add and print the subtractively-decoded resources only if they are valid. There's an example in the dmesg log attached to the bugzilla below (but this patch doesn't fix the bug reported there). Link: https://bugzilla.kernel.org/show_bug.cgi?id=73141 Signed-off-by: Bjorn Helgaas <[email protected]>
1 parent 26370fc commit d739a09

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/pci/probe.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -475,7 +475,7 @@ void pci_read_bridge_bases(struct pci_bus *child)
475475

476476
if (dev->transparent) {
477477
pci_bus_for_each_resource(child->parent, res, i) {
478-
if (res) {
478+
if (res && res->flags) {
479479
pci_bus_add_resource(child, res,
480480
PCI_SUBTRACTIVE_DECODE);
481481
dev_printk(KERN_DEBUG, &dev->dev,

0 commit comments

Comments
 (0)