From patchwork Tue Jul 4 07:55:07 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sagi Grimberg X-Patchwork-Id: 9824251 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 1266860237 for ; Tue, 4 Jul 2017 07:56:01 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 05091265B9 for ; Tue, 4 Jul 2017 07:56:01 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id EE15B28417; Tue, 4 Jul 2017 07:56:00 +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=-5.1 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI, T_DKIM_INVALID, URIBL_BLACK 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 6FC4A265B9 for ; Tue, 4 Jul 2017 07:56:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752222AbdGDHz7 (ORCPT ); Tue, 4 Jul 2017 03:55:59 -0400 Received: from bombadil.infradead.org ([65.50.211.133]:60129 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752180AbdGDHz6 (ORCPT ); Tue, 4 Jul 2017 03:55:58 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20170209; h=References:In-Reply-To:Message-Id: Date:Subject:Cc:To:From:Sender:Reply-To:MIME-Version:Content-Type: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=OnussmePOK6fwYyVGq9BTAdneOhoArqsOGgdm7+8ijs=; b=RH4mJqdshtn2vRrHu0vJlaEQA LfGjdOEGP3SJbDERSO0WbNSi8uPgW92VLaZe10gVlIZEnEjFh2DH2jHqD1SKdEjAuaUWwYtivEfdX 5cRafc7nPH7rRewnxjuVx9gUsDXMSRYS2vBg2LedSvEhp+//2iYUZno7b74Mmqje7EOWqexDOkZJi PCw6dhv4q3J8ihMsoh03QB5yYtlSwGFXTJJLdSEDjycXl4tcGmCyoV1lw+QJJFXOIxHMqIJZFG2Z8 Y7HGCuw46WM8FOlJ/9WlvP8q9S7aEjEl0q5nk/gpXVtbAHKY+sxRq2tfwrv4VQZWafwF9NVzdR7D4 EGugITJIg==; Received: from bzq-82-81-101-184.red.bezeqint.net ([82.81.101.184] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtpsa (Exim 4.87 #1 (Red Hat Linux)) id 1dSIgd-0001E3-1I; Tue, 04 Jul 2017 07:55:56 +0000 From: Sagi Grimberg To: Jens Axboe , linux-block@vger.kernel.org, linux-nvme@lists.infradead.org Cc: Christoph Hellwig , Keith Busch Subject: [PATCH 3/8] nvme-loop: quiesce admin_q instead of stopping hw queues Date: Tue, 4 Jul 2017 10:55:07 +0300 Message-Id: <1499154912-10420-4-git-send-email-sagi@grimberg.me> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1499154912-10420-1-git-send-email-sagi@grimberg.me> References: <1499154912-10420-1-git-send-email-sagi@grimberg.me> 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 Before we iterate over the tags, we need to make sure that no inflight requests are being queued, so use quiesce helper for that. Signed-off-by: Sagi Grimberg --- drivers/nvme/target/loop.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/nvme/target/loop.c b/drivers/nvme/target/loop.c index 3d51341e62ee..891002ee005f 100644 --- a/drivers/nvme/target/loop.c +++ b/drivers/nvme/target/loop.c @@ -434,7 +434,7 @@ static void nvme_loop_shutdown_ctrl(struct nvme_loop_ctrl *ctrl) if (ctrl->ctrl.state == NVME_CTRL_LIVE) nvme_shutdown_ctrl(&ctrl->ctrl); - blk_mq_stop_hw_queues(ctrl->ctrl.admin_q); + blk_mq_quiesce_queue(ctrl->ctrl.admin_q); blk_mq_tagset_busy_iter(&ctrl->admin_tag_set, nvme_cancel_request, &ctrl->ctrl); nvme_loop_destroy_admin_queue(ctrl);