From: sashiko-bot@kernel.org
To: "Ionut Nechita (Wind River)" <ionut.nechita@windriver.com>
Cc: linux-pci@vger.kernel.org
Subject: Re: [PATCH 1/1] PCI: Don't block bridge config access while waiting for the device lock
Date: Thu, 19 Nov 2026 12:43:09 +0000 [thread overview]
Message-ID: <sashiko-outbox-223107@kernel.org> (raw)
In-Reply-To: <20261119123504.25906-2-ionut.nechita@windriver.com>
> From: Ionut Nechita <ionut.nechita@windriver.com>
>
> pci_reset_function() locks the upstream bridge with pci_dev_lock(),
> which takes the bridge's device lock and then blocks config access to
> the bridge, and only then takes the device lock of the function being
> reset. If another task holds that device lock, the reset sleeps with
> config access to the bridge blocked, and every user config read of the
> bridge sleeps in pci_wait_cfg() for as long.
>
> This happens with vfio-pci when a userspace driver keeps a VF open:
>
> 1. A driver unbind of the VF waits in vfio_unregister_group_dev()
> for the user to release the device, holding the VF device lock.
> 2. Writing 0 to sriov_numvfs on the PF takes the PF device lock and
> waits in sriov_disable() for the VF device lock.
> [ ... ]
> reads of unrelated callers stop being blocked.
>
> Fixes: 7e89efc6e9e4 ("PCI: Lock upstream bridge for pci_reset_function()")
> 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/20261119123504.25906-1-ionut.nechita@windriver.com?part=1
prev parent reply other threads:[~2026-11-19 12:43 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-19 12:35 [PATCH 0/1] PCI: Fix lspci hang when a reset waits for a vfio-held device Ionut Nechita (Wind River)
2026-11-19 12:35 ` [PATCH 1/1] PCI: Don't block bridge config access while waiting for the device lock Ionut Nechita (Wind River)
2026-11-19 12:43 ` 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-223107@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