aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/kernel/amd_iommu_init.c
diff options
context:
space:
mode:
authorJoerg Roedel <joerg.roedel@amd.com>2009-12-10 11:03:39 +0100
committerJoerg Roedel <joerg.roedel@amd.com>2009-12-10 12:21:31 +0100
commitb7cc9554bc73641c9ed4d7eb74b2d6e78f20abea (patch)
tree42a90d0bcef2932b3aca414bf6620fb13685e9b7 /arch/x86/kernel/amd_iommu_init.c
parentx86, Calgary IOMMU quirk: Find nearest matching Calgary while walking up the PCI tree (diff)
downloadlinux-dev-b7cc9554bc73641c9ed4d7eb74b2d6e78f20abea.tar.xz
linux-dev-b7cc9554bc73641c9ed4d7eb74b2d6e78f20abea.zip
x86/amd-iommu: Fix passthrough mode
The data structure changes to use dev->archdata.iommu field broke the iommu=pt mode because in this case the dev->archdata.iommu was left uninitialized. This moves the inititalization of the devices into the main init function and fixes the problem. Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
Diffstat (limited to 'arch/x86/kernel/amd_iommu_init.c')
-rw-r--r--arch/x86/kernel/amd_iommu_init.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/arch/x86/kernel/amd_iommu_init.c b/arch/x86/kernel/amd_iommu_init.c
index 7ffc39965233..df01c691d130 100644
--- a/arch/x86/kernel/amd_iommu_init.c
+++ b/arch/x86/kernel/amd_iommu_init.c
@@ -1274,6 +1274,10 @@ static int __init amd_iommu_init(void)
if (ret)
goto free;
+ ret = amd_iommu_init_devices();
+ if (ret)
+ goto free;
+
if (iommu_pass_through)
ret = amd_iommu_init_passthrough();
else
@@ -1296,6 +1300,9 @@ out:
return ret;
free:
+
+ amd_iommu_uninit_devices();
+
free_pages((unsigned long)amd_iommu_pd_alloc_bitmap,
get_order(MAX_DOMAIN_ID/8));