lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <715c9587-825f-6c22-96a2-273fb7f07bc3@collabora.com>
Date:   Thu, 21 Oct 2021 10:52:59 +0200
From:   AngeloGioacchino Del Regno 
        <angelogioacchino.delregno@...labora.com>
To:     Roger Lu <roger.lu@...iatek.com>,
        Matthias Brugger <matthias.bgg@...il.com>,
        Enric Balletbo Serra <eballetbo@...il.com>,
        Kevin Hilman <khilman@...nel.org>,
        Rob Herring <robh+dt@...nel.org>,
        Nicolas Boichat <drinkcat@...gle.com>,
        Stephen Boyd <sboyd@...nel.org>,
        Philipp Zabel <p.zabel@...gutronix.de>
Cc:     Fan Chen <fan.chen@...iatek.com>,
        HenryC Chen <HenryC.Chen@...iatek.com>,
        YT Lee <yt.lee@...iatek.com>,
        Xiaoqing Liu <Xiaoqing.Liu@...iatek.com>,
        Charles Yang <Charles.Yang@...iatek.com>,
        Angus Lin <Angus.Lin@...iatek.com>,
        Mark Rutland <mark.rutland@....com>,
        Nishanth Menon <nm@...com>, devicetree@...r.kernel.org,
        linux-arm-kernel@...ts.infradead.org,
        linux-mediatek@...ts.infradead.org, linux-kernel@...r.kernel.org,
        linux-pm@...r.kernel.org,
        Project_Global_Chrome_Upstream_Group@...iatek.com
Subject: Re: [PATCH v16 4/7] soc: mediatek: SVS: add debug commands

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 <roger.lu@...iatek.com>
> ---
>   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 <linux/bits.h>
>   #include <linux/clk.h>
>   #include <linux/completion.h>
> +#include <linux/debugfs.h>
>   #include <linux/device.h>
>   #include <linux/init.h>
>   #include <linux/interrupt.h>
> @@ -24,6 +25,7 @@
>   #include <linux/pm_runtime.h>
>   #include <linux/regulator/consumer.h>
>   #include <linux/reset.h>
> +#include <linux/seq_file.h>
>   #include <linux/slab.h>
>   #include <linux/spinlock.h>
>   #include <linux/thermal.h>
> @@ -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 <angelogioacchino.delregno@...labora.com>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ