linux-nvme / libnvme

C Library for NVM Express on Linux

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

nvme list fw rev does not get updated after firmware update

tkenbo opened this issue · comments

commented
[root@host ~]# nvme version
nvme version 2.5 (git 2.5)
libnvme version 1.5 (git 1.5-9-g1b042eb)
[root@host ~]# nvme list
Node                  Generic               SN                   Model                                    Namespace  Usage                      Format           FW Rev
--------------------- --------------------- -------------------- ---------------------------------------- ---------- -------------------------- ---------------- --------
/dev/nvme2n1          /dev/ng2n1            8WA00008             XP0000000000                            0x1          6.40  TB /   6.40  TB    512   B +  0 B   AAAAA470
[root@host ~]# nvme fw-download /dev/nvme2 -f AAAAA480.bin
Firmware download success
[root@host ~]# nvme fw-commit /dev/nvme2 -s 2 -a 1
Success committing firmware action:1 slot:2
[root@host ~]# nvme reset /dev/nvme2
[root@host ~]# nvme list
Node                  Generic               SN                   Model                                    Namespace  Usage                      Format           FW Rev
--------------------- --------------------- -------------------- ---------------------------------------- ---------- -------------------------- ---------------- --------
/dev/nvme2n1          /dev/ng2n1            8WA00008             XP00000000000                            0x1          6.40  TB /   6.40  TB    512   B +  0 B   AAAAA470
[root@host ~]# nvme id-ctrl /dev/nvme2 | grep fr
fr        : AAAAA480
[root@host ~]# cat /sys/class/nvme/nvme2/firmware_rev
AAAAA470

This used work as expected with v1.x as scan_ctrl function called identify controller command.
ret = nvme_identify_ctrl(fd, &c->id);

However in v2.x, it has changed to populate it from sysfs information.
c->firmware = nvme_get_ctrl_attr(c, "firmware_rev");

As shown above, firmware_rev attribute in sysfs does not seem changing after firmware update and not sure if this is how is it expected, incorrect driver behavior or nvmecli issue.
It'd be much appreciated if anyone could advise.