netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ibmvnic: remove excessive irqsave
@ 2021-03-05  1:43 angkery
  2021-03-05  4:19 ` Sukadev Bhattiprolu
  2021-03-05  5:49 ` Christophe Leroy
  0 siblings, 2 replies; 5+ messages in thread
From: angkery @ 2021-03-05  1:43 UTC (permalink / raw)
  To: mpe, benh, paulus, drt, ljp, sukadev, davem, kuba
  Cc: linuxppc-dev, netdev, linux-kernel, Junlin Yang

From: Junlin Yang <yangjunlin@yulong.com>

ibmvnic_remove locks multiple spinlocks while disabling interrupts:
spin_lock_irqsave(&adapter->state_lock, flags);
spin_lock_irqsave(&adapter->rwi_lock, flags);

there is no need for the second irqsave,since interrupts are disabled
at that point, so remove the second irqsave:
spin_lock_irqsave(&adapter->state_lock, flags);
spin_lock(&adapter->rwi_lock);

Generated by: ./scripts/coccinelle/locks/flags.cocci
./drivers/net/ethernet/ibm/ibmvnic.c:5413:1-18:
ERROR: nested lock+irqsave that reuses flags from line 5404.

Signed-off-by: Junlin Yang <yangjunlin@yulong.com>
---
 drivers/net/ethernet/ibm/ibmvnic.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/ethernet/ibm/ibmvnic.c b/drivers/net/ethernet/ibm/ibmvnic.c
index 2464c8a..a52668d 100644
--- a/drivers/net/ethernet/ibm/ibmvnic.c
+++ b/drivers/net/ethernet/ibm/ibmvnic.c
@@ -5408,9 +5408,9 @@ static void ibmvnic_remove(struct vio_dev *dev)
 	 * after setting state, so __ibmvnic_reset() which is called
 	 * from the flush_work() below, can make progress.
 	 */
-	spin_lock_irqsave(&adapter->rwi_lock, flags);
+	spin_lock(&adapter->rwi_lock);
 	adapter->state = VNIC_REMOVING;
-	spin_unlock_irqrestore(&adapter->rwi_lock, flags);
+	spin_unlock(&adapter->rwi_lock);
 
 	spin_unlock_irqrestore(&adapter->state_lock, flags);
 
-- 
1.9.1



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

end of thread, other threads:[~2021-03-05  7:07 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-03-05  1:43 [PATCH] ibmvnic: remove excessive irqsave angkery
2021-03-05  4:19 ` Sukadev Bhattiprolu
2021-03-05  5:49 ` Christophe Leroy
2021-03-05  6:04   ` Lijun Pan
2021-03-05  7:03   ` angkery

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