diff options
author | Marek Szyprowski <m.szyprowski@samsung.com> | 2013-10-09 15:30:13 +0200 |
---|---|---|
committer | Chanho Park <chanho61.park@samsung.com> | 2014-11-18 11:44:54 +0900 |
commit | b891ba7313be7530fb44609ef9a361557986ff1f (patch) | |
tree | 6d74b4114a2a64c6769a57df6fb1a6793b66a43c /drivers/iommu | |
parent | 370edf48eda5a1bf8bca3a69dca27df93cb008a0 (diff) | |
download | linux-3.10-b891ba7313be7530fb44609ef9a361557986ff1f.tar.gz linux-3.10-b891ba7313be7530fb44609ef9a361557986ff1f.tar.bz2 linux-3.10-b891ba7313be7530fb44609ef9a361557986ff1f.zip |
drivers: iommu: add workaround for multiple suspend/resume calls
Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Diffstat (limited to 'drivers/iommu')
-rw-r--r-- | drivers/iommu/exynos-iommu.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/drivers/iommu/exynos-iommu.c b/drivers/iommu/exynos-iommu.c index 76f423d34f7..78c91c949cd 100644 --- a/drivers/iommu/exynos-iommu.c +++ b/drivers/iommu/exynos-iommu.c @@ -183,6 +183,7 @@ struct sysmmu_drvdata { spinlock_t lock; struct iommu_domain *domain; bool runtime_active; + bool suspended; unsigned long pgtable; void __iomem *sfrbase; }; @@ -383,6 +384,10 @@ static irqreturn_t exynos_sysmmu_irq(int irq, void *dev_id) static void __sysmmu_disable_nocount(struct sysmmu_drvdata *data) { + if (data->suspended) + return; + + data->suspended = 1; clk_enable(data->clk_master); __raw_writel(CTRL_DISABLE, data->sfrbase + REG_MMU_CTRL); @@ -438,6 +443,11 @@ static void __sysmmu_init_config(struct sysmmu_drvdata *data) static void __sysmmu_enable_nocount(struct sysmmu_drvdata *data) { + if (!data->suspended) + return; + + data->suspended = 0; + clk_enable(data->clk_master); clk_enable(data->clk); @@ -634,6 +644,7 @@ static int __init exynos_sysmmu_probe(struct platform_device *pdev) } data->runtime_active = !pm_runtime_enabled(dev); + data->suspended = 1; spin_lock_init(&data->lock); INIT_LIST_HEAD(&data->node); |