aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/kernel/amd_iommu_init.c
diff options
context:
space:
mode:
authorJoerg Roedel <joerg.roedel@amd.com>2009-05-12 03:56:12 -0400
committerJoerg Roedel <joerg.roedel@amd.com>2009-05-28 12:11:39 -0400
commit736501ee000757082a4f0832826ae1eda7ea106e (patch)
tree246daf98fc43b266b49c834743c239414b74f9f5 /arch/x86/kernel/amd_iommu_init.c
parent05f92db9f47f852ff48bbed1b063b8ab8ad00285 (diff)
amd-iommu: implement suspend/resume
This patch puts everything together and enables suspend/resume support in the AMD IOMMU driver. 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.c21
1 files changed, 20 insertions, 1 deletions
diff --git a/arch/x86/kernel/amd_iommu_init.c b/arch/x86/kernel/amd_iommu_init.c
index 330896ba6a9f..4ca8fbfb68dc 100644
--- a/arch/x86/kernel/amd_iommu_init.c
+++ b/arch/x86/kernel/amd_iommu_init.c
@@ -965,12 +965,31 @@ static void disable_iommus(void)
965 965
966static int amd_iommu_resume(struct sys_device *dev) 966static int amd_iommu_resume(struct sys_device *dev)
967{ 967{
968 /*
969 * Disable IOMMUs before reprogramming the hardware registers.
970 * IOMMU is still enabled from the resume kernel.
971 */
972 disable_iommus();
973
974 /* re-load the hardware */
975 enable_iommus();
976
977 /*
978 * we have to flush after the IOMMUs are enabled because a
979 * disabled IOMMU will never execute the commands we send
980 */
981 amd_iommu_flush_all_domains();
982 amd_iommu_flush_all_devices();
983
968 return 0; 984 return 0;
969} 985}
970 986
971static int amd_iommu_suspend(struct sys_device *dev, pm_message_t state) 987static int amd_iommu_suspend(struct sys_device *dev, pm_message_t state)
972{ 988{
973 return -EINVAL; 989 /* disable IOMMUs to go out of the way for BIOS */
990 disable_iommus();
991
992 return 0;
974} 993}
975 994
976static struct sysdev_class amd_iommu_sysdev_class = { 995static struct sysdev_class amd_iommu_sysdev_class = {