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 5/5] rtl8192e: Replace semaphore ips_sem with mutex
Date: Wed, 1 Jun 2016 14:56:56 +0530 [thread overview]
Message-ID: <1464773216-32014-6-git-send-email-binoy.jayan@linaro.org> (raw)
In-Reply-To: <1464773216-32014-1-git-send-email-binoy.jayan@linaro.org>
The semaphore 'ips_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 scan_sem with mutex
drivers/staging/rtl8192e/rtl8192e/rtl_cam.c | 4 ++--
drivers/staging/rtl8192e/rtl8192e/rtl_ps.c | 8 ++++----
drivers/staging/rtl8192e/rtl8192e/rtl_wx.c | 16 ++++++++--------
drivers/staging/rtl8192e/rtllib.h | 3 +--
drivers/staging/rtl8192e/rtllib_softmac.c | 2 +-
5 files changed, 16 insertions(+), 17 deletions(-)
diff --git a/drivers/staging/rtl8192e/rtl8192e/rtl_cam.c b/drivers/staging/rtl8192e/rtl8192e/rtl_cam.c
index 803c8b0..30f65af 100644
--- a/drivers/staging/rtl8192e/rtl8192e/rtl_cam.c
+++ b/drivers/staging/rtl8192e/rtl8192e/rtl_cam.c
@@ -107,9 +107,9 @@ void rtl92e_set_key(struct net_device *dev, u8 EntryNo, u8 KeyIndex,
__func__);
return;
}
- down(&priv->rtllib->ips_sem);
+ mutex_lock(&priv->rtllib->ips_mutex);
rtl92e_ips_leave(dev);
- up(&priv->rtllib->ips_sem);
+ mutex_unlock(&priv->rtllib->ips_mutex);
}
}
priv->rtllib->is_set_key = true;
diff --git a/drivers/staging/rtl8192e/rtl8192e/rtl_ps.c b/drivers/staging/rtl8192e/rtl8192e/rtl_ps.c
index 98e4d88..aa4b015 100644
--- a/drivers/staging/rtl8192e/rtl8192e/rtl_ps.c
+++ b/drivers/staging/rtl8192e/rtl8192e/rtl_ps.c
@@ -179,9 +179,9 @@ void rtl92e_ips_leave_wq(void *data)
struct net_device *dev = ieee->dev;
struct r8192_priv *priv = (struct r8192_priv *)rtllib_priv(dev);
- down(&priv->rtllib->ips_sem);
+ mutex_lock(&priv->rtllib->ips_mutex);
rtl92e_ips_leave(dev);
- up(&priv->rtllib->ips_sem);
+ mutex_unlock(&priv->rtllib->ips_mutex);
}
void rtl92e_rtllib_ips_leave_wq(struct net_device *dev)
@@ -209,9 +209,9 @@ void rtl92e_rtllib_ips_leave(struct net_device *dev)
{
struct r8192_priv *priv = (struct r8192_priv *)rtllib_priv(dev);
- down(&priv->rtllib->ips_sem);
+ mutex_lock(&priv->rtllib->ips_mutex);
rtl92e_ips_leave(dev);
- up(&priv->rtllib->ips_sem);
+ mutex_unlock(&priv->rtllib->ips_mutex);
}
static bool _rtl92e_ps_set_mode(struct net_device *dev, u8 rtPsMode)
diff --git a/drivers/staging/rtl8192e/rtl8192e/rtl_wx.c b/drivers/staging/rtl8192e/rtl8192e/rtl_wx.c
index 78fe833..7413a10 100644
--- a/drivers/staging/rtl8192e/rtl8192e/rtl_wx.c
+++ b/drivers/staging/rtl8192e/rtl8192e/rtl_wx.c
@@ -281,9 +281,9 @@ static int _rtl92e_wx_set_mode(struct net_device *dev,
netdev_info(dev,
"=========>%s(): rtl92e_ips_leave\n",
__func__);
- down(&priv->rtllib->ips_sem);
+ mutex_lock(&priv->rtllib->ips_mutex);
rtl92e_ips_leave(dev);
- up(&priv->rtllib->ips_sem);
+ mutex_unlock(&priv->rtllib->ips_mutex);
}
}
}
@@ -442,9 +442,9 @@ static int _rtl92e_wx_set_scan(struct net_device *dev,
RT_TRACE(COMP_PS,
"=========>%s(): rtl92e_ips_leave\n",
__func__);
- down(&priv->rtllib->ips_sem);
+ mutex_lock(&priv->rtllib->ips_mutex);
rtl92e_ips_leave(dev);
- up(&priv->rtllib->ips_sem);
+ mutex_unlock(&priv->rtllib->ips_mutex);
}
}
rtllib_stop_scan(priv->rtllib);
@@ -698,9 +698,9 @@ static int _rtl92e_wx_set_enc(struct net_device *dev,
return -ENETDOWN;
priv->rtllib->wx_set_enc = 1;
- down(&priv->rtllib->ips_sem);
+ mutex_lock(&priv->rtllib->ips_mutex);
rtl92e_ips_leave(dev);
- up(&priv->rtllib->ips_sem);
+ mutex_unlock(&priv->rtllib->ips_mutex);
mutex_lock(&priv->wx_mutex);
RT_TRACE(COMP_SEC, "Setting SW wep key");
@@ -905,9 +905,9 @@ static int _rtl92e_wx_set_encode_ext(struct net_device *dev,
mutex_lock(&priv->wx_mutex);
priv->rtllib->wx_set_enc = 1;
- down(&priv->rtllib->ips_sem);
+ mutex_lock(&priv->rtllib->ips_mutex);
rtl92e_ips_leave(dev);
- up(&priv->rtllib->ips_sem);
+ mutex_unlock(&priv->rtllib->ips_mutex);
ret = rtllib_wx_set_encode_ext(ieee, info, wrqu, extra);
{
diff --git a/drivers/staging/rtl8192e/rtllib.h b/drivers/staging/rtl8192e/rtllib.h
index 5bdc378..38247fa 100644
--- a/drivers/staging/rtl8192e/rtllib.h
+++ b/drivers/staging/rtl8192e/rtllib.h
@@ -30,7 +30,6 @@
#include <linux/jiffies.h>
#include <linux/timer.h>
#include <linux/sched.h>
-#include <linux/semaphore.h>
#include <linux/mutex.h>
#include <linux/delay.h>
@@ -1654,7 +1653,7 @@ struct rtllib_device {
struct mutex wx_mutex;
struct mutex scan_mutex;
- struct semaphore ips_sem;
+ struct mutex ips_mutex;
spinlock_t mgmt_tx_lock;
spinlock_t beacon_lock;
diff --git a/drivers/staging/rtl8192e/rtllib_softmac.c b/drivers/staging/rtl8192e/rtllib_softmac.c
index 7f4033c..26cbfa8 100644
--- a/drivers/staging/rtl8192e/rtllib_softmac.c
+++ b/drivers/staging/rtl8192e/rtllib_softmac.c
@@ -3036,7 +3036,7 @@ void rtllib_softmac_init(struct rtllib_device *ieee)
mutex_init(&ieee->wx_mutex);
mutex_init(&ieee->scan_mutex);
- sema_init(&ieee->ips_sem, 1);
+ mutex_init(&ieee->ips_mutex);
spin_lock_init(&ieee->mgmt_tx_lock);
spin_lock_init(&ieee->beacon_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:28 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 ` [PATCH 4/5] rtl8192e: Replace semaphore scan_sem " Binoy Jayan
2016-06-01 9:26 ` Binoy Jayan [this message]
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-6-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®