Linux ARM-MSM sub-architecture
 help / color / mirror / Atom feed
* [PATCH v2 1/2] remoteproc: qcom_q6v5_wcss: fix parsing of qcom,halt-regs
@ 2025-12-02 16:26 Alexandru Gagniuc
  2025-12-02 16:26 ` [PATCH v2 2/2] remoteproc: qcom_q6v5_wcss: drop redundant wcss_q6_bcr_reset Alexandru Gagniuc
  2025-12-03 11:24 ` [PATCH v2 1/2] remoteproc: qcom_q6v5_wcss: fix parsing of qcom,halt-regs Konrad Dybcio
  0 siblings, 2 replies; 4+ messages in thread
From: Alexandru Gagniuc @ 2025-12-02 16:26 UTC (permalink / raw)
  To: andersson, mathieu.poirier, linux-arm-msm, linux-remoteproc,
	p.zabel, Govind Singh, Gokul Sriram Palanisamy
  Cc: konrad.dybcio, linux-kernel, 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.

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

Signed-off-by: Alexandru Gagniuc <mr.nuke.me@gmail.com>
---
changes since v1:
 - Add "Fixes:" to commit message

 drivers/remoteproc/qcom_q6v5_wcss.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/remoteproc/qcom_q6v5_wcss.c b/drivers/remoteproc/qcom_q6v5_wcss.c
index 07c88623f5978..23ec87827d4f8 100644
--- a/drivers/remoteproc/qcom_q6v5_wcss.c
+++ b/drivers/remoteproc/qcom_q6v5_wcss.c
@@ -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;
 }
-- 
2.45.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH v2 2/2] remoteproc: qcom_q6v5_wcss: drop redundant wcss_q6_bcr_reset
  2025-12-02 16:26 [PATCH v2 1/2] remoteproc: qcom_q6v5_wcss: fix parsing of qcom,halt-regs Alexandru Gagniuc
@ 2025-12-02 16:26 ` Alexandru Gagniuc
  2025-12-03 12:09   ` Konrad Dybcio
  2025-12-03 11:24 ` [PATCH v2 1/2] remoteproc: qcom_q6v5_wcss: fix parsing of qcom,halt-regs Konrad Dybcio
  1 sibling, 1 reply; 4+ messages in thread
From: Alexandru Gagniuc @ 2025-12-02 16:26 UTC (permalink / raw)
  To: andersson, mathieu.poirier, linux-arm-msm, linux-remoteproc,
	p.zabel, Gokul Sriram Palanisamy, Govind Singh
  Cc: konrad.dybcio, linux-kernel, Alexandru Gagniuc

The wcss_q6_bcr_reset used on QCS404, and wcss_q6_reset used on IPQ
are the same. "BCR reset" is redundant, and likely a mistake. Use the
documented "wcss_q6_reset" instead. Drop ".wcss_q6_reset_required"
from the descriptor, since all targets now need it.

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

Signed-off-by: Alexandru Gagniuc <mr.nuke.me@gmail.com>
---
Changes since v1:
 - rework change to unify wcss_q6_bcr_reset and wcss_q6_reset

 drivers/remoteproc/qcom_q6v5_wcss.c | 22 +++++-----------------
 1 file changed, 5 insertions(+), 17 deletions(-)

diff --git a/drivers/remoteproc/qcom_q6v5_wcss.c b/drivers/remoteproc/qcom_q6v5_wcss.c
index 23ec87827d4f8..465119201c345 100644
--- a/drivers/remoteproc/qcom_q6v5_wcss.c
+++ b/drivers/remoteproc/qcom_q6v5_wcss.c
@@ -96,7 +96,6 @@ struct wcss_data {
 	unsigned int crash_reason_smem;
 	u32 version;
 	bool aon_reset_required;
-	bool wcss_q6_reset_required;
 	const char *ssr_name;
 	const char *sysmon_name;
 	int ssctl_id;
@@ -134,7 +133,6 @@ struct q6v5_wcss {
 	struct reset_control *wcss_aon_reset;
 	struct reset_control *wcss_reset;
 	struct reset_control *wcss_q6_reset;
-	struct reset_control *wcss_q6_bcr_reset;
 
 	struct qcom_q6v5 q6v5;
 
@@ -309,7 +307,7 @@ static int q6v5_wcss_qcs404_power_on(struct q6v5_wcss *wcss)
 		return ret;
 
 	/* Remove reset to the WCNSS QDSP6SS */
-	reset_control_deassert(wcss->wcss_q6_bcr_reset);
+	reset_control_deassert(wcss->wcss_q6_reset);
 
 	/* Enable Q6SSTOP_AHBFABRIC_CBCR clock */
 	ret = clk_prepare_enable(wcss->ahbfabric_cbcr_clk);
@@ -803,18 +801,10 @@ static int q6v5_wcss_init_reset(struct q6v5_wcss *wcss,
 		return PTR_ERR(wcss->wcss_reset);
 	}
 
-	if (desc->wcss_q6_reset_required) {
-		wcss->wcss_q6_reset = devm_reset_control_get_exclusive(dev, "wcss_q6_reset");
-		if (IS_ERR(wcss->wcss_q6_reset)) {
-			dev_err(wcss->dev, "unable to acquire wcss_q6_reset\n");
-			return PTR_ERR(wcss->wcss_q6_reset);
-		}
-	}
-
-	wcss->wcss_q6_bcr_reset = devm_reset_control_get_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);
+	wcss->wcss_q6_reset = devm_reset_control_get_exclusive(dev, "wcss_q6_reset");
+	if (IS_ERR(wcss->wcss_q6_reset)) {
+		dev_err(wcss->dev, "unable to acquire wcss_q6_reset\n");
+		return PTR_ERR(wcss->wcss_q6_reset);
 	}
 
 	return 0;
@@ -1066,7 +1056,6 @@ static const struct wcss_data wcss_ipq8074_res_init = {
 	.firmware_name = "IPQ8074/q6_fw.mdt",
 	.crash_reason_smem = WCSS_CRASH_REASON,
 	.aon_reset_required = true,
-	.wcss_q6_reset_required = true,
 	.ops = &q6v5_wcss_ipq8074_ops,
 	.requires_force_stop = true,
 };
@@ -1076,7 +1065,6 @@ static const struct wcss_data wcss_qcs404_res_init = {
 	.firmware_name = "wcnss.mdt",
 	.version = WCSS_QCS404,
 	.aon_reset_required = false,
-	.wcss_q6_reset_required = false,
 	.ssr_name = "mpss",
 	.sysmon_name = "wcnss",
 	.ssctl_id = 0x12,
-- 
2.45.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH v2 1/2] remoteproc: qcom_q6v5_wcss: fix parsing of qcom,halt-regs
  2025-12-02 16:26 [PATCH v2 1/2] remoteproc: qcom_q6v5_wcss: fix parsing of qcom,halt-regs Alexandru Gagniuc
  2025-12-02 16:26 ` [PATCH v2 2/2] remoteproc: qcom_q6v5_wcss: drop redundant wcss_q6_bcr_reset Alexandru Gagniuc
@ 2025-12-03 11:24 ` Konrad Dybcio
  1 sibling, 0 replies; 4+ messages in thread
From: Konrad Dybcio @ 2025-12-03 11:24 UTC (permalink / raw)
  To: Alexandru Gagniuc, andersson, mathieu.poirier, linux-arm-msm,
	linux-remoteproc, p.zabel, Govind Singh, Gokul Sriram Palanisamy
  Cc: linux-kernel

On 12/2/25 5:26 PM, Alexandru Gagniuc wrote:
> 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.
> 
> Fixes: 0af65b9b915e ("remoteproc: qcom: wcss: Add non pas wcss Q6 support for QCS404")
> 
> Signed-off-by: Alexandru Gagniuc <mr.nuke.me@gmail.com>
> ---

Hm, that surely could have never worked

Reviewed-by: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>

Konrad


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH v2 2/2] remoteproc: qcom_q6v5_wcss: drop redundant wcss_q6_bcr_reset
  2025-12-02 16:26 ` [PATCH v2 2/2] remoteproc: qcom_q6v5_wcss: drop redundant wcss_q6_bcr_reset Alexandru Gagniuc
@ 2025-12-03 12:09   ` Konrad Dybcio
  0 siblings, 0 replies; 4+ messages in thread
From: Konrad Dybcio @ 2025-12-03 12:09 UTC (permalink / raw)
  To: Alexandru Gagniuc, andersson, mathieu.poirier, linux-arm-msm,
	linux-remoteproc, p.zabel, Gokul Sriram Palanisamy, Govind Singh
  Cc: linux-kernel

On 12/2/25 5:26 PM, Alexandru Gagniuc wrote:
> The wcss_q6_bcr_reset used on QCS404, and wcss_q6_reset used on IPQ
> are the same. "BCR reset" is redundant, and likely a mistake. Use the
> documented "wcss_q6_reset" instead. Drop ".wcss_q6_reset_required"
> from the descriptor, since all targets now need it.
> 
> Fixes: 0af65b9b915e ("remoteproc: qcom: wcss: Add non pas wcss Q6 support for QCS404")
> 
> Signed-off-by: Alexandru Gagniuc <mr.nuke.me@gmail.com>
> ---

[...]

> -	wcss->wcss_q6_bcr_reset = devm_reset_control_get_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);
> +	wcss->wcss_q6_reset = devm_reset_control_get_exclusive(dev, "wcss_q6_reset");
> +	if (IS_ERR(wcss->wcss_q6_reset)) {

This changes the bindings expectations

*however*

it actually fixes the driver to consume the intended ones (qcom,q6v5.txt)
(not even yaml!!!) which houses the description of the qcs404 wcss lists
wcss_q6_reset and *not* "wcss_q6_bcr_reset"

Please add a paragraph mentioning this in the commit message and add my

Reviewed-by: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>

Konrad

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2025-12-03 12:09 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-12-02 16:26 [PATCH v2 1/2] remoteproc: qcom_q6v5_wcss: fix parsing of qcom,halt-regs Alexandru Gagniuc
2025-12-02 16:26 ` [PATCH v2 2/2] remoteproc: qcom_q6v5_wcss: drop redundant wcss_q6_bcr_reset Alexandru Gagniuc
2025-12-03 12:09   ` Konrad Dybcio
2025-12-03 11:24 ` [PATCH v2 1/2] remoteproc: qcom_q6v5_wcss: fix parsing of qcom,halt-regs Konrad Dybcio

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox