Skip to content

Commit 14005c9

Browse files
ehristevChristoph Hellwig
authored andcommitted
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 e917a84 ("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: e917a84 ("nvme-pci: refresh visible attrs for cmb attributes") Fixes: 86adbf0 ("nvme: simplify transport specific device attribute handling") Signed-off-by: Eugen Hristev <[email protected]> Signed-off-by: André Almeida <[email protected]> Signed-off-by: Christoph Hellwig <[email protected]>
1 parent 190f4c2 commit 14005c9

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

drivers/nvme/host/pci.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2101,8 +2101,6 @@ static void nvme_map_cmb(struct nvme_dev *dev)
21012101
if ((dev->cmbsz & (NVME_CMBSZ_WDS | NVME_CMBSZ_RDS)) ==
21022102
(NVME_CMBSZ_WDS | NVME_CMBSZ_RDS))
21032103
pci_p2pmem_publish(pdev, true);
2104-
2105-
nvme_update_attrs(dev);
21062104
}
21072105

21082106
static int nvme_set_host_mem(struct nvme_dev *dev, u32 bits)
@@ -3010,6 +3008,8 @@ static void nvme_reset_work(struct work_struct *work)
30103008
if (result < 0)
30113009
goto out;
30123010

3011+
nvme_update_attrs(dev);
3012+
30133013
result = nvme_setup_io_queues(dev);
30143014
if (result)
30153015
goto out;
@@ -3343,6 +3343,8 @@ static int nvme_probe(struct pci_dev *pdev, const struct pci_device_id *id)
33433343
if (result < 0)
33443344
goto out_disable;
33453345

3346+
nvme_update_attrs(dev);
3347+
33463348
result = nvme_setup_io_queues(dev);
33473349
if (result)
33483350
goto out_disable;

0 commit comments

Comments
 (0)