Received: by 2002:ac0:bc90:0:0:0:0:0 with SMTP id a16csp324531img; Wed, 20 Mar 2019 01:12:40 -0700 (PDT) X-Google-Smtp-Source: APXvYqymxiU3hY3ik+/VKLPdJGhUfl/Ci+rj+OFtrCUemE3bOpLjbgUo1htJZJFSF7DYz5wXaIFF X-Received: by 2002:a17:902:7896:: with SMTP id q22mr6708289pll.66.1553069559915; Wed, 20 Mar 2019 01:12:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1553069559; cv=none; d=google.com; s=arc-20160816; b=IvKpyKhOP8u+8z8CuyRIz2751vOI87uXEAsYb/MCbST4sQegxOk4Bg+YIZg7loB3jC EvJZkibQ4LIxKEKRmZJnwfusFnwZkV9ro232Ys/5koonJnreZrNtPdMMMYok5tco9GVn 9bdJNUDWLbiFJgrnfrIN8cCQd2dV8kfqc3KuVf2hr0HRTgHfh5kYLINWZKKoYgx31oWs qlyD4omA6DFVgEh2Dc+lseVbWriyGpeeBLoiCFKt2Ys08a0DINmZa283xKhpiOT9K/zB ArrZHG5aWdzJmCyaEA/Nstb+5s0Rhcv1igQEl72qaGJJLnwqh9V/2jQ5JxyeqVrVr0v/ oymw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=evumvZfyWLjWlbYKSwX7aFDdUmZi+TCyMscs7G6P0Fw=; b=fk+UpgVKqLm1+mFtEvVWhqRzZKYS88V1lEt1mFwPDR5NcCRtSSLqmcCnp+b3WQW0Jr 18I07opLQ5D6yVWpLmvWgo3SzFUUPVK6UFlXW548/F840dhfh0FJcWLa6S1wkPGMdlBO 7rNSA3MKDq0irL9Qi51h8Lhqf5sbk4bsDDu3G83lQzYWAMgCbIh+Z8D1jb48EV7lMRHV e/iBUrz3rRBu+MaXeSeon9mMZ6gxMGcpbY77sVzpe5s1PVpJxIGpam++jmMsGduAzdKv F8DipiNzbXIGTx8h1xVICYCYhjiZAx25oJXwonsItLcGxGes+uFScZK9vblNWmwNRLsP IlXA== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 33si1303403ply.361.2019.03.20.01.12.24; Wed, 20 Mar 2019 01:12:39 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727782AbfCTILZ (ORCPT + 99 others); Wed, 20 Mar 2019 04:11:25 -0400 Received: from mx1.redhat.com ([209.132.183.28]:48818 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727304AbfCTILY (ORCPT ); Wed, 20 Mar 2019 04:11:24 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 907D489C3A; Wed, 20 Mar 2019 08:11:24 +0000 (UTC) Received: from ming.t460p (ovpn-8-16.pek2.redhat.com [10.72.8.16]) by smtp.corp.redhat.com (Postfix) with ESMTPS id EC9E65D9C4; Wed, 20 Mar 2019 08:11:17 +0000 (UTC) Date: Wed, 20 Mar 2019 16:11:12 +0800 From: Ming Lei To: zhengbin Cc: axboe@kernel.dk, hch@lst.de, linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, houtao1@huawei.com, yanaijie@huawei.com, yuyufen@huawei.com Subject: Re: [PATCH] blk-mq: fix a hung issue when set device state to blocked and restore running Message-ID: <20190320081110.GA8408@ming.t460p> References: <1553068921-6605-1-git-send-email-zhengbin13@huawei.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1553068921-6605-1-git-send-email-zhengbin13@huawei.com> User-Agent: Mutt/1.9.1 (2017-09-22) X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.27]); Wed, 20 Mar 2019 08:11:24 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Mar 20, 2019 at 04:02:01PM +0800, zhengbin wrote: > When I use dd test a SCSI device which use blk-mq in the following steps: > 1.echo "blocked" >/sys/block/sda/device/state > 2.dd if=/dev/sda of=/mnt/t.log bs=1M count=10 > 3.echo "running" >/sys/block/sda/device/state > dd should finish this work after step 3, unfortunately, still hung. > > After step2, the key code process is like this: > blk_mq_dispatch_rq_list-->scsi_queue_rq-->prep_to_mq > -->if ret is BLK_STS_RESOURCE, delay run hw queue > > prep_to_mq will return BLK_STS_RESOURCE, and scsi_queue_rq will transter > it to BLK_STS_DEV_RESOURCE. In this situtation, we should delay run hw BLK_STS_DEV_RESOURCE means that the driver will rerun hw queue, so maybe you need to investigate why it is returned from scsi driver first. BTW, I'd suggest you read the big comment on BLK_STS_DEV_RESOURCE first. Thanks, Ming