Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1647642

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

From Christoph Hellwig <hch@infradead.org>
Newsgroups linux.kernel
Subject Re: [PATCH] pci: iov: use device lock to protect IOV sysfs accesses
Date 2017-05-23 07:30 +0200
Message-ID <tKayl-7e0-5@gated-at.bofh.it> (permalink)
References <tK4sW-3eD-15@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


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 drivers don't expect this.
> 
> We could reorder pointer assignments, or try detecting races in all
> drivers, but it seems simpler and cleaner to just hold the device lock
> instead of special SR-IOV lock, since that lock is already supposed
> to synchronize the driver callbacks.
> 
> Remove the iov lock completely, since we remove the last user.

Having just debugged a different method vs ->remove race I violently
agree.

Reviewed-by: Christoph Hellwig <hch@lst.de>

Back to linux.kernel | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

[PATCH] pci: iov: use device lock to protect IOV sysfs accesses Jakub Kicinski <jakub.kicinski@netronome.com> - 2017-05-23 01:00 +0200
  Re: [PATCH] pci: iov: use device lock to protect IOV sysfs accesses Christoph Hellwig <hch@infradead.org> - 2017-05-23 07:30 +0200

csiph-web