All of lore.kernel.org
 help / color / mirror / Atom feed
From: Kanchan Joshi <joshi.k@samsung.com>
To: Christoph Hellwig <hch@lst.de>
Cc: Joel Granados <j.granados@samsung.com>,
	kbusch@kernel.org, sagi@grimberg.me,
	linux-nvme@lists.infradead.org, gost.dev@samsung.com,
	k.jensen@samsung.com
Subject: Re: [PATCH 3/5] nvme: refactor namespace probing
Date: Wed, 13 Jul 2022 15:47:00 +0530	[thread overview]
Message-ID: <20220713101700.GA16726@test-zns> (raw)
In-Reply-To: <20220713054914.1888305-4-hch@lst.de>

[-- Attachment #1: Type: text/plain, Size: 1346 bytes --]

On Wed, Jul 13, 2022 at 07:49:12AM +0200, Christoph Hellwig wrote:

> static void nvme_scan_ns(struct nvme_ctrl *ctrl, unsigned nsid)
> {
>-	struct nvme_ns_ids ids = { };
>-	struct nvme_id_ns_cs_indep *id;
>+	struct nvme_ns_info info = { .nsid = nsid };
> 	struct nvme_ns *ns;
>-	bool ready = true;
>
>-	if (nvme_identify_ns_descs(ctrl, nsid, &ids))
>+	if (nvme_identify_ns_descs(ctrl, &info))
> 		return;
>
>-	if (ids.csi != NVME_CSI_NVM && !nvme_multi_css(ctrl)) {
>+	if (info.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.
>+	 * 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.
> 	 */
>-	if ((ctrl->cap & NVME_CAP_CRMS_CRIMS) &&
>-	    !nvme_identify_ns_cs_indep(ctrl, nsid, &id)) {
>-		ready = id->nstat & NVME_NSTAT_NRDY;
>-		kfree(id);
>+	if (ctrl->cap & NVME_CAP_CRMS_CRIMS) {
>+		if (nvme_ns_info_from_id_cs_indep(ctrl, &info))
>+			return;

Is this return fine if independent id-ns fails? Earlier behavior was to
ingore such failure.


[-- Attachment #2: Type: text/plain, Size: 0 bytes --]



  parent reply	other threads:[~2022-07-13 10:22 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CGME20220713054925eucas1p2f1015324abe9ccf6a665212f41d553c7@eucas1p2.samsung.com>
2022-07-13  5:49 ` enable generic interface (/dev/ngX) for unknown command sets Christoph Hellwig
2022-07-13  5:49   ` [PATCH 1/5] nvme: rename nvme_validate_or_alloc_ns to nvme_scan_ns Christoph Hellwig
2022-07-13  7:29     ` Chaitanya Kulkarni
2022-07-13  9:11     ` Sagi Grimberg
2022-07-13 10:23     ` Kanchan Joshi
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
2022-07-13  5:49   ` [PATCH 3/5] nvme: refactor namespace probing Christoph Hellwig
2022-07-13  9:21     ` Sagi Grimberg
2022-07-13 10:16       ` Christoph Hellwig
2022-07-13 11:29         ` Sagi Grimberg
2022-07-13 10:17     ` Kanchan Joshi [this message]
2022-07-13 11:27       ` Christoph Hellwig
2022-07-13  5:49   ` [PATCH 4/5] nvme: factor out a nvme_ns_is_readonly helper Christoph Hellwig
2022-07-13  7:55     ` Chaitanya Kulkarni
2022-07-13  9:23     ` Sagi Grimberg
2022-07-13 10:26     ` Kanchan Joshi
2022-07-13  5:49   ` [PATCH 5/5] nvme: enable generic interface (/dev/ngXnY) for unknown command sets Christoph Hellwig
2022-07-13  9:25     ` Sagi Grimberg
2022-07-13 10:19       ` Christoph Hellwig
2022-07-13  9:27   ` enable generic interface (/dev/ngX) " Javier González
2022-07-18  5:24 enable generic interface (/dev/ngX) for unknown command sets v2 Christoph Hellwig
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

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=20220713101700.GA16726@test-zns \
    --to=joshi.k@samsung.com \
    --cc=gost.dev@samsung.com \
    --cc=hch@lst.de \
    --cc=j.granados@samsung.com \
    --cc=k.jensen@samsung.com \
    --cc=kbusch@kernel.org \
    --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.