Linux PCI subsystem development
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Samiullah Khawaja" <skhawaja@google.com>
Cc: linux-pci@vger.kernel.org
Subject: Re: [PATCH v2] vfio/pci: Only lock the upstream bridge if the reset may need it
Date: Tue, 24 Nov 2026 21:48:20 +0000	[thread overview]
Message-ID: <sashiko-outbox-232063@kernel.org> (raw)
In-Reply-To: <20261124212842.1934651-1-skhawaja@google.com>

> Commit 962ae6892d8b ("vfio/pci: Lock upstream bridge for
> vfio_pci_core_disable()") makes vfio_pci_core_disable() trylock the
> upstream bridge before resetting the device, and skips the reset if the
> trylock fails.
> 
> All VFs of a PF have the same upstream bridge. Take a device with two
> VFs, both used by one process. When the process is killed, both VFs can
> be released at the same time. The first one takes the bridge lock and
> does its FLR, the second one fails the trylock and is never reset.
> 
> The bridge lock is only needed for a bus reset, which is done through
> the bridge. Add pci_reset_function_needs_bridge_lock(), which returns
> false if there is no upstream bridge, if bus resets are disabled for the
> device, or if the device is a VF. Use it in vfio_pci_core_disable() and
> pci_reset_function() to only lock the bridge when it is needed.
> 
> Fixes: 962ae6892d8b ("vfio/pci: Lock upstream bridge for vfio_pci_core_disable()")
> Cc: stable@vger.kernel.org
> Signed-off-by: Samiullah Khawaja <skhawaja@google.com>

Sashiko has reviewed this patch and found no issues.

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261124212842.1934651-1-skhawaja@google.com?part=1

  reply	other threads:[~2026-11-24 21:48 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-24 21:28 [PATCH v2] vfio/pci: Only lock the upstream bridge if the reset may need it Samiullah Khawaja
2026-11-24 21:48 ` sashiko-bot [this message]
2026-11-24 22:03 ` Alex Williamson

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-232063@kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=sashiko-reviews@lists.linux.dev \
    --cc=skhawaja@google.com \
    /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