nvme-pci: refresh visible attrs after being checked
authorEugen Hristev <eugen.hristev@collabora.com>
Fri, 13 Jun 2025 19:21:01 +0000 (16:21 -0300)
committerChristoph Hellwig <hch@lst.de>
Mon, 30 Jun 2025 06:42:47 +0000 (08:42 +0200)
commit14005c96d6649b27fa52d0cd0f492eb3b5586c07
tree4b8ac86cd5f896c19bbcd9722b7b964b661d1f03
parent190f4c2c863af7cc5bb354b70e0805f06419c038
nvme-pci: refresh visible attrs after being checked

The sysfs attributes are registered early, but the driver does not know
whether they are needed or not at that moment.

For the CMB attributes, commit e917a849c3fc ("nvme-pci: refresh visible
attrs for cmb attributes") solved this problem by
calling nvme_update_attrs after mapping the CMB.  However the issue
persists for the HMB attributes. To solve the problem, moved the call to
nvme_update_attrs after nvme_setup_host_mem, which sets up the HMB.

Fixes: e917a849c3fc ("nvme-pci: refresh visible attrs for cmb attributes")
Fixes: 86adbf0cdb9e ("nvme: simplify transport specific device attribute handling")
Signed-off-by: Eugen Hristev <eugen.hristev@collabora.com>
Signed-off-by: André Almeida <andrealmeid@igalia.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
drivers/nvme/host/pci.c