Re: [PATCH] soc: qcom: smsm: Increase SMSM_DEFAULT_NUM_HOSTS to 5

From: Vishnu Santhosh

Date: Thu Jul 02 2026 - 01:18:09 EST



On 12-06-2026 01:04 pm, Dmitry Baryshkov wrote:
On Thu, Jun 11, 2026 at 11:26:34AM +0530, Vishnu Santhosh wrote:
SMEM_SMSM_SIZE_INFO (id 419) is not populated by the boot firmware on
Qualcomm Shikra SoC.
Can we fix the firmware instead of hacking the driver?

Agreed. I checked with the firmware POCs, and confirmed they will populate

SMEM_SMSM_SIZE_INFO correctly at boot instead of leaving it to the driver's

compiled-in defaults for Shikra. I'm dropping this patch.


The SMSM driver falls back to
SMSM_DEFAULT_NUM_HOSTS when this segment is absent, which causes
SMEM_SMSM_CPU_INTR_MASK (id 333) to be allocated with the wrong size.

SMEM_SMSM_CPU_INTR_MASK is sized as SMSM_DEFAULT_NUM_ENTRIES *
SMSM_DEFAULT_NUM_HOSTS * sizeof(u32). With SMSM_DEFAULT_NUM_ENTRIES
fixed at 8, the current SMSM_DEFAULT_NUM_HOSTS of 3 allocates 96
bytes. Qualcomm Shikra SoC modem firmware expects 160 bytes,
requiring SMSM_DEFAULT_NUM_HOSTS to be 5. The size mismatch causes
the modem to crash on boot with "smsm.c: Bad pointer from smem_alloc".

Increase SMSM_DEFAULT_NUM_HOSTS to 5 to match the modem firmware
expectation and prevent the boot crash.
What about the older platforms which might expect to have 3 hosts only?

With the firmware fix, that's no longer a concern as the existing driver defaults

stay untouched. Thank you for the review.


Co-developed-by: Deepak Kumar Singh <deepak.singh@xxxxxxxxxxxxxxxx>
Signed-off-by: Deepak Kumar Singh <deepak.singh@xxxxxxxxxxxxxxxx>
Signed-off-by: Vishnu Santhosh <vishnu.santhosh@xxxxxxxxxxxxxxxx>
---
drivers/soc/qcom/smsm.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/soc/qcom/smsm.c b/drivers/soc/qcom/smsm.c
index 021e9d1f61dc5200514c5a239d52be97f7e82825..7d1823ab4198bbfa01cd1cf9c33999b32e2490a3 100644
--- a/drivers/soc/qcom/smsm.c
+++ b/drivers/soc/qcom/smsm.c
@@ -54,7 +54,7 @@
* Default sizes, in case SMEM_SMSM_SIZE_INFO is not found.
*/
#define SMSM_DEFAULT_NUM_ENTRIES 8
-#define SMSM_DEFAULT_NUM_HOSTS 3
+#define SMSM_DEFAULT_NUM_HOSTS 5
struct smsm_entry;
struct smsm_host;

---
base-commit: 9716c086c8e8b141d35aa61f2e96a2e83de212a7
change-id: 20260527-qcom-smsm-default-num-hosts-c471f9c4311a

Best regards,
--
Vishnu Santhosh <vishnu.santhosh@xxxxxxxxxxxxxxxx>