From: Chaitanya Kulkarni <chaitanya.kulkarni@wdc.com>
Date: Tue, 22 Sep 2020 19:49:38 +0000 (-0700)
Subject: nvme-core: don't use NVME_NSID_ALL for command effects and supported log
X-Git-Tag: baikal/aarch64/sdk6.1~8335^2~1^2
X-Git-Url: https://git.baikalelectronics.ru/sdk/?a=commitdiff_plain;h=9cd90644ca9475303fd671a0f6d2ea883229d19e;p=kernel.git

nvme-core: don't use NVME_NSID_ALL for command effects and supported log

In the function nvme_get_effects_log() it uses NVME_NSID_ALL which has
namespace scope. The command effect log page is controller specific.

Replace NVME_NSID_ALL with 0x00 which specifies the controller scope
instead of namespace scope.

Fixes: 13329f5e2749 ("nvme: check admin passthru command effects")
Link: https://bugzilla.kernel.org/show_bug.cgi?id=209287
Reported-by: Huai-Cheng Kuo <hh81478072@gmail.com>
Signed-off-by: Chaitanya Kulkarni <chaitanya.kulkarni@wdc.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
---

diff --git a/drivers/nvme/host/core.c b/drivers/nvme/host/core.c
index 4cea14c18a6d2..53c93836c7c6f 100644
--- a/drivers/nvme/host/core.c
+++ b/drivers/nvme/host/core.c
@@ -3041,7 +3041,7 @@ static int nvme_get_effects_log(struct nvme_ctrl *ctrl, u8 csi,
 	if (!cel)
 		return -ENOMEM;
 
-	ret = nvme_get_log(ctrl, NVME_NSID_ALL, NVME_LOG_CMD_EFFECTS, 0, csi,
+	ret = nvme_get_log(ctrl, 0x00, NVME_LOG_CMD_EFFECTS, 0, csi,
 			&cel->log, sizeof(cel->log), 0);
 	if (ret) {
 		kfree(cel);