From: Keith Busch <kbusch@kernel.org>
To: dan.j.williams@intel.com
Cc: Keith Busch <kbusch@meta.com>,
linux-pci@vger.kernel.org, helgaas@kernel.org, alex@shazbot.org,
lukas@wunner.de, guojinhui.liam@bytedance.com,
ilpo.jarvinen@linux.intel.com
Subject: Re: [PATCHv2 3/4] pci: remove slot specific lock/unlock and save/restore
Date: Wed, 4 Feb 2026 14:33:00 -0700 [thread overview]
Message-ID: <aYO7DHyuxXS3ZEZ8@kbusch-mbp> (raw)
In-Reply-To: <697d9a0fa0427_1d3310063@dwillia2-mobl4.notmuch>
On Fri, Jan 30, 2026 at 09:58:39PM -0800, dan.j.williams@intel.com wrote:
> Should this be:
>
> bus = slot ? slot->bus : NULL;
>
> ?
Yes, you're right.
> Looks like at least pci_reset_bus() could pass a NULL @slot.
>
> > int rc;
> >
> > - if (!slot || !pci_slot_resettable(slot))
> > + if (!slot || (bus && !pci_bus_resettable(bus)))
>
> With above and something like this:
>
> @@ -5219,6 +5219,8 @@ static bool pci_bus_resettable(struct pci_bus *bus)
> {
> struct pci_dev *dev;
>
> + if (!bus)
> + return false;
Sounds good.
> > int rc;
> >
> > rc = pci_slot_reset(slot, PCI_RESET_PROBE);
> > if (rc)
> > return rc;
> >
> > - if (pci_slot_trylock(slot)) {
> > - pci_slot_save_and_disable_locked(slot);
> > + if (pci_bus_trylock(bus)) {
> > + pci_bus_save_and_disable_locked(bus);
> > might_sleep();
> > rc = pci_reset_hotplug_slot(slot->hotplug, PCI_RESET_DO_RESET);
> > - pci_slot_restore_locked(slot);
> > - pci_slot_unlock(slot);
> > + pci_bus_restore_locked(bus);
> > + pci_bus_unlock(bus);
>
> With at least the @bus initialization fixup above and with or without
> the other suggested cleanups you can add:
Thanks!
next prev parent reply other threads:[~2026-02-04 21:33 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-01-30 16:59 [PATCHv2 0/4] pci: slot handling fixes Keith Busch
2026-01-30 16:59 ` [PATCHv2 1/4] PCI: Fix incorrect unlocking in pci_slot_trylock() Keith Busch
2026-01-30 16:59 ` [PATCHv2 2/4] pci: fix slot reset device locking Keith Busch
2026-01-30 16:59 ` [PATCHv2 3/4] pci: remove slot specific lock/unlock and save/restore Keith Busch
2026-01-31 5:58 ` dan.j.williams
2026-02-04 21:33 ` Keith Busch [this message]
2026-02-02 20:27 ` Keith Busch
2026-01-30 16:59 ` [PATCHv2 4/4] pci: make reset_subordinate hotplug safe Keith Busch
2026-01-31 6:42 ` dan.j.williams
2026-02-04 22:31 ` Keith Busch
2026-01-31 0:18 ` [PATCHv2 0/4] pci: slot handling fixes 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=aYO7DHyuxXS3ZEZ8@kbusch-mbp \
--to=kbusch@kernel.org \
--cc=alex@shazbot.org \
--cc=dan.j.williams@intel.com \
--cc=guojinhui.liam@bytedance.com \
--cc=helgaas@kernel.org \
--cc=ilpo.jarvinen@linux.intel.com \
--cc=kbusch@meta.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox