All of lore.kernel.org
 help / color / mirror / Atom feed
From: Christoph Hellwig <hch@lst.de>
To: Joel Granados <j.granados@samsung.com>,
	kbusch@kernel.org, sagi@grimberg.me
Cc: joshi.k@samsung.com, linux-nvme@lists.infradead.org,
	gost.dev@samsung.com, k.jensen@samsung.com,
	"Javier González" <javier.gonz@samsung.com>,
	"Chaitanya Kulkarni" <kch@nvidia.com>
Subject: [PATCH 2/5] nvme: generalize the nvme_multi_css check in nvme_scan_ns
Date: Mon, 18 Jul 2022 07:25:00 +0200	[thread overview]
Message-ID: <20220718052503.235270-3-hch@lst.de> (raw)
In-Reply-To: <20220718052503.235270-1-hch@lst.de>

Check for multiple command set support early on an error out if is
not supported when a !NVM command set namespace is found.  This
prepares for adding command set independent passthrough support.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Javier González <javier.gonz@samsung.com>
Reviewed-by: Sagi Grimberg <sagi@grimberg.me>
Reviewed-by: Kanchan Joshi <joshi.k@samsung.com>
Reviewed-by: Chaitanya Kulkarni <kch@nvidia.com>
---
 drivers/nvme/host/core.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/drivers/nvme/host/core.c b/drivers/nvme/host/core.c
index 88b14fbb7a5a8..4769c49141913 100644
--- a/drivers/nvme/host/core.c
+++ b/drivers/nvme/host/core.c
@@ -4293,6 +4293,12 @@ static void nvme_scan_ns(struct nvme_ctrl *ctrl, unsigned nsid)
 	if (nvme_identify_ns_descs(ctrl, nsid, &ids))
 		return;
 
+	if (ids.csi != NVME_CSI_NVM && !nvme_multi_css(ctrl)) {
+		dev_warn(ctrl->device,
+			"command set not reported for nsid: %d\n", nsid);
+		return;
+	}
+
 	/*
 	 * Check if the namespace is ready.  If not ignore it, we will get an
 	 * AEN once it becomes ready and restart the scan.
@@ -4324,12 +4330,6 @@ static void nvme_scan_ns(struct nvme_ctrl *ctrl, unsigned nsid)
 				nsid);
 			break;
 		}
-		if (!nvme_multi_css(ctrl)) {
-			dev_warn(ctrl->device,
-				"command set not reported for nsid: %d\n",
-				nsid);
-			break;
-		}
 		nvme_alloc_ns(ctrl, nsid, &ids);
 		break;
 	default:
-- 
2.30.2



  parent reply	other threads:[~2022-07-18  5:25 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-07-18  5:24 enable generic interface (/dev/ngX) for unknown command sets v2 Christoph Hellwig
2022-07-18  5:24 ` [PATCH 1/5] nvme: rename nvme_validate_or_alloc_ns to nvme_scan_ns Christoph Hellwig
2022-07-19 13:07   ` Joel Granados
2022-07-18  5:25 ` Christoph Hellwig [this message]
2022-07-18  5:25 ` [PATCH 3/5] nvme: refactor namespace probing Christoph Hellwig
2022-07-19  7:08   ` Kanchan Joshi
2022-07-19 13:00     ` Joel Granados
2022-07-19 14:37       ` Christoph Hellwig
2022-07-20  8:11         ` Joel Granados
2022-07-20  8:19   ` Joel Granados
2022-07-20  9:02     ` Christoph Hellwig
2022-07-20 12:15       ` Joel Granados
2022-07-18  5:25 ` [PATCH 4/5] nvme: factor out a nvme_ns_is_readonly helper Christoph Hellwig
2022-07-18  5:25 ` [PATCH 5/5] nvme: enable generic interface (/dev/ngXnY) for unknown command sets Christoph Hellwig
2022-07-21 22:14 ` enable generic interface (/dev/ngX) for unknown command sets v2 Sagi Grimberg
  -- strict thread matches above, loose matches on Subject: below --
2022-07-13  5:49 enable generic interface (/dev/ngX) for unknown command sets Christoph Hellwig
2022-07-13  5:49 ` [PATCH 2/5] nvme: generalize the nvme_multi_css check in nvme_scan_ns Christoph Hellwig
2022-07-13  7:32   ` Chaitanya Kulkarni
2022-07-13  9:12   ` Sagi Grimberg
2022-07-13 10:24   ` Kanchan Joshi

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220718052503.235270-3-hch@lst.de \
    --to=hch@lst.de \
    --cc=gost.dev@samsung.com \
    --cc=j.granados@samsung.com \
    --cc=javier.gonz@samsung.com \
    --cc=joshi.k@samsung.com \
    --cc=k.jensen@samsung.com \
    --cc=kbusch@kernel.org \
    --cc=kch@nvidia.com \
    --cc=linux-nvme@lists.infradead.org \
    --cc=sagi@grimberg.me \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.