Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 242730
b: refs/heads/master
c: 134fac3
h: refs/heads/master
v: v3
  • Loading branch information
Rafael J. Wysocki committed Mar 23, 2011
1 parent 62f761d commit 83bd405
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 30 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: e1a85b2c519551d4792180cdab4074d7e99bf2c9
refs/heads/master: 134fac3f457f3dd753ecdb25e6da3e5f6629f696
38 changes: 9 additions & 29 deletions trunk/drivers/pci/intel-iommu.c
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
#include <linux/iova.h>
#include <linux/iommu.h>
#include <linux/intel-iommu.h>
#include <linux/sysdev.h>
#include <linux/syscore_ops.h>
#include <linux/tboot.h>
#include <linux/dmi.h>
#include <asm/cacheflush.h>
Expand Down Expand Up @@ -3135,7 +3135,7 @@ static void iommu_flush_all(void)
}
}

static int iommu_suspend(struct sys_device *dev, pm_message_t state)
static int iommu_suspend(void)
{
struct dmar_drhd_unit *drhd;
struct intel_iommu *iommu = NULL;
Expand Down Expand Up @@ -3175,15 +3175,15 @@ static int iommu_suspend(struct sys_device *dev, pm_message_t state)
return -ENOMEM;
}

static int iommu_resume(struct sys_device *dev)
static void iommu_resume(void)
{
struct dmar_drhd_unit *drhd;
struct intel_iommu *iommu = NULL;
unsigned long flag;

if (init_iommu_hw()) {
WARN(1, "IOMMU setup failed, DMAR can not resume!\n");
return -EIO;
return;
}

for_each_active_iommu(iommu, drhd) {
Expand All @@ -3204,40 +3204,20 @@ static int iommu_resume(struct sys_device *dev)

for_each_active_iommu(iommu, drhd)
kfree(iommu->iommu_state);

return 0;
}

static struct sysdev_class iommu_sysclass = {
.name = "iommu",
static struct syscore_ops iommu_syscore_ops = {
.resume = iommu_resume,
.suspend = iommu_suspend,
};

static struct sys_device device_iommu = {
.cls = &iommu_sysclass,
};

static int __init init_iommu_sysfs(void)
static void __init init_iommu_pm_ops(void)
{
int error;

error = sysdev_class_register(&iommu_sysclass);
if (error)
return error;

error = sysdev_register(&device_iommu);
if (error)
sysdev_class_unregister(&iommu_sysclass);

return error;
register_syscore_ops(&iommu_syscore_ops);
}

#else
static int __init init_iommu_sysfs(void)
{
return 0;
}
static inline int init_iommu_pm_ops(void) { }
#endif /* CONFIG_PM */

/*
Expand Down Expand Up @@ -3320,7 +3300,7 @@ int __init intel_iommu_init(void)
#endif
dma_ops = &intel_dma_ops;

init_iommu_sysfs();
init_iommu_pm_ops();

register_iommu(&intel_iommu_ops);

Expand Down

0 comments on commit 83bd405

Please sign in to comment.