From: Chris Lew <quic_clew@quicinc.com>
To: Bjorn Andersson <andersson@kernel.org>,
Baolin Wang <baolin.wang@linux.alibaba.com>,
Peter Zijlstra <peterz@infradead.org>,
"Ingo Molnar" <mingo@redhat.com>, Will Deacon <will@kernel.org>,
Waiman Long <longman@redhat.com>,
Boqun Feng <boqun.feng@gmail.com>,
Jonathan Corbet <corbet@lwn.net>,
Mathieu Poirier <mathieu.poirier@linaro.org>,
Rob Herring <robh@kernel.org>,
Krzysztof Kozlowski <krzk+dt@kernel.org>,
Conor Dooley <conor+dt@kernel.org>,
Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>,
Konrad Dybcio <konrad.dybcio@linaro.org>
Cc: <linux-remoteproc@vger.kernel.org>,
<linux-kernel@vger.kernel.org>, <linux-doc@vger.kernel.org>,
<linux-arm-msm@vger.kernel.org>, <devicetree@vger.kernel.org>,
Chris Lew <quic_clew@quicinc.com>,
"Richard Maina" <quic_rmaina@quicinc.com>
Subject: [PATCH v3 0/4] Add support for hwspinlock bust
Date: Wed, 29 May 2024 11:09:54 -0700 [thread overview]
Message-ID: <20240529-hwspinlock-bust-v3-0-c8b924ffa5a2@quicinc.com> (raw)
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. A driver can use the
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.
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>
---
Changes in v3:
- Fixed 80 char comment formatting and missing space suggested by Bjorn
- Changed unsigned to unsigned int in smem apis from checkpatch warning
- Removed null pointer check in smem bust api
- Picked up reviewed-by trailers from Bjorn
- Link to v2: https://lore.kernel.org/r/20240524-hwspinlock-bust-v2-0-fb88fd17ca0b@quicinc.com
Changes in v2:
- Remove extra print in qcom_q6v5_pas as suggested by Bryan
- Expose SMEM API that remotproc can call to bust the smem hwlock as suggested by Krzysztof
- Drop patches related to multiple references on a hwlock
- Link to v1: https://lore.kernel.org/r/20240516-hwspinlock-bust-v1-0-47a90a859238@quicinc.com
---
Chris Lew (1):
soc: qcom: smem: Add qcom_smem_bust_hwspin_lock_by_host()
Richard Maina (3):
hwspinlock: Introduce hwspin_lock_bust()
hwspinlock: qcom: implement bust operation
remoteproc: qcom_q6v5_pas: Add hwspinlock bust on stop
Documentation/locking/hwspinlock.rst | 11 +++++++++++
drivers/hwspinlock/hwspinlock_core.c | 28 ++++++++++++++++++++++++++++
drivers/hwspinlock/hwspinlock_internal.h | 3 +++
drivers/hwspinlock/qcom_hwspinlock.c | 25 +++++++++++++++++++++++++
drivers/remoteproc/qcom_q6v5_pas.c | 11 +++++++++++
drivers/soc/qcom/smem.c | 26 ++++++++++++++++++++++++++
include/linux/hwspinlock.h | 6 ++++++
include/linux/soc/qcom/smem.h | 2 ++
8 files changed, 112 insertions(+)
---
base-commit: e7b4ef8fffaca247809337bb78daceb406659f2d
change-id: 20240509-hwspinlock-bust-d497a70c1a3a
Best regards,
--
Chris Lew <quic_clew@quicinc.com>
next reply other threads:[~2024-05-29 18:10 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-05-29 18:09 Chris Lew [this message]
2024-05-29 18:09 ` [PATCH v3 1/4] hwspinlock: Introduce hwspin_lock_bust() Chris Lew
2024-05-29 18:09 ` [PATCH v3 2/4] hwspinlock: qcom: implement bust operation Chris Lew
2024-05-29 18:09 ` [PATCH v3 3/4] soc: qcom: smem: Add qcom_smem_bust_hwspin_lock_by_host() Chris Lew
2024-05-29 19:05 ` Bjorn Andersson
2024-05-29 18:09 ` [PATCH v3 4/4] remoteproc: qcom_q6v5_pas: Add hwspinlock bust on stop Chris Lew
2024-05-29 21:28 ` (subset) [PATCH v3 0/4] Add support for hwspinlock bust Bjorn Andersson
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20240529-hwspinlock-bust-v3-0-c8b924ffa5a2@quicinc.com \
--to=quic_clew@quicinc.com \
--cc=andersson@kernel.org \
--cc=baolin.wang@linux.alibaba.com \
--cc=boqun.feng@gmail.com \
--cc=conor+dt@kernel.org \
--cc=corbet@lwn.net \
--cc=devicetree@vger.kernel.org \
--cc=konrad.dybcio@linaro.org \
--cc=krzk+dt@kernel.org \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-doc@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-remoteproc@vger.kernel.org \
--cc=longman@redhat.com \
--cc=manivannan.sadhasivam@linaro.org \
--cc=mathieu.poirier@linaro.org \
--cc=mingo@redhat.com \
--cc=peterz@infradead.org \
--cc=quic_rmaina@quicinc.com \
--cc=robh@kernel.org \
--cc=will@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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®