From: Keith Busch <kbusch@kernel.org>
To: Davidlohr Bueso <dave@stgolabs.net>
Cc: Keith Busch <kbusch@meta.com>,
linux-pci@vger.kernel.org, bhelgaas@google.com,
Jonathan Cameron <Jonathan.Cameron@huawei.com>
Subject: Re: [PATCHv2 2/5] pci: make pci_destroy_dev concurrent safe
Date: Thu, 3 Oct 2024 08:54:19 -0600 [thread overview]
Message-ID: <Zv6wG5qF74J237w2@kbusch-mbp> (raw)
In-Reply-To: <20241003023354.txfw7w4ud247h5va@offworld>
On Wed, Oct 02, 2024 at 07:34:13PM -0700, Davidlohr Bueso wrote:
> On Tue, 27 Aug 2024, Keith Busch wrote:
> > static void pci_destroy_dev(struct pci_dev *dev)
> > {
> > - if (!dev->dev.kobj.parent)
> > + if (pci_dev_test_and_set_removed(dev))
>
> Doesn't this want to be if (!pci_dev_test_and_set_removed()) ?
No, this function returns the previous value of the REMOVED flag. If
it's already set, then another thread already removed this device.
> This also fixes a splat when triggering a removal when you add
> subordinate refcounting is added:
>
> https://git.kernel.org/pub/scm/linux/kernel/git/kbusch/linux.git/commit/?h=pci-bus-locking-2024-09-09&id=3883c485d5e45b5e17f685f77ff4020bec162336
Oh, that's pretty neat. Thanks for testing that! I think that reference
counting patch is pretty safe too. I can rebase the series with that one
included next time.
next prev parent reply other threads:[~2024-10-03 14:54 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-08-27 19:28 [PATCHv2 0/5] pci cleanup/prep patches Keith Busch
2024-08-27 19:28 ` [PATCHv2 1/5] pci: make pci_stop_dev concurrent safe Keith Busch
2024-10-02 23:39 ` Davidlohr Bueso
2024-10-03 0:04 ` Keith Busch
2024-08-27 19:28 ` [PATCHv2 2/5] pci: make pci_destroy_dev " Keith Busch
2024-10-03 2:34 ` Davidlohr Bueso
2024-10-03 14:54 ` Keith Busch [this message]
2024-10-03 17:04 ` Davidlohr Bueso
2024-10-03 17:59 ` Keith Busch
2024-10-08 2:15 ` Davidlohr Bueso
2024-10-22 20:29 ` Keith Busch
2024-08-27 19:28 ` [PATCHv2 3/5] pci: move the walk bus lock to where its needed Keith Busch
2024-10-03 0:32 ` Davidlohr Bueso
2024-10-09 11:09 ` Ilpo Järvinen
2024-08-27 19:28 ` [PATCHv2 4/5] pci: walk bus recursively Keith Busch
2024-10-09 12:08 ` Ilpo Järvinen
2024-08-27 19:28 ` [PATCHv2 5/5] pci: unexport pci_walk_bus_locked Keith Busch
2024-10-03 0:35 ` Davidlohr Bueso
2024-10-09 12:20 ` Ilpo Järvinen
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=Zv6wG5qF74J237w2@kbusch-mbp \
--to=kbusch@kernel.org \
--cc=Jonathan.Cameron@huawei.com \
--cc=bhelgaas@google.com \
--cc=dave@stgolabs.net \
--cc=kbusch@meta.com \
--cc=linux-pci@vger.kernel.org \
/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