From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from vps0.lunn.ch ([185.16.172.187]:55721 "EHLO vps0.lunn.ch" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932196AbeCLTdw (ORCPT ); Mon, 12 Mar 2018 15:33:52 -0400 Date: Mon, 12 Mar 2018 20:33:51 +0100 From: Andrew Lunn To: John Allen Cc: netdev@vger.kernel.org, Thomas Falcon , Nathan Fontenot Subject: Re: [PATCH net-next v2] ibmvnic: Bail from ibmvnic_open if driver is already open Message-ID: <20180312193351.GA31588@lunn.ch> References: <36666f4d-6207-ab97-e7f6-4d7d0c6a1155@linux.vnet.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <36666f4d-6207-ab97-e7f6-4d7d0c6a1155@linux.vnet.ibm.com> Sender: netdev-owner@vger.kernel.org List-ID: On Mon, Mar 12, 2018 at 02:19:52PM -0500, John Allen wrote: > If the driver is already in the "open" state, don't attempt the procedure > for opening the driver. > > Signed-off-by: John Allen > --- > v2: Unlock reset_lock mutex before returning. > > diff --git a/drivers/net/ethernet/ibm/ibmvnic.c b/drivers/net/ethernet/ibm/ibmvnic.c > index 7be4b06..9a5e8ac 100644 > --- a/drivers/net/ethernet/ibm/ibmvnic.c > +++ b/drivers/net/ethernet/ibm/ibmvnic.c > @@ -1057,6 +1057,11 @@ static int ibmvnic_open(struct net_device *netdev) > > mutex_lock(&adapter->reset_lock); > > + if (adapter->state == VNIC_OPEN) { > + mutex_unlock(&adapter->reset_lock); > + return 0; > + } Hi John This looks better. But how did you get ibmvnic_open() to be called twice? Is the actual issue that __ibmvnic_close() does not kill off the adapter->ibmvnic_reset workqueue, so that a reset can happen after close() has been called? Andrew