Skip to contentSkip to conversation

nvme-pci: flush initial scan_work for async probe

PATCH Applied Keith Busch 3 participants 3 messages Jan 24, 2023 NVMe

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 nvme-pci: flush initial scan_work for async probe

From: Keith Busch <[email protected]>

The nvme device may have a namespace with the root partition, so make sure we've completed scanning before returning from the async probe.

Fixes eac3ef262941 ("nvme-pci: split the initial probe from the rest path")
---
 drivers/nvme/host/pci.c | 1 +
 1 file changed, 1 insertion(+)
drivers/nvme/host/pci.c +1 -0
index b294b41a149a7..ff97426749976 100644
@@ -3046,6 +3046,7 @@ static int nvme_probe(struct pci_dev *pdev, const struct pci_device_id *id)
 
 	nvme_start_ctrl(&dev->ctrl);
 	nvme_put_ctrl(&dev->ctrl);
+	flush_work(&dev->ctrl.scan_work);
 	return 0;
 
 out_disable:
Signature · 1 line
2.30.2
Tested-by on v1 1/1
#1 lore raw
Quoted 28 lines · Keith Busch

From: Keith Busch <[email protected]>

The nvme device may have a namespace with the root partition, so make sure we've completed scanning before returning from the async probe.

Fixes eac3ef262941 ("nvme-pci: split the initial probe from the rest path")
---
 drivers/nvme/host/pci.c | 1 +
 1 file changed, 1 insertion(+)
drivers/nvme/host/pci.c +1 -0
index b294b41a149a7..ff97426749976 100644
@@ -3046,6 +3046,7 @@ static int nvme_probe(struct pci_dev *pdev, const struct pci_device_id *id)
 
 	nvme_start_ctrl(&dev->ctrl);
 	nvme_put_ctrl(&dev->ctrl);
+	flush_work(&dev->ctrl.scan_work);
 	return 0;
 
 out_disable:
Signature · 1 line
2.30.2

Thanks Keith,