mbox series

[v2,0/2] Bluetooth: iso: Fix circular lock warnings

Message ID 20241209094218.4939-1-iulia.tanasescu@nxp.com
Headers show
Series Bluetooth: iso: Fix circular lock warnings | expand

Message

Iulia Tanasescu Dec. 9, 2024, 9:42 a.m. UTC
This patch fixes the circular locking dependency warnings in iso.c,
caused by A->B/B->A type lock ordering with sk and hdev.

The first commit fixes the warning caused by iso_listen_bis, by
releasing sk lock before entering the function and acquiring hdev
lock.

The second commit fixes the warning caused by iso_conn_big_sync.
This reworks iso_sock_recvmsg, since it contains multiple function
calls that need sk lock to be released: The socket needs to be kept
alive with sock_hold before being released. To avoid multiple
hold/release/lock/put calls, the socket is grabbed and locked at the
beginning of the switch, and it is released and ungrabbed at the end,
with release/lock calls when necessary in the switch.

Iulia Tanasescu (2):
  Bluetooth: iso: Fix circular lock in iso_listen_bis
  Bluetooth: iso: Fix circular lock in iso_conn_big_sync

 net/bluetooth/iso.c | 48 ++++++++++++++++++++++++++++++++++++---------
 1 file changed, 39 insertions(+), 9 deletions(-)


base-commit: 269f7b219173ffbb01121243c55cef8a5503593b