remoteproc: qcom_wcnss: Fix reserved region mapping failure
Subsystems (2)
PATCH 1/1 remoteproc: qcom_wcnss: Fix reserved region mapping failure
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().
---
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?
--- drivers/remoteproc/qcom_wcnss.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/remoteproc/qcom_wcnss.c +1 -1
@@ -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);
Signature · 1 line
2.51.0
Am Mittwoch, dem 28.01.2026 um 16:02 -0600 schrieb Rob Herring (Arm):
Quoted 40 lines
Commit
c70b9d5fdcd7("remoteproc: qcom: Use of_reserved_mem_region_* functions for "memory-region"") switched fromdevm_ioremap_wc()todevm_ioremap_resource_wc(). The difference isdevm_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 todevm_ioremap_wc().Reported-by Marek Szyprowski <[email protected]>Reported-by André Apitzsch <[email protected]>Fixes c70b9d5fdcd7 ("remoteproc: qcom: Use of_reserved_mem_region_*functions for "memory-region"")
Signed-off-by Rob Herring (Arm) <[email protected]>---
I created some dummy regions matching the flags used here and didrequest_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?
---
drivers/remoteproc/qcom_wcnss.c | 2 +-1 file changed, 1 insertion(+), 1 deletion(-)drivers/remoteproc/qcom_wcnss.c +0
-0@@ -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);drivers/remoteproc/qcom_wcnss.c +0
-1- wcnss->mem_region = devm_ioremap_resource_wc(wcnss->dev,&res);
drivers/remoteproc/qcom_wcnss.c +1
-0+ wcnss->mem_region = devm_ioremap_wc(wcnss->dev, wcnss-Quoted 1 line
mem_phys,wcnss->mem_size);
Quoted 4 lines
if (
IS_ERR(wcnss->mem_region)) { dev_err(wcnss->dev, "unable to map memory region:
%pR\n", &res);
returnPTR_ERR(wcnss->mem_region);
Thanks.
Quoted 8 lines · Rob Herring (Arm)
Commit
c70b9d5fdcd7("remoteproc: qcom: Use of_reserved_mem_region_* functions for "memory-region"") switched fromdevm_ioremap_wc()todevm_ioremap_resource_wc(). The difference isdevm_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 todevm_ioremap_wc().
Quoted 4 lines
Reported-by Marek Szyprowski <[email protected]>Reported-by André Apitzsch <[email protected]>Fixes c70b9d5fdcd7 ("remoteproc: qcom: Use of_reserved_mem_region_* functions for "memory-region"")Signed-off-by Rob Herring (Arm) <[email protected]>
Quoted 7 lines
---
I created some dummy regions matching the flags used here and didrequest_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.
Quoted 9 lines
--- drivers/remoteproc/qcom_wcnss.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/remoteproc/qcom_wcnss.c +0
-0
drivers/remoteproc/qcom_wcnss.c static int wcnss_alloc_memory_region(struct qcom_wcnss *wcnss) · line 543
Quoted 8 lines
drivers/remoteproc/qcom_wcnss.c +1
-1@@ -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
Signature · 2 lines
Marek Szyprowski, PhD Samsung R&D Institute Poland
Quoted 9 lines · Rob Herring (Arm)
Commit
c70b9d5fdcd7("remoteproc: qcom: Use of_reserved_mem_region_* functions for "memory-region"") switched fromdevm_ioremap_wc()todevm_ioremap_resource_wc(). The difference isdevm_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 todevm_ioremap_wc().[...]
Applied, thanks!
[1/1] remoteproc: qcom_wcnss: Fix reserved region mapping failure
commit: f9b888599418951b8229bbb28851ed4da50c58e9
Best regards,
Signature · 1 line
Bjorn Andersson <[email protected]>