aboutsummaryrefslogtreecommitdiff
path: root/block/nvme.c
diff options
context:
space:
mode:
Diffstat (limited to 'block/nvme.c')
-rw-r--r--block/nvme.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/block/nvme.c b/block/nvme.c
index 80c4318..2b5421e 100644
--- a/block/nvme.c
+++ b/block/nvme.c
@@ -708,6 +708,7 @@ static int nvme_init(BlockDriverState *bs, const char *device, int namespace,
AioContext *aio_context = bdrv_get_aio_context(bs);
int ret;
uint64_t cap;
+ uint32_t ver;
uint64_t timeout_ms;
uint64_t deadline, now;
volatile NvmeBar *regs = NULL;
@@ -764,6 +765,11 @@ static int nvme_init(BlockDriverState *bs, const char *device, int namespace,
bs->bl.request_alignment = s->page_size;
timeout_ms = MIN(500 * NVME_CAP_TO(cap), 30000);
+ ver = le32_to_cpu(regs->vs);
+ trace_nvme_controller_spec_version(extract32(ver, 16, 16),
+ extract32(ver, 8, 8),
+ extract32(ver, 0, 8));
+
/* Reset device to get a clean state. */
regs->cc = cpu_to_le32(le32_to_cpu(regs->cc) & 0xFE);
/* Wait for CSTS.RDY = 0. */