Messages in this thread Patch in this message | | | From | Daniel Wagner <> | Subject | [PATCH] nvme: Use NN for max_namespaces if MNAN is zero | Date | Fri, 21 May 2021 16:47:34 +0200 |
| |
NVMe 1.4 states that MNAN might be zero, in which case we should evaluate NN to get the number of supported namespaces.
Signed-off-by: Daniel Wagner <dwagner@suse.de> --- drivers/nvme/host/core.c | 2 ++ 1 file changed, 2 insertions(+)
diff --git a/drivers/nvme/host/core.c b/drivers/nvme/host/core.c index e7441ccaa8db..32457c77c9ab 100644 --- a/drivers/nvme/host/core.c +++ b/drivers/nvme/host/core.c @@ -2905,6 +2905,8 @@ static int nvme_init_identify(struct nvme_ctrl *ctrl) ctrl->sgls = le32_to_cpu(id->sgls); ctrl->kas = le16_to_cpu(id->kas); ctrl->max_namespaces = le32_to_cpu(id->mnan); + if (!ctrl->max_namespaces) + ctrl->max_namespaces = le32_to_cpu(id->nn); ctrl->ctratt = le32_to_cpu(id->ctratt); if (id->rtd3e) { -- 2.29.2
| |