Skip to contentSkip to conversation

remoteproc: qcom_wcnss: Fix reserved region mapping failure

PATCH Applied Rob Herring (Arm) 4 participants 4 messages Jan 28 – Feb 23

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

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().

Fixes c70b9d5fdcd7 ("remoteproc: qcom: Use of_reserved_mem_region_* functions for "memory-region"")

---
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
index ee18bf2e8054..4add9037dbd5 100644
@@ -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
Tested-by on v1 1/1
#1 lore raw

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 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().

Fixes c70b9d5fdcd7 ("remoteproc: qcom: Use of_reserved_mem_region_*

functions for "memory-region"")

---
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 +0 -0
index ee18bf2e8054..4add9037dbd5 100644
@@ -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);
  return PTR_ERR(wcnss->mem_region);

Thanks.

Tested-by on v1 1/1
#2 lore raw
In reply to Rob Herring (Arm)
Quoted 8 lines · Rob Herring (Arm)

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().

Quoted 4 lines
Fixes c70b9d5fdcd7 ("remoteproc: qcom: Use of_reserved_mem_region_* functions for "memory-region"")
Quoted 7 lines

---
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.

Quoted 9 lines
---
  drivers/remoteproc/qcom_wcnss.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
drivers/remoteproc/qcom_wcnss.c +0 -0
index ee18bf2e8054..4add9037dbd5 100644

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
maintainer Applied
#3 lore raw
In reply to Rob Herring (Arm)
Quoted 9 lines · Rob Herring (Arm)

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().

[...]

Applied, thanks!

[1/1] remoteproc: qcom_wcnss: Fix reserved region mapping failure

      commit: f9b888599418951b8229bbb28851ed4da50c58e9

Best regards,

Signature · 1 line
Bjorn Andersson <[email protected]>