[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20170523052546.GA1408@infradead.org>
Date: Mon, 22 May 2017 22:25:46 -0700
From: Christoph Hellwig <hch@...radead.org>
To: Jakub Kicinski <jakub.kicinski@...ronome.com>
Cc: Bjorn Helgaas <bhelgaas@...gle.com>, linux-pci@...r.kernel.org,
linux-kernel@...r.kernel.org,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Emil Tantilov <emil.s.tantilov@...el.com>,
Alexander Duyck <alexander.h.duyck@...el.com>,
oss-drivers@...ronome.com
Subject: Re: [PATCH] pci: iov: use device lock to protect IOV sysfs accesses
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@....de>
Powered by blists - more mailing lists