From patchwork Wed Oct 17 09:07:12 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "jianchao.wang" X-Patchwork-Id: 10645163 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 6D0A8109C for ; Wed, 17 Oct 2018 09:06:32 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5D4A22ABC4 for ; Wed, 17 Oct 2018 09:06:32 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 5112D2AC40; Wed, 17 Oct 2018 09:06:32 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 04A3B2ABC4 for ; Wed, 17 Oct 2018 09:06:32 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727285AbeJQRBD (ORCPT ); Wed, 17 Oct 2018 13:01:03 -0400 Received: from userp2120.oracle.com ([156.151.31.85]:47446 "EHLO userp2120.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727238AbeJQRBD (ORCPT ); Wed, 17 Oct 2018 13:01:03 -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 w9H8x6kx068776; Wed, 17 Oct 2018 09:05:13 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-2018-07-02; bh=xar3IM2xcUOuRJ8vfJjoYMneHSe65id2InNHRVWwp3A=; b=EQp2+c1Ndp02uPFSrxuN91k54Ptqp7wFL69jMDCtPpAzB+m4W9Cy4tuKINsd/Le+lh/q dqulCAKefZT/puIgxYBWA5WLbBsvsP7h6OUEwtx/f2yXDHIrAuiN+MqUxILgFapAcwOS a3fBT+yKGLiMbwCnIUGsYMQiwJTH1kmNUhejVCSFMVzn17Yol2iVaftllcY/H43XCiyV b2Vigzpq+0NR0fT3Gcxd98MOJA7ozOij4GqZcLfyam2cxO954yina7t5IQE63F4hNtPB 1Yu1cFXf+8QyibkwvSFg2FUgBD8ltenCv//KL7m7JJbLmmVHvFRcPwXaLeSyiDrgF6z2 Cw== Received: from aserv0022.oracle.com (aserv0022.oracle.com [141.146.126.234]) by userp2120.oracle.com with ESMTP id 2n39brdh0r-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 17 Oct 2018 09:05:13 +0000 Received: from userv0122.oracle.com (userv0122.oracle.com [156.151.31.75]) by aserv0022.oracle.com (8.14.4/8.14.4) with ESMTP id w9H956pw009465 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 17 Oct 2018 09:05:07 GMT Received: from abhmp0008.oracle.com (abhmp0008.oracle.com [141.146.116.14]) by userv0122.oracle.com (8.14.4/8.14.4) with ESMTP id w9H955KW026741; Wed, 17 Oct 2018 09:05:06 GMT Received: from will-ThinkCentre-M910s.cn.oracle.com (/10.182.70.254) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Wed, 17 Oct 2018 02:05:05 -0700 From: Jianchao Wang To: axboe@kernel.dk Cc: hch@lst.de, keith.busch@linux.intel.com, ming.lei@redhat.com, linux-block@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH V2 3/3] nvme-pci: unquiesce queues after update hw queues Date: Wed, 17 Oct 2018 17:07:12 +0800 Message-Id: <1539767232-9389-4-git-send-email-jianchao.w.wang@oracle.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1539767232-9389-1-git-send-email-jianchao.w.wang@oracle.com> References: <1539767232-9389-1-git-send-email-jianchao.w.wang@oracle.com> X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=9048 signatures=668706 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=1 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=933 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1807170000 definitions=main-1810170082 Sender: linux-block-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-block@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP updating hw queues uses bio retrieve to drain the queues. unquiescing queues before that is not needed and will cause requests to be issued to dead hw queue. So move unquiescing queues after updating hw queues, as well as the wait freeze. Signed-off-by: Jianchao Wang --- drivers/nvme/host/pci.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/nvme/host/pci.c b/drivers/nvme/host/pci.c index d668682..dbf6904 100644 --- a/drivers/nvme/host/pci.c +++ b/drivers/nvme/host/pci.c @@ -2327,11 +2327,11 @@ static void nvme_reset_work(struct work_struct *work) nvme_remove_namespaces(&dev->ctrl); new_state = NVME_CTRL_ADMIN_ONLY; } else { - nvme_start_queues(&dev->ctrl); - nvme_wait_freeze(&dev->ctrl); /* hit this only when allocate tagset fails */ if (nvme_dev_add(dev)) new_state = NVME_CTRL_ADMIN_ONLY; + nvme_start_queues(&dev->ctrl); + nvme_wait_freeze(&dev->ctrl); nvme_unfreeze(&dev->ctrl); }