Add the missing callback and the corresponding description in the
relevant chapter.

Signed-off-by: Antonio Borneo <[email protected]>
---

Changes in v2:
- align with review from sashiko.dev:
  
http://sashiko.dev/#/patchset/20260314170142.18290-1-antonio.borneo%40foss.st.com
  - update the number of callbacks;
  - report the returned value;
  - report it can sleep.
- rebase on v7.0-rc5
- v1 available at:
  
https://lore.kernel.org/lkml/[email protected]/

---
 Documentation/locking/hwspinlock.rst | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/Documentation/locking/hwspinlock.rst 
b/Documentation/locking/hwspinlock.rst
index a737c702a7d1d..a5fff33181c1b 100644
--- a/Documentation/locking/hwspinlock.rst
+++ b/Documentation/locking/hwspinlock.rst
@@ -420,11 +420,12 @@ initialized by the hwspinlock core itself.
 Implementation callbacks
 ========================
 
-There are three possible callbacks defined in 'struct hwspinlock_ops'::
+There are four possible callbacks defined in 'struct hwspinlock_ops'::
 
        struct hwspinlock_ops {
                int (*trylock)(struct hwspinlock *lock);
                void (*unlock)(struct hwspinlock *lock);
+               int (*bust)(struct hwspinlock *lock, unsigned int id);
                void (*relax)(struct hwspinlock *lock);
        };
 
@@ -436,6 +437,11 @@ return 0 on failure and 1 on success. This callback may 
**not** sleep.
 The ->unlock() callback releases the lock. It always succeed, and it, too,
 may **not** sleep.
 
+The ->bust() callback is optional. It is called by hwspinlock core to bust a
+specific lock when the remote processor 'id' is not responding, e.g. due to a
+firmware crash. It return 0 on success and a negative error code on failure.
+It can sleep.
+
 The ->relax() callback is optional. It is called by hwspinlock core while
 spinning on a lock, and can be used by the underlying implementation to force
 a delay between two successive invocations of ->trylock(). It may **not** 
sleep.

base-commit: c369299895a591d96745d6492d4888259b004a9e
-- 
2.34.1


Reply via email to