From: Christoph Hellwig <hch@infradead.org>
To: Jakub Kicinski <jakub.kicinski@netronome.com>
Cc: Bjorn Helgaas <bhelgaas@google.com>,
linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Emil Tantilov <emil.s.tantilov@intel.com>,
Alexander Duyck <alexander.h.duyck@intel.com>,
oss-drivers@netronome.com
Subject: Re: [PATCH] pci: iov: use device lock to protect IOV sysfs accesses
Date: Mon, 22 May 2017 22:25:46 -0700 [thread overview]
Message-ID: <20170523052546.GA1408@infradead.org> (raw)
In-Reply-To: <20170522225023.14010-1-jakub.kicinski@netronome.com>
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>
next prev parent reply other threads:[~2017-05-23 5:25 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-05-22 22:50 [PATCH] pci: iov: use device lock to protect IOV sysfs accesses Jakub Kicinski
2017-05-23 5:25 ` Christoph Hellwig [this message]
2017-05-26 23:47 ` Bjorn Helgaas
2017-05-26 23:58 ` Jakub Kicinski
2017-05-30 23:07 ` Bjorn Helgaas
2017-05-30 23:34 ` Jakub Kicinski
2017-06-14 4:57 ` Jakub Kicinski
2017-06-15 2:47 ` Bjorn Helgaas
2017-06-15 8:30 ` Christoph Hellwig
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20170523052546.GA1408@infradead.org \
--to=hch@infradead.org \
--cc=alexander.h.duyck@intel.com \
--cc=bhelgaas@google.com \
--cc=emil.s.tantilov@intel.com \
--cc=gregkh@linuxfoundation.org \
--cc=jakub.kicinski@netronome.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pci@vger.kernel.org \
--cc=oss-drivers@netronome.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).