From: Shan Hai Date: Tue, 17 Oct 2017 09:50:03 +0000 (+0800) Subject: nvme: report the scsi TUR state correctly X-Git-Tag: v4.1.12-117.0_27200813_3~167 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=5ea603cbd4a676b1148a7b1a5e4c68e9053d3547;p=users%2Fjedix%2Flinux-maple.git nvme: report the scsi TUR state correctly Orabug: 26993705 The current nvme driver reports the scsi TEST UNIT READY state upside down because of the inconsistency between the condition checking and the return value, fix it by making it consistent. Signed-off-by: Shan Hai Reviewed-by: Martin K. Petersen --- diff --git a/drivers/nvme/host/scsi.c b/drivers/nvme/host/scsi.c index e947e298a737..332f37fad89c 100644 --- a/drivers/nvme/host/scsi.c +++ b/drivers/nvme/host/scsi.c @@ -2315,7 +2315,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);