[PATCH] nvme-pci: flush initial scan_work for async probe

Klaus Jensen its at irrelevant.dk
Tue Jan 24 09:47:57 PST 2023


On Jan 24 09:17, Keith Busch wrote:
> From: Keith Busch <kbusch at kernel.org>
> 
> 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")
> Reported-by: Klaus Jensen <its at irrelevant.dk>
> Tested-by: Ville Syrjälä <ville.syrjala at linux.intel.com>
> Signed-off-by: Keith Busch <kbusch at kernel.org>
> ---
>  drivers/nvme/host/pci.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/nvme/host/pci.c b/drivers/nvme/host/pci.c
> index b294b41a149a7..ff97426749976 100644
> --- a/drivers/nvme/host/pci.c
> +++ b/drivers/nvme/host/pci.c
> @@ -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:
> -- 
> 2.30.2
> 

Thanks Keith,

Tested-by: Klaus Jensen <k.jensen at samsung.com>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 488 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-nvme/attachments/20230124/a20ea7e7/attachment.sig>


More information about the Linux-nvme mailing list