* [PATCH] nvme: avoid deleting uncreated queues
@ 2026-05-24 15:47 Prashant Kamble
2026-05-26 7:02 ` Neil Armstrong
2026-06-03 16:22 ` Neil Armstrong
0 siblings, 2 replies; 3+ messages in thread
From: Prashant Kamble @ 2026-05-24 15:47 UTC (permalink / raw)
Cc: prashant.kamble223, Neil Armstrong, Bin Meng, Tom Rini,
Andrew Goodbody, u-boot
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;
}
--
2.43.0
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] nvme: avoid deleting uncreated queues
2026-05-24 15:47 [PATCH] nvme: avoid deleting uncreated queues Prashant Kamble
@ 2026-05-26 7:02 ` Neil Armstrong
2026-06-03 16:22 ` Neil Armstrong
1 sibling, 0 replies; 3+ messages in thread
From: Neil Armstrong @ 2026-05-26 7:02 UTC (permalink / raw)
To: Prashant Kamble; +Cc: Bin Meng, Tom Rini, Andrew Goodbody, u-boot
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
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] nvme: avoid deleting uncreated queues
2026-05-24 15:47 [PATCH] nvme: avoid deleting uncreated queues Prashant Kamble
2026-05-26 7:02 ` Neil Armstrong
@ 2026-06-03 16:22 ` Neil Armstrong
1 sibling, 0 replies; 3+ messages in thread
From: Neil Armstrong @ 2026-06-03 16:22 UTC (permalink / raw)
To: Prashant Kamble; +Cc: Bin Meng, Tom Rini, Andrew Goodbody, u-boot
Hi,
On Sun, 24 May 2026 21:17:14 +0530, 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.
>
> [...]
Thanks, Applied to https://source.denx.de/u-boot/custodians/u-boot-ufs (u-boot-nvme-fixes)
[1/1] nvme: avoid deleting uncreated queues
https://source.denx.de/u-boot/custodians/u-boot-ufs/-/commit/61280341e926aee1787d9aedb358a43fad96e787
--
Neil
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2026-06-03 16:22 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-05-24 15:47 [PATCH] nvme: avoid deleting uncreated queues Prashant Kamble
2026-05-26 7:02 ` Neil Armstrong
2026-06-03 16:22 ` Neil Armstrong
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox