* [PATCH 1/2] ath10k: remove unused <linux/semaphore.h>
@ 2016-06-21 11:45 Chaehyun Lim
2016-06-21 11:45 ` [PATCH 2/2] ath6kl: replace semaphore with mutex Chaehyun Lim
` (2 more replies)
0 siblings, 3 replies; 6+ messages in thread
From: Chaehyun Lim @ 2016-06-21 11:45 UTC (permalink / raw)
To: kvalo; +Cc: netdev, linux-wireless, Chaehyun Lim, ath10k
<linux/semaphore.h> is not used anymore, so just remove it.
Signed-off-by: Chaehyun Lim <chaehyun.lim@gmail.com>
---
drivers/net/wireless/ath/ath10k/htc.h | 1 -
1 file changed, 1 deletion(-)
diff --git a/drivers/net/wireless/ath/ath10k/htc.h b/drivers/net/wireless/ath/ath10k/htc.h
index cc82718..0c55cd9 100644
--- a/drivers/net/wireless/ath/ath10k/htc.h
+++ b/drivers/net/wireless/ath/ath10k/htc.h
@@ -22,7 +22,6 @@
#include <linux/list.h>
#include <linux/bug.h>
#include <linux/skbuff.h>
-#include <linux/semaphore.h>
#include <linux/timer.h>
struct ath10k;
--
2.9.0
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH 2/2] ath6kl: replace semaphore with mutex
2016-06-21 11:45 [PATCH 1/2] ath10k: remove unused <linux/semaphore.h> Chaehyun Lim
@ 2016-06-21 11:45 ` Chaehyun Lim
2016-06-21 12:05 ` kbuild test robot
2016-06-21 13:46 ` [PATCH 1/2] ath10k: remove unused <linux/semaphore.h> Sergei Shtylyov
2016-07-08 6:44 ` [1/2] " Kalle Valo
2 siblings, 1 reply; 6+ messages in thread
From: Chaehyun Lim @ 2016-06-21 11:45 UTC (permalink / raw)
To: kvalo; +Cc: ath10k, linux-wireless, netdev, Chaehyun Lim
It replaces struct semaphore sem with struct mutex mutex
Signed-off-by: Chaehyun Lim <chaehyun.lim@gmail.com>
---
drivers/net/wireless/ath/ath6kl/cfg80211.c | 30 +++++++++++++++---------------
drivers/net/wireless/ath/ath6kl/core.c | 2 +-
drivers/net/wireless/ath/ath6kl/core.h | 2 +-
drivers/net/wireless/ath/ath6kl/debug.c | 12 ++++++------
drivers/net/wireless/ath/ath6kl/init.c | 6 +++---
5 files changed, 26 insertions(+), 26 deletions(-)
diff --git a/drivers/net/wireless/ath/ath6kl/cfg80211.c b/drivers/net/wireless/ath/ath6kl/cfg80211.c
index f6b5390..d4eb066 100644
--- a/drivers/net/wireless/ath/ath6kl/cfg80211.c
+++ b/drivers/net/wireless/ath/ath6kl/cfg80211.c
@@ -480,14 +480,14 @@ static int ath6kl_cfg80211_connect(struct wiphy *wiphy, struct net_device *dev,
return -EINVAL;
}
- if (down_interruptible(&ar->sem)) {
+ if (mutex_lock_interruptible(&ar->mutex)) {
ath6kl_err("busy, couldn't get access\n");
return -ERESTARTSYS;
}
if (test_bit(DESTROY_IN_PROGRESS, &ar->flag)) {
ath6kl_err("busy, destroy in progress\n");
- up(&ar->sem);
+ mutex_unlock(&ar->mutex);
return -EBUSY;
}
@@ -500,14 +500,14 @@ static int ath6kl_cfg80211_connect(struct wiphy *wiphy, struct net_device *dev,
WMI_TIMEOUT);
if (signal_pending(current)) {
ath6kl_err("cmd queue drain timeout\n");
- up(&ar->sem);
+ mutex_unlock(&ar->mutex);
return -EINTR;
}
}
status = ath6kl_set_assoc_req_ies(vif, sme->ie, sme->ie_len);
if (status) {
- up(&ar->sem);
+ mutex_unlock(&ar->mutex);
return status;
}
@@ -522,7 +522,7 @@ static int ath6kl_cfg80211_connect(struct wiphy *wiphy, struct net_device *dev,
vif->req_bssid,
vif->ch_hint);
- up(&ar->sem);
+ mutex_unlock(&ar->mutex);
if (status) {
ath6kl_err("wmi_reconnect_cmd failed\n");
return -EIO;
@@ -548,7 +548,7 @@ static int ath6kl_cfg80211_connect(struct wiphy *wiphy, struct net_device *dev,
status = ath6kl_set_auth_type(vif, sme->auth_type);
if (status) {
- up(&ar->sem);
+ mutex_unlock(&ar->mutex);
return status;
}
@@ -570,7 +570,7 @@ static int ath6kl_cfg80211_connect(struct wiphy *wiphy, struct net_device *dev,
if (sme->key_idx > WMI_MAX_KEY_INDEX) {
ath6kl_err("key index %d out of bounds\n",
sme->key_idx);
- up(&ar->sem);
+ mutex_unlock(&ar->mutex);
return -ENOENT;
}
@@ -594,7 +594,7 @@ static int ath6kl_cfg80211_connect(struct wiphy *wiphy, struct net_device *dev,
if (ath6kl_wmi_bssfilter_cmd(ar->wmi, vif->fw_vif_idx,
ALL_BSS_FILTER, 0) != 0) {
ath6kl_err("couldn't set bss filtering\n");
- up(&ar->sem);
+ mutex_unlock(&ar->mutex);
return -EIO;
}
}
@@ -626,7 +626,7 @@ static int ath6kl_cfg80211_connect(struct wiphy *wiphy, struct net_device *dev,
0);
if (status) {
ath6kl_err("couldn't set listen intervel\n");
- up(&ar->sem);
+ mutex_unlock(&ar->mutex);
return status;
}
}
@@ -651,7 +651,7 @@ static int ath6kl_cfg80211_connect(struct wiphy *wiphy, struct net_device *dev,
ath6kl_wmi_scanparams_cmd(ar->wmi, vif->fw_vif_idx, 0, 0,
sme->bg_scan_period, 0, 0, 0, 3, 0, 0, 0);
- up(&ar->sem);
+ mutex_unlock(&ar->mutex);
if (status == -EINVAL) {
memset(vif->ssid, 0, sizeof(vif->ssid));
@@ -832,7 +832,7 @@ static int ath6kl_cfg80211_disconnect(struct wiphy *wiphy,
return -EBUSY;
}
- if (down_interruptible(&ar->sem)) {
+ if (mutex_lock_interruptible(&ar->mutex)) {
ath6kl_err("busy, couldn't get access\n");
return -ERESTARTSYS;
}
@@ -845,7 +845,7 @@ static int ath6kl_cfg80211_disconnect(struct wiphy *wiphy,
if (!test_bit(SKIP_SCAN, &ar->flag))
memset(vif->req_bssid, 0, sizeof(vif->req_bssid));
- up(&ar->sem);
+ mutex_unlock(&ar->mutex);
vif->sme_state = SME_DISCONNECTED;
@@ -1775,7 +1775,7 @@ static int ath6kl_get_station(struct wiphy *wiphy, struct net_device *dev,
if (memcmp(mac, vif->bssid, ETH_ALEN) != 0)
return -ENOENT;
- if (down_interruptible(&ar->sem))
+ if (mutex_lock_interruptible(&ar->mutex))
return -EBUSY;
set_bit(STATS_UPDATE_PEND, &vif->flags);
@@ -1783,7 +1783,7 @@ static int ath6kl_get_station(struct wiphy *wiphy, struct net_device *dev,
ret = ath6kl_wmi_get_stats_cmd(ar->wmi, vif->fw_vif_idx);
if (ret != 0) {
- up(&ar->sem);
+ mutex_unlock(&ar->mutex);
return -EIO;
}
@@ -1792,7 +1792,7 @@ static int ath6kl_get_station(struct wiphy *wiphy, struct net_device *dev,
&vif->flags),
WMI_TIMEOUT);
- up(&ar->sem);
+ mutex_unlock(&ar->mutex);
if (left == 0)
return -ETIMEDOUT;
diff --git a/drivers/net/wireless/ath/ath6kl/core.c b/drivers/net/wireless/ath/ath6kl/core.c
index ebb9f16..0da253a 100644
--- a/drivers/net/wireless/ath/ath6kl/core.c
+++ b/drivers/net/wireless/ath/ath6kl/core.c
@@ -283,7 +283,7 @@ struct ath6kl *ath6kl_core_create(struct device *dev)
spin_lock_init(&ar->list_lock);
init_waitqueue_head(&ar->event_wq);
- sema_init(&ar->sem, 1);
+ mutex_init(&ar->mutex);
INIT_LIST_HEAD(&ar->amsdu_rx_buffer_queue);
INIT_LIST_HEAD(&ar->vif_list);
diff --git a/drivers/net/wireless/ath/ath6kl/core.h b/drivers/net/wireless/ath/ath6kl/core.h
index ac25f17..42848bd 100644
--- a/drivers/net/wireless/ath/ath6kl/core.h
+++ b/drivers/net/wireless/ath/ath6kl/core.h
@@ -722,7 +722,7 @@ struct ath6kl {
*/
spinlock_t lock;
- struct semaphore sem;
+ struct mutex mutex;
u8 lrssi_roam_threshold;
struct ath6kl_version version;
u32 target_type;
diff --git a/drivers/net/wireless/ath/ath6kl/debug.c b/drivers/net/wireless/ath/ath6kl/debug.c
index e2b7809..9c1e709 100644
--- a/drivers/net/wireless/ath/ath6kl/debug.c
+++ b/drivers/net/wireless/ath/ath6kl/debug.c
@@ -102,13 +102,13 @@ int ath6kl_read_tgt_stats(struct ath6kl *ar, struct ath6kl_vif *vif)
{
long left;
- if (down_interruptible(&ar->sem))
+ if (mutex_lock_interruptible(&ar->mutex))
return -EBUSY;
set_bit(STATS_UPDATE_PEND, &vif->flags);
if (ath6kl_wmi_get_stats_cmd(ar->wmi, 0)) {
- up(&ar->sem);
+ mutex_unlock(&ar->mutex);
return -EIO;
}
@@ -116,7 +116,7 @@ int ath6kl_read_tgt_stats(struct ath6kl *ar, struct ath6kl_vif *vif)
!test_bit(STATS_UPDATE_PEND,
&vif->flags), WMI_TIMEOUT);
- up(&ar->sem);
+ mutex_unlock(&ar->mutex);
if (left <= 0)
return -ETIMEDOUT;
@@ -1167,20 +1167,20 @@ static ssize_t ath6kl_roam_table_read(struct file *file, char __user *user_buf,
unsigned int len, buf_len;
ssize_t ret_cnt;
- if (down_interruptible(&ar->sem))
+ if (mutex_lock_interruptible(&ar->mutex))
return -EBUSY;
set_bit(ROAM_TBL_PEND, &ar->flag);
ret = ath6kl_wmi_get_roam_tbl_cmd(ar->wmi);
if (ret) {
- up(&ar->sem);
+ mutex_unlock(&ar->sem);
return ret;
}
left = wait_event_interruptible_timeout(
ar->event_wq, !test_bit(ROAM_TBL_PEND, &ar->flag), WMI_TIMEOUT);
- up(&ar->sem);
+ mutex_unlock(&ar->mutex);
if (left <= 0)
return -ETIMEDOUT;
diff --git a/drivers/net/wireless/ath/ath6kl/init.c b/drivers/net/wireless/ath/ath6kl/init.c
index 58fb227..377f1fa 100644
--- a/drivers/net/wireless/ath/ath6kl/init.c
+++ b/drivers/net/wireless/ath/ath6kl/init.c
@@ -1890,8 +1890,8 @@ void ath6kl_stop_txrx(struct ath6kl *ar)
set_bit(DESTROY_IN_PROGRESS, &ar->flag);
- if (down_interruptible(&ar->sem)) {
- ath6kl_err("down_interruptible failed\n");
+ if (mutex_lock_interruptible(&ar->mutex)) {
+ ath6kl_err("mutex_lock_interruptible failed\n");
return;
}
@@ -1938,6 +1938,6 @@ void ath6kl_stop_txrx(struct ath6kl *ar)
*/
ath6kl_init_hw_reset(ar);
- up(&ar->sem);
+ mutex_unlock(&ar->mutex);
}
EXPORT_SYMBOL(ath6kl_stop_txrx);
--
2.9.0
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH 2/2] ath6kl: replace semaphore with mutex
2016-06-21 11:45 ` [PATCH 2/2] ath6kl: replace semaphore with mutex Chaehyun Lim
@ 2016-06-21 12:05 ` kbuild test robot
0 siblings, 0 replies; 6+ messages in thread
From: kbuild test robot @ 2016-06-21 12:05 UTC (permalink / raw)
To: Chaehyun Lim
Cc: netdev, linux-wireless, ath10k, kvalo, kbuild-all, Chaehyun Lim
[-- Attachment #1: Type: text/plain, Size: 1477 bytes --]
Hi,
[auto build test ERROR on ath6kl/ath-next]
[also build test ERROR on v4.7-rc4 next-20160621]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]
url: https://github.com/0day-ci/linux/commits/Chaehyun-Lim/ath10k-remove-unused-linux-semaphore-h/20160621-195511
base: https://git.kernel.org/pub/scm/linux/kernel/git/kvalo/ath.git ath-next
config: sparc64-allyesconfig (attached as .config)
compiler: sparc64-linux-gnu-gcc (Debian 5.3.1-8) 5.3.1 20160205
reproduce:
wget https://git.kernel.org/cgit/linux/kernel/git/wfg/lkp-tests.git/plain/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# save the attached .config to linux build tree
make.cross ARCH=sparc64
All errors (new ones prefixed by >>):
drivers/net/wireless/ath/ath6kl/debug.c: In function 'ath6kl_roam_table_read':
>> drivers/net/wireless/ath/ath6kl/debug.c:1177:19: error: 'struct ath6kl' has no member named 'sem'
mutex_unlock(&ar->sem);
^
vim +1177 drivers/net/wireless/ath/ath6kl/debug.c
1171 return -EBUSY;
1172
1173 set_bit(ROAM_TBL_PEND, &ar->flag);
1174
1175 ret = ath6kl_wmi_get_roam_tbl_cmd(ar->wmi);
1176 if (ret) {
> 1177 mutex_unlock(&ar->sem);
1178 return ret;
1179 }
1180
---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all Intel Corporation
[-- Attachment #2: .config.gz --]
[-- Type: application/octet-stream, Size: 46468 bytes --]
[-- Attachment #3: Type: text/plain, Size: 146 bytes --]
_______________________________________________
ath10k mailing list
ath10k@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/ath10k
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH 1/2] ath10k: remove unused <linux/semaphore.h>
2016-06-21 11:45 [PATCH 1/2] ath10k: remove unused <linux/semaphore.h> Chaehyun Lim
2016-06-21 11:45 ` [PATCH 2/2] ath6kl: replace semaphore with mutex Chaehyun Lim
@ 2016-06-21 13:46 ` Sergei Shtylyov
2016-06-30 11:26 ` Valo, Kalle
2016-07-08 6:44 ` [1/2] " Kalle Valo
2 siblings, 1 reply; 6+ messages in thread
From: Sergei Shtylyov @ 2016-06-21 13:46 UTC (permalink / raw)
To: Chaehyun Lim, kvalo; +Cc: netdev, linux-wireless, ath10k
Hello.
On 6/21/2016 2:45 PM, Chaehyun Lim wrote:
> <linux/semaphore.h> is not used anymore, so just remove it.
s/it/#include/?
> Signed-off-by: Chaehyun Lim <chaehyun.lim@gmail.com>
[...]
> diff --git a/drivers/net/wireless/ath/ath10k/htc.h b/drivers/net/wireless/ath/ath10k/htc.h
> index cc82718..0c55cd9 100644
> --- a/drivers/net/wireless/ath/ath10k/htc.h
> +++ b/drivers/net/wireless/ath/ath10k/htc.h
> @@ -22,7 +22,6 @@
> #include <linux/list.h>
> #include <linux/bug.h>
> #include <linux/skbuff.h>
> -#include <linux/semaphore.h>
> #include <linux/timer.h>
>
> struct ath10k;
MBR, Sergei
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH 1/2] ath10k: remove unused <linux/semaphore.h>
2016-06-21 13:46 ` [PATCH 1/2] ath10k: remove unused <linux/semaphore.h> Sergei Shtylyov
@ 2016-06-30 11:26 ` Valo, Kalle
0 siblings, 0 replies; 6+ messages in thread
From: Valo, Kalle @ 2016-06-30 11:26 UTC (permalink / raw)
To: Sergei Shtylyov
Cc: Chaehyun Lim, netdev@vger.kernel.org,
linux-wireless@vger.kernel.org, ath10k@lists.infradead.org
Sergei Shtylyov <sergei.shtylyov@cogentembedded.com> writes:
> On 6/21/2016 2:45 PM, Chaehyun Lim wrote:
>
>> <linux/semaphore.h> is not used anymore, so just remove it.
>
> s/it/#include/?
Fixed that in the pending branch.
--
Kalle Valo
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [1/2] ath10k: remove unused <linux/semaphore.h>
2016-06-21 11:45 [PATCH 1/2] ath10k: remove unused <linux/semaphore.h> Chaehyun Lim
2016-06-21 11:45 ` [PATCH 2/2] ath6kl: replace semaphore with mutex Chaehyun Lim
2016-06-21 13:46 ` [PATCH 1/2] ath10k: remove unused <linux/semaphore.h> Sergei Shtylyov
@ 2016-07-08 6:44 ` Kalle Valo
2 siblings, 0 replies; 6+ messages in thread
From: Kalle Valo @ 2016-07-08 6:44 UTC (permalink / raw)
To: Chaehyun Lim; +Cc: netdev, linux-wireless, Chaehyun Lim, ath10k
Chaehyun Lim <chaehyun.lim@gmail.com> wrote:
> <linux/semaphore.h> is not used anymore, so just remove it.
>
> Signed-off-by: Chaehyun Lim <chaehyun.lim@gmail.com>
Thanks, 1 patch applied to ath-next branch of ath.git:
a3dadad73324 ath10k: remove unused <linux/semaphore.h>
--
Sent by pwcli
https://patchwork.kernel.org/patch/9190357/
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2016-07-08 6:44 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-06-21 11:45 [PATCH 1/2] ath10k: remove unused <linux/semaphore.h> Chaehyun Lim
2016-06-21 11:45 ` [PATCH 2/2] ath6kl: replace semaphore with mutex Chaehyun Lim
2016-06-21 12:05 ` kbuild test robot
2016-06-21 13:46 ` [PATCH 1/2] ath10k: remove unused <linux/semaphore.h> Sergei Shtylyov
2016-06-30 11:26 ` Valo, Kalle
2016-07-08 6:44 ` [1/2] " Kalle Valo
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).