linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/5] SCM: Add support for wait-queue aware firmware
@ 2022-06-27 19:44 Guru Das Srinagesh
  2022-06-27 19:44 ` [PATCH 1/5] dt-bindings: firmware: qcom-scm: Add "allow-multi-call" property Guru Das Srinagesh
                   ` (4 more replies)
  0 siblings, 5 replies; 17+ messages in thread
From: Guru Das Srinagesh @ 2022-06-27 19:44 UTC (permalink / raw)
  To: Andy Gross, Bjorn Andersson, Philipp Zabel, linux-arm-msm, linux-kernel
  Cc: David Heidelberg, Robert Marko, Rajendra Nayak, Elliot Berman,
	Guru Das Srinagesh

This patch series enables the QCOM SCM driver to support firmware (FW) versions
that expect the high-level OS (HLOS) to be tolerant of SCM call requests not
being processed right away and, instead, being placed on a wait-queue in FW and
processed accordingly.

The problem this feature is fixing is as follows. In a scenario where there is
a VM in addition to HLOS (and an underlying hypervisor):

1. HLOS makes an SMC call on core 5
2. The hypervisor scheduling interrupt interrupts this SMC call.
3. The hypervisor schedules the VM on core 5.
4. The VM makes an SMC call on core 5.
5. The SMC call is non-interruptibly stuck on FW spinlock on core 5.
6. HLOS cannot reschedule since core 5 is not responding to Reschedule IPIs.
7. Watchdog timer expires waiting for core 5.

This problem is solved by FW returning a new return code SCM_WAITQ_SLEEP to
HLOS right away when it is overwhelmed by the VM's SMC call. HLOS then places
the call on a wait-queue and wakes it up when it receives an interrupt that
signifies "all-clear".

This new design also supports scenarios involving only HLOS (and no other VMs).
Such scenarios make use of a second new return code SCM_WAITQ_WAKE.

There are three new SMC calls also being defined in this design that, together
with the two new return codes, form the handshake protocol between Linux and
FW.

This design is also backwards-compatible with existing firmware versions that
do not support this feature.

Guru Das Srinagesh (5):
  dt-bindings: firmware: qcom-scm: Add "allow-multi-call" property
  firmware: qcom: scm: Optionally remove SCM call serialization
  dt-bindings: firmware: qcom-scm: Add optional interrupt
  firmware: qcom: scm: Add wait-queue helper functions
  firmware: qcom: scm: Add wait-queue handling logic

 .../devicetree/bindings/firmware/qcom,scm.txt      |   4 +
 drivers/firmware/qcom_scm-smc.c                    | 143 +++++++++++++++++++--
 drivers/firmware/qcom_scm.c                        | 124 +++++++++++++++++-
 drivers/firmware/qcom_scm.h                        |  14 ++
 4 files changed, 275 insertions(+), 10 deletions(-)

-- 
2.7.4


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

end of thread, other threads:[~2022-07-21 16:50 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-06-27 19:44 [PATCH 0/5] SCM: Add support for wait-queue aware firmware Guru Das Srinagesh
2022-06-27 19:44 ` [PATCH 1/5] dt-bindings: firmware: qcom-scm: Add "allow-multi-call" property Guru Das Srinagesh
2022-06-27 19:44 ` [PATCH 2/5] firmware: qcom: scm: Optionally remove SCM call serialization Guru Das Srinagesh
2022-06-27 19:44 ` [PATCH 3/5] dt-bindings: firmware: qcom-scm: Add optional interrupt Guru Das Srinagesh
2022-06-27 19:44 ` [PATCH 4/5] firmware: qcom: scm: Add wait-queue helper functions Guru Das Srinagesh
2022-06-28 13:33   ` Rajendra Nayak
2022-06-28 17:43     ` Guru Das Srinagesh
2022-07-14  1:04     ` Guru Das Srinagesh
2022-07-01 10:59   ` Rajendra Nayak
2022-07-14  1:04     ` Guru Das Srinagesh
2022-06-27 19:44 ` [PATCH 5/5] firmware: qcom: scm: Add wait-queue handling logic Guru Das Srinagesh
2022-07-01 11:02   ` Rajendra Nayak
2022-07-01 11:21     ` Rajendra Nayak
2022-07-14  0:57       ` Guru Das Srinagesh
2022-07-19 10:33         ` Rajendra Nayak
2022-07-21 16:50           ` Guru Das Srinagesh
2022-07-21 16:48       ` Guru Das Srinagesh

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).