mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] AMD IOMMU: disable suspend/resume with IOMMU enabled (for now)
@ 2008-06-30 18:18 Joerg Roedel
  2008-06-30 18:35 ` Ingo Molnar
  0 siblings, 1 reply; 2+ messages in thread
From: Joerg Roedel @ 2008-06-30 18:18 UTC (permalink / raw)
  To: mingo, tglx; +Cc: linux-kernel, iommu, bhavna.sarathy, Joerg Roedel

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>
---
 arch/x86/kernel/amd_iommu_init.c |   35 +++++++++++++++++++++++++++++++++++
 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 6ab8128..5d9e45c 100644
--- a/arch/x86/kernel/amd_iommu_init.c
+++ b/arch/x86/kernel/amd_iommu_init.c
@@ -21,6 +21,7 @@
 #include <linux/acpi.h>
 #include <linux/gfp.h>
 #include <linux/list.h>
+#include <linux/sysdev.h>
 #include <asm/pci-direct.h>
 #include <asm/amd_iommu_types.h>
 #include <asm/amd_iommu.h>
@@ -654,6 +655,32 @@ static void __init enable_iommus(void)
 	}
 }
 
+/*
+ * Suspend/Resume support
+ * disable suspend until real resume implemented
+ */
+
+static int amd_iommu_resume(struct sys_device *dev)
+{
+	return 0;
+}
+
+static int amd_iommu_suspend(struct sys_device *dev, pm_message_t state)
+{
+	return -EINVAL;
+}
+
+static struct sysdev_class amd_iommu_sysdev_class = {
+	.name = "amd_iommu",
+	.suspend = amd_iommu_suspend,
+	.resume = amd_iommu_resume,
+};
+
+static struct sys_device device_amd_iommu = {
+	.id = 0,
+	.cls = &amd_iommu_sysdev_class,
+};
+
 int __init amd_iommu_init(void)
 {
 	int i, ret = 0;
@@ -745,6 +772,14 @@ int __init amd_iommu_init(void)
 	if (ret)
 		goto free;
 
+	ret = sysdev_class_register(&amd_iommu_sysdev_class);
+	if (ret)
+		goto free;
+
+	ret = sysdev_register(&device_amd_iommu);
+	if (ret)
+		goto free;
+
 	enable_iommus();
 
 	printk(KERN_INFO "AMD IOMMU: aperture size is %d MB\n",
-- 
1.5.3.7



^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] AMD IOMMU: disable suspend/resume with IOMMU enabled (for now)
  2008-06-30 18:18 [PATCH] AMD IOMMU: disable suspend/resume with IOMMU enabled (for now) Joerg Roedel
@ 2008-06-30 18:35 ` Ingo Molnar
  0 siblings, 0 replies; 2+ messages in thread
From: Ingo Molnar @ 2008-06-30 18:35 UTC (permalink / raw)
  To: Joerg Roedel
  Cc: mingo, tglx, linux-kernel, iommu, bhavna.sarathy, Rafael J. Wysocki


* Joerg Roedel <joerg.roedel@amd.com> wrote:

> 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.

applied to tip/x86/amd-iommu, thanks Joerg.

	Ingo

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2008-06-30 18:37 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-06-30 18:18 [PATCH] AMD IOMMU: disable suspend/resume with IOMMU enabled (for now) Joerg Roedel
2008-06-30 18:35 ` Ingo Molnar

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®