Renesas R-Car SoCs have their spinlocks inside a unit called MFIS. Up to
R-Car Gen4, there was only one MFIS unit on the SoC. Gen5, though, has
multiple instances and, thus, multiple spinlock providers. The spinlocks
are meant for specific cases (AP<->AP, AP<->RT, AP<->SCP...). For
development on these systems, it is helpful to have an overview of
registered spinlocks in debugfs. This series adds support for that. The
first two patches update the radix-tree header to support more lock
types. The third patch fixes a missing RCU annotation for the slot
pointer. The fourth patch finally adds the desired functionality.

Because the radix tree seems to have no dedicated tree nor maintainer, I
suggest that all these patches go in via hwspinlock. This also keeps the
dependencies zero.

A branch for testing is here:

git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux.git 
renesas/mfis/hwspinlock

It has been tested on a SparrowHawk board (R-Car V4H) and an Ironhide
board (R-Car X5H).

Looking forward to comments.

Changes since v1:
* dropped patch inverting the HWSPINLOCK_UNUSED logic
* added radix tree patches to support the mutex treelock of hwspinlock
* included RCU annotation patch sent previously as independent patch
* addresses Sashiko comments in patch 4
        * ensure correct locking
        * add error codes
        * proper ppos handling
        * no leaking iterator when done
        * mark pointer dereference as protected (needs patch 2)
        * split up long lines


Wolfram Sang (4):
  radix-tree: add parameter doc for radix_tree_deref_slot_protected()
  radix-tree: allow more lock types with
    radix_tree_deref_slot_protected()
  hwspinlock: annotate slot pointer as RCU sensitive
  hwspinlock: add summary in debugfs

 drivers/hwspinlock/hwspinlock_core.c | 91 +++++++++++++++++++++++++++-
 include/linux/radix-tree.h           |  9 ++-
 2 files changed, 94 insertions(+), 6 deletions(-)

-- 
2.47.3


Reply via email to