[PATCH] remoteproc: qcom: Update MAX_NUM_OF_SS to 30

Mukesh Ojha posted 1 patch 1 month, 3 weeks ago
drivers/remoteproc/qcom_common.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
[PATCH] remoteproc: qcom: Update MAX_NUM_OF_SS to 30
Posted by Mukesh Ojha 1 month, 3 weeks ago
In the latest firmware for Qualcomm SoCs, the value of MAX_NUM_OF_SS has
been increased to 30 to accumulate more subsystems.

Let's update so that we should not get array out of bound error when we
test minidump on these SoCs.

Signed-off-by: Mukesh Ojha <mukesh.ojha@oss.qualcomm.com>
---
 drivers/remoteproc/qcom_common.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/remoteproc/qcom_common.c b/drivers/remoteproc/qcom_common.c
index 8c8688f99f0a..dbe3bf852585 100644
--- a/drivers/remoteproc/qcom_common.c
+++ b/drivers/remoteproc/qcom_common.c
@@ -28,7 +28,7 @@
 #define to_ssr_subdev(d) container_of(d, struct qcom_rproc_ssr, subdev)
 #define to_pdm_subdev(d) container_of(d, struct qcom_rproc_pdm, subdev)
 
-#define MAX_NUM_OF_SS           10
+#define MAX_NUM_OF_SS           30
 #define MAX_REGION_NAME_LENGTH  16
 #define SBL_MINIDUMP_SMEM_ID	602
 #define MINIDUMP_REGION_VALID		('V' << 24 | 'A' << 16 | 'L' << 8 | 'I' << 0)
-- 
2.50.1
Re: [PATCH] remoteproc: qcom: Update MAX_NUM_OF_SS to 30
Posted by Bjorn Andersson 1 month, 3 weeks ago
On Fri, Aug 08, 2025 at 10:14:17PM +0530, Mukesh Ojha wrote:
> In the latest firmware for Qualcomm SoCs, the value of MAX_NUM_OF_SS has
> been increased to 30 to accumulate more subsystems.
> 
> Let's update so that we should not get array out of bound error when we
> test minidump on these SoCs.
> 

But this number is used to size the minidump_global_toc struct, which is
used to describe the content of the smem item - and this item didn't
grow on old platforms.

Doesn't this imply that on older platforms you've now told Linux (and
your debugger) that it's fine to write beyond the smem item?


It seems to me that it would be appropriate to check the returned size
of the qcom_smem_get() call - in particular if the size of the item
isn't fixed.

Regards,
Bjorn

> Signed-off-by: Mukesh Ojha <mukesh.ojha@oss.qualcomm.com>
> ---
>  drivers/remoteproc/qcom_common.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/remoteproc/qcom_common.c b/drivers/remoteproc/qcom_common.c
> index 8c8688f99f0a..dbe3bf852585 100644
> --- a/drivers/remoteproc/qcom_common.c
> +++ b/drivers/remoteproc/qcom_common.c
> @@ -28,7 +28,7 @@
>  #define to_ssr_subdev(d) container_of(d, struct qcom_rproc_ssr, subdev)
>  #define to_pdm_subdev(d) container_of(d, struct qcom_rproc_pdm, subdev)
>  
> -#define MAX_NUM_OF_SS           10
> +#define MAX_NUM_OF_SS           30
>  #define MAX_REGION_NAME_LENGTH  16
>  #define SBL_MINIDUMP_SMEM_ID	602
>  #define MINIDUMP_REGION_VALID		('V' << 24 | 'A' << 16 | 'L' << 8 | 'I' << 0)
> -- 
> 2.50.1
>
Re: [PATCH] remoteproc: qcom: Update MAX_NUM_OF_SS to 30
Posted by Mukesh Ojha 1 month, 3 weeks ago
On Mon, Aug 11, 2025 at 09:49:08AM -0500, Bjorn Andersson wrote:
> On Fri, Aug 08, 2025 at 10:14:17PM +0530, Mukesh Ojha wrote:
> > In the latest firmware for Qualcomm SoCs, the value of MAX_NUM_OF_SS has
> > been increased to 30 to accumulate more subsystems.
> > 
> > Let's update so that we should not get array out of bound error when we
> > test minidump on these SoCs.
> > 
> 
> But this number is used to size the minidump_global_toc struct, which is
> used to describe the content of the smem item - and this item didn't
> grow on old platforms.
> 
> Doesn't this imply that on older platforms you've now told Linux (and
> your debugger) that it's fine to write beyond the smem item?
> 
> 
> It seems to me that it would be appropriate to check the returned size
> of the qcom_smem_get() call - in particular if the size of the item
> isn't fixed.

Yes, you are right., do you think it should a fix (cc stable) ?

-Mukesh
> 
> Regards,
> Bjorn
> 
> > Signed-off-by: Mukesh Ojha <mukesh.ojha@oss.qualcomm.com>
> > ---
> >  drivers/remoteproc/qcom_common.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> > 
> > diff --git a/drivers/remoteproc/qcom_common.c b/drivers/remoteproc/qcom_common.c
> > index 8c8688f99f0a..dbe3bf852585 100644
> > --- a/drivers/remoteproc/qcom_common.c
> > +++ b/drivers/remoteproc/qcom_common.c
> > @@ -28,7 +28,7 @@
> >  #define to_ssr_subdev(d) container_of(d, struct qcom_rproc_ssr, subdev)
> >  #define to_pdm_subdev(d) container_of(d, struct qcom_rproc_pdm, subdev)
> >  
> > -#define MAX_NUM_OF_SS           10
> > +#define MAX_NUM_OF_SS           30
> >  #define MAX_REGION_NAME_LENGTH  16
> >  #define SBL_MINIDUMP_SMEM_ID	602
> >  #define MINIDUMP_REGION_VALID		('V' << 24 | 'A' << 16 | 'L' << 8 | 'I' << 0)
> > -- 
> > 2.50.1
> > 

-- 
-Mukesh Ojha