Re: [PATCH] pci/sriov: Hold rescan lock while enumerating

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Aug 09, 2018 at 10:33:56AM -0600, Keith Busch wrote:
> --- a/drivers/pci/pci-sysfs.c
> +++ b/drivers/pci/pci-sysfs.c
> @@ -591,6 +591,7 @@ static ssize_t sriov_numvfs_store(struct device *dev,
>  	if (num_vfs > pci_sriov_get_totalvfs(pdev))
>  		return -ERANGE;
>  
> +	pci_lock_rescan_remove();
>  	device_lock(&pdev->dev);

Doesn't this obviate the need to hold the device_lock()?  What could
otherwise run concurrently that doesn't hold pci_lock_rescan_remove()
and would cause a race condition?

Thanks,

Lukas



[Index of Archives]     [DMA Engine]     [Linux Coverity]     [Linux USB]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Greybus]

  Powered by Linux