diff mbox series

ibmvnic: Move debug printk out of spinlock

Message ID 1553702294-20576-1-git-send-email-tlfalcon@linux.ibm.com
State Rejected
Delegated to: David Miller
Headers show
Series ibmvnic: Move debug printk out of spinlock | expand

Commit Message

Thomas Falcon March 27, 2019, 3:58 p.m. UTC
Move this print statement out of the reset queue spinlock
in case it sleeps.

Signed-off-by: Thomas Falcon <tlfalcon@linux.ibm.com>
---
 drivers/net/ethernet/ibm/ibmvnic.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

David Miller March 27, 2019, 9:26 p.m. UTC | #1
From: Thomas Falcon <tlfalcon@linux.ibm.com>
Date: Wed, 27 Mar 2019 10:58:14 -0500

> Move this print statement out of the reset queue spinlock
> in case it sleeps.
> 
> Signed-off-by: Thomas Falcon <tlfalcon@linux.ibm.com>

printk does not sleep and can be used in any context, even with
spinlocks held
diff mbox series

Patch

diff --git a/drivers/net/ethernet/ibm/ibmvnic.c b/drivers/net/ethernet/ibm/ibmvnic.c
index 5ecbb1a..eb979b0 100644
--- a/drivers/net/ethernet/ibm/ibmvnic.c
+++ b/drivers/net/ethernet/ibm/ibmvnic.c
@@ -2045,8 +2045,8 @@  static int ibmvnic_reset(struct ibmvnic_adapter *adapter,
 	list_for_each(entry, &adapter->rwi_list) {
 		tmp = list_entry(entry, struct ibmvnic_rwi, list);
 		if (tmp->reset_reason == reason) {
-			netdev_dbg(netdev, "Skipping matching reset\n");
 			spin_unlock_irqrestore(&adapter->rwi_lock, flags);
+			netdev_dbg(netdev, "Skipping matching reset\n");
 			ret = EBUSY;
 			goto err;
 		}