hwspinlock: Introduce hwspin_lock_bust()
authorRichard Maina <quic_rmaina@quicinc.com>
Wed, 29 May 2024 18:09:55 +0000 (11:09 -0700)
committerBjorn Andersson <andersson@kernel.org>
Wed, 29 May 2024 19:52:26 +0000 (12:52 -0700)
commit7c327d56597d8de1680cf24e956b704270d3d84a
tree46e51f75c8a0a7c15e25938abbf0ab770ed05dce
parent1613e604df0cd359cf2a7fbd9be7a0bcfacfabd0
hwspinlock: Introduce hwspin_lock_bust()

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>
Documentation/locking/hwspinlock.rst
drivers/hwspinlock/hwspinlock_core.c
drivers/hwspinlock/hwspinlock_internal.h
include/linux/hwspinlock.h