[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20210521144734.90044-1-dwagner@suse.de>
Date: Fri, 21 May 2021 16:47:34 +0200
From: Daniel Wagner <dwagner@...e.de>
To: linux-nvme@...ts.infradead.org
Cc: linux-kernel@...r.kernel.org, Keith Busch <kbusch@...nel.org>,
Jens Axboe <axboe@...com>, Christoph Hellwig <hch@....de>,
Sagi Grimberg <sagi@...mberg.me>,
Daniel Wagner <dwagner@...e.de>
Subject: [PATCH] nvme: Use NN for max_namespaces if MNAN is zero
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@...e.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
Powered by blists - more mailing lists