QEMU-Devel Archive mirror
 help / color / mirror / Atom feed
From: Vincent Fu <vincentfu@gmail.com>
To: qemu-devel@nongnu.org, its@irrelevant.dk, k.jensen@samsung.com
Cc: vincentfu@gmail.com, Vincent Fu <vincent.fu@samsung.com>
Subject: [PATCH] hw/nvme: fix number of PIDs for FDP RUH update
Date: Fri,  3 May 2024 13:50:04 -0400	[thread overview]
Message-ID: <20240503175004.1573-1-vincent.fu@samsung.com> (raw)

The number of PIDs is in the upper 16 bits of cdw10. So we need to
right-shift by 16 bits instead of only a single bit.

Signed-off-by: Vincent Fu <vincent.fu@samsung.com>
---
 hw/nvme/ctrl.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/hw/nvme/ctrl.c b/hw/nvme/ctrl.c
index 127c3d2383..e89f9f7808 100644
--- a/hw/nvme/ctrl.c
+++ b/hw/nvme/ctrl.c
@@ -4352,7 +4352,7 @@ static uint16_t nvme_io_mgmt_send_ruh_update(NvmeCtrl *n, NvmeRequest *req)
     NvmeNamespace *ns = req->ns;
     uint32_t cdw10 = le32_to_cpu(cmd->cdw10);
     uint16_t ret = NVME_SUCCESS;
-    uint32_t npid = (cdw10 >> 1) + 1;
+    uint32_t npid = (cdw10 >> 16) + 1;
     unsigned int i = 0;
     g_autofree uint16_t *pids = NULL;
     uint32_t maxnpid;
-- 
2.43.0



             reply	other threads:[~2024-05-03 21:13 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-05-03 17:50 Vincent Fu [this message]
2024-05-06  7:12 ` [PATCH] hw/nvme: fix number of PIDs for FDP RUH update Klaus Jensen

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=20240503175004.1573-1-vincent.fu@samsung.com \
    --to=vincentfu@gmail.com \
    --cc=its@irrelevant.dk \
    --cc=k.jensen@samsung.com \
    --cc=qemu-devel@nongnu.org \
    --cc=vincent.fu@samsung.com \
    /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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).