Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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.

Fixes: 0af65b9b915e ("remoteproc: qcom: wcss: Add non pas wcss Q6 support for QCS404")
Signed-off-by: Alexandru Gagniuc <mr.nuke.me@gmail.com>
Link: https://lore.kernel.org/r/20251129013207.3981517-1-mr.nuke.me@gmail.com
Signed-off-by: Bjorn Andersson <andersson@kernel.org>

authored by

Alexandru Gagniuc and committed by
Bjorn Andersson
7e81fa8d cda5dc12

+4 -4
+4 -4
drivers/remoteproc/qcom_q6v5_wcss.c
··· 85 85 #define TCSR_WCSS_CLK_MASK 0x1F 86 86 #define TCSR_WCSS_CLK_ENABLE 0x14 87 87 88 - #define MAX_HALT_REG 3 88 + #define MAX_HALT_REG 4 89 89 enum { 90 90 WCSS_IPQ8074, 91 91 WCSS_QCS404, ··· 864 864 return -EINVAL; 865 865 } 866 866 867 - wcss->halt_q6 = halt_reg[0]; 868 - wcss->halt_wcss = halt_reg[1]; 869 - wcss->halt_nc = halt_reg[2]; 867 + wcss->halt_q6 = halt_reg[1]; 868 + wcss->halt_wcss = halt_reg[2]; 869 + wcss->halt_nc = halt_reg[3]; 870 870 871 871 return 0; 872 872 }