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: <3c59833569ca93ec6d65c0145f1054c5f889aeab.camel@mediatek.com>
Date: Tue, 16 Sep 2025 02:01:55 +0000
From: CK Hu (胡俊光) <ck.hu@...iatek.com>
To: "robh@...nel.org" <robh@...nel.org>, "krzk+dt@...nel.org"
	<krzk+dt@...nel.org>, Paul-pl Chen (陳柏霖)
	<Paul-pl.Chen@...iatek.com>, "conor+dt@...nel.org" <conor+dt@...nel.org>,
	AngeloGioacchino Del Regno <angelogioacchino.delregno@...labora.com>,
	"chunkuang.hu@...nel.org" <chunkuang.hu@...nel.org>
CC: Sunny Shen (沈姍姍) <Sunny.Shen@...iatek.com>,
	Sirius Wang (王皓昱) <Sirius.Wang@...iatek.com>,
	Nancy Lin (林欣螢) <Nancy.Lin@...iatek.com>,
	Xiandong Wang (王先冬)
	<Xiandong.Wang@...iatek.com>, "linux-kernel@...r.kernel.org"
	<linux-kernel@...r.kernel.org>, "dri-devel@...ts.freedesktop.org"
	<dri-devel@...ts.freedesktop.org>, Project_Global_Chrome_Upstream_Group
	<Project_Global_Chrome_Upstream_Group@...iatek.com>,
	"linux-mediatek@...ts.infradead.org" <linux-mediatek@...ts.infradead.org>,
	Jason-JH Lin (林睿祥) <Jason-JH.Lin@...iatek.com>,
	"devicetree@...r.kernel.org" <devicetree@...r.kernel.org>,
	"fshao@...omium.org" <fshao@...omium.org>, "p.zabel@...gutronix.de"
	<p.zabel@...gutronix.de>, Singo Chang (張興國)
	<Singo.Chang@...iatek.com>, "linux-arm-kernel@...ts.infradead.org"
	<linux-arm-kernel@...ts.infradead.org>, "matthias.bgg@...il.com"
	<matthias.bgg@...il.com>, "treapking@...omium.org" <treapking@...omium.org>
Subject: Re: [PATCH v4 06/19] soc: mediatek: Add runtime PM and top clocks and
 async controls for MMSYS

On Thu, 2025-08-28 at 16:07 +0800, Paul Chen wrote:
> From: Nancy Lin <nancy.lin@...iatek.com>
> 
> - Add initialization of top clocks and async clocks for each MMSYS.
> - Add PM runtime control and new functions to manage these clocks.
> - Add functions to set these clocks according to the default
>   configuration of the corresponding MMSYS.
> 
> Signed-off-by: Nancy Lin <nancy.lin@...iatek.com>
> Signed-off-by: Paul-pl Chen <paul-pl.chen@...iatek.com>
> ---

[snip]

>  void mtk_mmsys_ddp_connect(struct device *dev,
>  			   enum mtk_ddp_comp_id cur,
>  			   enum mtk_ddp_comp_id next)
> @@ -390,7 +491,7 @@ static int mtk_mmsys_probe(struct platform_device *pdev)
>  	struct platform_device *clks;
>  	struct platform_device *drm;
>  	struct mtk_mmsys *mmsys;
> -	int ret;
> +	int ret, i;
>  
>  	mmsys = devm_kzalloc(dev, sizeof(*mmsys), GFP_KERNEL);
>  	if (!mmsys)
> @@ -432,6 +533,49 @@ static int mtk_mmsys_probe(struct platform_device *pdev)
>  		return PTR_ERR(clks);
>  	mmsys->clks_pdev = clks;
>  
> +	if (mmsys->data->num_top_clk) {
> +		struct device_node *node;
> +
> +		node = of_get_child_by_name(dev->of_node, "top");

You should define this in binding document.

> +		if (!node) {
> +			dev_err(&pdev->dev, "Couldn't find top node\n");
> +			return -EINVAL;
> +		}
> +
> +		mmsys->top_clk = devm_kmalloc_array(dev, mmsys->data->num_top_clk,
> +						    sizeof(*mmsys->top_clk), GFP_KERNEL);
> +		if (!mmsys->top_clk)
> +			return -ENOMEM;
> +
> +		for (i = 0; i < mmsys->data->num_top_clk; i++) {
> +			mmsys->top_clk[i] = of_clk_get(node, i);
> +			if (IS_ERR(mmsys->top_clk[i]))
> +				return PTR_ERR(mmsys->top_clk[i]);
> +		}
> +	}
> +
> +	if (mmsys->data->num_async_info) {
> +		struct device_node *node;
> +
> +		node = of_get_child_by_name(dev->of_node, "async");

You should define this in binding document.

Regards,
CK

> +		if (!node) {
> +			dev_err(&pdev->dev, "Couldn't find async node\n");
> +			return -EINVAL;
> +		}
> +
> +		mmsys->async_clk = devm_kmalloc_array(dev, mmsys->data->num_async_info,
> +						      sizeof(*mmsys->async_clk), GFP_KERNEL);
> +		if (!mmsys->async_clk)
> +			return -ENOMEM;
> +		mmsys->num_async_clk = mmsys->data->num_async_info;
> +
> +		for (i = 0; i < mmsys->num_async_clk; i++) {
> +			mmsys->async_clk[i] = of_clk_get(node, i);
> +			if (IS_ERR(mmsys->async_clk[i]))
> +				return PTR_ERR(mmsys->async_clk[i]);
> +		}
> +	}
> +
>  	if (mmsys->data->is_vppsys)
>  		goto out_probe_done;
>  
> @@ -443,6 +587,9 @@ static int mtk_mmsys_probe(struct platform_device *pdev)
>  	}
>  	mmsys->drm_pdev = drm;
>  
> +	if (of_property_present(dev->of_node, "power-domains"))
> +		pm_runtime_enable(dev);
> +
>  out_probe_done:
>  	return 0;
>  }
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ