diff options
author | Joerg Roedel <joerg.roedel@amd.com> | 2010-01-22 11:44:35 -0500 |
---|---|---|
committer | Joerg Roedel <joerg.roedel@amd.com> | 2010-01-22 11:44:35 -0500 |
commit | f5325094379158e6b876ea0010c807bf7890ec8f (patch) | |
tree | 54a40356a9076bddaac4186c1b97e2dbb98a5863 /arch/x86 | |
parent | 2ca762790caf822f7b61430fbaffa3ae4219977f (diff) |
x86/amd-iommu: Fix IOMMU-API initialization for iommu=pt
This patch moves the initialization of the iommu-api out of
the dma-ops initialization code. This ensures that the
iommu-api is initialized even with iommu=pt.
Cc: stable@kernel.org
Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
Diffstat (limited to 'arch/x86')
-rw-r--r-- | arch/x86/include/asm/amd_iommu_proto.h | 1 | ||||
-rw-r--r-- | arch/x86/kernel/amd_iommu.c | 8 | ||||
-rw-r--r-- | arch/x86/kernel/amd_iommu_init.c | 3 |
3 files changed, 10 insertions, 2 deletions
diff --git a/arch/x86/include/asm/amd_iommu_proto.h b/arch/x86/include/asm/amd_iommu_proto.h index 4d817f9e6e7..d2544f1d705 100644 --- a/arch/x86/include/asm/amd_iommu_proto.h +++ b/arch/x86/include/asm/amd_iommu_proto.h | |||
@@ -31,6 +31,7 @@ extern void amd_iommu_reset_cmd_buffer(struct amd_iommu *iommu); | |||
31 | extern int amd_iommu_init_devices(void); | 31 | extern int amd_iommu_init_devices(void); |
32 | extern void amd_iommu_uninit_devices(void); | 32 | extern void amd_iommu_uninit_devices(void); |
33 | extern void amd_iommu_init_notifier(void); | 33 | extern void amd_iommu_init_notifier(void); |
34 | extern void amd_iommu_init_api(void); | ||
34 | #ifndef CONFIG_AMD_IOMMU_STATS | 35 | #ifndef CONFIG_AMD_IOMMU_STATS |
35 | 36 | ||
36 | static inline void amd_iommu_stats_init(void) { } | 37 | static inline void amd_iommu_stats_init(void) { } |
diff --git a/arch/x86/kernel/amd_iommu.c b/arch/x86/kernel/amd_iommu.c index 4478a48198a..751ce73c6e1 100644 --- a/arch/x86/kernel/amd_iommu.c +++ b/arch/x86/kernel/amd_iommu.c | |||
@@ -2221,6 +2221,12 @@ static struct dma_map_ops amd_iommu_dma_ops = { | |||
2221 | /* | 2221 | /* |
2222 | * The function which clues the AMD IOMMU driver into dma_ops. | 2222 | * The function which clues the AMD IOMMU driver into dma_ops. |
2223 | */ | 2223 | */ |
2224 | |||
2225 | void __init amd_iommu_init_api(void) | ||
2226 | { | ||
2227 | register_iommu(&amd_iommu_ops); | ||
2228 | } | ||
2229 | |||
2224 | int __init amd_iommu_init_dma_ops(void) | 2230 | int __init amd_iommu_init_dma_ops(void) |
2225 | { | 2231 | { |
2226 | struct amd_iommu *iommu; | 2232 | struct amd_iommu *iommu; |
@@ -2256,8 +2262,6 @@ int __init amd_iommu_init_dma_ops(void) | |||
2256 | /* Make the driver finally visible to the drivers */ | 2262 | /* Make the driver finally visible to the drivers */ |
2257 | dma_ops = &amd_iommu_dma_ops; | 2263 | dma_ops = &amd_iommu_dma_ops; |
2258 | 2264 | ||
2259 | register_iommu(&amd_iommu_ops); | ||
2260 | |||
2261 | amd_iommu_stats_init(); | 2265 | amd_iommu_stats_init(); |
2262 | 2266 | ||
2263 | return 0; | 2267 | return 0; |
diff --git a/arch/x86/kernel/amd_iommu_init.c b/arch/x86/kernel/amd_iommu_init.c index fb490ce7dd5..9dc91b43147 100644 --- a/arch/x86/kernel/amd_iommu_init.c +++ b/arch/x86/kernel/amd_iommu_init.c | |||
@@ -1292,9 +1292,12 @@ static int __init amd_iommu_init(void) | |||
1292 | ret = amd_iommu_init_passthrough(); | 1292 | ret = amd_iommu_init_passthrough(); |
1293 | else | 1293 | else |
1294 | ret = amd_iommu_init_dma_ops(); | 1294 | ret = amd_iommu_init_dma_ops(); |
1295 | |||
1295 | if (ret) | 1296 | if (ret) |
1296 | goto free; | 1297 | goto free; |
1297 | 1298 | ||
1299 | amd_iommu_init_api(); | ||
1300 | |||
1298 | amd_iommu_init_notifier(); | 1301 | amd_iommu_init_notifier(); |
1299 | 1302 | ||
1300 | enable_iommus(); | 1303 | enable_iommus(); |