Skip to content

Bluetooth: More lockdep warning fixes with the help of RCU

Johan Hedberg linux-bluetooth 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest4 patches 1 replyIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/4Bluetooth: Convert LTK list to RCUinclude/net/bluetooth/hci_core.h net/bluetooth/hci_core.c net/bluetooth/hci_event.c +1 more+31 -260 replies
2/4Bluetooth: Convert IRK list to RCUinclude/net/bluetooth/hci_core.h net/bluetooth/hci_core.c net/bluetooth/smp.c+33 -240 replies
3/4Bluetooth: Remove unnecessary hdev locking in smp.cnet/bluetooth/smp.c+0 -70 replies
4/4Bluetooth: Add debug logs to help track locking issuesnet/bluetooth/l2cap_core.c net/bluetooth/l2cap_sock.c+11 -20 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH 0/4] Bluetooth: More lockdep warning fixes with the help of RCU

Hi,

This patch set converts the LTK and IRK lists to use RCU which eliminates the need to always hold the hdev lock while accessing these lists. This helps us fix more lockdep warnings arising from hdev locking in smp.c.

What this patch set doesn't fix is the general problem of the SMP context holding references to list entries without any guarantee that those references stay valid if some other thread goes and removes the entries. For this the proper fix would probably be to introduce kref for the entries to ensure that external references stay valid. However, since that requires considerably more code it's better to first merge most lists into a single "remote device info" list that's protected both by kref and RCU.

Johan

----------------------------------------------------------------
Johan Hedberg (4):
Bluetooth: Convert LTK list to RCU
Bluetooth: Convert IRK list to RCU
Bluetooth: Remove unnecessary hdev locking in smp.c
Bluetooth: Add debug logs to help track locking issues

 include/net/bluetooth/hci_core.h |  2 +
 net/bluetooth/hci_core.c         | 88 ++++++++++++++++++++++----------------
 net/bluetooth/hci_event.c        |  4 +-
 net/bluetooth/l2cap_core.c       |  3 +-
 net/bluetooth/l2cap_sock.c       | 10 ++++-
 net/bluetooth/smp.c              | 27 ++++--------
 6 files changed, 75 insertions(+), 59 deletions(-)