Linux PCI subsystem development
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Ionut Nechita (Wind River)" <ionut.nechita@windriver.com>
Cc: linux-pci@vger.kernel.org
Subject: Re: [PATCH] PCI: Don't block config access while waiting for device locks in bus reset
Date: Fri, 20 Nov 2026 08:15:01 +0000	[thread overview]
Message-ID: <sashiko-outbox-224695@kernel.org> (raw)
In-Reply-To: <20261120080031.56565-1-ionut.nechita@windriver.com>

> From: Ionut Nechita <ionut.nechita@windriver.com>
> 
> __pci_bus_lock(), used by bus and slot resets, locks the bridge and every
> device below it with pci_dev_lock(), one device after the other.  Each
> pci_dev_lock() takes the device lock and then blocks config access to the
> device.  If another task holds the device lock of a device further down
> the list, the reset sleeps with config access already blocked to the
> bridge and to every device locked before it, and every user config read
> of those devices sleeps in pci_wait_cfg() for as long.
> 
> This is the same problem as the one fixed for pci_reset_function(): a
> driver unbind of a function held open by a vfio user waits in
> vfio_unregister_group_dev() with the device lock held until the user
> releases the device.  A bus or slot reset that reaches that device during
> error recovery (pci_bus_error_reset()) keeps config access to the bridge
> blocked meanwhile, and lspci hangs in D state.
> 
> Take all device locks first, from the top of the tree down as before, and
> block config access to the bridge and the devices only once all of them
> are held.  The order in which the device locks are taken is unchanged.
> 
> The trylock variant does not sleep on a device lock, and the unlock path
> releases each device's config access and device lock together, as
> before, so neither is changed.
> 
> Fixes: a4e772898f8b ("PCI: Add missing bridge lock to pci_bus_lock()")
> Cc: stable@vger.kernel.org
> Signed-off-by: Ionut Nechita <ionut.nechita@windriver.com>

Sashiko has reviewed this patch and found no issues.

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261120080031.56565-1-ionut.nechita@windriver.com?part=1


      reply	other threads:[~2026-11-20  8:15 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-20  8:00 [PATCH] PCI: Don't block config access while waiting for device locks in bus reset Ionut Nechita (Wind River)
2026-11-20  8:15 ` sashiko-bot [this message]

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=sashiko-outbox-224695@kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=ionut.nechita@windriver.com \
    --cc=linux-pci@vger.kernel.org \
    --cc=sashiko-reviews@lists.linux.dev \
    /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