Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

memory: mtk-smi: Add PM suspend and resume ops

In the commit 4f0a1a1ae351 ("memory: mtk-smi: Invoke pm runtime_callback
to enable clocks"), we use pm_runtime callback to enable/disable the smi
larb clocks. It will cause the larb's clock may not be disabled when
suspend. That is because device_prepare will call pm_runtime_get_noresume
which will keep the larb's PM runtime status still is active when suspend,
then it won't enter our pm_runtime suspend callback to disable the
corresponding clocks.

This patch adds suspend pm_ops to force disable the clocks, Use "LATE" to
make sure it disable the larb's clocks after the multimedia devices.

Fixes: 4f0a1a1ae351 ("memory: mtk-smi: Invoke pm runtime_callback to enable clocks")
Signed-off-by: Anan Sun <anan.sun@mediatek.com>
Signed-off-by: Yong Wu <yong.wu@mediatek.com>
Signed-off-by: Joerg Roedel <jroedel@suse.de>

authored by

Yong Wu and committed by
Joerg Roedel
fb03082a 4f5cafb5

+4
+4
drivers/memory/mtk-smi.c
··· 366 366 367 367 static const struct dev_pm_ops smi_larb_pm_ops = { 368 368 SET_RUNTIME_PM_OPS(mtk_smi_larb_suspend, mtk_smi_larb_resume, NULL) 369 + SET_LATE_SYSTEM_SLEEP_PM_OPS(pm_runtime_force_suspend, 370 + pm_runtime_force_resume) 369 371 }; 370 372 371 373 static struct platform_driver mtk_smi_larb_driver = { ··· 509 507 510 508 static const struct dev_pm_ops smi_common_pm_ops = { 511 509 SET_RUNTIME_PM_OPS(mtk_smi_common_suspend, mtk_smi_common_resume, NULL) 510 + SET_LATE_SYSTEM_SLEEP_PM_OPS(pm_runtime_force_suspend, 511 + pm_runtime_force_resume) 512 512 }; 513 513 514 514 static struct platform_driver mtk_smi_common_driver = {