From: Binoy Jayan <binoy.jayan@linaro.org>
To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Arnd Bergmann <arnd@arndb.de>,
Mateusz Kulikowski <mateusz.kulikowski@gmail.com>,
devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org,
Binoy Jayan <binoy.jayan@linaro.org>
Subject: [PATCH 4/5] rtl8192e: Replace semaphore scan_sem with mutex
Date: Wed, 1 Jun 2016 14:56:55 +0530 [thread overview]
Message-ID: <1464773216-32014-5-git-send-email-binoy.jayan@linaro.org> (raw)
In-Reply-To: <1464773216-32014-1-git-send-email-binoy.jayan@linaro.org>
The semaphore 'scan_sem' in the rtl8192e is a simple mutex, so it should
be written as one. Semaphores are going away in the future.
Signed-off-by: Binoy Jayan <binoy.jayan@linaro.org>
---
This patch depends on the following patch:
rtl8192e: Replace semaphore rf_sem with mutex
drivers/staging/rtl8192e/rtllib.h | 2 +-
drivers/staging/rtl8192e/rtllib_softmac.c | 16 ++++++++--------
2 files changed, 9 insertions(+), 9 deletions(-)
diff --git a/drivers/staging/rtl8192e/rtllib.h b/drivers/staging/rtl8192e/rtllib.h
index 513dd61..5bdc378 100644
--- a/drivers/staging/rtl8192e/rtllib.h
+++ b/drivers/staging/rtl8192e/rtllib.h
@@ -1653,7 +1653,7 @@ struct rtllib_device {
short proto_stoppping;
struct mutex wx_mutex;
- struct semaphore scan_sem;
+ struct mutex scan_mutex;
struct semaphore ips_sem;
spinlock_t mgmt_tx_lock;
diff --git a/drivers/staging/rtl8192e/rtllib_softmac.c b/drivers/staging/rtl8192e/rtllib_softmac.c
index 30abb7f..7f4033c 100644
--- a/drivers/staging/rtl8192e/rtllib_softmac.c
+++ b/drivers/staging/rtl8192e/rtllib_softmac.c
@@ -513,7 +513,7 @@ static void rtllib_softmac_scan_syncro(struct rtllib_device *ieee, u8 is_mesh)
ieee->be_scan_inprogress = true;
- down(&ieee->scan_sem);
+ mutex_lock(&ieee->scan_mutex);
while (1) {
do {
@@ -566,7 +566,7 @@ out:
if (IS_DOT11D_ENABLE(ieee))
DOT11D_ScanComplete(ieee);
}
- up(&ieee->scan_sem);
+ mutex_unlock(&ieee->scan_mutex);
ieee->be_scan_inprogress = false;
@@ -587,7 +587,7 @@ static void rtllib_softmac_scan_wq(void *data)
if (rtllib_act_scanning(ieee, true))
return;
- down(&ieee->scan_sem);
+ mutex_lock(&ieee->scan_mutex);
if (ieee->eRFPowerState == eRfOff) {
netdev_info(ieee->dev,
@@ -618,7 +618,7 @@ static void rtllib_softmac_scan_wq(void *data)
schedule_delayed_work(&ieee->softmac_scan_wq,
msecs_to_jiffies(RTLLIB_SOFTMAC_SCAN_TIME));
- up(&ieee->scan_sem);
+ mutex_unlock(&ieee->scan_mutex);
return;
out:
@@ -630,7 +630,7 @@ out1:
ieee->actscanning = false;
ieee->scan_watch_dog = 0;
ieee->scanning_continue = 0;
- up(&ieee->scan_sem);
+ mutex_unlock(&ieee->scan_mutex);
}
@@ -683,7 +683,7 @@ EXPORT_SYMBOL(rtllib_start_send_beacons);
static void rtllib_softmac_stop_scan(struct rtllib_device *ieee)
{
- down(&ieee->scan_sem);
+ mutex_lock(&ieee->scan_mutex);
ieee->scan_watch_dog = 0;
if (ieee->scanning_continue == 1) {
ieee->scanning_continue = 0;
@@ -692,7 +692,7 @@ static void rtllib_softmac_stop_scan(struct rtllib_device *ieee)
cancel_delayed_work_sync(&ieee->softmac_scan_wq);
}
- up(&ieee->scan_sem);
+ mutex_unlock(&ieee->scan_mutex);
}
void rtllib_stop_scan(struct rtllib_device *ieee)
@@ -3035,7 +3035,7 @@ void rtllib_softmac_init(struct rtllib_device *ieee)
ieee);
mutex_init(&ieee->wx_mutex);
- sema_init(&ieee->scan_sem, 1);
+ mutex_init(&ieee->scan_mutex);
sema_init(&ieee->ips_sem, 1);
spin_lock_init(&ieee->mgmt_tx_lock);
--
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
a Linux Foundation Collaborative Project
next prev parent reply other threads:[~2016-06-01 9:27 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-06-01 9:26 [PATCH 0/5] *** rtl8192e: Replace semaphore with mutex *** Binoy Jayan
2016-06-01 9:26 ` [PATCH 1/5] rtl8192e: rtllib_device: Replace semaphore wx_sem with mutex Binoy Jayan
2016-06-01 9:26 ` [PATCH 2/5] rtl8192e: r8192_priv: " Binoy Jayan
2016-06-01 9:26 ` [PATCH 3/5] rtl8192e: Replace semaphore rf_sem " Binoy Jayan
2016-06-01 9:26 ` Binoy Jayan [this message]
2016-06-01 9:26 ` [PATCH 5/5] rtl8192e: Replace semaphore ips_sem " Binoy Jayan
2016-06-01 12:38 ` [PATCH 0/5] *** rtl8192e: Replace semaphore with mutex *** Arnd Bergmann
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1464773216-32014-5-git-send-email-binoy.jayan@linaro.org \
--to=binoy.jayan@linaro.org \
--cc=arnd@arndb.de \
--cc=devel@driverdev.osuosl.org \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mateusz.kulikowski@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®