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: Sukadev Bhattiprolu <hidden>
Date: 2021-01-13 00:52:40

Saeed Mahameed [saeed@kernel.org] wrote:
On Tue, 2021-01-12 at 10:14 -0800, Sukadev Bhattiprolu wrote:
<snip>
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.

Thanks for the review.

Sukadev
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help