Netdev Archive on lore.kernel.org
 help / color / Atom feed
* [PATCH 20/30] pcnet32: Add missing annotation for pcnet32_suspend()
       [not found] ` <20200214204741.94112-1-jbi.octave@gmail.com>
@ 2020-02-14 20:47   ` Jules Irenge
  2020-02-14 20:47   ` [PATCH 21/30] sfc: Add missing annotation for efx_ef10_try_update_nic_stats_vf() Jules Irenge
                     ` (7 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: Jules Irenge @ 2020-02-14 20:47 UTC (permalink / raw)
  To: linux-kernel; +Cc: boqun.feng, Jules Irenge, Don Fry, David S. Miller, netdev

Sparse reports a warning at pcnet32_suspend()

warning: context imbalance in pcnet32_suspend() - unexpected unlock

The root cause is the missing annotation at pcnet32_suspend()
Add the missing __must_hold(&lp->lock) annotattion

Signed-off-by: Jules Irenge <jbi.octave@gmail.com>
---
 drivers/net/ethernet/amd/pcnet32.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/amd/pcnet32.c b/drivers/net/ethernet/amd/pcnet32.c
index dc7d88227e76..ac6c19441932 100644
--- a/drivers/net/ethernet/amd/pcnet32.c
+++ b/drivers/net/ethernet/amd/pcnet32.c
@@ -684,7 +684,7 @@ static void pcnet32_poll_controller(struct net_device *dev)
  * lp->lock must be held.
  */
 static int pcnet32_suspend(struct net_device *dev, unsigned long *flags,
-			   int can_sleep)
+			   int can_sleep) __must_hold(&lp->lock)
 {
 	int csr5;
 	struct pcnet32_private *lp = netdev_priv(dev);
-- 
2.24.1


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

* [PATCH 21/30] sfc: Add missing annotation for efx_ef10_try_update_nic_stats_vf()
       [not found] ` <20200214204741.94112-1-jbi.octave@gmail.com>
  2020-02-14 20:47   ` [PATCH 20/30] pcnet32: Add missing annotation for pcnet32_suspend() Jules Irenge
@ 2020-02-14 20:47   ` Jules Irenge
  2020-02-17 18:00     ` Martin Habets
  2020-02-14 20:47   ` [PATCH 24/30] tipc: Add missing annotation for tipc_node_read_lock() Jules Irenge
                     ` (6 subsequent siblings)
  8 siblings, 1 reply; 10+ messages in thread
From: Jules Irenge @ 2020-02-14 20:47 UTC (permalink / raw)
  To: linux-kernel
  Cc: boqun.feng, Jules Irenge, Solarflare linux maintainers,
	Edward Cree, Martin Habets, David S. Miller, netdev

Sparse reports a warning at  efx_ef10_try_update_nic_stats_vf()

warning: context imbalance in  efx_ef10_try_update_nic_stats_vf()
	 - unexpected unlock

The root cause is the missing annotation at
efx_ef10_try_update_nic_stats_vf()
Add the missing __must_hold(&efx->stats_lock) annotattion

Signed-off-by: Jules Irenge <jbi.octave@gmail.com>
---
 drivers/net/ethernet/sfc/ef10.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/net/ethernet/sfc/ef10.c b/drivers/net/ethernet/sfc/ef10.c
index 52113b7529d6..b1102c7e814d 100644
--- a/drivers/net/ethernet/sfc/ef10.c
+++ b/drivers/net/ethernet/sfc/ef10.c
@@ -1820,6 +1820,7 @@ static size_t efx_ef10_update_stats_pf(struct efx_nic *efx, u64 *full_stats,
 }
 
 static int efx_ef10_try_update_nic_stats_vf(struct efx_nic *efx)
+	__must_hold(&efx->stats_lock)
 {
 	MCDI_DECLARE_BUF(inbuf, MC_CMD_MAC_STATS_IN_LEN);
 	struct efx_ef10_nic_data *nic_data = efx->nic_data;
-- 
2.24.1


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

* [PATCH 24/30] tipc: Add missing annotation for tipc_node_read_lock()
       [not found] ` <20200214204741.94112-1-jbi.octave@gmail.com>
  2020-02-14 20:47   ` [PATCH 20/30] pcnet32: Add missing annotation for pcnet32_suspend() Jules Irenge
  2020-02-14 20:47   ` [PATCH 21/30] sfc: Add missing annotation for efx_ef10_try_update_nic_stats_vf() Jules Irenge
@ 2020-02-14 20:47   ` Jules Irenge
  2020-02-14 20:47   ` [PATCH 25/30] tipc: Add missing annotation for tipc_node_read_unlock() Jules Irenge
                     ` (5 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: Jules Irenge @ 2020-02-14 20:47 UTC (permalink / raw)
  To: linux-kernel
  Cc: boqun.feng, Jules Irenge, Jon Maloy, Ying Xue, David S. Miller,
	Jakub Kicinski, netdev, tipc-discussion

Sparse reports a warning at tipc_node_read_lock()

warning: context imbalance in  tipc_node_read_lock - wrong count at exit

The root cause is the missing annotation at tipc_node_read_lock()
Add the missing __acquires(&n->lock) annotattion

Signed-off-by: Jules Irenge <jbi.octave@gmail.com>
---
 net/tipc/node.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/tipc/node.c b/net/tipc/node.c
index 99b28b69fc17..4e267ed94a2a 100644
--- a/net/tipc/node.c
+++ b/net/tipc/node.c
@@ -351,7 +351,7 @@ static struct tipc_node *tipc_node_find_by_id(struct net *net, u8 *id)
 	return found ? n : NULL;
 }
 
-static void tipc_node_read_lock(struct tipc_node *n)
+static void tipc_node_read_lock(struct tipc_node *n) __acquires(&n->lock)
 {
 	read_lock_bh(&n->lock);
 }
-- 
2.24.1


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

* [PATCH 25/30] tipc: Add missing annotation for tipc_node_read_unlock()
       [not found] ` <20200214204741.94112-1-jbi.octave@gmail.com>
                     ` (2 preceding siblings ...)
  2020-02-14 20:47   ` [PATCH 24/30] tipc: Add missing annotation for tipc_node_read_lock() Jules Irenge
@ 2020-02-14 20:47   ` Jules Irenge
  2020-02-14 20:47   ` [PATCH 26/30] tipc: Add missing annotation for tipc_node_write_lock() Jules Irenge
                     ` (4 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: Jules Irenge @ 2020-02-14 20:47 UTC (permalink / raw)
  To: linux-kernel
  Cc: boqun.feng, Jules Irenge, Jon Maloy, Ying Xue, David S. Miller,
	Jakub Kicinski, netdev, tipc-discussion

Sparse reports a warning at tipc_node_read_unlock()

warning: context imbalance in  tipc_node_read_unlock - unexpected unlock

The root cause is the missing annotation at tipc_node_read_unlock()
Add the missing __releases(&n->lock) annotation

Signed-off-by: Jules Irenge <jbi.octave@gmail.com>
---
 net/tipc/node.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/tipc/node.c b/net/tipc/node.c
index 4e267ed94a2a..eafa38896e3a 100644
--- a/net/tipc/node.c
+++ b/net/tipc/node.c
@@ -356,7 +356,7 @@ static void tipc_node_read_lock(struct tipc_node *n) __acquires(&n->lock)
 	read_lock_bh(&n->lock);
 }
 
-static void tipc_node_read_unlock(struct tipc_node *n)
+static void tipc_node_read_unlock(struct tipc_node *n) __releases(&n->lock)
 {
 	read_unlock_bh(&n->lock);
 }
-- 
2.24.1


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

* [PATCH 26/30] tipc: Add missing annotation for tipc_node_write_lock()
       [not found] ` <20200214204741.94112-1-jbi.octave@gmail.com>
                     ` (3 preceding siblings ...)
  2020-02-14 20:47   ` [PATCH 25/30] tipc: Add missing annotation for tipc_node_read_unlock() Jules Irenge
@ 2020-02-14 20:47   ` Jules Irenge
  2020-02-14 20:47   ` [PATCH 27/30] tipc: Add missing annotation for tipc_node_write_unlock_fast() Jules Irenge
                     ` (3 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: Jules Irenge @ 2020-02-14 20:47 UTC (permalink / raw)
  To: linux-kernel
  Cc: boqun.feng, Jules Irenge, Jon Maloy, Ying Xue, David S. Miller,
	Jakub Kicinski, netdev, tipc-discussion

Sparse reports a warning at tipc_node_write_lock()

warning: context imbalance in  tipc_node_write_lock - wrong count at exit

The root cause is the missing annotation at tipc_node_write_lock()
Add the missing __acquires(&n->lock) annotation

Signed-off-by: Jules Irenge <jbi.octave@gmail.com>
---
 net/tipc/node.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/tipc/node.c b/net/tipc/node.c
index eafa38896e3a..d8401789fa23 100644
--- a/net/tipc/node.c
+++ b/net/tipc/node.c
@@ -361,7 +361,7 @@ static void tipc_node_read_unlock(struct tipc_node *n) __releases(&n->lock)
 	read_unlock_bh(&n->lock);
 }
 
-static void tipc_node_write_lock(struct tipc_node *n)
+static void tipc_node_write_lock(struct tipc_node *n) __acquires(&n->lock)
 {
 	write_lock_bh(&n->lock);
 }
-- 
2.24.1


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

* [PATCH 27/30] tipc: Add missing annotation for tipc_node_write_unlock_fast()
       [not found] ` <20200214204741.94112-1-jbi.octave@gmail.com>
                     ` (4 preceding siblings ...)
  2020-02-14 20:47   ` [PATCH 26/30] tipc: Add missing annotation for tipc_node_write_lock() Jules Irenge
@ 2020-02-14 20:47   ` Jules Irenge
  2020-02-14 20:47   ` [PATCH 28/30] tipc: Add missing annotation for tipc_node_write_unlock() Jules Irenge
                     ` (2 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: Jules Irenge @ 2020-02-14 20:47 UTC (permalink / raw)
  To: linux-kernel
  Cc: boqun.feng, Jules Irenge, Jon Maloy, Ying Xue, David S. Miller,
	Jakub Kicinski, netdev, tipc-discussion

Sparse reports a warning at tipc_node_write_unlock_fast()

warning: context imbalance in tipc_node_write_unlock_fast
	 - unexpected unlock

The root cause is the missing annotation at tipc_node_write_unlock_fast()
Add the missing __releases(&n->lock) annotation

Signed-off-by: Jules Irenge <jbi.octave@gmail.com>
---
 net/tipc/node.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/net/tipc/node.c b/net/tipc/node.c
index d8401789fa23..cc656b2205db 100644
--- a/net/tipc/node.c
+++ b/net/tipc/node.c
@@ -367,6 +367,7 @@ static void tipc_node_write_lock(struct tipc_node *n) __acquires(&n->lock)
 }
 
 static void tipc_node_write_unlock_fast(struct tipc_node *n)
+	__releases(&n->lock)
 {
 	write_unlock_bh(&n->lock);
 }
-- 
2.24.1


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

* [PATCH 28/30] tipc: Add missing annotation for tipc_node_write_unlock()
       [not found] ` <20200214204741.94112-1-jbi.octave@gmail.com>
                     ` (5 preceding siblings ...)
  2020-02-14 20:47   ` [PATCH 27/30] tipc: Add missing annotation for tipc_node_write_unlock_fast() Jules Irenge
@ 2020-02-14 20:47   ` Jules Irenge
  2020-02-14 20:47   ` [PATCH 29/30] net: Add missing annotation for netlink_walk_start() Jules Irenge
  2020-02-14 20:47   ` [PATCH 30/30] net: Add missing annotation for netlink_walk_stop() Jules Irenge
  8 siblings, 0 replies; 10+ messages in thread
From: Jules Irenge @ 2020-02-14 20:47 UTC (permalink / raw)
  To: linux-kernel
  Cc: boqun.feng, Jules Irenge, Jon Maloy, Ying Xue, David S. Miller,
	Jakub Kicinski, netdev, tipc-discussion

Sparse reports a warning at tipc_node_write_unlock()

warning: context imbalance in tipc_node_write_unlock
	 - unexpected unlock

The root cause is the missing annotation at tipc_node_write_unlock()
Add the missing __releases(&n->lock) annotation

Signed-off-by: Jules Irenge <jbi.octave@gmail.com>
---
 net/tipc/node.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/tipc/node.c b/net/tipc/node.c
index cc656b2205db..c3b810427d24 100644
--- a/net/tipc/node.c
+++ b/net/tipc/node.c
@@ -372,7 +372,7 @@ static void tipc_node_write_unlock_fast(struct tipc_node *n)
 	write_unlock_bh(&n->lock);
 }
 
-static void tipc_node_write_unlock(struct tipc_node *n)
+static void tipc_node_write_unlock(struct tipc_node *n) __releases(&n->lock)
 {
 	struct net *net = n->net;
 	u32 addr = 0;
-- 
2.24.1


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

* [PATCH 29/30] net: Add missing annotation for netlink_walk_start()
       [not found] ` <20200214204741.94112-1-jbi.octave@gmail.com>
                     ` (6 preceding siblings ...)
  2020-02-14 20:47   ` [PATCH 28/30] tipc: Add missing annotation for tipc_node_write_unlock() Jules Irenge
@ 2020-02-14 20:47   ` Jules Irenge
  2020-02-14 20:47   ` [PATCH 30/30] net: Add missing annotation for netlink_walk_stop() Jules Irenge
  8 siblings, 0 replies; 10+ messages in thread
From: Jules Irenge @ 2020-02-14 20:47 UTC (permalink / raw)
  To: linux-kernel
  Cc: boqun.feng, Jules Irenge, David S. Miller, Jakub Kicinski,
	Patrick Talbert, Herbert Xu, Greg Kroah-Hartman, Taehee Yoo,
	Tetsuo Handa, Li RongQing, Thomas Gleixner, netdev

Sparse reports a warning at netlink_walk_start()

warning: context imbalance in netlink_walk_start()
	 - wrong count at exit

The root cause is the missing annotation at netlink_walk_start()
A close look at rhashtable_walk_start_check()
shows that an __acquires(RCU) is needed here.

Add the missing __acquires(RCU) annotation

Signed-off-by: Jules Irenge <jbi.octave@gmail.com>
---
 net/netlink/af_netlink.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/netlink/af_netlink.c b/net/netlink/af_netlink.c
index 4e31721e7293..a3fddc845538 100644
--- a/net/netlink/af_netlink.c
+++ b/net/netlink/af_netlink.c
@@ -2539,7 +2539,7 @@ struct nl_seq_iter {
 	int link;
 };
 
-static void netlink_walk_start(struct nl_seq_iter *iter)
+static void netlink_walk_start(struct nl_seq_iter *iter) __acquires(RCU)
 {
 	rhashtable_walk_enter(&nl_table[iter->link].hash, &iter->hti);
 	rhashtable_walk_start(&iter->hti);
-- 
2.24.1


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

* [PATCH 30/30] net: Add missing annotation for netlink_walk_stop()
       [not found] ` <20200214204741.94112-1-jbi.octave@gmail.com>
                     ` (7 preceding siblings ...)
  2020-02-14 20:47   ` [PATCH 29/30] net: Add missing annotation for netlink_walk_start() Jules Irenge
@ 2020-02-14 20:47   ` Jules Irenge
  8 siblings, 0 replies; 10+ messages in thread
From: Jules Irenge @ 2020-02-14 20:47 UTC (permalink / raw)
  To: linux-kernel
  Cc: boqun.feng, Jules Irenge, David S. Miller, Jakub Kicinski,
	Taehee Yoo, Johannes Berg, Tetsuo Handa, Thomas Gleixner,
	Patrick Talbert, Herbert Xu, Li RongQing, netdev

Sparse reports a warning at netlink_walk_stop()

warning: context imbalance in netlink_walk_stop()
	 - unexpected unlock

The root cause is the missing annotation at netlink_walk_stop()
A close look at rhashtable_walk_stop()
shows that an __releases(RCU) is needed here
Add the missing __releases(RCU) annotation

Signed-off-by: Jules Irenge <jbi.octave@gmail.com>
---
 net/netlink/af_netlink.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/netlink/af_netlink.c b/net/netlink/af_netlink.c
index a3fddc845538..7a287dc73f63 100644
--- a/net/netlink/af_netlink.c
+++ b/net/netlink/af_netlink.c
@@ -2545,7 +2545,7 @@ static void netlink_walk_start(struct nl_seq_iter *iter) __acquires(RCU)
 	rhashtable_walk_start(&iter->hti);
 }
 
-static void netlink_walk_stop(struct nl_seq_iter *iter)
+static void netlink_walk_stop(struct nl_seq_iter *iter) __releases(RCU)
 {
 	rhashtable_walk_stop(&iter->hti);
 	rhashtable_walk_exit(&iter->hti);
-- 
2.24.1


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

* Re: [PATCH 21/30] sfc: Add missing annotation for efx_ef10_try_update_nic_stats_vf()
  2020-02-14 20:47   ` [PATCH 21/30] sfc: Add missing annotation for efx_ef10_try_update_nic_stats_vf() Jules Irenge
@ 2020-02-17 18:00     ` Martin Habets
  0 siblings, 0 replies; 10+ messages in thread
From: Martin Habets @ 2020-02-17 18:00 UTC (permalink / raw)
  To: Jules Irenge, linux-kernel
  Cc: boqun.feng, Solarflare linux maintainers, Edward Cree,
	David S. Miller, open list:SFC NETWORK DRIVER

On 14/02/2020 20:47, Jules Irenge wrote:
> Sparse reports a warning at  efx_ef10_try_update_nic_stats_vf()
> 
> warning: context imbalance in  efx_ef10_try_update_nic_stats_vf()
> 	 - unexpected unlock
> 
> The root cause is the missing annotation at
> efx_ef10_try_update_nic_stats_vf()
> Add the missing __must_hold(&efx->stats_lock) annotattion
> 
> Signed-off-by: Jules Irenge <jbi.octave@gmail.com>

Thanks

Acked-by: Martin Habets <mhabets@solarflare.com>

> ---
>  drivers/net/ethernet/sfc/ef10.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/net/ethernet/sfc/ef10.c b/drivers/net/ethernet/sfc/ef10.c
> index 52113b7529d6..b1102c7e814d 100644
> --- a/drivers/net/ethernet/sfc/ef10.c
> +++ b/drivers/net/ethernet/sfc/ef10.c
> @@ -1820,6 +1820,7 @@ static size_t efx_ef10_update_stats_pf(struct efx_nic *efx, u64 *full_stats,
>  }
>  
>  static int efx_ef10_try_update_nic_stats_vf(struct efx_nic *efx)
> +	__must_hold(&efx->stats_lock)
>  {
>  	MCDI_DECLARE_BUF(inbuf, MC_CMD_MAC_STATS_IN_LEN);
>  	struct efx_ef10_nic_data *nic_data = efx->nic_data;
> 

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

end of thread, back to index

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <0/30>
     [not found] ` <20200214204741.94112-1-jbi.octave@gmail.com>
2020-02-14 20:47   ` [PATCH 20/30] pcnet32: Add missing annotation for pcnet32_suspend() Jules Irenge
2020-02-14 20:47   ` [PATCH 21/30] sfc: Add missing annotation for efx_ef10_try_update_nic_stats_vf() Jules Irenge
2020-02-17 18:00     ` Martin Habets
2020-02-14 20:47   ` [PATCH 24/30] tipc: Add missing annotation for tipc_node_read_lock() Jules Irenge
2020-02-14 20:47   ` [PATCH 25/30] tipc: Add missing annotation for tipc_node_read_unlock() Jules Irenge
2020-02-14 20:47   ` [PATCH 26/30] tipc: Add missing annotation for tipc_node_write_lock() Jules Irenge
2020-02-14 20:47   ` [PATCH 27/30] tipc: Add missing annotation for tipc_node_write_unlock_fast() Jules Irenge
2020-02-14 20:47   ` [PATCH 28/30] tipc: Add missing annotation for tipc_node_write_unlock() Jules Irenge
2020-02-14 20:47   ` [PATCH 29/30] net: Add missing annotation for netlink_walk_start() Jules Irenge
2020-02-14 20:47   ` [PATCH 30/30] net: Add missing annotation for netlink_walk_stop() Jules Irenge

Netdev Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/netdev/0 netdev/git/0.git
	git clone --mirror https://lore.kernel.org/netdev/1 netdev/git/1.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 netdev netdev/ https://lore.kernel.org/netdev \
		netdev@vger.kernel.org
	public-inbox-index netdev

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.netdev


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git