Re: [PATCH v5] remoteproc: Use of_reserved_mem_region_* functions for "memory-region"

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Aug 20, 2025 at 3:19 AM Daniel Baluta <daniel.baluta@xxxxxxxxx> wrote:
>
> Hi Rob,
>
> This patch will break IMX RPROC support.
> <snip>
>
> > --- a/drivers/remoteproc/imx_rproc.c
> > +++ b/drivers/remoteproc/imx_rproc.c
>
> <snip>
> >  static int imx_rproc_parse_fw(struct rproc *rproc, const struct firmware *fw)
> <snip>
>
> > -               priv->mem[b].cpu_addr = devm_ioremap_wc(&pdev->dev, res.start, resource_size(&res));
> > +               priv->mem[b].cpu_addr = devm_ioremap_resource_wc(&pdev->dev, &res);
>
> devm_ioremap_resource_wc works only for IORESOURCE_MEM resources:
>
> lib/devres.c:124
> static void __iomem *
> __devm_ioremap_resource(struct device *dev, const struct resource *res,
>
> »       if (!res || resource_type(res) != IORESOURCE_MEM) {
> »       »       ret = dev_err_probe(dev, -EINVAL, "invalid resource
> %pR\n", res);
> »       »       return IOMEM_ERR_PTR(ret);
> »       }
>
> while the devm_ioremap_wc doesn't care about this.
>
> So we cannot use devm_ioremap_resource_wc here unless you add
> IORESOURCE_MEM flags
> to  of_reserved_mem_region_to_resource as discussed here:
>
> https://lkml.org/lkml/2025/4/28/759
>
> The same issue we are already experiencing with Sound Open Firmware
> where the change was already merged
> and we have a bug already reported.
>
> How should we fix this:
>
> 1) Add  res->flags = IORESOURCE_MEM; in  of_reserved_mem_region_to_resource

Sigh. I thought I rolled that change into it. I just sent a fix[1].

Rob

[1] https://lore.kernel.org/all/20250820192805.565568-1-robh@xxxxxxxxxx/





[Index of Archives]     [Linux Samsung SOC]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]

  Powered by Linux