Skip to contentSkip to conversation

pci: dmar/intr_remapping/iov use physfn to search drhd

PATCH In review Yinghai Lu 2 participants 2 messages Aug 4, 2009 – Aug 10, 2009 PCI

lore
Share & tools
lore

Yinghai Lu

author
#0 lore raw

PATCH 1/1 pci: dmar/intr_remapping/iov use physfn to search drhd

when virtfn is used, we should use physfn to find correct drhd

---
 drivers/pci/dmar.c           |    5 +++++
 2 files changed, 12 insertions(+), 1 deletion(-)
drivers/pci/dmar.c +5 -0
Index: linux-2.6/drivers/pci/dmar.c
===================================================================
@@ -493,6 +493,11 @@ dmar_find_matched_drhd_unit(struct pci_d
 	struct dmar_drhd_unit *dmaru = NULL;
 	struct acpi_dmar_hardware_unit *drhd;
 
+#ifdef CONFIG_PCI_IOV
+	if (dev->is_virtfn)
+		dev = dev->physfn;
+#endif
+
 	list_for_each_entry(dmaru, &dmar_drhd_units, list) {
 		drhd = container_of(dmaru->hdr,
 				    struct acpi_dmar_hardware_unit,
#1 lore raw

For Dave.

Quoted 26 lines · On Tue, 04 Aug 2009 08:57:11 -0700 Yinghai Lu <[email protected]> wrote:

when virtfn is used, we should use physfn to find correct drhd

---
 drivers/pci/dmar.c           |    5 +++++
 2 files changed, 12 insertions(+), 1 deletion(-)

Index: linux-2.6/drivers/pci/dmar.c
===================================================================

drivers/pci/dmar.c +5 -0
@@ -493,6 +493,11 @@ dmar_find_matched_drhd_unit(struct pci_d
 	struct dmar_drhd_unit *dmaru = NULL;
 	struct acpi_dmar_hardware_unit *drhd;
 
+#ifdef CONFIG_PCI_IOV
+	if (dev->is_virtfn)
+		dev = dev->physfn;
+#endif
+
 	list_for_each_entry(dmaru, &dmar_drhd_units, list) {
 		drhd = container_of(dmaru->hdr,
 				    struct acpi_dmar_hardware_unit,
Signature · 1 line
Jesse Barnes, Intel Open Source Technology Center