U-Boot Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Neil Armstrong <neil.armstrong@linaro.org>
To: Prashant Kamble <prashant.kamble223@gmail.com>
Cc: Bin Meng <bmeng.cn@gmail.com>, Tom Rini <trini@konsulko.com>,
	Andrew Goodbody <andrew.goodbody@linaro.org>,
	u-boot@lists.denx.de
Subject: Re: [PATCH] nvme: avoid deleting uncreated queues
Date: Tue, 26 May 2026 09:02:20 +0200	[thread overview]
Message-ID: <fb2a5d48-e137-4ba5-b2f4-93a27b74a90a@linaro.org> (raw)
In-Reply-To: <20260524154718.16381-1-prashant.kamble223@gmail.com>

On 5/24/26 17:47, Prashant Kamble wrote:
> nvme_create_queue() may issue Delete CQ or Delete SQ
> commands even when the corresponding queue creation
> failed.
> 
> Avoid sending delete commands for queues that were never
> successfully created.
> 
> Signed-off-by: Prashant Kamble <prashant.kamble223@gmail.com>
> ---
>   drivers/nvme/nvme.c | 12 +++---------
>   1 file changed, 3 insertions(+), 9 deletions(-)
> 
> diff --git a/drivers/nvme/nvme.c b/drivers/nvme/nvme.c
> index 9df7824b1c5..980ca919632 100644
> --- a/drivers/nvme/nvme.c
> +++ b/drivers/nvme/nvme.c
> @@ -298,11 +298,6 @@ static int nvme_delete_queue(struct nvme_dev *dev, u8 opcode, u16 id)
>   	return nvme_submit_admin_cmd(dev, &c, NULL);
>   }
>   
> -static int nvme_delete_sq(struct nvme_dev *dev, u16 sqid)
> -{
> -	return nvme_delete_queue(dev, nvme_admin_delete_sq, sqid);
> -}
> -
>   static int nvme_delete_cq(struct nvme_dev *dev, u16 cqid)
>   {
>   	return nvme_delete_queue(dev, nvme_admin_delete_cq, cqid);
> @@ -563,20 +558,19 @@ static int nvme_create_queue(struct nvme_queue *nvmeq, int qid)
>   	nvmeq->cq_vector = qid - 1;
>   	result = nvme_alloc_cq(dev, qid, nvmeq);
>   	if (result < 0)
> -		goto release_cq;
> +		goto release_ret;
>   
>   	result = nvme_alloc_sq(dev, qid, nvmeq);
>   	if (result < 0)
> -		goto release_sq;
> +		goto release_cq;
>   
>   	nvme_init_queue(nvmeq, qid);
>   
>   	return result;
>   
> - release_sq:
> -	nvme_delete_sq(dev, qid);
>    release_cq:
>   	nvme_delete_cq(dev, qid);
> + release_ret:
>   
>   	return result;
>   }

Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>

Thanks,
Neil

  reply	other threads:[~2026-05-26  7:02 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-24 15:47 [PATCH] nvme: avoid deleting uncreated queues Prashant Kamble
2026-05-26  7:02 ` Neil Armstrong [this message]
2026-06-03 16:22 ` Neil Armstrong

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=fb2a5d48-e137-4ba5-b2f4-93a27b74a90a@linaro.org \
    --to=neil.armstrong@linaro.org \
    --cc=andrew.goodbody@linaro.org \
    --cc=bmeng.cn@gmail.com \
    --cc=prashant.kamble223@gmail.com \
    --cc=trini@konsulko.com \
    --cc=u-boot@lists.denx.de \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox