Message ID | 20221226094248.4506-9-roger.lu@mediatek.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show
Return-Path: <linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org> X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 8418DC4167B for <linux-arm-kernel@archiver.kernel.org>; Mon, 26 Dec 2022 09:45:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:CC:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=p9p+YuCsRB2WXeXi6zAoQgCW55KRvZOVveriGNNuhn8=; b=PRkU463npkw4cg e7N1MSvMFvYsl0LghhjumLOkUBKNfM31rQPZ3nsZk4JKsojklZw/Diz/nsqCCQlOLy/84Jr6Is0wt ZIUIuXXjuSTeKidAYvqxeBgoTM1WlOF4EEKi5IHWOa/YYJBInMOdvRwGZXqwz2RpshyElCspwk6lk 3JTkVASkHJyrmbAZbl00XKfWIxcFblTUZYoiXvCKD0oO22jp6gFV66IjbtdY11aTigQHIPCOc1k3d /rHmjKhF3khFsa3ld5wPpdxU8Igon+hZ9/pJLUtP4x+WA3ggGOTHPNqceyeUSdfgnEdWLDtc/5jab xE0JxbtgSSWFbISTnFEA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1p9k1f-002ucd-5K; Mon, 26 Dec 2022 09:44:07 +0000 Received: from mailgw02.mediatek.com ([216.200.240.185]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1p9k0Y-002tyZ-Fc; Mon, 26 Dec 2022 09:43:04 +0000 X-UUID: fd8c34c68a80466c8cb48051cf878c07-20221226 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=mediatek.com; s=dk; h=Content-Type:MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:CC:To:From; bh=LoWOBCRpuIv0lWQImnSJ5VJr+gKMSYGQngXpmKueuqc=; b=enbKf5RNDhhhM1JVBdRFKx8Vq6LHLUCcU1F5LzmQNhd91kw5hhP9mGNmeN3N/WHO2VecvuAgTVVB5aZz9yfDWLvuvg+Lp52aBYHwyBQ75M3UMzTOR6jyZog/zpi0KkVAmSYwphDGGaqvTTo7M8GZCK+3AKNldLaFOqwNMMkvZxw=; X-CID-P-RULE: Release_Ham X-CID-O-INFO: VERSION:1.1.14,REQID:798f1bc5-1f53-4bbf-be7f-111fe1060ab3,IP:0,U RL:0,TC:0,Content:0,EDM:0,RT:0,SF:0,FILE:0,BULK:0,RULE:Release_Ham,ACTION: release,TS:0 X-CID-META: VersionHash:dcaaed0,CLOUDID:1410cf52-dd49-462e-a4be-2143a3ddc739,B ulkID:nil,BulkQuantity:0,Recheck:0,SF:102,TC:nil,Content:0,EDM:-3,IP:nil,U RL:11|1,File:nil,Bulk:nil,QS:nil,BEC:nil,COL:0 X-UUID: fd8c34c68a80466c8cb48051cf878c07-20221226 Received: from mtkmbs11n2.mediatek.inc [(172.21.101.187)] by mailgw02.mediatek.com (envelope-from <roger.lu@mediatek.com>) (musrelay.mediatek.com ESMTP with TLSv1.2 ECDHE-RSA-AES256-GCM-SHA384 256/256) with ESMTP id 1425675543; Mon, 26 Dec 2022 02:42:53 -0700 Received: from mtkmbs11n2.mediatek.inc (172.21.101.187) by mtkmbs11n2.mediatek.inc (172.21.101.187) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.792.15; Mon, 26 Dec 2022 17:42:50 +0800 Received: from mtksdccf07.mediatek.inc (172.21.84.99) by mtkmbs11n2.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.2.792.15 via Frontend Transport; Mon, 26 Dec 2022 17:42:50 +0800 From: Roger Lu <roger.lu@mediatek.com> To: Matthias Brugger <matthias.bgg@gmail.com>, Enric Balletbo Serra <eballetbo@gmail.com>, Kevin Hilman <khilman@kernel.org>, Nicolas Boichat <drinkcat@google.com> CC: Fan Chen <fan.chen@mediatek.com>, Roger Lu <roger.lu@mediatek.com>, Jia-wei Chang <jia-wei.chang@mediatek.com>, <devicetree@vger.kernel.org>, <linux-arm-kernel@lists.infradead.org>, <linux-mediatek@lists.infradead.org>, <linux-kernel@vger.kernel.org>, <linux-pm@vger.kernel.org>, <Project_Global_Chrome_Upstream_Group@mediatek.com> Subject: [PATCH v1 08/13] soc: mediatek: mtk-svs: add main_clk check during system-wide suspend Date: Mon, 26 Dec 2022 17:42:43 +0800 Message-ID: <20221226094248.4506-9-roger.lu@mediatek.com> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20221226094248.4506-1-roger.lu@mediatek.com> References: <20221226094248.4506-1-roger.lu@mediatek.com> MIME-Version: 1.0 X-MTK: N X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20221226_014258_566455_F191D472 X-CRM114-Status: GOOD ( 11.26 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: <linux-arm-kernel.lists.infradead.org> List-Unsubscribe: <http://lists.infradead.org/mailman/options/linux-arm-kernel>, <mailto:linux-arm-kernel-request@lists.infradead.org?subject=unsubscribe> List-Archive: <http://lists.infradead.org/pipermail/linux-arm-kernel/> List-Post: <mailto:linux-arm-kernel@lists.infradead.org> List-Help: <mailto:linux-arm-kernel-request@lists.infradead.org?subject=help> List-Subscribe: <http://lists.infradead.org/mailman/listinfo/linux-arm-kernel>, <mailto:linux-arm-kernel-request@lists.infradead.org?subject=subscribe> Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" <linux-arm-kernel-bounces@lists.infradead.org> Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org |
Series |
Enahance SVS's robustness
|
expand
|
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];
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(+)