From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id B4EA9C433F5 for ; Fri, 24 Dec 2021 09:39:04 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1352292AbhLXJjE (ORCPT ); Fri, 24 Dec 2021 04:39:04 -0500 Received: from mailgw01.mediatek.com ([60.244.123.138]:50872 "EHLO mailgw01.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1343812AbhLXJjC (ORCPT ); Fri, 24 Dec 2021 04:39:02 -0500 X-UUID: 249930cfafff4f549a169c87bdbde67c-20211224 X-UUID: 249930cfafff4f549a169c87bdbde67c-20211224 Received: from mtkmbs10n1.mediatek.inc [(172.21.101.34)] by mailgw01.mediatek.com (envelope-from ) (Generic MTA with TLSv1.2 ECDHE-RSA-AES256-GCM-SHA384 256/256) with ESMTP id 1935198536; Fri, 24 Dec 2021 17:39:00 +0800 Received: from mtkexhb02.mediatek.inc (172.21.101.103) by mtkmbs10n1.mediatek.inc (172.21.101.34) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.2.792.15; Fri, 24 Dec 2021 17:38:59 +0800 Received: from mtkcas10.mediatek.inc (172.21.101.39) by mtkexhb02.mediatek.inc (172.21.101.103) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Fri, 24 Dec 2021 17:38:58 +0800 Received: from mtksdccf07 (172.21.84.99) by mtkcas10.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1497.2 via Frontend Transport; Fri, 24 Dec 2021 17:38:58 +0800 Message-ID: Subject: Re: [PATCH v16 4/7] soc: mediatek: SVS: add debug commands From: Roger Lu To: AngeloGioacchino Del Regno , Matthias Brugger , Enric Balletbo Serra , Kevin Hilman , Rob Herring , Nicolas Boichat , Stephen Boyd , Philipp Zabel CC: Fan Chen , HenryC Chen , YT Lee , Xiaoqing Liu , Charles Yang , Angus Lin , Mark Rutland , Nishanth Menon , , , , , , Date: Fri, 24 Dec 2021 17:38:58 +0800 In-Reply-To: <715c9587-825f-6c22-96a2-273fb7f07bc3@collabora.com> References: <20210428065440.3704-1-roger.lu@mediatek.com> <20210428065440.3704-5-roger.lu@mediatek.com> <715c9587-825f-6c22-96a2-273fb7f07bc3@collabora.com> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.28.5-0ubuntu0.18.04.2 MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-MTK: N Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi AngeloGioacchino, Sorry for the late reply. On Thu, 2021-10-21 at 10:52 +0200, AngeloGioacchino Del Regno wrote: > Il 28/04/21 08:54, Roger Lu ha scritto: > > The purpose of SVS is to help find the suitable voltages > > for DVFS. Therefore, if SVS bank voltages are concerned > > to be wrong, we can adjust SVS bank voltages by this patch. > > > > Signed-off-by: Roger Lu > > --- > > drivers/soc/mediatek/mtk-svs.c | 328 +++++++++++++++++++++++++++++++++ > > 1 file changed, 328 insertions(+) > > > > diff --git a/drivers/soc/mediatek/mtk-svs.c b/drivers/soc/mediatek/mtk-svs.c > > index 2d2153c92373..8794a2d87baa 100644 > > --- a/drivers/soc/mediatek/mtk-svs.c > > +++ b/drivers/soc/mediatek/mtk-svs.c > > @@ -6,6 +6,7 @@ > > #include > > #include > > #include > > +#include > > #include > > #include > > #include > > @@ -24,6 +25,7 @@ > > #include > > #include > > #include > > +#include > > #include > > #include > > #include > > @@ -62,6 +64,39 @@ > > #define SVSB_INTSTS_COMPLETE 0x1 > > #define SVSB_INTSTS_CLEAN 0x00ffffff > > > > +#define debug_fops_ro(name) > > \ > > + static int svs_##name##_debug_open(struct inode *inode, \ > > + struct file *filp) \ > > + { \ > > + return single_open(filp, svs_##name##_debug_show, \ > > + inode->i_private); \ > > + } \ > > + static const struct file_operations svs_##name##_debug_fops = { \ > > + .owner = THIS_MODULE, \ > > + .open = svs_##name##_debug_open, \ > > + .read = seq_read, \ > > + .llseek = seq_lseek, \ > > + .release = single_release, \ > > + } > > + > > +#define debug_fops_rw(name) > > \ > > + static int svs_##name##_debug_open(struct inode *inode, \ > > + struct file *filp) \ > > + { \ > > + return single_open(filp, svs_##name##_debug_show, \ > > + inode->i_private); \ > > + } \ > > + static const struct file_operations svs_##name##_debug_fops = { \ > > + .owner = THIS_MODULE, \ > > + .open = svs_##name##_debug_open, \ > > + .read = seq_read, \ > > + .write = svs_##name##_debug_write, \ > > + .llseek = seq_lseek, \ > > + .release = single_release, \ > > + } > > + > > +#define svs_dentry(name) {__stringify(name), &svs_##name##_debug_fops} > > + > > static DEFINE_SPINLOCK(mtk_svs_lock); > > > > /* > > @@ -83,6 +118,7 @@ enum svsb_phase { > > SVSB_PHASE_INIT01, > > SVSB_PHASE_INIT02, > > SVSB_PHASE_MON, > > + SVSB_PHASE_NUM, > > I would move the addition of these last members in the previous (3/7) patch, > where you introduce the driver in the first place. > > Also, I think that using _MAX instead would be better, as it is pretty > much a common practice. So, this would become SVSB_PHASE_MAX. Okay. I'll move it to previous (3/7) patch. Thanks for advice. > > > }; > > > > enum svs_reg_index { > > @@ -140,6 +176,7 @@ enum svs_reg_index { > > SPARE2, > > SPARE3, > > THSLPEVEB, > > + SVS_REG_NUM, > > ... and this would become SVS_REG_MAX Okay. I'll move it to previous (3/7) patch. Thanks for advice. > > > }; > > > > static const u32 svs_regs_v2[] = { > > Apart from that, > > Acked-by: AngeloGioacchino Del Regno >