Re: [PATCH v2 2/2] pci/iov: fix kobject_uevent() ordering in sriov_enable()

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

 



On Fri, Feb 09, 2024 at 07:22:17PM -0800, Kuppuswamy Sathyanarayanan wrote:
> On 2/9/24 3:52 PM, Jim Harris wrote:
> > @@ -677,8 +677,8 @@ static int sriov_enable(struct pci_dev *dev, int nr_virtfn)
> >  	if (rc)
> >  		goto err_pcibios;
> >  
> > -	kobject_uevent(&dev->dev.kobj, KOBJ_CHANGE);
> >  	iov->num_VFs = nr_virtfn;
> > +	kobject_uevent(&dev->dev.kobj, KOBJ_CHANGE);

Since it's accessed unlocked now, I *think* this wants appropriate
barriers to ensure the order is observed the same on all CPUs. Something
like 'smp_store_release(&iov->num_VFs, nr_virtfn)' for writing it, and
use 'smp_load_acquire()' on the read-side.




[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