Re: [PATCH] pci: iov: use device lock to protect IOV sysfs accesses

2017-06-15 Thread Christoph Hellwig
On Wed, Jun 14, 2017 at 09:47:26PM -0500, Bjorn Helgaas wrote: > > Signed-off-by: Jakub Kicinski > > Applied with Christoph's reviewed-by to pci/virtualization for v4.13, > thanks! Btw, given how you wanted the comments on locking for the reset methods it might be

Re: [PATCH] pci: iov: use device lock to protect IOV sysfs accesses

2017-06-15 Thread Christoph Hellwig
On Wed, Jun 14, 2017 at 09:47:26PM -0500, Bjorn Helgaas wrote: > > Signed-off-by: Jakub Kicinski > > Applied with Christoph's reviewed-by to pci/virtualization for v4.13, > thanks! Btw, given how you wanted the comments on locking for the reset methods it might be worth to comment the locking

Re: [PATCH] pci: iov: use device lock to protect IOV sysfs accesses

2017-06-14 Thread Bjorn Helgaas
On Mon, May 22, 2017 at 03:50:23PM -0700, Jakub Kicinski wrote: > PCI core sets the driver pointer before calling ->probe() and only > clears it after ->remove(). This means driver's ->sriov_configure() > callback will happily race with probe() and remove(), most likely > leading to BUGs, since

Re: [PATCH] pci: iov: use device lock to protect IOV sysfs accesses

2017-06-14 Thread Bjorn Helgaas
On Mon, May 22, 2017 at 03:50:23PM -0700, Jakub Kicinski wrote: > PCI core sets the driver pointer before calling ->probe() and only > clears it after ->remove(). This means driver's ->sriov_configure() > callback will happily race with probe() and remove(), most likely > leading to BUGs, since

Re: [PATCH] pci: iov: use device lock to protect IOV sysfs accesses

2017-06-13 Thread Jakub Kicinski
On Tue, 30 May 2017 16:34:29 -0700, Jakub Kicinski wrote: > On Tue, 30 May 2017 18:07:18 -0500, Bjorn Helgaas wrote: > > On Fri, May 26, 2017 at 04:58:20PM -0700, Jakub Kicinski wrote: > > > On Fri, 26 May 2017 18:47:26 -0500, Bjorn Helgaas wrote: > > > > On Mon, May 22, 2017 at 03:50:23PM

Re: [PATCH] pci: iov: use device lock to protect IOV sysfs accesses

2017-06-13 Thread Jakub Kicinski
On Tue, 30 May 2017 16:34:29 -0700, Jakub Kicinski wrote: > On Tue, 30 May 2017 18:07:18 -0500, Bjorn Helgaas wrote: > > On Fri, May 26, 2017 at 04:58:20PM -0700, Jakub Kicinski wrote: > > > On Fri, 26 May 2017 18:47:26 -0500, Bjorn Helgaas wrote: > > > > On Mon, May 22, 2017 at 03:50:23PM

Re: [PATCH] pci: iov: use device lock to protect IOV sysfs accesses

2017-05-30 Thread Jakub Kicinski
On Tue, 30 May 2017 18:07:18 -0500, Bjorn Helgaas wrote: > On Fri, May 26, 2017 at 04:58:20PM -0700, Jakub Kicinski wrote: > > On Fri, 26 May 2017 18:47:26 -0500, Bjorn Helgaas wrote: > > > On Mon, May 22, 2017 at 03:50:23PM -0700, Jakub Kicinski wrote: > > > > PCI core sets the driver pointer

Re: [PATCH] pci: iov: use device lock to protect IOV sysfs accesses

2017-05-30 Thread Jakub Kicinski
On Tue, 30 May 2017 18:07:18 -0500, Bjorn Helgaas wrote: > On Fri, May 26, 2017 at 04:58:20PM -0700, Jakub Kicinski wrote: > > On Fri, 26 May 2017 18:47:26 -0500, Bjorn Helgaas wrote: > > > On Mon, May 22, 2017 at 03:50:23PM -0700, Jakub Kicinski wrote: > > > > PCI core sets the driver pointer

Re: [PATCH] pci: iov: use device lock to protect IOV sysfs accesses

2017-05-30 Thread Bjorn Helgaas
On Fri, May 26, 2017 at 04:58:20PM -0700, Jakub Kicinski wrote: > On Fri, 26 May 2017 18:47:26 -0500, Bjorn Helgaas wrote: > > On Mon, May 22, 2017 at 03:50:23PM -0700, Jakub Kicinski wrote: > > > PCI core sets the driver pointer before calling ->probe() and only > > > clears it after ->remove().

Re: [PATCH] pci: iov: use device lock to protect IOV sysfs accesses

2017-05-30 Thread Bjorn Helgaas
On Fri, May 26, 2017 at 04:58:20PM -0700, Jakub Kicinski wrote: > On Fri, 26 May 2017 18:47:26 -0500, Bjorn Helgaas wrote: > > On Mon, May 22, 2017 at 03:50:23PM -0700, Jakub Kicinski wrote: > > > PCI core sets the driver pointer before calling ->probe() and only > > > clears it after ->remove().

Re: [PATCH] pci: iov: use device lock to protect IOV sysfs accesses

2017-05-26 Thread Jakub Kicinski
On Fri, 26 May 2017 18:47:26 -0500, Bjorn Helgaas wrote: > On Mon, May 22, 2017 at 03:50:23PM -0700, Jakub Kicinski wrote: > > PCI core sets the driver pointer before calling ->probe() and only > > clears it after ->remove(). This means driver's ->sriov_configure() > > callback will happily race

Re: [PATCH] pci: iov: use device lock to protect IOV sysfs accesses

2017-05-26 Thread Jakub Kicinski
On Fri, 26 May 2017 18:47:26 -0500, Bjorn Helgaas wrote: > On Mon, May 22, 2017 at 03:50:23PM -0700, Jakub Kicinski wrote: > > PCI core sets the driver pointer before calling ->probe() and only > > clears it after ->remove(). This means driver's ->sriov_configure() > > callback will happily race

Re: [PATCH] pci: iov: use device lock to protect IOV sysfs accesses

2017-05-26 Thread Bjorn Helgaas
Hi Jakub, On Mon, May 22, 2017 at 03:50:23PM -0700, Jakub Kicinski wrote: > PCI core sets the driver pointer before calling ->probe() and only > clears it after ->remove(). This means driver's ->sriov_configure() > callback will happily race with probe() and remove(), most likely > leading to

Re: [PATCH] pci: iov: use device lock to protect IOV sysfs accesses

2017-05-26 Thread Bjorn Helgaas
Hi Jakub, On Mon, May 22, 2017 at 03:50:23PM -0700, Jakub Kicinski wrote: > PCI core sets the driver pointer before calling ->probe() and only > clears it after ->remove(). This means driver's ->sriov_configure() > callback will happily race with probe() and remove(), most likely > leading to

Re: [PATCH] pci: iov: use device lock to protect IOV sysfs accesses

2017-05-22 Thread Christoph Hellwig
On Mon, May 22, 2017 at 03:50:23PM -0700, Jakub Kicinski wrote: > PCI core sets the driver pointer before calling ->probe() and only > clears it after ->remove(). This means driver's ->sriov_configure() > callback will happily race with probe() and remove(), most likely > leading to BUGs, since

Re: [PATCH] pci: iov: use device lock to protect IOV sysfs accesses

2017-05-22 Thread Christoph Hellwig
On Mon, May 22, 2017 at 03:50:23PM -0700, Jakub Kicinski wrote: > PCI core sets the driver pointer before calling ->probe() and only > clears it after ->remove(). This means driver's ->sriov_configure() > callback will happily race with probe() and remove(), most likely > leading to BUGs, since

[PATCH] pci: iov: use device lock to protect IOV sysfs accesses

2017-05-22 Thread Jakub Kicinski
PCI core sets the driver pointer before calling ->probe() and only clears it after ->remove(). This means driver's ->sriov_configure() callback will happily race with probe() and remove(), most likely leading to BUGs, since drivers don't expect this. We could reorder pointer assignments, or try

[PATCH] pci: iov: use device lock to protect IOV sysfs accesses

2017-05-22 Thread Jakub Kicinski
PCI core sets the driver pointer before calling ->probe() and only clears it after ->remove(). This means driver's ->sriov_configure() callback will happily race with probe() and remove(), most likely leading to BUGs, since drivers don't expect this. We could reorder pointer assignments, or try