diff options
| author | Richard Maina <quic_rmaina@quicinc.com> | 2024-05-29 11:09:55 -0700 |
|---|---|---|
| committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2024-09-08 07:54:43 +0200 |
| commit | a6978d1b7bb8f3a25305e8ff7d367f7289614c5d (patch) | |
| tree | 3ca713da08b502cb26b8c098b8f3b3ec0a78c2c0 /Documentation | |
| parent | e51077ad1bf497ff20d44b90491b3d6ef71af59b (diff) | |
| download | linux-a6978d1b7bb8f3a25305e8ff7d367f7289614c5d.tar.gz linux-a6978d1b7bb8f3a25305e8ff7d367f7289614c5d.tar.bz2 linux-a6978d1b7bb8f3a25305e8ff7d367f7289614c5d.zip | |
hwspinlock: Introduce hwspin_lock_bust()
[ Upstream commit 7c327d56597d8de1680cf24e956b704270d3d84a ]
When a remoteproc crashes or goes down unexpectedly this can result in
a state where locks held by the remoteproc will remain locked possibly
resulting in deadlock. This new API hwspin_lock_bust() allows
hwspinlock implementers to define a bust operation for freeing previously
acquired hwspinlocks after verifying ownership of the acquired lock.
Signed-off-by: Richard Maina <quic_rmaina@quicinc.com>
Reviewed-by: Bjorn Andersson <andersson@kernel.org>
Signed-off-by: Chris Lew <quic_clew@quicinc.com>
Link: https://lore.kernel.org/r/20240529-hwspinlock-bust-v3-1-c8b924ffa5a2@quicinc.com
Signed-off-by: Bjorn Andersson <andersson@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'Documentation')
| -rw-r--r-- | Documentation/locking/hwspinlock.rst | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/Documentation/locking/hwspinlock.rst b/Documentation/locking/hwspinlock.rst index 6f03713b7003..2ffaa3cbd63f 100644 --- a/Documentation/locking/hwspinlock.rst +++ b/Documentation/locking/hwspinlock.rst @@ -87,6 +87,17 @@ Should be called from a process context (might sleep). :: + int hwspin_lock_bust(struct hwspinlock *hwlock, unsigned int id); + +After verifying the owner of the hwspinlock, release a previously acquired +hwspinlock; returns 0 on success, or an appropriate error code on failure +(e.g. -EOPNOTSUPP if the bust operation is not defined for the specific +hwspinlock). + +Should be called from a process context (might sleep). + +:: + int hwspin_lock_timeout(struct hwspinlock *hwlock, unsigned int timeout); Lock a previously-assigned hwspinlock with a timeout limit (specified in |
