diff mbox

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

Message ID 4A785A57.8050505@kernel.org (mailing list archive)
State Not Applicable, archived
Headers show

Commit Message

Yinghai Lu Aug. 4, 2009, 3:57 p.m. UTC
when virtfn is used, we should use physfn to find correct drhd

Signed-off-by: Yinghai Lu <yinghai@kernel.org>

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

--
To unsubscribe from this list: send the line "unsubscribe linux-pci" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Comments

Jesse Barnes Aug. 10, 2009, 4:30 p.m. UTC | #1
For Dave.

On Tue, 04 Aug 2009 08:57:11 -0700
Yinghai Lu <yinghai@kernel.org> wrote:

> 
> when virtfn is used, we should use physfn to find correct drhd
> 
> Signed-off-by: Yinghai Lu <yinghai@kernel.org>
> 
> ---
>  drivers/pci/dmar.c           |    5 +++++
>  2 files changed, 12 insertions(+), 1 deletion(-)
> 
> Index: linux-2.6/drivers/pci/dmar.c
> ===================================================================
> --- linux-2.6.orig/drivers/pci/dmar.c
> +++ 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,
>
diff mbox

Patch

Index: linux-2.6/drivers/pci/dmar.c
===================================================================
--- linux-2.6.orig/drivers/pci/dmar.c
+++ 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,