mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH v3 0/2] firmware: qcom: scm locking improvements
@ 2026-10-01 16:16 Albert Esteve
  2026-10-01 16:16 ` [PATCH v3 1/2] firmware: qcom: scm: Introduce new locking mechanism for SCM driver Albert Esteve
  2026-10-01 16:16 ` [PATCH v3 2/2] firmware: qcom: scm: Allow the SMC request to freeze Albert Esteve
  0 siblings, 2 replies; 5+ messages in thread
From: Albert Esteve @ 2026-10-01 16:16 UTC (permalink / raw)
  To: Bjorn Andersson, Konrad Dybcio, Shivendra Pratap,
	Bartosz Golaszewski, Unnathi Chalicheemala, Mukesh Ojha
  Cc: linux-arm-msm, linux-kernel, Albert Esteve, Ninad Naik,
	Murali Nalajala, Venkatakrishnaiah Pari, Jian Shu,
	Yuvaraj Ranganathan, Guru Das Srinagesh

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
- Drop TASK_KILLABLE: returning early on a fatal signal skips the
  QCOM_SCM_WAITQ_RESUME SMC, leaking the TrustZone execution context

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@redhat.com>
---
Changes in v3:
- Drop TASK_KILLABLE from patch 2 (raised by Sashiko)
- Rebase to v7.3-rc5 kernel
- Link to v2: https://lore.kernel.org/r/20260831-port-scm-patches-v2-0-bab5595e77b3@redhat.com

Changes in v2:
- Improved issue explanation in commit bodies
  and added Fixes: tags
- Treat 0 wq_cnt responses as invalid
- Forward wait_for_completion_state() return value
- Link to v1: https://lore.kernel.org/r/20260824-port-scm-patches-v1-0-1dfd69374402@redhat.com

---
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

 drivers/firmware/qcom/qcom_scm-legacy.c |  8 ++------
 drivers/firmware/qcom/qcom_scm-smc.c    |  7 ++-----
 drivers/firmware/qcom/qcom_scm.c        | 10 ++++++----
 drivers/firmware/qcom/qcom_scm.h        |  3 +++
 4 files changed, 13 insertions(+), 15 deletions(-)
---
base-commit: 551c722f40809618230001baccf219193e22fc5a
change-id: 20260820-port-scm-patches-bf58a5a1b56e

Best regards,
-- 
Albert Esteve <aesteve@redhat.com>


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

end of thread, other threads:[~2026-10-06  9:30 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-10-01 16:16 [PATCH v3 0/2] firmware: qcom: scm locking improvements Albert Esteve
2026-10-01 16:16 ` [PATCH v3 1/2] firmware: qcom: scm: Introduce new locking mechanism for SCM driver Albert Esteve
2026-10-06  9:27   ` Pavan Kondeti
2026-10-01 16:16 ` [PATCH v3 2/2] firmware: qcom: scm: Allow the SMC request to freeze Albert Esteve
2026-10-06  9:30   ` Pavan Kondeti

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

all inboxes | Powered by JetHome®