From mboxrd@z Thu Jan 1 00:00:00 1970 From: John Allen Subject: [PATCH net] ibmvnic: Disable irqs before exiting reset from closed state Date: Fri, 30 Mar 2018 13:44:21 -0500 Message-ID: <4511c12c-0a2a-8d46-531d-2bdc1293ca00@linux.vnet.ibm.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Cc: Thomas Falcon , Nathan Fontenot To: netdev@vger.kernel.org Return-path: Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:36408 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752069AbeC3So1 (ORCPT ); Fri, 30 Mar 2018 14:44:27 -0400 Received: from pps.filterd (m0098414.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.22/8.16.0.22) with SMTP id w2UIcpdi007420 for ; Fri, 30 Mar 2018 14:44:26 -0400 Received: from e31.co.us.ibm.com (e31.co.us.ibm.com [32.97.110.149]) by mx0b-001b2d01.pphosted.com with ESMTP id 2h1t1hhk8j-1 (version=TLSv1.2 cipher=AES256-SHA256 bits=256 verify=NOT) for ; Fri, 30 Mar 2018 14:44:26 -0400 Received: from localhost by e31.co.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Fri, 30 Mar 2018 12:44:25 -0600 Content-Language: en-US Sender: netdev-owner@vger.kernel.org List-ID: When the driver is closed, all the associated irqs are disabled. In the event that the driver exits a reset in the closed state, we should be consistent with the state we are in directly after a close. So before we exit the reset routine, all irqs should be disabled as well. This will prevent the irqs from being enabled twice in this case and reporting a number of noisy warning traces. Signed-off-by: John Allen --- diff --git a/drivers/net/ethernet/ibm/ibmvnic.c b/drivers/net/ethernet/ibm/ibmvnic.c index 0389a7a..b492af6 100644 --- a/drivers/net/ethernet/ibm/ibmvnic.c +++ b/drivers/net/ethernet/ibm/ibmvnic.c @@ -1167,19 +1167,11 @@ static void clean_tx_pools(struct ibmvnic_adapter *adapter) } } -static void ibmvnic_cleanup(struct net_device *netdev) +static void ibmvnic_disable_irqs(struct ibmvnic_adapter *adapter) { - struct ibmvnic_adapter *adapter = netdev_priv(netdev); + struct net_device *netdev = adapter->netdev; int i; - /* ensure that transmissions are stopped if called by do_reset */ - if (adapter->resetting) - netif_tx_disable(netdev); - else - netif_tx_stop_all_queues(netdev); - - ibmvnic_napi_disable(adapter); - if (adapter->tx_scrq) { for (i = 0; i < adapter->req_tx_queues; i++) if (adapter->tx_scrq[i]->irq) { @@ -1198,6 +1190,21 @@ static void ibmvnic_cleanup(struct net_device *netdev) } } } +} + +static void ibmvnic_cleanup(struct net_device *netdev) +{ + struct ibmvnic_adapter *adapter = netdev_priv(netdev); + + /* ensure that transmissions are stopped if called by do_reset */ + if (adapter->resetting) + netif_tx_disable(netdev); + else + netif_tx_stop_all_queues(netdev); + + ibmvnic_napi_disable(adapter); + ibmvnic_disable_irqs(adapter); + clean_rx_pools(adapter); clean_tx_pools(adapter); } @@ -1772,6 +1779,7 @@ static int do_reset(struct ibmvnic_adapter *adapter, } } + ibmvnic_disable_irqs(adapter); adapter->state = VNIC_CLOSED; if (reset_state == VNIC_CLOSED)