From 145e8fd265eed984c7fe48403a69f744bdb6cbcb Mon Sep 17 00:00:00 2001 From: Janghyuck Kim Date: Tue, 12 Jun 2018 16:19:53 +0900 Subject: [PATCH] [HACK] iommu/exynos: hold runtime pm during boot time Change-Id: I08997782bb36b9dec11834c4fdefda6a021327a7 Signed-off-by: Janghyuck Kim --- drivers/iommu/exynos-iommu.c | 10 ++++++++++ drivers/iommu/exynos-iommu.h | 1 + 2 files changed, 11 insertions(+) diff --git a/drivers/iommu/exynos-iommu.c b/drivers/iommu/exynos-iommu.c index 0f1c081ebf9c..f76b1d1aefe0 100644 --- a/drivers/iommu/exynos-iommu.c +++ b/drivers/iommu/exynos-iommu.c @@ -463,6 +463,9 @@ static int __init sysmmu_parse_dt(struct device *sysmmu, if (of_property_read_bool(sysmmu->of_node, "sysmmu,no-suspend")) dev_pm_syscore_device(sysmmu, true); + if (of_property_read_bool(sysmmu->of_node, "sysmmu,hold-rpm-on-boot")) + drvdata->hold_rpm_on_boot = true; + if (IS_TLB_WAY_TYPE(drvdata)) { ret = sysmmu_parse_tlb_way_dt(sysmmu, drvdata); if (ret) @@ -567,6 +570,9 @@ static int __init exynos_sysmmu_probe(struct platform_device *pdev) pm_runtime_enable(dev); + if (data->hold_rpm_on_boot) + pm_runtime_get_sync(dev); + dev_info(data->sysmmu, "is probed. Version %d.%d.%d\n", MMU_MAJ_VER(data->version), MMU_MIN_VER(data->version), @@ -669,6 +675,10 @@ static int sysmmu_enable_from_master(struct device *master, } break; } + if (drvdata->hold_rpm_on_boot) { + pm_runtime_put(drvdata->sysmmu); + drvdata->hold_rpm_on_boot = false; + } } spin_unlock_irqrestore(&owner->lock, flags); diff --git a/drivers/iommu/exynos-iommu.h b/drivers/iommu/exynos-iommu.h index f8bacc1154f1..e0c3e2b510a7 100644 --- a/drivers/iommu/exynos-iommu.h +++ b/drivers/iommu/exynos-iommu.h @@ -346,6 +346,7 @@ struct sysmmu_drvdata { struct atomic_notifier_head fault_notifiers; struct tlb_props tlb_props; bool is_suspended; + bool hold_rpm_on_boot; struct exynos_iommu_event_log log; }; -- 2.20.1