[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20140510150253.2997.70728.stgit@bling.home>
Date: Sat, 10 May 2014 09:02:53 -0600
From: Alex Williamson <alex.williamson@...hat.com>
To: linux-pci@...r.kernel.org, iommu@...ts.linux-foundation.org
Cc: bhelgaas@...gle.com, acooks@...il.com,
linux-kernel@...r.kernel.org, linux@...izon.com
Subject: [PATCH v3 05/15] PCI: Quirk pci_for_each_dma_alias() for bridges
Several PCIe-to-PCI bridges fail to provide a PCIe capability, causing
us to handle them as conventional PCI devices. In some cases, this
may be correct, in others it's not. Add a dev_flag bit to identify
devices to be handled as standard PCIe-to-PCI bridges.
Signed-off-by: Alex Williamson <alex.williamson@...hat.com>
---
drivers/pci/search.c | 10 ++++++++--
include/linux/pci.h | 2 ++
2 files changed, 10 insertions(+), 2 deletions(-)
diff --git a/drivers/pci/search.c b/drivers/pci/search.c
index ad698b2..dab4561 100644
--- a/drivers/pci/search.c
+++ b/drivers/pci/search.c
@@ -98,8 +98,14 @@ int pci_for_each_dma_alias(struct pci_dev *pdev,
continue;
}
} else {
- ret = fn(tmp, PCI_DEVID(tmp->bus->number, tmp->devfn),
- data);
+ if (tmp->dev_flags & PCI_DEV_FLAG_PCIE_BRIDGE_ALIAS)
+ ret = fn(tmp,
+ PCI_DEVID(tmp->subordinate->number,
+ PCI_DEVFN(0, 0)), data);
+ else
+ ret = fn(tmp,
+ PCI_DEVID(tmp->bus->number,
+ tmp->devfn), data);
if (ret)
return ret;
}
diff --git a/include/linux/pci.h b/include/linux/pci.h
index b4c97d2..31d9a90 100644
--- a/include/linux/pci.h
+++ b/include/linux/pci.h
@@ -171,6 +171,8 @@ enum pci_dev_flags {
PCI_DEV_FLAGS_ASSIGNED = (__force pci_dev_flags_t) 4,
/* Flag for quirk use to store if quirk-specific ACS is enabled */
PCI_DEV_FLAGS_ACS_ENABLED_QUIRK = (__force pci_dev_flags_t) 8,
+ /* DMA alias the device as if it was a PCIe-to-PCI bridge */
+ PCI_DEV_FLAG_PCIE_BRIDGE_ALIAS = (__force pci_dev_flags_t) 16,
};
enum pci_irq_reroute_variant {
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists