From: Jose Ignacio Tornos Martinez <jtornosm@redhat.com>
To: alex@shazbot.org
Cc: bhelgaas@google.com, jtornosm@redhat.com,
linux-kernel@vger.kernel.org, linux-pci@vger.kernel.org
Subject: Re: [PATCH v4 2/3] PCI: Add soft reset method as last resort
Date: Tue, 19 May 2026 07:35:50 +0200 [thread overview]
Message-ID: <20260519053551.7140-1-jtornosm@redhat.com> (raw)
In-Reply-To: <20260518111555.6b1ce60d@shazbot.org>
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;
if (pci_pm_reset(dev, true) == 0)
return -ENOTTY;
if (pci_d3cold_reset(dev, true) == 0)
return -ENOTTY;
if (!dev->pm_cap)
return -ENOTTY;
if (probe)
return 0;
return pci_do_d3hot_transition(dev);
}
DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_QCOM, 0x1103, quirk_allow_soft_reset);
DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_QCOM, 0x1107, quirk_allow_soft_reset);
DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_QCOM, 0x0308, quirk_allow_soft_reset);
This way:
- Only proven device IDs get soft reset capability (no broad reset reporting)
- Device-specific version matching device IDs (as you suggested)
- Generic infrastructure but explicit opt-in per device
- Different from v2: new method with quirk, not modifying pm reset behavior
Would this approach be acceptable?
Thanks
Best regards
José Ignacio
next prev parent reply other threads:[~2026-05-19 5:36 UTC|newest]
Thread overview: 8+ 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 12:48 ` [PATCH v4 2/3] PCI: Add soft reset method as last resort Jose Ignacio Tornos Martinez
2026-05-18 17:15 ` Alex Williamson
2026-05-19 5:35 ` Jose Ignacio Tornos Martinez [this message]
2026-05-20 16:13 ` Alex Williamson
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=20260519053551.7140-1-jtornosm@redhat.com \
--to=jtornosm@redhat.com \
--cc=alex@shazbot.org \
--cc=bhelgaas@google.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
all inboxes | Powered by JetHome®