diff options
author | Joerg Roedel <joerg.roedel@amd.com> | 2009-12-10 05:03:39 -0500 |
---|---|---|
committer | Joerg Roedel <joerg.roedel@amd.com> | 2009-12-10 06:21:31 -0500 |
commit | b7cc9554bc73641c9ed4d7eb74b2d6e78f20abea (patch) | |
tree | 42a90d0bcef2932b3aca414bf6620fb13685e9b7 /arch/x86/kernel/amd_iommu_init.c | |
parent | 4528752f49c1f4025473d12bc5fa9181085c3f22 (diff) |
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.c | 7 |
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) | |||
1274 | if (ret) | 1274 | if (ret) |
1275 | goto free; | 1275 | goto free; |
1276 | 1276 | ||
1277 | ret = amd_iommu_init_devices(); | ||
1278 | if (ret) | ||
1279 | goto free; | ||
1280 | |||
1277 | if (iommu_pass_through) | 1281 | if (iommu_pass_through) |
1278 | ret = amd_iommu_init_passthrough(); | 1282 | ret = amd_iommu_init_passthrough(); |
1279 | else | 1283 | else |
@@ -1296,6 +1300,9 @@ out: | |||
1296 | return ret; | 1300 | return ret; |
1297 | 1301 | ||
1298 | free: | 1302 | free: |
1303 | |||
1304 | amd_iommu_uninit_devices(); | ||
1305 | |||
1299 | free_pages((unsigned long)amd_iommu_pd_alloc_bitmap, | 1306 | free_pages((unsigned long)amd_iommu_pd_alloc_bitmap, |
1300 | get_order(MAX_DOMAIN_ID/8)); | 1307 | get_order(MAX_DOMAIN_ID/8)); |
1301 | 1308 | ||