Thread (3 messages) 3 messages, 2 authors, 2021-10-23

Re: [PATCH] staging: r8188eu: Use a Mutex instead of a binary Semaphore

From: Fabio M. De Francesco <hidden>
Date: 2021-10-23 14:02:27
Also in: lkml

On Friday, October 22, 2021 7:52:33 PM CEST Larry Finger wrote:
On 10/22/21 12:19, Fabio M. De Francesco wrote:
quoted
Use a Mutex instead of a binary Semaphore for the purpose of enforcing
mutual exclusive access to the "pwrctrl_priv" structure.

Mutexes are sleeping locks similar to Semaphores with a 'count' of one
(like binary Semaphores), however they have a simpler interface, more
efficient performance, and additional constraints.

There is no change in the logic of the new code; however it is more
simple because it gets rid of four unnecessary wrappers:
_init_pwrlock(), _enter_pwrlock(),_exit_pwrlock(), _rtw_down_sema().

Actually, there is a change in the state in which the code waits for
acquiring locks, because it makes it in an uninterruptible state
(instead the old code used down_interruptible()). Interruptible
waits are neither required nor wanted in this driver.

Tested with ASUSTek Computer, Inc. Realtek 8188EUS [USB-N10 Nano].

Signed-off-by: Fabio M. De Francesco <redacted>
Well done.

Acked-by: Larry Finger <redacted>
Hi Larry, 

Thank you very much for giving your "Acked-by" tag, and, above all, for the 
"Well done".

Best regards,

Fabio


Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help