From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:44844 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S932365AbeCLTHB (ORCPT ); Mon, 12 Mar 2018 15:07:01 -0400 Received: from pps.filterd (m0098421.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.22/8.16.0.22) with SMTP id w2CJ5rs5147012 for ; Mon, 12 Mar 2018 15:07:01 -0400 Received: from e33.co.us.ibm.com (e33.co.us.ibm.com [32.97.110.151]) by mx0a-001b2d01.pphosted.com with ESMTP id 2gnxgv24q6-1 (version=TLSv1.2 cipher=AES256-SHA256 bits=256 verify=NOT) for ; Mon, 12 Mar 2018 15:07:00 -0400 Received: from localhost by e33.co.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Mon, 12 Mar 2018 13:06:59 -0600 Subject: Re: [PATCH net-next] ibmvnic: Bail from ibmvnic_open if driver is already open To: Andrew Lunn Cc: netdev@vger.kernel.org, Thomas Falcon , Nathan Fontenot References: <20180312190148.GT27783@lunn.ch> From: John Allen Date: Mon, 12 Mar 2018 14:06:56 -0500 MIME-Version: 1.0 In-Reply-To: <20180312190148.GT27783@lunn.ch> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Message-Id: <3f644cb5-887b-1b29-3d5e-e58967f9f6fe@linux.vnet.ibm.com> Sender: netdev-owner@vger.kernel.org List-ID: On 03/12/2018 02:01 PM, Andrew Lunn wrote: > On Mon, Mar 12, 2018 at 01:47:51PM -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 >> --- >> diff --git a/drivers/net/ethernet/ibm/ibmvnic.c b/drivers/net/ethernet/ibm/ibmvnic.c >> index 7be4b06..98c4f75 100644 >> --- a/drivers/net/ethernet/ibm/ibmvnic.c >> +++ b/drivers/net/ethernet/ibm/ibmvnic.c >> @@ -1057,6 +1057,9 @@ static int ibmvnic_open(struct net_device *netdev) >> >> mutex_lock(&adapter->reset_lock); >> >> + if (adapter->state == VNIC_OPEN) >> + return 0; >> + > > I've not looked at the actual code, but what about the lock it just > took and does not unlock before returning? Ah yes, I missed that. I will update and send a new version. > > Andrew >