linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 2/9]  mt76: remove unnecessary annotations
       [not found] ` <20200411001933.10072-1-jbi.octave@gmail.com>
@ 2020-04-11  0:19   ` Jules Irenge
  2020-04-11  0:19   ` [PATCH 3/9] hostap: Add missing annotations for prism2_bss_list_proc_start() and prism2_bss_list_proc_stop Jules Irenge
                     ` (2 subsequent siblings)
  3 siblings, 0 replies; 7+ messages in thread
From: Jules Irenge @ 2020-04-11  0:19 UTC (permalink / raw)
  To: linux-kernel
  Cc: boqun.feng, Felix Fietkau, Lorenzo Bianconi, Ryder Lee, Roy Luo,
	Kalle Valo, David S. Miller, Matthias Brugger,
	open list:MEDIATEK MT76 WIRELESS LAN DRIVER,
	open list:NETWORKING DRIVERS,
	moderated list:ARM/Mediatek SoC support,
	moderated list:ARM/Mediatek SoC support

Sparse report warnings at mt76_tx_status_unlock() and mt76_tx_status_lock()

warning: context imbalance in mt76_tx_status_lock() - wrong count at exit
warning: context imbalance in mt76_tx_status_unlock() - unexpected unlock

The root cause is the additional __acquire(&dev->status_list.lock)
and __release(&dev->status_list.unlock) called
 from inside mt76_tx_status_lock() and mt76_tx_status_unlock().

Remove __acquire(&dev->status_list.lock) annotation
Remove __releases(&dev->status_list.unlock)
Correct &dev->status_list.unlock to &dev->status_list.lock
	-unlock not defined in the sk_buff_head struct

Signed-off-by: Jules Irenge <jbi.octave@gmail.com>
---
 drivers/net/wireless/mediatek/mt76/tx.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/net/wireless/mediatek/mt76/tx.c b/drivers/net/wireless/mediatek/mt76/tx.c
index 7ee91d946882..7581ba9c2e95 100644
--- a/drivers/net/wireless/mediatek/mt76/tx.c
+++ b/drivers/net/wireless/mediatek/mt76/tx.c
@@ -101,18 +101,16 @@ mt76_tx_status_lock(struct mt76_dev *dev, struct sk_buff_head *list)
 {
 	__skb_queue_head_init(list);
 	spin_lock_bh(&dev->status_list.lock);
-	__acquire(&dev->status_list.lock);
 }
 EXPORT_SYMBOL_GPL(mt76_tx_status_lock);
 
 void
 mt76_tx_status_unlock(struct mt76_dev *dev, struct sk_buff_head *list)
-		      __releases(&dev->status_list.unlock)
+		      __releases(&dev->status_list.lock)
 {
 	struct sk_buff *skb;
 
 	spin_unlock_bh(&dev->status_list.lock);
-	__release(&dev->status_list.unlock);
 
 	while ((skb = __skb_dequeue(list)) != NULL)
 		ieee80211_tx_status(dev->hw, skb);
-- 
2.24.1


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH 3/9] hostap: Add missing annotations for prism2_bss_list_proc_start() and prism2_bss_list_proc_stop
       [not found] ` <20200411001933.10072-1-jbi.octave@gmail.com>
  2020-04-11  0:19   ` [PATCH 2/9] mt76: remove unnecessary annotations Jules Irenge
@ 2020-04-11  0:19   ` Jules Irenge
  2020-04-15  8:42     ` Kalle Valo
  2020-04-11  0:19   ` [PATCH 4/9] mac80211: Add missing annotation for brcms_rfkill_set_hw_state() Jules Irenge
  2020-04-11  0:19   ` [PATCH 5/9] mac80211: Add missing annotation for brcms_down() Jules Irenge
  3 siblings, 1 reply; 7+ messages in thread
From: Jules Irenge @ 2020-04-11  0:19 UTC (permalink / raw)
  To: linux-kernel
  Cc: boqun.feng, Jouni Malinen, Kalle Valo, David S. Miller,
	zhong jiang, Andrew Morton, Stephen Rothwell, Alexey Dobriyan,
	open list:HOST AP DRIVER, open list:NETWORKING DRIVERS

Sparse reports warnings at prism2_bss_list_proc_start() and prism2_bss_list_proc_stop()

warning: context imbalance in prism2_wds_proc_stop() - unexpected unlock
warning: context imbalance in prism2_bss_list_proc_start() - wrong count at exit

The root cause is the missing annotations at prism2_bss_list_proc_start()

Add the missing __acquires(&local->lock) annotation
Add the missing __releases(&local->lock) annotation

Signed-off-by: Jules Irenge <jbi.octave@gmail.com>
---
 drivers/net/wireless/intersil/hostap/hostap_proc.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/net/wireless/intersil/hostap/hostap_proc.c b/drivers/net/wireless/intersil/hostap/hostap_proc.c
index a2ee4693eaed..97c270845fd1 100644
--- a/drivers/net/wireless/intersil/hostap/hostap_proc.c
+++ b/drivers/net/wireless/intersil/hostap/hostap_proc.c
@@ -149,6 +149,7 @@ static int prism2_bss_list_proc_show(struct seq_file *m, void *v)
 }
 
 static void *prism2_bss_list_proc_start(struct seq_file *m, loff_t *_pos)
+	__acquires(&local->lock)
 {
 	local_info_t *local = PDE_DATA(file_inode(m->file));
 	spin_lock_bh(&local->lock);
@@ -162,6 +163,7 @@ static void *prism2_bss_list_proc_next(struct seq_file *m, void *v, loff_t *_pos
 }
 
 static void prism2_bss_list_proc_stop(struct seq_file *m, void *v)
+	__releases(&local->lock)
 {
 	local_info_t *local = PDE_DATA(file_inode(m->file));
 	spin_unlock_bh(&local->lock);
-- 
2.24.1


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH 4/9] mac80211: Add missing annotation for brcms_rfkill_set_hw_state()
       [not found] ` <20200411001933.10072-1-jbi.octave@gmail.com>
  2020-04-11  0:19   ` [PATCH 2/9] mt76: remove unnecessary annotations Jules Irenge
  2020-04-11  0:19   ` [PATCH 3/9] hostap: Add missing annotations for prism2_bss_list_proc_start() and prism2_bss_list_proc_stop Jules Irenge
@ 2020-04-11  0:19   ` Jules Irenge
  2020-04-15  8:44     ` [PATCH 4/9] brcmsmac: " Kalle Valo
  2020-04-11  0:19   ` [PATCH 5/9] mac80211: Add missing annotation for brcms_down() Jules Irenge
  3 siblings, 1 reply; 7+ messages in thread
From: Jules Irenge @ 2020-04-11  0:19 UTC (permalink / raw)
  To: linux-kernel
  Cc: boqun.feng, Arend van Spriel, Franky Lin, Hante Meuleman,
	Chi-Hsien Lin, Wright Feng, Kalle Valo, David S. Miller,
	Johannes Berg,
	open list:BROADCOM BRCM80211 IEEE802.11n WIRELESS DRIVER,
	open list:BROADCOM BRCM80211 IEEE802.11n WIRELESS DRIVER,
	open list:BROADCOM BRCM80211 IEEE802.11n WIRELESS DRIVER,
	open list:NETWORKING DRIVERS

Sparse reports a warning at brcms_rfkill_set_hw_state()

warning: context imbalance in brcms_rfkill_set_hw_state()
	- unexpected unlock
The root cause is the missing annotation at brcms_rfkill_set_hw_state()
Add the missing __must_hold(&wl->lock) annotation

Signed-off-by: Jules Irenge <jbi.octave@gmail.com>
---
 drivers/net/wireless/broadcom/brcm80211/brcmsmac/mac80211_if.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmsmac/mac80211_if.c b/drivers/net/wireless/broadcom/brcm80211/brcmsmac/mac80211_if.c
index 8e8b685cfe09..c3dbeacea6ca 100644
--- a/drivers/net/wireless/broadcom/brcm80211/brcmsmac/mac80211_if.c
+++ b/drivers/net/wireless/broadcom/brcm80211/brcmsmac/mac80211_if.c
@@ -1717,6 +1717,7 @@ int brcms_check_firmwares(struct brcms_info *wl)
  * precondition: perimeter lock has been acquired
  */
 bool brcms_rfkill_set_hw_state(struct brcms_info *wl)
+	__must_hold(&wl->lock)
 {
 	bool blocked = brcms_c_check_radio_disabled(wl->wlc);
 
-- 
2.24.1


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH 5/9] mac80211: Add missing annotation for brcms_down()
       [not found] ` <20200411001933.10072-1-jbi.octave@gmail.com>
                     ` (2 preceding siblings ...)
  2020-04-11  0:19   ` [PATCH 4/9] mac80211: Add missing annotation for brcms_rfkill_set_hw_state() Jules Irenge
@ 2020-04-11  0:19   ` Jules Irenge
  2020-04-15  8:45     ` [PATCH 5/9] brcmsmac: " Kalle Valo
  3 siblings, 1 reply; 7+ messages in thread
From: Jules Irenge @ 2020-04-11  0:19 UTC (permalink / raw)
  To: linux-kernel
  Cc: boqun.feng, Arend van Spriel, Franky Lin, Hante Meuleman,
	Chi-Hsien Lin, Wright Feng, Kalle Valo, David S. Miller,
	Johannes Berg,
	open list:BROADCOM BRCM80211 IEEE802.11n WIRELESS DRIVER,
	open list:BROADCOM BRCM80211 IEEE802.11n WIRELESS DRIVER,
	open list:BROADCOM BRCM80211 IEEE802.11n WIRELESS DRIVER,
	open list:NETWORKING DRIVERS

Sparse reports a warning at brcms_down()

warning: context imbalance in brcms_down()
	- unexpected unlock
The root cause is the missing annotation at brcms_down()
Add the missing __must_hold(&wl->lock) annotation

Signed-off-by: Jules Irenge <jbi.octave@gmail.com>
---
 drivers/net/wireless/broadcom/brcm80211/brcmsmac/mac80211_if.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmsmac/mac80211_if.c b/drivers/net/wireless/broadcom/brcm80211/brcmsmac/mac80211_if.c
index c3dbeacea6ca..648efcbc819f 100644
--- a/drivers/net/wireless/broadcom/brcm80211/brcmsmac/mac80211_if.c
+++ b/drivers/net/wireless/broadcom/brcm80211/brcmsmac/mac80211_if.c
@@ -1431,6 +1431,7 @@ int brcms_up(struct brcms_info *wl)
  * precondition: perimeter lock has been acquired
  */
 void brcms_down(struct brcms_info *wl)
+	__must_hold(&wl->lock)
 {
 	uint callbacks, ret_val = 0;
 
-- 
2.24.1


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [PATCH 3/9] hostap: Add missing annotations for prism2_bss_list_proc_start() and prism2_bss_list_proc_stop
  2020-04-11  0:19   ` [PATCH 3/9] hostap: Add missing annotations for prism2_bss_list_proc_start() and prism2_bss_list_proc_stop Jules Irenge
@ 2020-04-15  8:42     ` Kalle Valo
  0 siblings, 0 replies; 7+ messages in thread
From: Kalle Valo @ 2020-04-15  8:42 UTC (permalink / raw)
  To: Jules Irenge
  Cc: linux-kernel, boqun.feng, Jouni Malinen, David S. Miller,
	zhong jiang, Andrew Morton, Stephen Rothwell, Alexey Dobriyan,
	open list:HOST AP DRIVER, open list:NETWORKING DRIVERS

Jules Irenge <jbi.octave@gmail.com> wrote:

> Sparse reports warnings at prism2_bss_list_proc_start() and prism2_bss_list_proc_stop()
> 
> warning: context imbalance in prism2_wds_proc_stop() - unexpected unlock
> warning: context imbalance in prism2_bss_list_proc_start() - wrong count at exit
> 
> The root cause is the missing annotations at prism2_bss_list_proc_start()
> 
> Add the missing __acquires(&local->lock) annotation
> Add the missing __releases(&local->lock) annotation
> 
> Signed-off-by: Jules Irenge <jbi.octave@gmail.com>

Patch applied to wireless-drivers-next.git, thanks.

1c0e3c73e98d hostap: Add missing annotations for prism2_bss_list_proc_start() and prism2_bss_list_proc_stop

-- 
https://patchwork.kernel.org/patch/11483853/

https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH 4/9] brcmsmac: Add missing annotation for brcms_rfkill_set_hw_state()
  2020-04-11  0:19   ` [PATCH 4/9] mac80211: Add missing annotation for brcms_rfkill_set_hw_state() Jules Irenge
@ 2020-04-15  8:44     ` Kalle Valo
  0 siblings, 0 replies; 7+ messages in thread
From: Kalle Valo @ 2020-04-15  8:44 UTC (permalink / raw)
  To: Jules Irenge
  Cc: linux-kernel, boqun.feng, Arend van Spriel, Franky Lin,
	Hante Meuleman, Chi-Hsien Lin, Wright Feng, David S. Miller,
	Johannes Berg,
	open list:BROADCOM BRCM80211 IEEE802.11n WIRELESS DRIVER,
	open list:BROADCOM BRCM80211 IEEE802.11n WIRELESS DRIVER,
	open list:BROADCOM BRCM80211 IEEE802.11n WIRELESS DRIVER,
	open list:NETWORKING DRIVERS

Jules Irenge <jbi.octave@gmail.com> wrote:

> Sparse reports a warning at brcms_rfkill_set_hw_state()
> 
> warning: context imbalance in brcms_rfkill_set_hw_state()
> 	- unexpected unlock
> The root cause is the missing annotation at brcms_rfkill_set_hw_state()
> Add the missing __must_hold(&wl->lock) annotation
> 
> Signed-off-by: Jules Irenge <jbi.octave@gmail.com>

Patch applied to wireless-drivers-next.git, thanks.

2fe5efb8a475 brcmsmac: Add missing annotation for brcms_rfkill_set_hw_state()

-- 
https://patchwork.kernel.org/patch/11483837/

https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH 5/9] brcmsmac: Add missing annotation for brcms_down()
  2020-04-11  0:19   ` [PATCH 5/9] mac80211: Add missing annotation for brcms_down() Jules Irenge
@ 2020-04-15  8:45     ` Kalle Valo
  0 siblings, 0 replies; 7+ messages in thread
From: Kalle Valo @ 2020-04-15  8:45 UTC (permalink / raw)
  To: Jules Irenge
  Cc: linux-kernel, boqun.feng, Arend van Spriel, Franky Lin,
	Hante Meuleman, Chi-Hsien Lin, Wright Feng, David S. Miller,
	Johannes Berg,
	open list:BROADCOM BRCM80211 IEEE802.11n WIRELESS DRIVER,
	open list:BROADCOM BRCM80211 IEEE802.11n WIRELESS DRIVER,
	open list:BROADCOM BRCM80211 IEEE802.11n WIRELESS DRIVER,
	open list:NETWORKING DRIVERS

Jules Irenge <jbi.octave@gmail.com> wrote:

> Sparse reports a warning at brcms_down()
> 
> warning: context imbalance in brcms_down()
> 	- unexpected unlock
> The root cause is the missing annotation at brcms_down()
> Add the missing __must_hold(&wl->lock) annotation
> 
> Signed-off-by: Jules Irenge <jbi.octave@gmail.com>

Patch applied to wireless-drivers-next.git, thanks.

40fb232c02d1 brcmsmac: Add missing annotation for brcms_down()

-- 
https://patchwork.kernel.org/patch/11483851/

https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2020-04-15  8:46 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <0/9>
     [not found] ` <20200411001933.10072-1-jbi.octave@gmail.com>
2020-04-11  0:19   ` [PATCH 2/9] mt76: remove unnecessary annotations Jules Irenge
2020-04-11  0:19   ` [PATCH 3/9] hostap: Add missing annotations for prism2_bss_list_proc_start() and prism2_bss_list_proc_stop Jules Irenge
2020-04-15  8:42     ` Kalle Valo
2020-04-11  0:19   ` [PATCH 4/9] mac80211: Add missing annotation for brcms_rfkill_set_hw_state() Jules Irenge
2020-04-15  8:44     ` [PATCH 4/9] brcmsmac: " Kalle Valo
2020-04-11  0:19   ` [PATCH 5/9] mac80211: Add missing annotation for brcms_down() Jules Irenge
2020-04-15  8:45     ` [PATCH 5/9] brcmsmac: " 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).