Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

PCI: Mark invalid BARs as unassigned

If a BAR is not inside any upstream bridge window, or if it conflicts with
another resource, mark it as IORESOURCE_UNSET so we don't try to use it.
We may be able to assign a different address for it.

Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Acked-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>

+2
+2
drivers/pci/setup-res.c
··· 120 120 if (!root) { 121 121 dev_info(&dev->dev, "can't claim BAR %d %pR: no compatible bridge window\n", 122 122 resource, res); 123 + res->flags |= IORESOURCE_UNSET; 123 124 return -EINVAL; 124 125 } 125 126 ··· 128 127 if (conflict) { 129 128 dev_info(&dev->dev, "can't claim BAR %d %pR: address conflict with %s %pR\n", 130 129 resource, res, conflict->name, conflict); 130 + res->flags |= IORESOURCE_UNSET; 131 131 return -EBUSY; 132 132 } 133 133