From: Lukas Wunner <lukas@wunner.de>
To: Keith Busch <kbusch@meta.com>
Cc: linux-pci@vger.kernel.org, bhelgaas@google.com,
Keith Busch <kbusch@kernel.org>,
Jonathan Cameron <Jonathan.Cameron@huawei.com>
Subject: Re: [PATCHv3 1/5] pci: make pci_stop_dev concurrent safe
Date: Thu, 7 Nov 2024 15:06:57 +0100 [thread overview]
Message-ID: <ZyzJgaEOJOKmh_xw@wunner.de> (raw)
In-Reply-To: <20241022224851.340648-2-kbusch@meta.com>
On Tue, Oct 22, 2024 at 03:48:47PM -0700, Keith Busch wrote:
> --- a/drivers/pci/remove.c
> +++ b/drivers/pci/remove.c
> @@ -31,18 +31,16 @@ static int pci_pwrctl_unregister(struct device *dev, void *data)
>
> static void pci_stop_dev(struct pci_dev *dev)
> {
> - pci_pme_active(dev, false);
> -
> - if (pci_dev_is_added(dev)) {
> - device_for_each_child(dev->dev.parent, dev_of_node(&dev->dev),
> - pci_pwrctl_unregister);
> - device_release_driver(&dev->dev);
> - pci_proc_detach_device(dev);
> - pci_remove_sysfs_dev_files(dev);
> - of_pci_remove_node(dev);
> + if (!pci_dev_test_and_clear_added(dev))
> + return;
>
> - pci_dev_assign_added(dev, false);
> - }
> + pci_pme_active(dev, false);
> + device_for_each_child(dev->dev.parent, dev_of_node(&dev->dev),
> + pci_pwrctl_unregister);
> + device_release_driver(&dev->dev);
> + pci_proc_detach_device(dev);
> + pci_remove_sysfs_dev_files(dev);
> + of_pci_remove_node(dev);
> }
The above is now queued for v6.13 as commit 6d6d962a8dc2 on pci/locking.
I note there's a behavioral change here:
Previously "pci_pme_active(dev, false)" was called unconditionally,
now only if the "added" flag has been set. The commit message
doesn't explain why this change is fine, so perhaps it's inadvertent?
Thanks,
Lukas
next prev parent reply other threads:[~2024-11-07 14:17 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-10-22 22:48 [PATCHv3 0/5] pci cleanup/prep patches Keith Busch
2024-10-22 22:48 ` [PATCHv3 1/5] pci: make pci_stop_dev concurrent safe Keith Busch
2024-11-07 14:06 ` Lukas Wunner [this message]
2024-11-07 15:56 ` Keith Busch
2024-11-11 7:20 ` Lukas Wunner
2024-10-22 22:48 ` [PATCHv3 2/5] pci: make pci_destroy_dev " Keith Busch
2024-10-22 22:48 ` [PATCHv3 3/5] pci: move the walk bus lock to where its needed Keith Busch
2024-10-22 22:48 ` [PATCHv3 4/5] pci: walk bus recursively Keith Busch
2024-11-11 8:21 ` Lukas Wunner
2024-10-22 22:48 ` [PATCHv3 5/5] pci: unexport pci_walk_bus_locked Keith Busch
2024-10-23 21:43 ` Bjorn Helgaas
2024-10-23 22:00 ` Keith Busch
2024-10-23 22:07 ` Bjorn Helgaas
2024-10-23 22:20 ` [PATCHv3 0/5] pci cleanup/prep patches 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=ZyzJgaEOJOKmh_xw@wunner.de \
--to=lukas@wunner.de \
--cc=Jonathan.Cameron@huawei.com \
--cc=bhelgaas@google.com \
--cc=kbusch@kernel.org \
--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