From: Marek Szyprowski Date: Wed, 19 Sep 2018 09:36:55 +0000 (+0200) Subject: clk: samsung: exynos5433: add workaround for NOIRQ sleep X-Git-Tag: submit/tizen/20190329.020226~142 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=7cc9c3c70f76a06cd8f0885e4915c31171f25aeb;p=platform%2Fkernel%2Flinux-exynos.git clk: samsung: exynos5433: add workaround for NOIRQ sleep Signed-off-by: Marek Szyprowski Change-Id: I53b8969337a3464eb5cd5d877ce877670895836a --- diff --git a/drivers/clk/samsung/clk-exynos5433.c b/drivers/clk/samsung/clk-exynos5433.c index 4a0f8ff87ca0..7e6c0c9397a9 100644 --- a/drivers/clk/samsung/clk-exynos5433.c +++ b/drivers/clk/samsung/clk-exynos5433.c @@ -5623,6 +5623,24 @@ static int __maybe_unused exynos5433_cmu_resume(struct device *dev) return 0; } +/* + * late_suspend and early_resume callbacks are required to balance + * pm_runtime_disable and pm_runtime_enable calls in device_suspend_late + * and device_resume_early core functions to keep runtime enabled for + * CMU device during noirq sleep phase. + */ +static int __maybe_unused exynos5433_late_suspend(struct device *dev) +{ + pm_runtime_enable(dev); + return 0; +} + +static int __maybe_unused exynos5433_early_resume(struct device *dev) +{ + pm_runtime_disable(dev); + return 0; +} + static int __init exynos5433_cmu_probe(struct platform_device *pdev) { const struct samsung_cmu_info *info; @@ -5760,6 +5778,8 @@ static const struct of_device_id exynos5433_cmu_of_match[] = { static const struct dev_pm_ops exynos5433_cmu_pm_ops = { SET_RUNTIME_PM_OPS(exynos5433_cmu_suspend, exynos5433_cmu_resume, NULL) + SET_LATE_SYSTEM_SLEEP_PM_OPS(exynos5433_late_suspend, + exynos5433_early_resume) SET_NOIRQ_SYSTEM_SLEEP_PM_OPS(pm_runtime_force_suspend, pm_runtime_force_resume) };