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 mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id B819DC4332F for ; Thu, 21 Oct 2021 08:53:07 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 9BD1D60EFE for ; Thu, 21 Oct 2021 08:53:07 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231443AbhJUIzW (ORCPT ); Thu, 21 Oct 2021 04:55:22 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45714 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230385AbhJUIzT (ORCPT ); Thu, 21 Oct 2021 04:55:19 -0400 Received: from bhuna.collabora.co.uk (bhuna.collabora.co.uk [IPv6:2a00:1098:0:82:1000:25:2eeb:e3e3]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EE837C06161C; Thu, 21 Oct 2021 01:53:03 -0700 (PDT) Received: from [127.0.0.1] (localhost [127.0.0.1]) (Authenticated sender: kholk11) with ESMTPSA id E4C991F44759 Subject: Re: [PATCH v16 4/7] soc: mediatek: SVS: add debug commands To: Roger Lu , 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 , 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 References: <20210428065440.3704-1-roger.lu@mediatek.com> <20210428065440.3704-5-roger.lu@mediatek.com> From: AngeloGioacchino Del Regno Message-ID: <715c9587-825f-6c22-96a2-273fb7f07bc3@collabora.com> Date: Thu, 21 Oct 2021 10:52:59 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.13.0 MIME-Version: 1.0 In-Reply-To: <20210428065440.3704-5-roger.lu@mediatek.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. > }; > > 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 > }; > > static const u32 svs_regs_v2[] = { Apart from that, Acked-by: AngeloGioacchino Del Regno 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 mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2EDF8C433F5 for ; Thu, 21 Oct 2021 08:53:45 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id E8885610CB for ; Thu, 21 Oct 2021 08:53:44 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org E8885610CB Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=collabora.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:Content-Type: Content-Transfer-Encoding:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:Date:Message-ID:From: References:Cc:To:Subject:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=0aymabb7UDoVdKQhy9kjQz8dspEPRDlFkUfhwruyIZE=; b=ZrIW0Kt2PuQCFyvhfBybkE5Vo9 emOO+lj/u7X+6CCaQt03ZKR1MQfDmhHjkOkQUJRfFH2mrn/gXNZKbjgV2KUyFgd6UefPsJ3IYHueP X/aUgTv875l10/32zxLMCxYPxPJyy6ZPec+ABc6iUPnYJsqSQ/z5F5H4+9FT34dB0j8ed11V7vLc8 23JGf9Q/LFrB7tIZ4QnaDAb1KuZ4ZeYz0VAgBE64QO4OaOmMOVJ31JMaMoMl90aAisREkAFBipg0y QyTbCI11L7wBn7Ns4DcvoTGV1esuTUxCAHRwfsNR/9TlR/RqgJFIQCcCjkNEIsrP8uFZ65lVUenCI 9g0YGl0w==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mdTpO-006vZt-0I; Thu, 21 Oct 2021 08:53:34 +0000 Received: from bhuna.collabora.co.uk ([2a00:1098:0:82:1000:25:2eeb:e3e3]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mdTou-006vR0-I1; Thu, 21 Oct 2021 08:53:06 +0000 Received: from [127.0.0.1] (localhost [127.0.0.1]) (Authenticated sender: kholk11) with ESMTPSA id E4C991F44759 Subject: Re: [PATCH v16 4/7] soc: mediatek: SVS: add debug commands To: Roger Lu , 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 , 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 References: <20210428065440.3704-1-roger.lu@mediatek.com> <20210428065440.3704-5-roger.lu@mediatek.com> From: AngeloGioacchino Del Regno Message-ID: <715c9587-825f-6c22-96a2-273fb7f07bc3@collabora.com> Date: Thu, 21 Oct 2021 10:52:59 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.13.0 MIME-Version: 1.0 In-Reply-To: <20210428065440.3704-5-roger.lu@mediatek.com> Content-Language: en-US X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20211021_015304_795242_AF603C89 X-CRM114-Status: GOOD ( 21.03 ) X-BeenThere: linux-mediatek@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Sender: "Linux-mediatek" Errors-To: linux-mediatek-bounces+linux-mediatek=archiver.kernel.org@lists.infradead.org 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. > }; > > 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 > }; > > static const u32 svs_regs_v2[] = { Apart from that, Acked-by: AngeloGioacchino Del Regno _______________________________________________ Linux-mediatek mailing list Linux-mediatek@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-mediatek 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 mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id F17AAC433F5 for ; Thu, 21 Oct 2021 08:54:45 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id BB9F160EFE for ; Thu, 21 Oct 2021 08:54:45 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org BB9F160EFE Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=collabora.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:Content-Type: Content-Transfer-Encoding:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:Date:Message-ID:From: References:Cc:To:Subject:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=Mc9O77RZVWM9KiETQ9802WfmnfFBvDx9W9HkA23t4mA=; b=0EtTUb/ILfVVNG/w6HOi0rJunL 42A6+UFSCz0LCKVIIR06qzc07Kfp0nwU1Z1ooETz2AalyxZvIl1+8WqpmpgkcpEYapS5BF/+AC7o5 1K8QKiZiTrIP0mjgUUDWbag+F8N5BgTvJW2chvvvqVo07LQGfEOGf6KJJwRYeRBVU2O/sWJDyzIqQ W0SjzoRkmOvf5wpHOziI2JY06ZrqGy5Hjag8rqodtpKDXM8+1pvSRel9pMP0wtOHJC3tKBgy4O/i3 KtuTI/FQBww29r1xjA6PDDoGJcY6EPUJTdtNY+eo0goPmhTjqR3DOb2hlh+Fb9lSmxxg+3mWlKJ4R pE+32fOg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mdTp4-006vTw-HU; Thu, 21 Oct 2021 08:53:14 +0000 Received: from bhuna.collabora.co.uk ([2a00:1098:0:82:1000:25:2eeb:e3e3]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mdTou-006vR0-I1; Thu, 21 Oct 2021 08:53:06 +0000 Received: from [127.0.0.1] (localhost [127.0.0.1]) (Authenticated sender: kholk11) with ESMTPSA id E4C991F44759 Subject: Re: [PATCH v16 4/7] soc: mediatek: SVS: add debug commands To: Roger Lu , 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 , 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 References: <20210428065440.3704-1-roger.lu@mediatek.com> <20210428065440.3704-5-roger.lu@mediatek.com> From: AngeloGioacchino Del Regno Message-ID: <715c9587-825f-6c22-96a2-273fb7f07bc3@collabora.com> Date: Thu, 21 Oct 2021 10:52:59 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.13.0 MIME-Version: 1.0 In-Reply-To: <20210428065440.3704-5-roger.lu@mediatek.com> Content-Language: en-US X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20211021_015304_795242_AF603C89 X-CRM114-Status: GOOD ( 21.03 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org 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. > }; > > 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 > }; > > static const u32 svs_regs_v2[] = { Apart from that, Acked-by: AngeloGioacchino Del Regno _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel