From 7c21db9b86229aba7646aaf8dc0ac34a3c797bcd Mon Sep 17 00:00:00 2001 From: Joerg Roedel Date: Mon, 30 Jun 2008 20:18:02 +0200 Subject: [PATCH] --- yaml --- r: 99637 b: refs/heads/master c: 7441e9cb18a1a1e5b87f516fa97b6d4abb0838e3 h: refs/heads/master i: 99635: 5c817171f9ba7325118fc02f5bf34d57994ca4b7 v: v3 --- [refs] | 2 +- trunk/arch/x86/kernel/amd_iommu_init.c | 35 ++++++++++++++++++++++++++ 2 files changed, 36 insertions(+), 1 deletion(-) diff --git a/[refs] b/[refs] index b8512b5a8247..81004fb3d682 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 07c40e8a1acdb56fca485a6deeb252ebf19509a1 +refs/heads/master: 7441e9cb18a1a1e5b87f516fa97b6d4abb0838e3 diff --git a/trunk/arch/x86/kernel/amd_iommu_init.c b/trunk/arch/x86/kernel/amd_iommu_init.c index 6ab8128db1cc..5d9e45c7cea2 100644 --- a/trunk/arch/x86/kernel/amd_iommu_init.c +++ b/trunk/arch/x86/kernel/amd_iommu_init.c @@ -21,6 +21,7 @@ #include #include #include +#include #include #include #include @@ -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",