Thread (20 messages) flat view 20 messages, 4 authors, 2021-01-14

Re: [PATCH net-next v2 5/7] ibmvnic: serialize access to work queue

From: Jakub Kicinski <kuba@kernel.org>
Date: 2021-01-13 01:57:37

On Tue, 12 Jan 2021 16:40:49 -0800 Sukadev Bhattiprolu wrote:
Saeed Mahameed [saeed@kernel.org] wrote:
quoted
On Tue, 2021-01-12 at 10:14 -0800, Sukadev Bhattiprolu wrote:  
<snip>
quoted
quoted
@@ -5467,7 +5472,15 @@ static int ibmvnic_remove(struct vio_dev *dev)
 		return -EBUSY;
 	}
 
+	/* If ibmvnic_reset() is scheduling a reset, wait for it to
+	 * finish. Then prevent it from scheduling any more resets
+	 * and have the reset functions ignore any resets that have
+	 * already been scheduled.
+	 */
+	spin_lock_irqsave(&adapter->remove_lock, flags);
 	adapter->state = VNIC_REMOVING;
+	spin_unlock_irqrestore(&adapter->remove_lock, flags);
+  
Why irqsave/restore variants ? are you expecting this spinlock to be
held in interruptcontext ?
  
quoted
 	spin_unlock_irqrestore(&adapter->state_lock, flags);  
Good question.

One of the callers of ibmvnic_reset() is the ->ndo_tx_timeout()
method which gets called from the watchdog timer.
watchdog is a normal timer, so it's gonna run in softirq, you don't
need to mask irqs.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help