[PATCH 1/8] nvme: use Independent ID-NS only for unknown cmd sets
Max Gurtovoy
mgurtovoy at nvidia.com
Mon Jan 22 06:56:52 PST 2024
According to the specification, the Admin Identify command is not
part of the Admin commands permitted to return a status code of "Admin
Command Media Not Ready" for "Controller Ready Independent of Media"
feature (represented by NVME_CAP_CRMS_CRIMS capability). Therefore, use
the legacy ID-NS also if this capability is supported by the controller.
Keep using the Independent ID-NS limited mechanism only for unknown
command sets.
Reviewed-by: Israel Rukshin <israelr at nvidia.com>
Signed-off-by: Max Gurtovoy <mgurtovoy at nvidia.com>
---
drivers/nvme/host/core.c | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/drivers/nvme/host/core.c b/drivers/nvme/host/core.c
index 1a17616fbae0..ff18c263c62c 100644
--- a/drivers/nvme/host/core.c
+++ b/drivers/nvme/host/core.c
@@ -3808,12 +3808,12 @@ static void nvme_scan_ns(struct nvme_ctrl *ctrl, unsigned nsid)
}
/*
- * If available try to use the Command Set Idependent Identify Namespace
- * data structure to find all the generic information that is needed to
- * set up a namespace. If not fall back to the legacy version.
+ * Try to use the Command Set Idependent Identify Namespace data
+ * structure to find all the generic information that is needed to set
+ * up a namespace only for unknown command sets. Otherwise, fall back
+ * to the legacy version.
*/
- if ((ctrl->cap & NVME_CAP_CRMS_CRIMS) ||
- (info.ids.csi != NVME_CSI_NVM && info.ids.csi != NVME_CSI_ZNS))
+ if (info.ids.csi != NVME_CSI_NVM && info.ids.csi != NVME_CSI_ZNS)
ret = nvme_ns_info_from_id_cs_indep(ctrl, &info);
else
ret = nvme_ns_info_from_identify(ctrl, &info);
--
2.18.1
More information about the Linux-nvme
mailing list