From patchwork Thu Jun 15 04:50:09 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Falcon X-Patchwork-Id: 776106 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 3wpB030bCrz9s5L for ; Thu, 15 Jun 2017 14:50:43 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752008AbdFOEul (ORCPT ); Thu, 15 Jun 2017 00:50:41 -0400 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:42068 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751976AbdFOEuk (ORCPT ); Thu, 15 Jun 2017 00:50:40 -0400 Received: from pps.filterd (m0098409.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.20/8.16.0.20) with SMTP id v5F4mfOd031234 for ; Thu, 15 Jun 2017 00:50:39 -0400 Received: from e14.ny.us.ibm.com (e14.ny.us.ibm.com [129.33.205.204]) by mx0a-001b2d01.pphosted.com with ESMTP id 2b3k3ds1dp-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for ; Thu, 15 Jun 2017 00:50:39 -0400 Received: from localhost by e14.ny.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Thu, 15 Jun 2017 00:50:38 -0400 Received: from b01cxnp22034.gho.pok.ibm.com (9.57.198.24) by e14.ny.us.ibm.com (146.89.104.201) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Thu, 15 Jun 2017 00:50:36 -0400 Received: from b01ledav006.gho.pok.ibm.com (b01ledav006.gho.pok.ibm.com [9.57.199.111]) by b01cxnp22034.gho.pok.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id v5F4oZTO41484444; Thu, 15 Jun 2017 04:50:35 GMT Received: from b01ledav006.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id D150AAC03F; Thu, 15 Jun 2017 00:50:33 -0400 (EDT) Received: from tlfalcon-workstation.austin.ibm.com (unknown [9.41.92.147]) by b01ledav006.gho.pok.ibm.com (Postfix) with ESMTP id 672D7AC03A; Thu, 15 Jun 2017 00:50:33 -0400 (EDT) From: Thomas Falcon To: netdev@vger.kernel.org Cc: nfont@linux.vnet.ibm.com, jallen@linux.vnet.ibm.com, davem@davemloft.net, Thomas Falcon Subject: [PATCH 5/5 net-next v2] ibmvnic: Exit polling routine correctly during adapter reset Date: Wed, 14 Jun 2017 23:50:09 -0500 X-Mailer: git-send-email 2.7.4 In-Reply-To: <1497502209-16248-1-git-send-email-tlfalcon@linux.vnet.ibm.com> References: <1497502209-16248-1-git-send-email-tlfalcon@linux.vnet.ibm.com> X-TM-AS-GCONF: 00 x-cbid: 17061504-0052-0000-0000-0000022364E8 X-IBM-SpamModules-Scores: X-IBM-SpamModules-Versions: BY=3.00007234; HX=3.00000241; KW=3.00000007; PH=3.00000004; SC=3.00000212; SDB=6.00874969; UDB=6.00435591; IPR=6.00655057; BA=6.00005421; NDR=6.00000001; ZLA=6.00000005; ZF=6.00000009; ZB=6.00000000; ZP=6.00000000; ZH=6.00000000; ZU=6.00000002; MB=3.00015831; XFM=3.00000015; UTC=2017-06-15 04:50:37 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 17061504-0053-0000-0000-000050F7F845 Message-Id: <1497502209-16248-6-git-send-email-tlfalcon@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:, , definitions=2017-06-15_02:, , signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 suspectscore=1 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1703280000 definitions=main-1706150082 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org This patch fixes a bug where, in the case of a device reset, the polling routine will never complete, causing napi_disable to sleep indefinitely when attempting to close the device. Signed-off-by: Thomas Falcon --- drivers/net/ethernet/ibm/ibmvnic.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/drivers/net/ethernet/ibm/ibmvnic.c b/drivers/net/ethernet/ibm/ibmvnic.c index 5378b21..ba4c79d 100644 --- a/drivers/net/ethernet/ibm/ibmvnic.c +++ b/drivers/net/ethernet/ibm/ibmvnic.c @@ -1504,9 +1504,6 @@ static int ibmvnic_poll(struct napi_struct *napi, int budget) int scrq_num = (int)(napi - adapter->napi); int frames_processed = 0; - if (adapter->resetting) - return 0; - restart_poll: while (frames_processed < budget) { struct sk_buff *skb; @@ -1516,6 +1513,12 @@ static int ibmvnic_poll(struct napi_struct *napi, int budget) u16 offset; u8 flags = 0; + if (unlikely(adapter->resetting)) { + enable_scrq_irq(adapter, adapter->rx_scrq[scrq_num]); + napi_complete_done(napi, frames_processed); + return frames_processed; + } + if (!pending_scrq(adapter, adapter->rx_scrq[scrq_num])) break; next = ibmvnic_next_scrq(adapter, adapter->rx_scrq[scrq_num]);