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

From: Sukadev Bhattiprolu <[email-masked]>
Date: Tue, 12 Jan 2021 16:40:49 -0800

Saeed Mahameed [[email-masked]] wrote:
> On Tue, 2021-01-12 at 10:14 -0800, Sukadev Bhattiprolu wrote:

<snip>
> > @@ -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 ?
> 
> >  	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