diff options
author | Joerg Roedel <joerg.roedel@amd.com> | 2009-05-19 13:06:27 -0400 |
---|---|---|
committer | Joerg Roedel <joerg.roedel@amd.com> | 2009-05-28 12:09:26 -0400 |
commit | 92ac4320af6ed4294c2c221dd4ccbfd9026a3aa7 (patch) | |
tree | dc77e4dfbac57240dadf05dc5b1589d511bce80a /arch/x86/kernel/amd_iommu_init.c | |
parent | d91cecdd796c27df46339e80ed436a980c56fcad (diff) |
amd-iommu: add function to disable all iommus
This function is required for suspend/resume support with AMD IOMMU
enabled.
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 | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/arch/x86/kernel/amd_iommu_init.c b/arch/x86/kernel/amd_iommu_init.c index feee475e626..ed10c0f5ff7 100644 --- a/arch/x86/kernel/amd_iommu_init.c +++ b/arch/x86/kernel/amd_iommu_init.c | |||
@@ -252,6 +252,11 @@ static void __init iommu_enable(struct amd_iommu *iommu) | |||
252 | iommu_feature_enable(iommu, CONTROL_IOMMU_EN); | 252 | iommu_feature_enable(iommu, CONTROL_IOMMU_EN); |
253 | } | 253 | } |
254 | 254 | ||
255 | static void iommu_disable(struct amd_iommu *iommu) | ||
256 | { | ||
257 | iommu_feature_disable(iommu, CONTROL_IOMMU_EN); | ||
258 | } | ||
259 | |||
255 | /* | 260 | /* |
256 | * mapping and unmapping functions for the IOMMU MMIO space. Each AMD IOMMU in | 261 | * mapping and unmapping functions for the IOMMU MMIO space. Each AMD IOMMU in |
257 | * the system has one. | 262 | * the system has one. |
@@ -945,6 +950,14 @@ static void __init enable_iommus(void) | |||
945 | } | 950 | } |
946 | } | 951 | } |
947 | 952 | ||
953 | static void disable_iommus(void) | ||
954 | { | ||
955 | struct amd_iommu *iommu; | ||
956 | |||
957 | for_each_iommu(iommu) | ||
958 | iommu_disable(iommu); | ||
959 | } | ||
960 | |||
948 | /* | 961 | /* |
949 | * Suspend/Resume support | 962 | * Suspend/Resume support |
950 | * disable suspend until real resume implemented | 963 | * disable suspend until real resume implemented |