Skip to contentSkip to conversation

remoteproc: qcom_q6v5_wcss: fix parsing of qcom,halt-regs

PATCH Superseded Alexandru Gagniuc 3 participants 8 messages Nov 29, 2025 – Dec 6, 2025

Subsystems (2)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 remoteproc: qcom_q6v5_wcss: fix parsing of qcom,halt-regs

The "qcom,halt-regs" consists of a phandle reference followed by the three offsets within syscon for halt registers. Thus, we need to request 4 integers from of_property_read_variable_u32_array(), with the halt_reg ofsets at indexes 1, 2, and 3. Offset 0 is the phandle.

With MAX_HALT_REG at 3, of_property_read_variable_u32_array() returns -EOVERFLOW, causing .probe() to fail.

Increase MAX_HALT_REG to 4, and update the indexes accordingly.

---
 drivers/remoteproc/qcom_q6v5_wcss.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
drivers/remoteproc/qcom_q6v5_wcss.c +4 -4
index 07c88623f5978..23ec87827d4f8 100644
@@ -85,7 +85,7 @@
 #define TCSR_WCSS_CLK_MASK	0x1F
 #define TCSR_WCSS_CLK_ENABLE	0x14
 
-#define MAX_HALT_REG		3
+#define MAX_HALT_REG		4
 enum {
 	WCSS_IPQ8074,
 	WCSS_QCS404,
@@ -864,9 +864,9 @@ static int q6v5_wcss_init_mmio(struct q6v5_wcss *wcss,
 		return -EINVAL;
 	}
 
-	wcss->halt_q6 = halt_reg[0];
-	wcss->halt_wcss = halt_reg[1];
-	wcss->halt_nc = halt_reg[2];
+	wcss->halt_q6 = halt_reg[1];
+	wcss->halt_wcss = halt_reg[2];
+	wcss->halt_nc = halt_reg[3];
 
 	return 0;
 }
Signature · 1 line
2.45.1
#1 lore raw

PATCH 2/2 remoteproc: qcom_q6v5_wcss: use optional reset for wcss_q6_bcr_reset

The "wcss_q6_bcr_reset" is not used on IPQ8074, and IPQ6018. Use devm_reset_control_get_optional_exclusive() for this reset so that probe() does not fail on platforms where it is not used.

---
 drivers/remoteproc/qcom_q6v5_wcss.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/remoteproc/qcom_q6v5_wcss.c +2 -1
index 23ec87827d4f8..6e28744ce3f75 100644
@@ -811,7 +811,8 @@ static int q6v5_wcss_init_reset(struct q6v5_wcss *wcss,
 		}
 	}
 
-	wcss->wcss_q6_bcr_reset = devm_reset_control_get_exclusive(dev, "wcss_q6_bcr_reset");
+	wcss->wcss_q6_bcr_reset = devm_reset_control_get_optional_exclusive(dev,
+							"wcss_q6_bcr_reset");
 	if (IS_ERR(wcss->wcss_q6_bcr_reset)) {
 		dev_err(wcss->dev, "unable to acquire wcss_q6_bcr_reset\n");
 		return PTR_ERR(wcss->wcss_q6_bcr_reset);
Signature · 1 line
2.45.1
#2 lore raw

Re: [PATCH 2/2] remoteproc: qcom_q6v5_wcss: use optional reset for wcss_q6_bcr_reset

Quoted 6 lines · Alexandru Gagniuc

The "wcss_q6_bcr_reset" is not used on IPQ8074, and IPQ6018. Use devm_reset_control_get_optional_exclusive() for this reset so that probe() does not fail on platforms where it is not used.

---

This reset is not even used (or documented anywhere).. the closest I can find is "wcss_q6_reset" in qcom,q6v5.txt, initially documented in:

Fixes 3a3d4163e0bf ("remoteproc: qcom: Introduce Hexagon V5 based WCSS driver")

which claims it was made for.. IPQ8074

Peeking at the GCC driver, this reset is most likely present as GCC_WCSS_Q6_BCR

Konrad

#3 lore raw

Re: [PATCH 2/2] remoteproc: qcom_q6v5_wcss: use optional reset for wcss_q6_bcr_reset

Quoted 12 lines · Konrad Dybcio
Quoted 6 lines · Alexandru Gagniuc

The "wcss_q6_bcr_reset" is not used on IPQ8074, and IPQ6018. Use devm_reset_control_get_optional_exclusive() for this reset so that probe() does not fail on platforms where it is not used.

---

This reset is not even used (or documented anywhere).. the closest I can find is "wcss_q6_reset" in qcom,q6v5.txt, initially documented in:

Quoted 6 lines
Fixes 3a3d4163e0bf ("remoteproc: qcom: Introduce Hexagon V5 based WCSS driver")

which claims it was made for.. IPQ8074

Peeking at the GCC driver, this reset is most likely present as GCC_WCSS_Q6_BCR

The downstream kernel uses GCC_WCSS_Q6_BCR for ipq8074 [1] and ipq6018 [2]. They only use of ->wcss_q6_bcr_reset in the QCN404 path, which does not use ->wcss_q6_reset. So maybe we can get away with calling it "wcss_q6_reset", store the pointer in ->wcss_q6_reset, and drop '.wcss_q6_reset_required'

Which path do you think is the most appropriate?

Alex

[1] https://git.codelinaro.org/clo/qsdk/oss/kernel/linux-ipq-5.4/-/blob/NHSS.QSDK.12.5.r5/arch/arm64/boot/dts/qcom/ipq8074.dtsi?ref_type=heads#L1060
[2] https://git.codelinaro.org/clo/qsdk/oss/kernel/linux-ipq-5.4/-/blob/NHSS.QSDK.12.5.r5/arch/arm64/boot/dts/qcom/ipq6018.dtsi?ref_type=heads#L1440
[3] https://git.codelinaro.org/clo/qsdk/oss/kernel/linux-ipq-5.4/-/blob/NHSS.QSDK.12.5.r5/drivers/remoteproc/qcom_q6v5_wcss.c#L967

#4 lore raw

Re: [PATCH 2/2] remoteproc: qcom_q6v5_wcss: use optional reset for wcss_q6_bcr_reset

Quoted 17 lines · On 12/1/25 10:04 PM, [email protected] wrote:
Quoted 16 lines · Konrad Dybcio
Quoted 6 lines · Alexandru Gagniuc

The "wcss_q6_bcr_reset" is not used on IPQ8074, and IPQ6018. Use devm_reset_control_get_optional_exclusive() for this reset so that probe() does not fail on platforms where it is not used.

---

This reset is not even used (or documented anywhere).. the closest I can find is "wcss_q6_reset" in qcom,q6v5.txt, initially documented in:

Fixes 3a3d4163e0bf ("remoteproc: qcom: Introduce Hexagon V5 based WCSS driver")

which claims it was made for.. IPQ8074

Quoted 7 lines
Quoted 2 lines

Peeking at the GCC driver, this reset is most likely present as GCC_WCSS_Q6_BCR

The downstream kernel uses GCC_WCSS_Q6_BCR for ipq8074 [1] and ipq6018 [2]. They only use of ->wcss_q6_bcr_reset in the QCN404 path, which does not use ->wcss_q6_reset. So maybe we can get away with calling it "wcss_q6_reset", store the pointer in ->wcss_q6_reset, and drop '.wcss_q6_reset_required'

"BCR reset" is like saying "PIN number", both of the ones you mentioned are referring to the same thing

Konrad

maintainer
#5 lore raw
In reply to Alexandru Gagniuc
Quoted 10 lines · Alexandru Gagniuc

The "qcom,halt-regs" consists of a phandle reference followed by the three offsets within syscon for halt registers. Thus, we need to request 4 integers from of_property_read_variable_u32_array(), with the halt_reg ofsets at indexes 1, 2, and 3. Offset 0 is the phandle.

With MAX_HALT_REG at 3, of_property_read_variable_u32_array() returns -EOVERFLOW, causing .probe() to fail.

Increase MAX_HALT_REG to 4, and update the indexes accordingly.

Good catch, thanks

Fixes 0af65b9b915e ("remoteproc: qcom: wcss: Add non pas wcss Q6 support for QCS404")

Regards,
Bjorn

Quoted 34 lines
---
 drivers/remoteproc/qcom_q6v5_wcss.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
drivers/remoteproc/qcom_q6v5_wcss.c +4 -4
index 07c88623f5978..23ec87827d4f8 100644
@@ -85,7 +85,7 @@
 #define TCSR_WCSS_CLK_MASK	0x1F
 #define TCSR_WCSS_CLK_ENABLE	0x14
 
-#define MAX_HALT_REG		3
+#define MAX_HALT_REG		4
 enum {
 	WCSS_IPQ8074,
 	WCSS_QCS404,
@@ -864,9 +864,9 @@ static int q6v5_wcss_init_mmio(struct q6v5_wcss *wcss,
 		return -EINVAL;
 	}
 
-	wcss->halt_q6 = halt_reg[0];
-	wcss->halt_wcss = halt_reg[1];
-	wcss->halt_nc = halt_reg[2];
+	wcss->halt_q6 = halt_reg[1];
+	wcss->halt_wcss = halt_reg[2];
+	wcss->halt_nc = halt_reg[3];
 
 	return 0;
 }
Signature · 1 line
2.45.1
author
#6 lore raw
Quoted 9 lines · Bjorn Andersson
Quoted 8 lines · Alexandru Gagniuc

The "qcom,halt-regs" consists of a phandle reference followed by th three offsets within syscon for halt registers. Thus, we need to request 4 integers from of_property_read_variable_u32_array(), with the halt_reg ofsets at indexes 1, 2, and 3. Offset 0 is the phandle.

With MAX_HALT_REG at 3, of_property_read_variable_u32_array() returns -EOVERFLOW, causing .probe() to fail.

Quoted 6 lines
Quoted 2 lines

Increase MAX_HALT_REG to 4, and update the indexes accordingly.

Good catch, thanks

Fixes 0af65b9b915e ("remoteproc: qcom: wcss: Add non pas wcss Q6 support for QCS404")

Hi Bjorn,

I noticed that v1 of this series is included in the pull for v6.19 [1], even though there is a v2 [2] with some of your and Konrad's feedback included. I wanted to check if this is your intention. I am okay to go with v1, and am happy to submit any further improvements after the merge window.

Alex

[1] https://lore.kernel.org/linux-remoteproc/[email protected]/T/#u
[2] lore.kernel.org/linux-remoteproc/[email protected]/#r> Regards,

Quoted 36 lines

Bjorn

Quoted 34 lines
---
  drivers/remoteproc/qcom_q6v5_wcss.c | 8 ++++----
  1 file changed, 4 insertions(+), 4 deletions(-)
drivers/remoteproc/qcom_q6v5_wcss.c +4 -4
index 07c88623f5978..23ec87827d4f8 100644
@@ -85,7 +85,7 @@
  #define TCSR_WCSS_CLK_MASK	0x1F
  #define TCSR_WCSS_CLK_ENABLE	0x14
 
-#define MAX_HALT_REG		3
+#define MAX_HALT_REG		4
  enum {
  	WCSS_IPQ8074,
  	WCSS_QCS404,
@@ -864,9 +864,9 @@ static int q6v5_wcss_init_mmio(struct q6v5_wcss *wcss,
  		return -EINVAL;
  	}
 
-	wcss->halt_q6 = halt_reg[0];
-	wcss->halt_wcss = halt_reg[1];
-	wcss->halt_nc = halt_reg[2];
+	wcss->halt_q6 = halt_reg[1];
+	wcss->halt_wcss = halt_reg[2];
+	wcss->halt_nc = halt_reg[3];
 
  	return 0;
  }
Signature · 1 line
2.45.1
maintainer
#7 lore raw
Quoted 15 lines · Alex G.
Quoted 14 lines · Bjorn Andersson
Quoted 10 lines · Alexandru Gagniuc

The "qcom,halt-regs" consists of a phandle reference followed by th three offsets within syscon for halt registers. Thus, we need to request 4 integers from of_property_read_variable_u32_array(), with the halt_reg ofsets at indexes 1, 2, and 3. Offset 0 is the phandle.

With MAX_HALT_REG at 3, of_property_read_variable_u32_array() returns -EOVERFLOW, causing .probe() to fail.

Increase MAX_HALT_REG to 4, and update the indexes accordingly.

Good catch, thanks

Quoted 9 lines
Quoted 1 line
Fixes 0af65b9b915e ("remoteproc: qcom: wcss: Add non pas wcss Q6 support for QCS404")

Hi Bjorn,

I noticed that v1 of this series is included in the pull for v6.19 [1], even though there is a v2 [2] with some of your and Konrad's feedback included. I wanted to check if this is your intention. I am okay to go with v1, and am happy to submit any further improvements after the merge window.

That's strange, I should have sent you a "thank you" email when I applied it. I added my Fixes, and must have missed Konrad's input (or it hadn't shown up yet?)

Without looking at Konrad's feedback, please send a new patch on top of what I did merge if the changes would be beneficial.

Thanks,
Bjorn

Quoted 39 lines

Alex

[1] https://lore.kernel.org/linux-remoteproc/[email protected]/T/#u
[2] lore.kernel.org/linux-remoteproc/[email protected]/#r> Regards,

Quoted 33 lines

Bjorn

Quoted 31 lines
---
  drivers/remoteproc/qcom_q6v5_wcss.c | 8 ++++----
  1 file changed, 4 insertions(+), 4 deletions(-)
drivers/remoteproc/qcom_q6v5_wcss.c +4 -4
index 07c88623f5978..23ec87827d4f8 100644
@@ -85,7 +85,7 @@
  #define TCSR_WCSS_CLK_MASK	0x1F
  #define TCSR_WCSS_CLK_ENABLE	0x14
-#define MAX_HALT_REG		3
+#define MAX_HALT_REG		4
  enum {
  	WCSS_IPQ8074,
  	WCSS_QCS404,
@@ -864,9 +864,9 @@ static int q6v5_wcss_init_mmio(struct q6v5_wcss *wcss,
  		return -EINVAL;
  	}
-	wcss->halt_q6 = halt_reg[0];
-	wcss->halt_wcss = halt_reg[1];
-	wcss->halt_nc = halt_reg[2];
+	wcss->halt_q6 = halt_reg[1];
+	wcss->halt_wcss = halt_reg[2];
+	wcss->halt_nc = halt_reg[3];
  	return 0;
  }
Signature · 1 line
2.45.1