staging: r8188eu: Use completions for signaling enqueueing
authorFabio M. De Francesco <fmdefrancesco@gmail.com>
Mon, 18 Oct 2021 16:20:05 +0000 (18:20 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 19 Oct 2021 07:33:54 +0000 (09:33 +0200)
commite8eb2f890f2c60acee7d58ac24840e5b75ffa349
tree2c2ae90530f507074381a34fbadee5ae6fd013ab
parentd250bf4c397ab8f529ed172a3eb4dab64f700a9d
staging: r8188eu: Use completions for signaling enqueueing

rtw_enqueue_cmd() uses a semaphore to notify rtw_cmd_thread() that it
has enqueued commands. rtw_cmd_thread() "down(s)" in interruptible mode
to wait to be notified.

Use completion variables because they are better suited for the purpose.

In rtw_cmd_thread(), wait in uninterruptible mode, even if the original
code uses down_interruptible(), because the interruption of
rtw_cmd_thread() is not allowed and unwanted.

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

Acked-by: Phillip Potter <phil@philpotter.co.uk>
Signed-off-by: Fabio M. De Francesco <fmdefrancesco@gmail.com>
Link: https://lore.kernel.org/r/20211018162006.5527-3-fmdefrancesco@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/r8188eu/core/rtw_cmd.c
drivers/staging/r8188eu/include/rtw_cmd.h
drivers/staging/r8188eu/os_dep/os_intfs.c