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]
Date:   Thu, 29 Sep 2022 11:02:14 +0200
From:   AngeloGioacchino Del Regno 
        <angelogioacchino.delregno@...labora.com>
To:     Chunfeng Yun <chunfeng.yun@...iatek.com>,
        Vinod Koul <vkoul@...nel.org>
Cc:     Kishon Vijay Abraham I <kishon@...com>,
        Matthias Brugger <matthias.bgg@...il.com>,
        linux-arm-kernel@...ts.infradead.org,
        linux-mediatek@...ts.infradead.org, linux-phy@...ts.infradead.org,
        linux-kernel@...r.kernel.org, Eddie Hung <eddie.hung@...iatek.com>,
        Tianping Fang <tianping.fang@...iatek.com>
Subject: Re: [PATCH v2 2/2] phy: mediatek: tphy: add debugfs files

Il 29/09/22 10:09, Chunfeng Yun ha scritto:
> These debugfs files are mainly used to make eye diagram test easier,
> especially helpful to do HQA test for a new IC without efuse enabled.
> 
> Signed-off-by: Chunfeng Yun <chunfeng.yun@...iatek.com>
> ---
> v2: add CONFIG_PHY_MTK_TPHY_DEBUGFS suggested by AngeloGioacchino
> ---
>   drivers/phy/mediatek/Kconfig        |   5 +
>   drivers/phy/mediatek/phy-mtk-tphy.c | 403 +++++++++++++++++++++++++++-
>   2 files changed, 407 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/phy/mediatek/Kconfig b/drivers/phy/mediatek/Kconfig
> index 3125ecb5d119..e9fdfe9f519f 100644
> --- a/drivers/phy/mediatek/Kconfig
> +++ b/drivers/phy/mediatek/Kconfig
> @@ -27,6 +27,11 @@ config PHY_MTK_TPHY
>   	  multi-ports is first version, otherwise is second version,
>   	  so you can easily distinguish them by banks layout.
>   
> +config PHY_MTK_TPHY_DEBUGFS
> +	bool "Add T-PHY Debugfs Files"
> +	help
> +	  Say Y here to add debugfs files mainly for T-PHY HQA test.
> +
>   config PHY_MTK_UFS
>   	tristate "MediaTek UFS M-PHY driver"
>   	depends on ARCH_MEDIATEK || COMPILE_TEST
> diff --git a/drivers/phy/mediatek/phy-mtk-tphy.c b/drivers/phy/mediatek/phy-mtk-tphy.c
> index e906a82791bd..d9509e1314a4 100644
> --- a/drivers/phy/mediatek/phy-mtk-tphy.c
> +++ b/drivers/phy/mediatek/phy-mtk-tphy.c
> @@ -7,6 +7,7 @@
>   
>   #include <dt-bindings/phy/phy.h>
>   #include <linux/clk.h>
> +#include <linux/debugfs.h>
>   #include <linux/delay.h>
>   #include <linux/iopoll.h>
>   #include <linux/mfd/syscon.h>
> @@ -264,6 +265,8 @@
>   
>   #define TPHY_CLKS_CNT	2
>   
> +#define USER_BUF_LEN(count) min_t(size_t, 8, (count))
> +
>   enum mtk_phy_version {
>   	MTK_PHY_V1 = 1,
>   	MTK_PHY_V2,
> @@ -310,6 +313,7 @@ struct mtk_phy_instance {
>   	struct clk_bulk_data clks[TPHY_CLKS_CNT];
>   	u32 index;
>   	u32 type;
> +	struct dentry *dbgfs;

Unused when !IS_ENABLED(CONFIG_PHY_MTK_TPHY_DEBUGFS)

>   	struct regmap *type_sw;
>   	u32 type_sw_reg;
>   	u32 type_sw_index;
> @@ -332,10 +336,389 @@ struct mtk_tphy {
>   	const struct mtk_phy_pdata *pdata;
>   	struct mtk_phy_instance **phys;
>   	int nphys;
> +	struct dentry *dbgfs_root;

Same here

>   	int src_ref_clk; /* MHZ, reference clock for slew rate calibrate */
>   	int src_coef; /* coefficient for slew rate calibrate */
>   };
>   
> +#if IS_ENABLED(CONFIG_PHY_MTK_TPHY_DEBUGFS)
> +

..snip..

> +
> +static void tphy_debufs_init(struct mtk_tphy *tphy, struct mtk_phy_instance *inst)

Please fix typo "debufs" -> "debugfs", here and everywhere else.

Apart from that, it looks good to me.

Regards,
Angelo

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ