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_interruptibe()). Interruptible waits are neither required nor wanted in this driver. Tested with ASUSTek Computer, Inc. Realtek 8188EUS [USB-N10 Nano]. Acked-by: Larry Finger <Larry.Finger@lwfinger.net> Signed-off-by: Fabio M. De Francesco <fmdefrancesco@gmail.com> Link: https://lore.kernel.org/r/20211022171917.24363-1-fmdefrancesco@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Linux kernel ============ There are several guides for kernel developers and users. These guides can be rendered in a number of formats, like HTML and PDF. Please read Documentation/admin-guide/README.rst first. In order to build the documentation, use ``make htmldocs`` or ``make pdfdocs``. The formatted documentation can also be read online at: https://www.kernel.org/doc/html/latest/ There are various text files in the Documentation/ subdirectory, several of them using the Restructured Text markup notation. Please read the Documentation/process/changes.rst file, as it contains the requirements for building and running the kernel, and information about the problems which may result by upgrading your kernel.
Description
Languages
C
97.6%
Assembly
1%
Shell
0.5%
Python
0.3%
Makefile
0.3%