netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH tip/core/rcu 2/7] sfc: Replace spin_is_locked() with lockdep
       [not found] <20181111200421.GA10551@linux.ibm.com>
@ 2018-11-11 20:04 ` Paul E. McKenney
  2018-11-12 13:02   ` Edward Cree
  2018-11-11 20:04 ` [PATCH tip/core/rcu 3/7] smsc: " Paul E. McKenney
  1 sibling, 1 reply; 4+ messages in thread
From: Paul E. McKenney @ 2018-11-11 20:04 UTC (permalink / raw)
  To: linux-kernel
  Cc: mingo, jiangshanlai, dipankar, akpm, mathieu.desnoyers, josh,
	tglx, peterz, rostedt, dhowells, edumazet, fweisbec, oleg, joel,
	Lance Roy, Solarflare linux maintainers, Edward Cree,
	Bert Kenward, David S. Miller, netdev, Paul E . McKenney

From: Lance Roy <ldr709@gmail.com>

lockdep_assert_held() is better suited to checking locking requirements,
since it only checks if the current thread holds the lock regardless of
whether someone else does. This is also a step towards possibly removing
spin_is_locked().

Signed-off-by: Lance Roy <ldr709@gmail.com>
Cc: Solarflare linux maintainers <linux-net-drivers@solarflare.com>
Cc: Edward Cree <ecree@solarflare.com>
Cc: Bert Kenward <bkenward@solarflare.com>
Cc: "David S. Miller" <davem@davemloft.net>
Cc: <netdev@vger.kernel.org>
Signed-off-by: Paul E. McKenney <paulmck@linux.ibm.com>
---
 drivers/net/ethernet/sfc/efx.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/sfc/efx.c b/drivers/net/ethernet/sfc/efx.c
index 98fe7e762e17..3643015a55cf 100644
--- a/drivers/net/ethernet/sfc/efx.c
+++ b/drivers/net/ethernet/sfc/efx.c
@@ -3167,7 +3167,7 @@ struct hlist_head *efx_rps_hash_bucket(struct efx_nic *efx,
 {
 	u32 hash = efx_filter_spec_hash(spec);
 
-	WARN_ON(!spin_is_locked(&efx->rps_hash_lock));
+	lockdep_assert_held(&efx->rps_hash_lock);
 	if (!efx->rps_hash_table)
 		return NULL;
 	return &efx->rps_hash_table[hash % EFX_ARFS_HASH_TABLE_SIZE];
-- 
2.17.1

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

* [PATCH tip/core/rcu 3/7] smsc: Replace spin_is_locked() with lockdep
       [not found] <20181111200421.GA10551@linux.ibm.com>
  2018-11-11 20:04 ` [PATCH tip/core/rcu 2/7] sfc: Replace spin_is_locked() with lockdep Paul E. McKenney
@ 2018-11-11 20:04 ` Paul E. McKenney
  1 sibling, 0 replies; 4+ messages in thread
From: Paul E. McKenney @ 2018-11-11 20:04 UTC (permalink / raw)
  To: linux-kernel
  Cc: mingo, jiangshanlai, dipankar, akpm, mathieu.desnoyers, josh,
	tglx, peterz, rostedt, dhowells, edumazet, fweisbec, oleg, joel,
	Lance Roy, Steve Glendinning, David S. Miller, netdev,
	Paul E . McKenney

From: Lance Roy <ldr709@gmail.com>

lockdep_assert_held() is better suited to checking locking requirements,
since it only checks if the current thread holds the lock regardless of
whether someone else does. This is also a step towards possibly removing
spin_is_locked().

Signed-off-by: Lance Roy <ldr709@gmail.com>
Cc: Steve Glendinning <steve.glendinning@shawell.net>
Cc: "David S. Miller" <davem@davemloft.net>
Cc: <netdev@vger.kernel.org>
Signed-off-by: Paul E. McKenney <paulmck@linux.ibm.com>
---
 drivers/net/ethernet/smsc/smsc911x.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/smsc/smsc911x.h b/drivers/net/ethernet/smsc/smsc911x.h
index 8d75508acd2b..51b2fc1a395f 100644
--- a/drivers/net/ethernet/smsc/smsc911x.h
+++ b/drivers/net/ethernet/smsc/smsc911x.h
@@ -67,7 +67,7 @@
 
 #ifdef CONFIG_DEBUG_SPINLOCK
 #define SMSC_ASSERT_MAC_LOCK(pdata) \
-		WARN_ON_SMP(!spin_is_locked(&pdata->mac_lock))
+		lockdep_assert_held(&pdata->mac_lock)
 #else
 #define SMSC_ASSERT_MAC_LOCK(pdata) do {} while (0)
 #endif				/* CONFIG_DEBUG_SPINLOCK */
-- 
2.17.1

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

* Re: [PATCH tip/core/rcu 2/7] sfc: Replace spin_is_locked() with lockdep
  2018-11-11 20:04 ` [PATCH tip/core/rcu 2/7] sfc: Replace spin_is_locked() with lockdep Paul E. McKenney
@ 2018-11-12 13:02   ` Edward Cree
  2018-11-12 17:07     ` Paul E. McKenney
  0 siblings, 1 reply; 4+ messages in thread
From: Edward Cree @ 2018-11-12 13:02 UTC (permalink / raw)
  To: Paul E. McKenney, linux-kernel
  Cc: mingo, jiangshanlai, dipankar, akpm, mathieu.desnoyers, josh,
	tglx, peterz, rostedt, dhowells, edumazet, fweisbec, oleg, joel,
	Lance Roy, Solarflare linux maintainers, Bert Kenward,
	David S. Miller, netdev

On 11/11/18 20:04, Paul E. McKenney wrote:
> From: Lance Roy <ldr709@gmail.com>
>
> lockdep_assert_held() is better suited to checking locking requirements,
> since it only checks if the current thread holds the lock regardless of
> whether someone else does. This is also a step towards possibly removing
> spin_is_locked().
>
> Signed-off-by: Lance Roy <ldr709@gmail.com>
> Cc: Solarflare linux maintainers <linux-net-drivers@solarflare.com>
> Cc: Edward Cree <ecree@solarflare.com>
> Cc: Bert Kenward <bkenward@solarflare.com>
> Cc: "David S. Miller" <davem@davemloft.net>
> Cc: <netdev@vger.kernel.org>
> Signed-off-by: Paul E. McKenney <paulmck@linux.ibm.com>
> ---
Acked-by: Edward Cree <ecree@solarflare.com>
>  drivers/net/ethernet/sfc/efx.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/net/ethernet/sfc/efx.c b/drivers/net/ethernet/sfc/efx.c
> index 98fe7e762e17..3643015a55cf 100644
> --- a/drivers/net/ethernet/sfc/efx.c
> +++ b/drivers/net/ethernet/sfc/efx.c
> @@ -3167,7 +3167,7 @@ struct hlist_head *efx_rps_hash_bucket(struct efx_nic *efx,
>  {
>  	u32 hash = efx_filter_spec_hash(spec);
>  
> -	WARN_ON(!spin_is_locked(&efx->rps_hash_lock));
> +	lockdep_assert_held(&efx->rps_hash_lock);
>  	if (!efx->rps_hash_table)
>  		return NULL;
>  	return &efx->rps_hash_table[hash % EFX_ARFS_HASH_TABLE_SIZE];

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

* Re: [PATCH tip/core/rcu 2/7] sfc: Replace spin_is_locked() with lockdep
  2018-11-12 13:02   ` Edward Cree
@ 2018-11-12 17:07     ` Paul E. McKenney
  0 siblings, 0 replies; 4+ messages in thread
From: Paul E. McKenney @ 2018-11-12 17:07 UTC (permalink / raw)
  To: Edward Cree
  Cc: linux-kernel, mingo, jiangshanlai, dipankar, akpm,
	mathieu.desnoyers, josh, tglx, peterz, rostedt, dhowells,
	edumazet, fweisbec, oleg, joel, Lance Roy,
	Solarflare linux maintainers, Bert Kenward, David S. Miller,
	netdev

On Mon, Nov 12, 2018 at 01:02:32PM +0000, Edward Cree wrote:
> On 11/11/18 20:04, Paul E. McKenney wrote:
> > From: Lance Roy <ldr709@gmail.com>
> >
> > lockdep_assert_held() is better suited to checking locking requirements,
> > since it only checks if the current thread holds the lock regardless of
> > whether someone else does. This is also a step towards possibly removing
> > spin_is_locked().
> >
> > Signed-off-by: Lance Roy <ldr709@gmail.com>
> > Cc: Solarflare linux maintainers <linux-net-drivers@solarflare.com>
> > Cc: Edward Cree <ecree@solarflare.com>
> > Cc: Bert Kenward <bkenward@solarflare.com>
> > Cc: "David S. Miller" <davem@davemloft.net>
> > Cc: <netdev@vger.kernel.org>
> > Signed-off-by: Paul E. McKenney <paulmck@linux.ibm.com>
> > ---
> Acked-by: Edward Cree <ecree@solarflare.com>

Applied, thank you!

							Thanx, Paul

> >  drivers/net/ethernet/sfc/efx.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/drivers/net/ethernet/sfc/efx.c b/drivers/net/ethernet/sfc/efx.c
> > index 98fe7e762e17..3643015a55cf 100644
> > --- a/drivers/net/ethernet/sfc/efx.c
> > +++ b/drivers/net/ethernet/sfc/efx.c
> > @@ -3167,7 +3167,7 @@ struct hlist_head *efx_rps_hash_bucket(struct efx_nic *efx,
> >  {
> >  	u32 hash = efx_filter_spec_hash(spec);
> >  
> > -	WARN_ON(!spin_is_locked(&efx->rps_hash_lock));
> > +	lockdep_assert_held(&efx->rps_hash_lock);
> >  	if (!efx->rps_hash_table)
> >  		return NULL;
> >  	return &efx->rps_hash_table[hash % EFX_ARFS_HASH_TABLE_SIZE];
> 
> 

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

end of thread, other threads:[~2018-11-13  3:02 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <20181111200421.GA10551@linux.ibm.com>
2018-11-11 20:04 ` [PATCH tip/core/rcu 2/7] sfc: Replace spin_is_locked() with lockdep Paul E. McKenney
2018-11-12 13:02   ` Edward Cree
2018-11-12 17:07     ` Paul E. McKenney
2018-11-11 20:04 ` [PATCH tip/core/rcu 3/7] smsc: " Paul E. McKenney

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).