On Thu, Sep 14, 2023 at 11:10:53AM +0200, Ahmad Fatoum wrote:
> Various remoteproc drivers point at reserved memory regions via a
> memory-region property in the device tree. As all reserved memory
> regions are requested since 2022.10.0, we shouldn't have code request
> them again. Fix that. There's not much use of the memory-region property
> for i.MX upstream, so breakage should've been rather limited.
> 
> This has only been build-tested.
> 
> Fixes: d0b5f6bde15b ("of: reserved-mem: reserve regions prior to 
> mmu_initcall()")
> Signed-off-by: Ahmad Fatoum <[email protected]>
> ---
>  drivers/remoteproc/imx_rproc.c | 15 +++++++--------
>  1 file changed, 7 insertions(+), 8 deletions(-)

Applied, thanks

Sascha

> 
> diff --git a/drivers/remoteproc/imx_rproc.c b/drivers/remoteproc/imx_rproc.c
> index 68fe8031e5fb..c1f70cf75520 100644
> --- a/drivers/remoteproc/imx_rproc.c
> +++ b/drivers/remoteproc/imx_rproc.c
> @@ -422,7 +422,7 @@ static int imx_rproc_addr_init(struct imx_rproc *priv,
>       /* remap optional addresses */
>       for (a = 0; a < nph; a++) {
>               struct device_node *node;
> -             struct resource res, *res_cpu;
> +             struct resource res;
>  
>               node = of_parse_phandle(np, "memory-region", a);
>               err = of_address_to_resource(node, 0, &res);
> @@ -434,13 +434,12 @@ static int imx_rproc_addr_init(struct imx_rproc *priv,
>               if (b >= IMX7D_RPROC_MEM_MAX)
>                       break;
>  
> -             res_cpu = request_sdram_region(dev_name(dev), res.start,
> -                                            resource_size(&res));
> -             if (!res_cpu) {
> -                     dev_err(dev, "remap optional addresses failed\n");
> -                     return -ENOMEM;
> -             }
> -             priv->mem[b].cpu_addr = (void *)res_cpu->start;
> +             /*
> +              * reserved memory region are automatically requested and
> +              * mapped uncached
> +              */
> +
> +             priv->mem[b].cpu_addr = phys_to_virt(res.start);
>               priv->mem[b].sys_addr = res.start;
>               priv->mem[b].size = resource_size(&res);
>               b++;
> -- 
> 2.39.2
> 
> 
> 

-- 
Pengutronix e.K.                           |                             |
Steuerwalder Str. 21                       | http://www.pengutronix.de/  |
31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

Reply via email to