summaryrefslogtreecommitdiffstats
path: root/arch/x86
diff options
context:
space:
mode:
authorJoerg Roedel <joerg.roedel@amd.com>2010-01-22 17:55:27 +0100
committerJoerg Roedel <joerg.roedel@amd.com>2010-01-22 17:56:49 +0100
commitd3ad9373b7c29b63d5e8460a69453718d200cc3b (patch)
treeef3ed00e69808277cbdcce68928525458eaaebdb /arch/x86
parentx86/amd-iommu: Fix IOMMU-API initialization for iommu=pt (diff)
downloadlinux-d3ad9373b7c29b63d5e8460a69453718d200cc3b.tar.xz
linux-d3ad9373b7c29b63d5e8460a69453718d200cc3b.zip
x86/amd-iommu: Fix deassignment of a device from the pt_domain
Deassigning a device from the passthrough domain does not work and breaks device assignment to kvm guests. This patch fixes the issue. Cc: stable@kernel.org Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
Diffstat (limited to 'arch/x86')
-rw-r--r--arch/x86/kernel/amd_iommu.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/arch/x86/kernel/amd_iommu.c b/arch/x86/kernel/amd_iommu.c
index 751ce73c6e1b..adb0ba025702 100644
--- a/arch/x86/kernel/amd_iommu.c
+++ b/arch/x86/kernel/amd_iommu.c
@@ -1511,9 +1511,11 @@ static void __detach_device(struct device *dev)
/*
* If we run in passthrough mode the device must be assigned to the
- * passthrough domain if it is detached from any other domain
+ * passthrough domain if it is detached from any other domain.
+ * Make sure we can deassign from the pt_domain itself.
*/
- if (iommu_pass_through && dev_data->domain == NULL)
+ if (iommu_pass_through &&
+ (dev_data->domain == NULL && domain != pt_domain))
__attach_device(dev, pt_domain);
}