Commit 983a338b authored by Daniel Wagner's avatar Daniel Wagner Committed by Keith Busch

nvme: update firmware version after commit

The firmware version sysfs entry needs to be updated after a successfully
firmware activation.

nvme-cli stopped issuing an Identify Controller command to list the
current firmware information and relies on sysfs showing the current
firmware version.
Reported-by: default avatarKenji Tomonaga <tkenbo@gmail.com>
Signed-off-by: default avatarDaniel Wagner <dwagner@suse.de>
Tested-by: default avatarKenji Tomonaga <tkenbo@gmail.com>
Reviewed-by: default avatarChristoph Hellwig <hch@lst.de>
Reviewed-by: default avatarNiklas Cassel <niklas.cassel@wdc.com>
[fixed off-by one afi index]
Signed-off-by: default avatarKeith Busch <kbusch@kernel.org>
parent 0e32fdd7
......@@ -4074,8 +4074,21 @@ static void nvme_get_fw_slot_info(struct nvme_ctrl *ctrl)
return;
if (nvme_get_log(ctrl, NVME_NSID_ALL, NVME_LOG_FW_SLOT, 0, NVME_CSI_NVM,
log, sizeof(*log), 0))
log, sizeof(*log), 0)) {
dev_warn(ctrl->device, "Get FW SLOT INFO log error\n");
goto out_free_log;
}
if (log->afi & 0x70 || !(log->afi & 0x7)) {
dev_info(ctrl->device,
"Firmware is activated after next Controller Level Reset\n");
goto out_free_log;
}
memcpy(ctrl->subsys->firmware_rev, &log->frs[(log->afi & 0x7) - 1],
sizeof(ctrl->subsys->firmware_rev));
out_free_log:
kfree(log);
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment