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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <46e0e1f1-e094-40f9-99f9-22678bb40d39@collabora.com>
Date: Thu, 20 Mar 2025 13:11:56 +0100
From: AngeloGioacchino Del Regno <angelogioacchino.delregno@...labora.com>
To: Xueqi Zhang <xueqi.zhang@...iatek.com>, Yong Wu <yong.wu@...iatek.com>,
 Krzysztof Kozlowski <krzk@...nel.org>, Rob Herring <robh@...nel.org>,
 Conor Dooley <conor+dt@...nel.org>, Matthias Brugger <matthias.bgg@...il.com>
Cc: Wendy-st Lin <wendy-st.lin@...iatek.com>,
 Project_Global_Chrome_Upstream_Group@...iatek.com,
 linux-mediatek@...ts.infradead.org, linux-kernel@...r.kernel.org,
 linux-arm-kernel@...ts.infradead.org, devicetree@...r.kernel.org,
 iommu@...ts.linux.dev
Subject: Re: [PATCH 2/3] memory: mtk-smi: Add a flag skip_rpm

Il 20/03/25 08:36, Xueqi Zhang ha scritto:
> MT8196 SMI commons is backed up/restored by RTFF HW.
> It doesn't need SW control the register backup/store
> in the runtime callback.Therefore, add a flag skip_rpm
> to help skip RPM operations for SMI commons.
> 
> Signed-off-by: Xueqi Zhang <xueqi.zhang@...iatek.com>

So the MT8196 SMI common doesn't require any clocks?

That's fine for me, but this looks bloody similar to MT6989's SMI common, which
is SMI GEN3 and not GEN2....

....so, are you sure that you need a `skip_rpm` flag and not new MTK_SMI_GEN3 and
MTK_SMI_GEN3_SUB_COMM types? :-)

Regards,
Angelo

> ---
>   drivers/memory/mtk-smi.c | 11 ++++++++---
>   1 file changed, 8 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/memory/mtk-smi.c b/drivers/memory/mtk-smi.c
> index a8f5467d6b31..b9affa3c3185 100644
> --- a/drivers/memory/mtk-smi.c
> +++ b/drivers/memory/mtk-smi.c
> @@ -123,6 +123,7 @@ static const char * const mtk_smi_common_clks[] = {"apb", "smi", "gals0", "gals1
>   struct mtk_smi_common_plat {
>   	enum mtk_smi_type	type;
>   	bool			has_gals;
> +	bool			skip_rpm;
>   	u32			bus_sel; /* Balance some larbs to enter mmu0 or mmu1 */
>   
>   	const struct mtk_smi_reg_pair	*init;
> @@ -547,6 +548,9 @@ static int mtk_smi_dts_clk_init(struct device *dev, struct mtk_smi *smi,
>   {
>   	int i, ret;
>   
> +	if (smi->plat->skip_rpm)
> +		return 0;
> +
>   	for (i = 0; i < clk_nr_required; i++)
>   		smi->clks[i].id = clks[i];
>   	ret = devm_clk_bulk_get(dev, clk_nr_required, smi->clks);
> @@ -783,7 +787,7 @@ static int mtk_smi_common_probe(struct platform_device *pdev)
>   	common->dev = dev;
>   	common->plat = of_device_get_match_data(dev);
>   
> -	if (common->plat->has_gals) {
> +	if (!common->plat->skip_rpm && common->plat->has_gals) {
>   		if (common->plat->type == MTK_SMI_GEN2)
>   			clk_required = MTK_SMI_COM_GALS_REQ_CLK_NR;
>   		else if (common->plat->type == MTK_SMI_GEN2_SUB_COMM)
> @@ -814,13 +818,14 @@ static int mtk_smi_common_probe(struct platform_device *pdev)
>   	}
>   
>   	/* link its smi-common if this is smi-sub-common */
> -	if (common->plat->type == MTK_SMI_GEN2_SUB_COMM) {
> +	if (common->plat->type == MTK_SMI_GEN2_SUB_COMM && !common->plat->skip_rpm) {
>   		ret = mtk_smi_device_link_common(dev, &common->smi_common_dev);
>   		if (ret < 0)
>   			return ret;
>   	}
>   
> -	pm_runtime_enable(dev);
> +	if (!common->plat->skip_rpm)
> +		pm_runtime_enable(dev);
>   	platform_set_drvdata(pdev, common);
>   	return 0;
>   }



Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ