devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/7] Add support for hwspinlock bust
@ 2024-05-16 22:58 Chris Lew
  2024-05-16 22:58 ` [PATCH 1/7] hwspinlock: Introduce refcount Chris Lew
                   ` (6 more replies)
  0 siblings, 7 replies; 30+ messages in thread
From: Chris Lew @ 2024-05-16 22:58 UTC (permalink / raw)
  To: Bjorn Andersson, Baolin Wang, Peter Zijlstra, Ingo Molnar,
	Will Deacon, Waiman Long, Boqun Feng, Jonathan Corbet,
	Mathieu Poirier, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
	Manivannan Sadhasivam, Konrad Dybcio
  Cc: linux-remoteproc, linux-kernel, linux-doc, linux-arm-msm,
	devicetree, Chris Lew, Richard Maina

hwspinlocks can be acquired by many devices on the SoC. If any of these
devices go into a bad state before the device releases the hwspinlock,
then that hwspinlock may end up in an unusable state.

In the case of smem, each remoteproc takes a hwspinlock before trying to
allocate an smem item. If the remoteproc were to suddenly crash without
releasing this, it would be impossible for other remoteprocs to allocate
any smem items.

We propose a new api to bust a hwspinlock. This functionality is meant
for drivers that manage the lifecycle of a device. The driver can use
the bust api if it detects the device has gone into an error state, thus
allowing other entities in the system to use the hwspinlock.

The bust API implies multiple devices in linux can get a reference to a
hwspinlock. We add the ability for multiple devices to get a reference
to a hwspinlock via hwspin_lock_request_specific().
hwspin_lock_request() will continue to provide the next unused lock.

For the smem example, the hwspinlock will now be referenced by remoteproc
and the smem driver.

These patches were tested on an sm8650 mtp using engineering cdsp
firmware that triggers a watchdog with the smem hwspinlock acquired.

Checked for error in dt-bindings with below.
 - make DT_CHECKER_FLAGS=-m DT_SCHEMA_FILES=remoteproc/qcom,pas-common.yaml dt_binding_check
 - make qcom/sm8650-mtp.dtb CHECK_DTBS=1

Signed-off-by: Chris Lew <quic_clew@quicinc.com>
---
Chris Lew (2):
      dt-bindings: remoteproc: qcom,pas: Add hwlocks
      arm64: dts: qcom: sm8650: Add hwlock to remoteproc

Richard Maina (5):
      hwspinlock: Introduce refcount
      hwspinlock: Enable hwspinlock sharing
      hwspinlock: Introduce hwspin_lock_bust()
      hwspinlock: qcom: implement bust operation
      remoteproc: qcom_q6v5_pas: Add hwspinlock bust on stop

 .../bindings/remoteproc/qcom,pas-common.yaml       |  3 ++
 Documentation/locking/hwspinlock.rst               | 19 ++++++--
 arch/arm64/boot/dts/qcom/sm8650.dtsi               |  3 ++
 drivers/hwspinlock/hwspinlock_core.c               | 52 ++++++++++++++++------
 drivers/hwspinlock/hwspinlock_internal.h           |  5 +++
 drivers/hwspinlock/qcom_hwspinlock.c               | 25 +++++++++++
 drivers/remoteproc/qcom_q6v5_pas.c                 | 28 ++++++++++++
 include/linux/hwspinlock.h                         |  6 +++
 8 files changed, 123 insertions(+), 18 deletions(-)
---
base-commit: e7b4ef8fffaca247809337bb78daceb406659f2d
change-id: 20240509-hwspinlock-bust-d497a70c1a3a

Best regards,
-- 
Chris Lew <quic_clew@quicinc.com>


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

end of thread, other threads:[~2024-05-25 16:46 UTC | newest]

Thread overview: 30+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-05-16 22:58 [PATCH 0/7] Add support for hwspinlock bust Chris Lew
2024-05-16 22:58 ` [PATCH 1/7] hwspinlock: Introduce refcount Chris Lew
2024-05-17  8:58   ` Bryan O'Donoghue
2024-05-17 18:32     ` Chris Lew
2024-05-16 22:58 ` [PATCH 2/7] hwspinlock: Enable hwspinlock sharing Chris Lew
2024-05-16 22:58 ` [PATCH 3/7] hwspinlock: Introduce hwspin_lock_bust() Chris Lew
2024-05-17  8:07   ` Bryan O'Donoghue
2024-05-17  8:47     ` Bryan O'Donoghue
2024-05-16 22:58 ` [PATCH 4/7] hwspinlock: qcom: implement bust operation Chris Lew
2024-05-16 22:58 ` [PATCH 5/7] dt-bindings: remoteproc: qcom,pas: Add hwlocks Chris Lew
2024-05-19 17:36   ` Krzysztof Kozlowski
2024-05-21  4:08     ` Chris Lew
2024-05-21  7:36       ` Krzysztof Kozlowski
2024-05-21 19:17         ` Bjorn Andersson
2024-05-22  7:26           ` Krzysztof Kozlowski
2024-05-22 17:50             ` Bjorn Andersson
2024-05-23  6:15               ` Krzysztof Kozlowski
2024-05-24 19:23                 ` Bjorn Andersson
2024-05-25 16:45                   ` Krzysztof Kozlowski
2024-05-16 22:58 ` [PATCH 6/7] remoteproc: qcom_q6v5_pas: Add hwspinlock bust on stop Chris Lew
2024-05-17  7:19   ` Mukesh Ojha
2024-05-17  7:21   ` Mukesh Ojha
2024-05-17 17:25     ` Chris Lew
2024-05-17  9:08   ` Bryan O'Donoghue
2024-05-17 17:20     ` Chris Lew
2024-05-21 17:38   ` Konrad Dybcio
2024-05-21 21:08     ` Chris Lew
2024-05-16 22:58 ` [PATCH 7/7] arm64: dts: qcom: sm8650: Add hwlock to remoteproc Chris Lew
2024-05-22  7:27   ` Krzysztof Kozlowski
2024-05-22 17:51     ` Bjorn Andersson

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