All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 0/2] Bluetooth: iso: Fix circular lock warnings
@ 2024-12-09  9:42 Iulia Tanasescu
  2024-12-09  9:42 ` [PATCH v2 1/2] Bluetooth: iso: Fix circular lock in iso_listen_bis Iulia Tanasescu
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Iulia Tanasescu @ 2024-12-09  9:42 UTC (permalink / raw)
  To: linux-bluetooth
  Cc: claudia.rosu, mihai-octavian.urzica, andrei.istodorescu,
	luiz.dentz, Iulia Tanasescu

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
-- 
2.43.0


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2024-12-11 16:50 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-12-09  9:42 [PATCH v2 0/2] Bluetooth: iso: Fix circular lock warnings Iulia Tanasescu
2024-12-09  9:42 ` [PATCH v2 1/2] Bluetooth: iso: Fix circular lock in iso_listen_bis Iulia Tanasescu
2024-12-09 10:33   ` Bluetooth: iso: Fix circular lock warnings bluez.test.bot
2024-12-09  9:42 ` [PATCH v2 2/2] Bluetooth: iso: Fix circular lock in iso_conn_big_sync Iulia Tanasescu
2024-12-11 16:50 ` [PATCH v2 0/2] Bluetooth: iso: Fix circular lock warnings patchwork-bot+bluetooth

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.