Received: by 2002:ac0:a594:0:0:0:0:0 with SMTP id m20-v6csp2011171imm; Thu, 24 May 2018 04:29:30 -0700 (PDT) X-Google-Smtp-Source: AB8JxZodyUBrcbCoJipsJx4CebG11Ckcq4qeufhYSIm3wE3oLrziDXMTUofLNBS737Hppzs0WSru X-Received: by 2002:a65:4d8a:: with SMTP id p10-v6mr5557170pgq.21.1527161369994; Thu, 24 May 2018 04:29:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527161369; cv=none; d=google.com; s=arc-20160816; b=sYSf8vZjWVyB9N/4/YlLxBgkJlFrFoKwh4sWxpTA1birjhNMI+8Oe/X7iOfAEcqYxp 3YRUEpUKf1RRkZrPbrOtTuA02XQsG0pjiLHDvBLhYw0pI0+Tyi/rjZEfzl51n4qTeVlc ks+KISTTm6sPZ4ox5mSkAcz8YUIa4B6AEbAgFfhHCb8S/+sj/bJwe4x1NUCwvsFZJCAS tgj+SERhTADlhdA85pNhST+XXpzFiWZJU6pdPzMVUGa7h30qrkqQXLYZlYGP3HBMEGRI 64CaEWL2Yc+k29ccLfdaADAkMMuXc5DNhEiYTWR9m8VJvKgXHW462W0hv7FVU96ubmMI Sw5A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:arc-authentication-results; bh=7Q3qZ202FsjMs9uZgOLhO4fsqW0DKehcQr3S/NhNNkI=; b=pgCSDjsywKZlhlP8/Q+BkNu81F9we2Ha+NInZhrfLLF5g3toM5MIZZrA9ovD6RCSKA PYIOhQV7833IM/uoY7t2z0SQvtv2HNoPZJxFgjAPfY56dCWcJThVceOwy+960RuBXZRF lsOj60QWO3JSSH82xKXttXXM2Z8i5Dx0NaBrT5SF1XqH6vo9296r7jNCstVHr4axCx6S r2O8lpVR4Cvy3jV0lEIaorVGBJpqr8mW+HKRbfYE6lTIaUvdBC7d5yaKpGrtRaFJcYZm iQc50i0KELyxND9Aj5ZsnVZzeGgkq82GfH/qgdbF5fQrG+eH9FVQBQ8P1KZXpksrQ63X ux0g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2017-10-26 header.b=PioF0Hqs; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=oracle.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id n4-v6si20996265pfk.277.2018.05.24.04.29.15; Thu, 24 May 2018 04:29:29 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2017-10-26 header.b=PioF0Hqs; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=oracle.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S967699AbeEXJv0 (ORCPT + 99 others); Thu, 24 May 2018 05:51:26 -0400 Received: from userp2120.oracle.com ([156.151.31.85]:48766 "EHLO userp2120.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S966279AbeEXJvM (ORCPT ); Thu, 24 May 2018 05:51:12 -0400 Received: from pps.filterd (userp2120.oracle.com [127.0.0.1]) by userp2120.oracle.com (8.16.0.22/8.16.0.22) with SMTP id w4O9oSE6029985; Thu, 24 May 2018 09:50:42 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : in-reply-to : references; s=corp-2017-10-26; bh=7Q3qZ202FsjMs9uZgOLhO4fsqW0DKehcQr3S/NhNNkI=; b=PioF0HqslfMn0y3g6eZE1YwTArAHSKObQX93XlVDTkFYchrp4LVTeGFEbOiuRNln78kP LQGL4HAEauc15xzL6OzorSlKz6PN7u4Kg2mO5rdIAkmfKEPGy6ICJmb1fv/SfQKCMmqM GjSpDLeMaDHFjDq3wFxKMolWBtk+B3Xf4IcNDJZMRtFeZidbXMTU4JEERJYQqHlBaQE7 /km85KuGIXx+urAVy5Eb/6M9cpXvYJKnsGcnWLi98mojxmf5PijQFZ8jk/BRWOec9OGV qg6lfqTI037OJlh93g4objt02iwUsNtEHhfXfCzlnELPzYDyB8MviseyAleB+f5QgMPc Ew== Received: from userv0021.oracle.com (userv0021.oracle.com [156.151.31.71]) by userp2120.oracle.com with ESMTP id 2j4nh7qknw-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 24 May 2018 09:50:42 +0000 Received: from userv0121.oracle.com (userv0121.oracle.com [156.151.31.72]) by userv0021.oracle.com (8.14.4/8.14.4) with ESMTP id w4O9ogfg017979 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 24 May 2018 09:50:42 GMT Received: from abhmp0005.oracle.com (abhmp0005.oracle.com [141.146.116.11]) by userv0121.oracle.com (8.14.4/8.13.8) with ESMTP id w4O9ofeF008338; Thu, 24 May 2018 09:50:41 GMT Received: from will-ThinkCentre-M910s.cn.oracle.com (/10.182.70.254) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Thu, 24 May 2018 02:50:41 -0700 From: Jianchao Wang To: keith.busch@intel.com, axboe@fb.com, hch@lst.de, sagi@grimberg.me Cc: linux-nvme@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH 2/2] nvme-pci: don't send delete cq command when allocate sq return -EINTR Date: Thu, 24 May 2018 17:51:34 +0800 Message-Id: <1527155494-1891-2-git-send-email-jianchao.w.wang@oracle.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1527155494-1891-1-git-send-email-jianchao.w.wang@oracle.com> References: <1527155494-1891-1-git-send-email-jianchao.w.wang@oracle.com> X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=8902 signatures=668700 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1711220000 definitions=main-1805240119 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org When allocate sq in nvme_create_queue return -EINTR, it means the allocate sq command times out and is completed with NVME_REQ_CANCELLED. At the moment, the controller has been disabled and admin request queue has been quiesced. Don't send delete cq command, otherwise, it will incur io hang. Signed-off-by: Jianchao Wang --- drivers/nvme/host/pci.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/drivers/nvme/host/pci.c b/drivers/nvme/host/pci.c index 70b79f2..4ce1c89 100644 --- a/drivers/nvme/host/pci.c +++ b/drivers/nvme/host/pci.c @@ -1478,7 +1478,15 @@ static int nvme_create_queue(struct nvme_queue *nvmeq, int qid) goto out; result = adapter_alloc_sq(dev, qid, nvmeq); - if (result < 0) + /* + * If return -EINTR, it means the allocate sq command times out and is completed + * with NVME_REQ_CANCELLED. At the time, the controller has been disabled + * and admin request queue has been quiesced. So don't try to send delete cq + * command any more. + */ + if (result == -EINTR) + goto out; + else if (result < 0) goto release_cq; /* -- 2.7.4