[PATCH 0/2] firmware: qcom: scm locking improvements
From: Albert Esteve
Date: Mon Aug 24 2026 - 07:36:11 EST
The qcom_scm driver serializes Secure Channel Manager calls
to Qualcomm firmware. This series ports two related fixes from
Qualcomm's kernel trees [1][2] adapted for the current upstream
driver.
Series summary:
Patch 1: Replace SCM global mutex with a counting semaphore.
Patch 2: Allow SCM waitqueue completions to freeze and be killed
cleanly on suspend and shutdown.
Adaptations:
- Size the semaphore from scm->wq_cnt (already queried via
WAITQ_GET_INFO during probe) rather than adding call_ctx_cnt
and extending skip_mutex helper
- Do not port skip_mutex unlock/relock around WAITQ_SLEEP; that
path does not exist in master
- Initialize the semaphore before publishing __scm
Tested on Qualcomm's SA8775P Ride V3, kernel 7.2:
- qcom_scm probes successfully
- qcomtee platform device registered
- SMC calls complete without error
[1] https://git.codelinaro.org/clo/le/meta-qti-auto-kernel/-/raw/LY.AU.0.1.0.r1-16800-gen4meta.0/recipes-kernel/linux/files/scm_adci/0008-PENDING-firmware-qcom-scm-Introduce-new-locking-mech.patch
[2] https://git.codelinaro.org/clo/le/meta-qti-auto-kernel/-/commit/9319960e593c88e6d88bfaf0f6ed3e1235926ea3
Signed-off-by: Albert Esteve <aesteve@xxxxxxxxxx>
---
Ninad Naik (1):
firmware: qcom: scm: Introduce new locking mechanism for SCM driver
Yuvaraj Ranganathan (1):
firmware: qcom: scm: Allow the SMC request to freeze and kill
drivers/firmware/qcom/qcom_scm-legacy.c | 8 ++------
drivers/firmware/qcom/qcom_scm-smc.c | 7 ++-----
drivers/firmware/qcom/qcom_scm.c | 6 +++++-
drivers/firmware/qcom/qcom_scm.h | 3 +++
4 files changed, 12 insertions(+), 12 deletions(-)
---
base-commit: 818bebeb63dd6bf5f4e07e145f6cdbace520a34c
change-id: 20260820-port-scm-patches-bf58a5a1b56e
Best regards,
--
Albert Esteve <aesteve@xxxxxxxxxx>