All of lore.kernel.org
 help / color / mirror / Atom feed
From: wenxiong@linux.vnet.ibm.com (wenxiong@linux.vnet.ibm.com)
Subject: [PATCH] nvme: TUR(Test unit Ready) broken for nvme drvices
Date: Mon,  5 Jun 2017 10:39:32 -0500	[thread overview]
Message-ID: <1496677172-22797-1-git-send-email-wenxiong@linux.vnet.ibm.com> (raw)

From: Wen Xiong <wenxiong@linux.vnet.ibm.com>

When doing sg_turs over nvme devices, we got the following errors.
The patch fixes the issue.
dd if=/dev/nvme0n1 of=/dev/null bs=1M count=1
1+0 records in
1+0 records out
1048576 bytes (1.0 MB) copied, 0.000994747 s, 1.1 GB/s

sg_turs /dev/nvme0n1
device not ready

Signed-off-by: Wen Xiong <wenxiong at linux.vnet.ibm.com>
---
 drivers/nvme/host/scsi.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/nvme/host/scsi.c b/drivers/nvme/host/scsi.c
index 1f7671e..af27930 100644
--- a/drivers/nvme/host/scsi.c
+++ b/drivers/nvme/host/scsi.c
@@ -2208,7 +2208,7 @@ static int nvme_trans_test_unit_ready(struct nvme_ns *ns,
 					struct sg_io_hdr *hdr,
 					u8 *cmd)
 {
-	if (nvme_ctrl_ready(ns->ctrl))
+	if (!nvme_ctrl_ready(ns->ctrl))
 		return nvme_trans_completion(hdr, SAM_STAT_CHECK_CONDITION,
 					    NOT_READY, SCSI_ASC_LUN_NOT_READY,
 					    SCSI_ASCQ_CAUSE_NOT_REPORTABLE);
-- 
1.7.1

             reply	other threads:[~2017-06-05 15:39 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-06-05 15:39 wenxiong [this message]
2017-06-05 17:44 ` [PATCH] nvme: TUR(Test unit Ready) broken for nvme drvices Christoph Hellwig
2017-06-12 15:23   ` Keith Busch
2017-06-12 15:17     ` Jens Axboe

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1496677172-22797-1-git-send-email-wenxiong@linux.vnet.ibm.com \
    --to=wenxiong@linux.vnet.ibm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.