From: Keith Busch <keith.busch@intel.com>
To: Lukas Wunner <lukas@wunner.de>
Cc: Linux PCI <linux-pci@vger.kernel.org>,
Bjorn Helgaas <bhelgaas@google.com>
Subject: Re: [PATCH] pci/sriov: Hold rescan lock while enumerating
Date: Thu, 9 Aug 2018 12:05:34 -0600 [thread overview]
Message-ID: <20180809180534.GA18816@localhost.localdomain> (raw)
In-Reply-To: <20180809175819.42j6laq5gxtpnlxy@wunner.de>
On Thu, Aug 09, 2018 at 07:58:19PM +0200, Lukas Wunner wrote:
> On Thu, Aug 09, 2018 at 10:33:56AM -0600, Keith Busch wrote:
> > --- a/drivers/pci/pci-sysfs.c
> > +++ b/drivers/pci/pci-sysfs.c
> > @@ -591,6 +591,7 @@ static ssize_t sriov_numvfs_store(struct device *dev,
> > if (num_vfs > pci_sriov_get_totalvfs(pdev))
> > return -ERANGE;
> >
> > + pci_lock_rescan_remove();
> > device_lock(&pdev->dev);
>
> Doesn't this obviate the need to hold the device_lock()? What could
> otherwise run concurrently that doesn't hold pci_lock_rescan_remove()
> and would cause a race condition?
The device_lock is still needed to protect against concurrent
pci_reset_function.
next prev parent reply other threads:[~2018-08-09 20:30 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-08-09 16:33 [PATCH] pci/sriov: Hold rescan lock while enumerating Keith Busch
2018-08-09 17:58 ` Lukas Wunner
2018-08-09 18:05 ` Keith Busch [this message]
2018-09-05 20:58 ` Bjorn Helgaas
2018-09-05 21:12 ` Keith Busch
2018-09-05 22:13 ` Bjorn Helgaas
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=20180809180534.GA18816@localhost.localdomain \
--to=keith.busch@intel.com \
--cc=bhelgaas@google.com \
--cc=linux-pci@vger.kernel.org \
--cc=lukas@wunner.de \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.