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] [day] [month] [year] [list]
Message-ID: <1b1231e5-cf10-4a26-8a62-311f4d8bcae9@collabora.com>
Date: Fri, 12 Jul 2024 10:21:07 +0200
From: AngeloGioacchino Del Regno <angelogioacchino.delregno@...labora.com>
To: Shun-yi Wang <shun-yi.wang@...iatek.com>,
 Bjorn Andersson <andersson@...nel.org>,
 Mathieu Poirier <mathieu.poirier@...aro.org>
Cc: Matthias Brugger <matthias.bgg@...il.com>,
 linux-remoteproc@...r.kernel.org, linux-kernel@...r.kernel.org,
 linux-arm-kernel@...ts.infradead.org, linux-mediatek@...ts.infradead.org,
 Project_Global_Chrome_Upstream_Group@...iatek.com,
 jason-ch.chen@...iatek.com, yaya.chang@...iatek.com,
 teddy.chen@...iatek.com, olivia.wen@...iatek.com
Subject: Re: [PATCH 1/1] remoteproc: mediatek: Support multiple reserved
 memory regions

Il 03/07/24 13:53, Shun-yi Wang ha scritto:
> From: "shun-yi.wang" <shun-yi.wang@...iatek.com>
> 
> SCP supports multiple reserved memory regions, intended for
> specific hardwards.
> 
> Signed-off-by: shun-yi.wang <shun-yi.wang@...iatek.com>
> ---
>   drivers/remoteproc/mtk_scp.c | 25 +++++++++++++++++--------
>   1 file changed, 17 insertions(+), 8 deletions(-)
> 
> diff --git a/drivers/remoteproc/mtk_scp.c b/drivers/remoteproc/mtk_scp.c
> index 9ecd5ea04b5f3..1902826cea0af 100644
> --- a/drivers/remoteproc/mtk_scp.c
> +++ b/drivers/remoteproc/mtk_scp.c
> @@ -1006,22 +1006,31 @@ EXPORT_SYMBOL_GPL(scp_mapping_dm_addr);
>   
>   static int scp_map_memory_region(struct mtk_scp *scp)
>   {
> -	int ret;
> +	int ret, i, err;
>   	const struct mtk_scp_sizes_data *scp_sizes;
> +	struct device_node *node = scp->dev->of_node;
> +	struct of_phandle_iterator it;


	struct device_node *node = scp->dev->of_node;
  	const struct mtk_scp_sizes_data *scp_sizes;
	struct of_phandle_iterator it;
	int i = 0;
	int ret;

	of_for_each_phandle(&it, ret, node, "memory-region", NULL, 0) {
		ret = ...
		if (ret) .....
		i++;
	}

> +
> +	i = 0;
> +	of_for_each_phandle(&it, err, node, "memory-region", NULL, 0) {
> +		ret = of_reserved_mem_device_init_by_idx(scp->dev, node, i);
> +
> +		if (ret) {
> +			dev_err(scp->dev, "failed to assign memory-region: %s\n",
> +				it.node->name);
> +			of_node_put(it.node);
> +			return -ENOMEM;
> +		}
>   
> -	ret = of_reserved_mem_device_init(scp->dev);
> +		i++;
> +	}
>   
>   	/* reserved memory is optional. */
> -	if (ret == -ENODEV) {
> +	if (!i) {

	if (i == 0) {
		dev_dbg(scp->dev, "skipping reserved memory initialization\n");
		return 0;
	}


Regards,
Angelo



Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ