Re: [PATCH] remoteproc: qcom_wcnss: Fix reserved region mapping failure

Marek Szyprowski
2026-02-10T10:06:07Z

On 28.01.2026 23:02, Rob Herring (Arm) wrote:
> Commit c70b9d5fdcd7 ("remoteproc: qcom: Use of_reserved_mem_region_*
> functions for "memory-region"") switched from devm_ioremap_wc() to
> devm_ioremap_resource_wc(). The difference is devm_ioremap_resource_wc()
> also requests the resource which fails. Testing of both fixed and
> dynamic reserved regions indicates that requesting the resource should
> work, so I'm not sure why it doesn't work in this case. Fix the issue by
> reverting back to devm_ioremap_wc().
>
> Reported-by: Marek Szyprowski <m.szyprowski@samsung.com>
> Reported-by: André Apitzsch <git@apitzsch.eu>
> Fixes: c70b9d5fdcd7 ("remoteproc: qcom: Use of_reserved_mem_region_* functions for "memory-region"")
> Signed-off-by: Rob Herring (Arm) <robh@kernel.org>
Tested-by: Marek Szyprowski <m.szyprowski@samsung.com>
> ---
> I created some dummy regions matching the flags used here and did
> request_mem_region() on them successfully, so I'm not sure why it
> doesn't work for this driver. Something else is requesting the region?
>
> Perhaps there's a deferred probe and somehow request_mem_region() is not
> getting undone correctly?

I didn't manage to track what is the root cause of the
request_mem_region() failure, but this is definitely not related to
deferred probe. This function is called only once from the qcom_wcnss
driver and fails, because the region is already assigned to 'reserved'
owner.

> ---
> drivers/remoteproc/qcom_wcnss.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/remoteproc/qcom_wcnss.c b/drivers/remoteproc/qcom_wcnss.c
> index ee18bf2e8054..4add9037dbd5 100644
> --- a/drivers/remoteproc/qcom_wcnss.c
> +++ b/drivers/remoteproc/qcom_wcnss.c
> @@ -537,7 +537,7 @@ static int wcnss_alloc_memory_region(struct qcom_wcnss *wcnss)
>
> wcnss->mem_phys = wcnss->mem_reloc = res.start;
> wcnss->mem_size = resource_size(&res);
> - wcnss->mem_region = devm_ioremap_resource_wc(wcnss->dev, &res);
> + wcnss->mem_region = devm_ioremap_wc(wcnss->dev, wcnss->mem_phys, wcnss->mem_size);
> if (IS_ERR(wcnss->mem_region)) {
> dev_err(wcnss->dev, "unable to map memory region: %pR\n", &res);
> return PTR_ERR(wcnss->mem_region);

Best regards
--
Marek Szyprowski, PhD
Samsung R&D Institute Poland