aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/kernel/amd_iommu_init.c
diff options
context:
space:
mode:
authorJoerg Roedel <joerg.roedel@amd.com>2008-06-30 14:18:02 -0400
committerIngo Molnar <mingo@elte.hu>2008-06-30 14:35:15 -0400
commit7441e9cb18a1a1e5b87f516fa97b6d4abb0838e3 (patch)
treeb462d1e48d16a805e01c0e93fe581e98f7da6cdc /arch/x86/kernel/amd_iommu_init.c
parent07c40e8a1acdb56fca485a6deeb252ebf19509a1 (diff)
x86, AMD IOMMU: disable suspend/resume with IOMMU enabled (for now)
This patch disables suspend/resume on machines with AMD IOMMU enabled. Real suspend/resume support for AMD IOMMU is currently being worked on. Until this is ready it will be disabled to avoid data corruption when the IOMMU is not properly re-enabled at resume. The patch is based on a similar patch for the GART driver written by Pavel Machek. The overall driver merged into tip/master is tested with parallel disk and network loads and showed no problems in a test running for 3 days. Signed-off-by: Joerg Roedel <joerg.roedel@amd.com> Cc: iommu@lists.linux-foundation.org Cc: bhavna.sarathy@amd.com Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'arch/x86/kernel/amd_iommu_init.c')
-rw-r--r--arch/x86/kernel/amd_iommu_init.c35
1 files changed, 35 insertions, 0 deletions
diff --git a/arch/x86/kernel/amd_iommu_init.c b/arch/x86/kernel/amd_iommu_init.c
index 6ab8128db1c..5d9e45c7cea 100644
--- a/arch/x86/kernel/amd_iommu_init.c
+++ b/arch/x86/kernel/amd_iommu_init.c
@@ -21,6 +21,7 @@
21#include <linux/acpi.h> 21#include <linux/acpi.h>
22#include <linux/gfp.h> 22#include <linux/gfp.h>
23#include <linux/list.h> 23#include <linux/list.h>
24#include <linux/sysdev.h>
24#include <asm/pci-direct.h> 25#include <asm/pci-direct.h>
25#include <asm/amd_iommu_types.h> 26#include <asm/amd_iommu_types.h>
26#include <asm/amd_iommu.h> 27#include <asm/amd_iommu.h>
@@ -654,6 +655,32 @@ static void __init enable_iommus(void)
654 } 655 }
655} 656}
656 657
658/*
659 * Suspend/Resume support
660 * disable suspend until real resume implemented
661 */
662
663static int amd_iommu_resume(struct sys_device *dev)
664{
665 return 0;
666}
667
668static int amd_iommu_suspend(struct sys_device *dev, pm_message_t state)
669{
670 return -EINVAL;
671}
672
673static struct sysdev_class amd_iommu_sysdev_class = {
674 .name = "amd_iommu",
675 .suspend = amd_iommu_suspend,
676 .resume = amd_iommu_resume,
677};
678
679static struct sys_device device_amd_iommu = {
680 .id = 0,
681 .cls = &amd_iommu_sysdev_class,
682};
683
657int __init amd_iommu_init(void) 684int __init amd_iommu_init(void)
658{ 685{
659 int i, ret = 0; 686 int i, ret = 0;
@@ -745,6 +772,14 @@ int __init amd_iommu_init(void)
745 if (ret) 772 if (ret)
746 goto free; 773 goto free;
747 774
775 ret = sysdev_class_register(&amd_iommu_sysdev_class);
776 if (ret)
777 goto free;
778
779 ret = sysdev_register(&device_amd_iommu);
780 if (ret)
781 goto free;
782
748 enable_iommus(); 783 enable_iommus();
749 784
750 printk(KERN_INFO "AMD IOMMU: aperture size is %d MB\n", 785 printk(KERN_INFO "AMD IOMMU: aperture size is %d MB\n",