Commit Graph

13 Commits

Author SHA1 Message Date
Pavel Skripkin e2f6d5b038 staging: rtl8712: get rid of flush_scheduled_work
commit 9be550ee43919b070bcd77f9228bdbbbc073245b upstream.

This patch is preparation for following patch for error handling
refactoring.

flush_scheduled_work() takes (wq_completion)events lock and
it can lead to deadlock when r871xu_dev_remove() is called from workqueue.
To avoid deadlock sutiation we can change flush_scheduled_work() call to
flush_work() call for all possibly scheduled works in this driver,
since next patch adds device_release_driver() in case of fw load failure.

Signed-off-by: Pavel Skripkin <paskripkin@gmail.com>
Cc: stable <stable@vger.kernel.org>
Link: https://lore.kernel.org/r/6e028b4c457eeb7156c76c6ea3cdb3cb0207c7e1.1626895918.git.paskripkin@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-08-12 13:21:01 +02:00
Nishka Dasgupta 7c93fdf090 staging: rtl8712: r8712_register_cmd_alive(): Change return values
Change return values of r8712_register_cmd_alive from _SUCCESS and _FAIL
to 0 and -EINVAL.
Change the return type of this function from sint to int.
Modify its call site to check for 0 instead of _SUCCESS.

Signed-off-by: Nishka Dasgupta <nishkadg.linux@gmail.com>
Link: https://lore.kernel.org/r/20190722092341.21030-4-nishkadg.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-07-25 09:52:00 +02:00
Michael Straube e24c1f8658 staging: rtl8712: add SPDX identifiers
This satisfies a checkpatch warning and is the preferred
method for notating the license.

The SPDX identifier is a legally binding shorthand, which
can be used instead of the full boiler plate text.

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-10-03 11:36:09 -07:00
Derek Robson b355da4c7c Staging: rtl8712: rtl871x_pwrctrl.h - style fix
Fixed style fo block comments
Found using checkpatch

Signed-off-by: Derek Robson <robsonde@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-03-06 09:17:03 +01:00
Raphaël Beamonte bef611a92e staging: rtl8712: checkpatch cleanup: block comments using a trailing */
Fix checkpatch.pl warning "Block comments use a trailing */ on
a separate line" on multiple files of the driver by editing the
affected comments.

Signed-off-by: Raphaël Beamonte <raphael.beamonte@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-09-12 11:43:52 +02:00
Binoy Jayan 5c2ba8b85e rtl8712: pwrctrl_priv: Replace semaphore lock with mutex
The semaphore 'lock' in 'pwrctrl_priv' is used as a simple mutex, so it
should be written as one. Semaphores are going away in the future.
_enter_pwrlock was using down_interruptible(), so the lock could be broken
by sending a signal. This could be a bug, because nothing checks the return
code here. Hence, using mutex_lock instead of the interruptible version.
Removing the now unused _enter_pwrlock and _down_sema.

Signed-off-by: Binoy Jayan <binoy.jayan@linaro.org>
Reviewed-by: Arnd Bergmann <arnd@arndb.de>
Tested-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-09-01 17:44:01 +02:00
Max Perepelitsyn 0636b4603f staging: rtl8712: remove spaces before commas
checkpatch.pl fix for
ERROR: space prohibited before that ',' (ctx:WxE)

Signed-off-by: Max Perepelitsyn <mperepelitsyn@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-01-17 14:20:25 -08:00
James A Shackleford 143198fd31 staging: rtl8712: remove #define _workitem struct work_struct
_workitem is just a #define for work_struct.  Remove the #define and
use struct work_struct directly instead.

Signed-off-by: James A Shackleford <shack@linux.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-07-09 12:30:46 -07:00
Larry Finger 73ee07faee staging: r8712u: Remove defines that are not used
This driver has a number of defines, etc. that are not used.

Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-09-04 14:14:08 -07:00
Larry Finger 86587b671b staging: r8712u: Simplify semaphores
I am preparing to convert this driver from semaphore to mutex locking,
The first step has been to eliminate a number of semaphores that were
initialized but never used, and one whose only use was a single "up"
after initialization. A total of 9 semaphores were removed in this process.

One other change was to remove some inline semaphore routines that were
unused.

In addition, several cases had the following structure:

down()
if () {
   ...
}
up()

The locking overhead was reduced by moving the up/down inside the if
block.

Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-02-09 09:12:55 -08:00
Ali Bahar b4f6209d73 staging: r8712u: Merging Realtek's latest (v2.6.6). Added Larry's copyright.
Larry Finger's copyright addendum has now been included in the
banners.
The files involved in this commit have had only their banners
changed; there have been no other mods.

Signed-off-by: Ali Bahar <ali@internetDog.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-08-23 12:53:52 -07:00
Ali Bahar 0e54f6090d staging: r8712u: Merging Realtek's latest (v2.6.6). Added copyright banners.
The only changes to these files have been the addition of only copyright
banners.

Signed-off-by: Ali Bahar <ali@internetDog.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-08-23 12:53:52 -07:00
Larry Finger 2865d42c78 staging: r8712u: Add the new driver to the mainline kernel
This code is for a completely new version of the Realtek 8192 USB devices
such as the D-Link DWA-130. The Realtek code, which was originally for
Linux, Windows XP and Windows CE, has been stripped of all code not needed
for Linux. In addition, only one additional configuration variable, which
enables AP mode, remains.

Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: Florian Schilhabel <florian.c.schilhabel@googlemail.com>
Tested-by: Frederic Leroy <fredo@starox.org>
2010-08-20 10:15:30 -05:00