@@ -493,3 +493,32 @@ static void __devinit pci_siemens_interrupt_controller(struct pci_dev *dev)
}
DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_SIEMENS, 0x0015,
pci_siemens_interrupt_controller);
+
+#ifdef CONFIG_PCI_MMCONFIG
+/*
+ * Ignore any MMCONFIG BARs. These can't be reassigned because MMCONFIG code
+ * has already discovered them, and they often conflict with other devices.
+ */
+static void quirk_ignore_mmconfig_bar(struct pci_dev *dev)
+{
+ struct pci_mmcfg_region *cfg;
+ int i;
+
+ list_for_each_entry(cfg, &pci_mmcfg_list, list) {
+ for (i = 0; i < 6; i++) {
+ struct resource *res = &dev->resource[i];
+
+ if (resource_type(res) == IORESOURCE_MEM &&
+ res->start < cfg->res.end &&
+ res->end > cfg->res.start) {
+ dev_info(&dev->dev, "BAR %d: %pR overlaps domain %04x [bus %02x-%02x] MMCONFIG region %pR; ignoring this BAR\n",
+ i, res, cfg->segment, cfg->start_bus,
+ cfg->end_bus, &cfg->res);
+ res->flags = 0;
+ res->start = 0;
+ }
+ }
+ }
+}
+DECLARE_PCI_FIXUP_HEADER(PCI_ANY_ID, PCI_ANY_ID, quirk_ignore_mmconfig_bar);
+#endif