Linux PCI subsystem development
 help / color / mirror / Atom feed
From: Alex Williamson <alex@shazbot.org>
To: Jose Ignacio Tornos Martinez <jtornosm@redhat.com>
Cc: bhelgaas@google.com, linux-kernel@vger.kernel.org,
	linux-pci@vger.kernel.org, alex@shazbot.org
Subject: Re: [PATCH v4 2/3] PCI: Add soft reset method as last resort
Date: Wed, 20 May 2026 10:13:38 -0600	[thread overview]
Message-ID: <20260520101338.21fe1e13@shazbot.org> (raw)
In-Reply-To: <20260519053551.7140-1-jtornosm@redhat.com>

On Tue, 19 May 2026 07:35:50 +0200
Jose Ignacio Tornos Martinez <jtornosm@redhat.com> wrote:

> Hello Alex,
> 
> Thank you for the feedback. I understand the concern about reporting reset
> capabilities for all devices.
> 
> Regarding the sysfs power state approach: I tested this, but the challenge
> is that VFIO needs automatic reset during VM crash/reassignment. When a VM
> terminates uncleanly, VFIO calls the device reset path automatically before
> reassignment - there's no opportunity for userspace to manipulate sysfs power
> state in that flow.
> 
> For the device-specific approach you mentioned, what if I modify the "soft"
> method to require an explicit quirk flag? Something like:
> 
>   static int pci_soft_reset(struct pci_dev *dev, bool probe)
>   {
>       /* Only available if device explicitly quirked for soft reset */
>       if (!(dev->dev_flags & PCI_DEV_FLAGS_ALLOW_SOFT_RESET))
>           return -ENOTTY;
> 
...
> 
> Would this approach be acceptable?

Device specific resets are made for this scenario.  Look at
pci_dev_specific_reset() and pci_dev_reset_methods[].  The supporting
evidence that this performs a worthwhile reset is still a bit weak, but
heuristically it seems better than nothing, which is what we're left
with otherwise.  Reset via D3hot for a device that does not expose
NoSoftRst- is not something we should enable or endorse for any common
use case.  Thanks,

Alex

  reply	other threads:[~2026-05-20 16:13 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-18 12:48 [PATCH v4 0/3] PCI: Add d3cold/soft reset methods for devices with limited reset capability Jose Ignacio Tornos Martinez
2026-05-18 12:48 ` [PATCH v4 1/3] PCI: Add d3cold as general reset method Jose Ignacio Tornos Martinez
2026-05-18 13:27   ` sashiko-bot
2026-05-18 12:48 ` [PATCH v4 2/3] PCI: Add soft reset method as last resort Jose Ignacio Tornos Martinez
2026-05-18 13:48   ` sashiko-bot
2026-05-18 17:15   ` Alex Williamson
2026-05-19  5:35     ` Jose Ignacio Tornos Martinez
2026-05-20 16:13       ` Alex Williamson [this message]
2026-05-21  6:32         ` Jose Ignacio Tornos Martinez
2026-05-18 12:48 ` [PATCH v4 3/3] PCI: Disable broken bus reset on Qualcomm devices Jose Ignacio Tornos Martinez

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=20260520101338.21fe1e13@shazbot.org \
    --to=alex@shazbot.org \
    --cc=bhelgaas@google.com \
    --cc=jtornosm@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --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