From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:42682 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751248AbeCLSr5 (ORCPT ); Mon, 12 Mar 2018 14:47:57 -0400 Received: from pps.filterd (m0098417.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.22/8.16.0.22) with SMTP id w2CIjaL0010042 for ; Mon, 12 Mar 2018 14:47:56 -0400 Received: from e35.co.us.ibm.com (e35.co.us.ibm.com [32.97.110.153]) by mx0a-001b2d01.pphosted.com with ESMTP id 2gnx392fpy-1 (version=TLSv1.2 cipher=AES256-SHA256 bits=256 verify=NOT) for ; Mon, 12 Mar 2018 14:47:56 -0400 Received: from localhost by e35.co.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Mon, 12 Mar 2018 12:47:55 -0600 To: netdev@vger.kernel.org Cc: Thomas Falcon , Nathan Fontenot From: John Allen Subject: [PATCH net-next] ibmvnic: Bail from ibmvnic_open if driver is already open Date: Mon, 12 Mar 2018 13:47:51 -0500 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Message-Id: Sender: netdev-owner@vger.kernel.org List-ID: 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; + if (adapter->state != VNIC_CLOSED) { rc = ibmvnic_login(netdev); if (rc) {