Message ID | 20230111074528.29354-8-roger.lu@mediatek.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4e01:0:0:0:0:0 with SMTP id p1csp3182485wrt; Tue, 10 Jan 2023 23:47:26 -0800 (PST) X-Google-Smtp-Source: AMrXdXvIx1D+t4wWXUBanTtxgnsLvVQSSjpT7T/mUkQaQspmSKwrjfTl8Ysu2VvDnpqkvYpgLba5 X-Received: by 2002:a05:6402:6c9:b0:46c:2c94:d30b with SMTP id n9-20020a05640206c900b0046c2c94d30bmr77797772edy.33.1673423245815; Tue, 10 Jan 2023 23:47:25 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1673423245; cv=none; d=google.com; s=arc-20160816; b=hFPKvWg69YmOtTgoswFxwz5rfIhzOgHH/XMHbZaDLCwuphoeovrvpVyPEasBslFdIB Yv65dgvON1OMV9D0vHMmwTXNkmGSwQiNVlhUIJg7F/2thzjkvWFHslzu2fd5pGCBJCS8 XJ3uO7kp6C+GE9PBs1+Sq+po8ZeSY2os8lyQx6QTa5COJpH5XKUJHwUhaaQ8uAAHNHGd 4XmdK81x/nMreP5pAu0PycHlOhAV/Xh6bR/3WvQ6n3GZ7xOi3+EzpOoES3XQ2m8XNtbb JPlLB5SVw4YpRE3XPK8rxGXsZ/Xryr1my8xFz7xngvpEmg4B2jzmGjbxaFUJNqvowylQ i3wQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=8i/kTiL7qMggq0JM+wjpexcmuwEQeM/AkSaq1pFFVPU=; b=CVBkiZzKLx0YXzAnsNgFMKh8tczWY/m3jLxZq82rmePuBFgLJ/m0viaPWYYkHIMqEr 3yO2HZ3b4Bfz3e/hwFpifnDv7HT0FdxSS0Y6WRlqSO0KObuN1fSc0SEW16YH41xOZKdr mXDsoteMyOFO/62YgYBELzYifcFXGfawavsybI926dDl7fY25bFpKbUZILKtvLpj+rNr CGHQcUg6kg9O2LNPXc3pPlN3xywpi2gwpItmJAumKyBC1yrOvL0azQSXSwsjIMVlqiKr CL6LCS/NDCOgybJcSW7oUxIag2cknATJBnftC89xyr7N2YLyO0JX5Rx7tIA2iC8e2Fzi uaPg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@mediatek.com header.s=dk header.b=n49Cs3fB; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=mediatek.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id f17-20020a50d551000000b004782d6db359si13291245edj.146.2023.01.10.23.47.02; Tue, 10 Jan 2023 23:47:25 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@mediatek.com header.s=dk header.b=n49Cs3fB; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=mediatek.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236015AbjAKHqc (ORCPT <rfc822;syz17693488234@gmail.com> + 99 others); Wed, 11 Jan 2023 02:46:32 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50536 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235554AbjAKHpq (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Wed, 11 Jan 2023 02:45:46 -0500 Received: from mailgw02.mediatek.com (unknown [210.61.82.184]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A0AA21182F; Tue, 10 Jan 2023 23:45:42 -0800 (PST) X-UUID: ecb572d2918311ed945fc101203acc17-20230111 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=8i/kTiL7qMggq0JM+wjpexcmuwEQeM/AkSaq1pFFVPU=; b=n49Cs3fBZ8h+kHtJyBExDr501d6BgMj0anld91RxbMPVy2Ejyzs0yyBiOmyuBPcx1i8q8X80hb4QjUEf5gKy2m/O6FyZETak7CvSnsr1VHF3wifAzC+a5qZhvOSn25pEP7fSL/FTnWmCIJs18OjNBZ4T49Lxheyxjh2oHhOsrYw=; X-CID-P-RULE: Release_Ham X-CID-O-INFO: VERSION:1.1.17,REQID:6181f2b2-4f36-42e4-839d-1a565275ceca,IP:0,U RL:0,TC:0,Content:-5,EDM:0,RT:0,SF:0,FILE:0,BULK:0,RULE:Release_Ham,ACTION :release,TS:-5 X-CID-META: VersionHash:543e81c,CLOUDID:22ac5354-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,OSI:0,OSA:0 X-CID-BVR: 0,NGT X-UUID: ecb572d2918311ed945fc101203acc17-20230111 Received: from mtkmbs11n1.mediatek.inc [(172.21.101.185)] by mailgw02.mediatek.com (envelope-from <roger.lu@mediatek.com>) (Generic MTA with TLSv1.2 ECDHE-RSA-AES256-GCM-SHA384 256/256) with ESMTP id 1626707124; Wed, 11 Jan 2023 15:45:31 +0800 Received: from mtkmbs13n2.mediatek.inc (172.21.101.108) by mtkmbs10n2.mediatek.inc (172.21.101.183) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.792.3; Wed, 11 Jan 2023 15:45:30 +0800 Received: from mtksdccf07.mediatek.inc (172.21.84.99) by mtkmbs13n2.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.2.792.15 via Frontend Transport; Wed, 11 Jan 2023 15:45:30 +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 v4 07/14] soc: mediatek: mtk-svs: keep svs alive if CONFIG_DEBUG_FS not supported Date: Wed, 11 Jan 2023 15:45:21 +0800 Message-ID: <20230111074528.29354-8-roger.lu@mediatek.com> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20230111074528.29354-1-roger.lu@mediatek.com> References: <20230111074528.29354-1-roger.lu@mediatek.com> MIME-Version: 1.0 Content-Type: text/plain X-MTK: N X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS, SPF_PASS,UNPARSEABLE_RELAY autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1754711453360674408?= X-GMAIL-MSGID: =?utf-8?q?1754711453360674408?= |
Series |
Enahance SVS's robustness
|
|
Commit Message
Roger Lu
Jan. 11, 2023, 7:45 a.m. UTC
Some projects might not support CONFIG_DEBUG_FS but still needs svs to be
alive. Therefore, enclose debug cmd codes with CONFIG_DEBUG_FS to make sure
svs can be alive when CONFIG_DEBUG_FS not supported.
Signed-off-by: Roger Lu <roger.lu@mediatek.com>
---
drivers/soc/mediatek/mtk-svs.c | 6 ++++++
1 file changed, 6 insertions(+)
Comments
On 11/01/2023 08:45, Roger Lu wrote: > Some projects might not support CONFIG_DEBUG_FS but still needs svs to be > alive. Therefore, enclose debug cmd codes with CONFIG_DEBUG_FS to make sure > svs can be alive when CONFIG_DEBUG_FS not supported. > > Signed-off-by: Roger Lu <roger.lu@mediatek.com> Applied, thanks! > --- > drivers/soc/mediatek/mtk-svs.c | 6 ++++++ > 1 file changed, 6 insertions(+) > > diff --git a/drivers/soc/mediatek/mtk-svs.c b/drivers/soc/mediatek/mtk-svs.c > index a3c84e819bc5..70ca9c9acae0 100644 > --- a/drivers/soc/mediatek/mtk-svs.c > +++ b/drivers/soc/mediatek/mtk-svs.c > @@ -138,6 +138,7 @@ > > static DEFINE_SPINLOCK(svs_lock); > > +#ifdef CONFIG_DEBUG_FS > #define debug_fops_ro(name) \ > static int svs_##name##_debug_open(struct inode *inode, \ > struct file *filp) \ > @@ -170,6 +171,7 @@ static DEFINE_SPINLOCK(svs_lock); > } > > #define svs_dentry_data(name) {__stringify(name), &svs_##name##_debug_fops} > +#endif > > /** > * enum svsb_phase - svs bank phase enumeration > @@ -652,6 +654,7 @@ static int svs_adjust_pm_opp_volts(struct svs_bank *svsb) > return ret; > } > > +#ifdef CONFIG_DEBUG_FS > static int svs_dump_debug_show(struct seq_file *m, void *p) > { > struct svs_platform *svsp = (struct svs_platform *)m->private; > @@ -867,6 +870,7 @@ static int svs_create_debug_cmds(struct svs_platform *svsp) > > return 0; > } > +#endif /* CONFIG_DEBUG_FS */ > > static u32 interpolate(u32 f0, u32 f1, u32 v0, u32 v1, u32 fx) > { > @@ -2476,11 +2480,13 @@ static int svs_probe(struct platform_device *pdev) > goto svs_probe_iounmap; > } > > +#ifdef CONFIG_DEBUG_FS > ret = svs_create_debug_cmds(svsp); > if (ret) { > dev_err(svsp->dev, "svs create debug cmds fail: %d\n", ret); > goto svs_probe_iounmap; > } > +#endif > > return 0; >
diff --git a/drivers/soc/mediatek/mtk-svs.c b/drivers/soc/mediatek/mtk-svs.c index a3c84e819bc5..70ca9c9acae0 100644 --- a/drivers/soc/mediatek/mtk-svs.c +++ b/drivers/soc/mediatek/mtk-svs.c @@ -138,6 +138,7 @@ static DEFINE_SPINLOCK(svs_lock); +#ifdef CONFIG_DEBUG_FS #define debug_fops_ro(name) \ static int svs_##name##_debug_open(struct inode *inode, \ struct file *filp) \ @@ -170,6 +171,7 @@ static DEFINE_SPINLOCK(svs_lock); } #define svs_dentry_data(name) {__stringify(name), &svs_##name##_debug_fops} +#endif /** * enum svsb_phase - svs bank phase enumeration @@ -652,6 +654,7 @@ static int svs_adjust_pm_opp_volts(struct svs_bank *svsb) return ret; } +#ifdef CONFIG_DEBUG_FS static int svs_dump_debug_show(struct seq_file *m, void *p) { struct svs_platform *svsp = (struct svs_platform *)m->private; @@ -867,6 +870,7 @@ static int svs_create_debug_cmds(struct svs_platform *svsp) return 0; } +#endif /* CONFIG_DEBUG_FS */ static u32 interpolate(u32 f0, u32 f1, u32 v0, u32 v1, u32 fx) { @@ -2476,11 +2480,13 @@ static int svs_probe(struct platform_device *pdev) goto svs_probe_iounmap; } +#ifdef CONFIG_DEBUG_FS ret = svs_create_debug_cmds(svsp); if (ret) { dev_err(svsp->dev, "svs create debug cmds fail: %d\n", ret); goto svs_probe_iounmap; } +#endif return 0;