Skip to content

Commit 342e7c6

Browse files
jwrdegoedegregkh
authored andcommitted
staging: rtl8723bs: Improve the comment explaining the locking rules
rtw_mlme.h has a comment which briefly describes the locking rules for the rtl8723bs driver, improve this to also mention the locking order of xmit_priv.lock vs the lock(s) embedded in the various queues. Cc: Fabio Aiuto <fabioaiuto83@gmail.com> Signed-off-by: Hans de Goede <hdegoede@redhat.com> Link: https://lore.kernel.org/r/20220302101637.26542-2-hdegoede@redhat.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 8f43470 commit 342e7c6

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

drivers/staging/rtl8723bs/include/rtw_mlme.h

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,13 +102,17 @@ there are several "locks" in mlme_priv,
102102
since mlme_priv is a shared resource between many threads,
103103
like ISR/Call-Back functions, the OID handlers, and even timer functions.
104104
105-
106105
Each struct __queue has its own locks, already.
107-
Other items are protected by mlme_priv.lock.
106+
Other items in mlme_priv are protected by mlme_priv.lock, while items in
107+
xmit_priv are protected by xmit_priv.lock.
108108
109109
To avoid possible dead lock, any thread trying to modifiying mlme_priv
110110
SHALL not lock up more than one locks at a time!
111111
112+
The only exception is that queue functions which take the __queue.lock
113+
may be called with the xmit_priv.lock held. In this case the order
114+
MUST always be first lock xmit_priv.lock and then call any queue functions
115+
which take __queue.lock.
112116
*/
113117

114118

0 commit comments

Comments
 (0)