From patchwork Wed Jul 5 17:00:37 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sagi Grimberg X-Patchwork-Id: 9826839 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 F115360317 for ; Wed, 5 Jul 2017 17:01:00 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E1F16283DA for ; Wed, 5 Jul 2017 17:01:00 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D69672856F; Wed, 5 Jul 2017 17:01: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 66E6E28574 for ; Wed, 5 Jul 2017 17:01:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751992AbdGERA7 (ORCPT ); Wed, 5 Jul 2017 13:00:59 -0400 Received: from merlin.infradead.org ([205.233.59.134]:33818 "EHLO merlin.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751703AbdGERA7 (ORCPT ); Wed, 5 Jul 2017 13:00:59 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=merlin.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=+QCGdmyOBlZJJ3/g79a5YRjQAUfrqpmFgmFnWFsRVYc=; b=ZT3vbBEGQ92cpShPdap6/v7DU 6P1TDglWn8T3nXBV7XkiXdBuh6RSlbuJJXk9aEqKgVI1BLEj7mmPERPmHyhZjfzPsqNhAv+K/0Exq tqIHc5gOhdbdCDGrJ2eE/q0XH0yveXiTZ4PD0/x+l46QXRrxB5pybHPlexaYj8I6lRKVbt1/NB+mH Zl900e1HGYyGUdtjmagP1I1Ne6x5Tg2Kmk7f9dg+ja/NQ3D1BjYPvgbpmYtUvy+S8mIOx2m5QltT0 U9CiKm/g2dRtr47es1/SV+7B2DlU2sjmtYlCuiVrMssal5DSfllry20oDgAiHsDWHEThr/pA2Yh8F QJg3OVNVA==; Received: from bzq-82-81-101-184.red.bezeqint.net ([82.81.101.184] helo=bombadil.infradead.org) by merlin.infradead.org with esmtpsa (Exim 4.87 #1 (Red Hat Linux)) id 1dSnfb-000171-RF; Wed, 05 Jul 2017 17:00:56 +0000 From: Sagi Grimberg To: Jens Axboe , linux-block@vger.kernel.org Cc: linux-nvme@lists.infradead.org, Christoph Hellwig , Keith Busch , James Smart , Ming Lei , virtio-dev@lists.oasis-open.org, Jason Wang Subject: [PATCH v3 8/8] virtio_blk: quiesce/unquiesce live IO when entering PM states Date: Wed, 5 Jul 2017 20:00:37 +0300 Message-Id: <1499274037-17438-9-git-send-email-sagi@grimberg.me> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1499274037-17438-1-git-send-email-sagi@grimberg.me> References: <1499274037-17438-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 Without it its not guaranteed that no .queue_rq is inflight. Reviewed-by: Ming Lei Acked-by: Michael S. Tsirkin Cc: virtio-dev@lists.oasis-open.org Cc: Jason Wang Signed-off-by: Sagi Grimberg --- drivers/block/virtio_blk.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/block/virtio_blk.c b/drivers/block/virtio_blk.c index 0297ad7c1452..4e02aa5fdac0 100644 --- a/drivers/block/virtio_blk.c +++ b/drivers/block/virtio_blk.c @@ -840,7 +840,7 @@ static int virtblk_freeze(struct virtio_device *vdev) /* Make sure no work handler is accessing the device. */ flush_work(&vblk->config_work); - blk_mq_stop_hw_queues(vblk->disk->queue); + blk_mq_quiesce_queue(vblk->disk->queue); vdev->config->del_vqs(vdev); return 0; @@ -857,7 +857,7 @@ static int virtblk_restore(struct virtio_device *vdev) virtio_device_ready(vdev); - blk_mq_start_stopped_hw_queues(vblk->disk->queue, true); + blk_mq_unquiesce_queue(vblk->disk->queue); return 0; } #endif