lkml.org 
[lkml]   [2022]   [Dec]   [26]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH v1 08/13] soc: mediatek: mtk-svs: add main_clk check during system-wide suspend
Date
SVS's main_clk might be disabled in svs_resume(). Therefore, if main_clk
is disabled and svs_suspend() is called by system-wide suspend stage,
return 0 directly.

Signed-off-by: Roger Lu <roger.lu@mediatek.com>
---
drivers/soc/mediatek/mtk-svs.c | 4 ++++
1 file changed, 4 insertions(+)

diff --git a/drivers/soc/mediatek/mtk-svs.c b/drivers/soc/mediatek/mtk-svs.c
index 2c1fbf11b554..934e7ea976b0 100644
--- a/drivers/soc/mediatek/mtk-svs.c
+++ b/drivers/soc/mediatek/mtk-svs.c
@@ -6,6 +6,7 @@
#include <linux/bitfield.h>
#include <linux/bits.h>
#include <linux/clk.h>
+#include <linux/clk-provider.h>
#include <linux/completion.h>
#include <linux/cpuidle.h>
#include <linux/debugfs.h>
@@ -1543,6 +1544,9 @@ static int svs_suspend(struct device *dev)
int ret;
u32 idx;

+ if (!__clk_is_enabled(svsp->main_clk))
+ return 0;
+
for (idx = 0; idx < svsp->bank_max; idx++) {
svsb = &svsp->banks[idx];

--
2.18.0
\
 
 \ /
  Last update: 2023-03-26 23:20    [W:0.254 / U:0.608 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site