mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
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,
	lukas@wunner.de
Subject: Re: [PATCH v3 1/2] PCI: Add D3cold as general reset method
Date: Mon, 18 May 2026 14:44:20 +0200	[thread overview]
Message-ID: <20260518124422.460518-1-jtornosm@redhat.com> (raw)
In-Reply-To: <20260514145452.44f9ac5b@shazbot.org>

Hello Alex,

Thank you again for the detailed feedback.

> Are you testing with the patch that marks these devices
> PCI_DEV_FLAGS_NO_BUS_RESET?
Yes, I'm testing with quirk_no_bus_reset applied.
My evidence about bus issues with the commented Qualcomm cards is
device-specific and not adapter-specific because we are using the same
adapter with the commented MediaTek MT7925e
- Uses quirk_no_flr (https://lore.kernel.org/all/20260511123936.36054-1-jtornosm@redhat.com/)
- reset_method shows: "bus"
- Bus reset works correctly for VFIO passthrough reuse
This proves PERST# is properly wired through the passive adapters. Since
Qualcomm devices fail SBR with the same adapter setup where MediaTek
succeeds, I think the issue is device-specific, not deployment-specific.

> I want to be sure that bouncing the device
> through D3hot is actually an improvement versus no reset at all, and
> we're not just performing a no-op reset to avoid the bus reset.
The D3hot transition is definitely an improvement over no reset at all:
- Without any reset: Device remains in undefined state after VM crash and
  cannot be reused.
- With D3hot transition: Command register gets cleared (0x0002 → 0x0000),
  device can be reinitialized and successfully assigned to the VM
Testing methodology: VM crash → check PCI config space → verify device
reusable. The D3hot transition clears enough state for VFIO passthrough
reuse, even though it's not a full FLR-style reset.

> That said, if you're testing before BAR restore and those registers
> aren't being cleared, this seems at best a device specific reset, but
> evidence is a bit sketchy. In the general case, a transition through
> D3hot for a device that does not claim NoSoftRst- cannot be consider to
> satisfy a reset request.
Agree, my testing confirms:
- Command register: CLEARED (0x0002 → 0x0000 → 0x0506 after driver init)
- BARs: PRESERVED (0x84200004 maintained throughout)
So, this is a partial reset, not a full spec-compliant reset and only the
command register is cleared. However it works.

> If you can block the known broken resets and manage to trigger a D3hot
> transition externally, that may provide a reasonably useful environment.
> We've also been known to implement the sketchier resets that can't fully
> be justified as a kernel quirk in QEMU itself.
I understand the concern about sketchy resets in the kernel. 
I have prepared v4 version with a different conservative approach not
changing anything in the current behavior, as a last resort and only adding
a "soft" method when other reset methods are not available (our current case
for Qualcomm cards).
I believe providing it as optional kernel infrastructure (user-controllable
via sysfs) has value because:
  - Benefits all VMMs (QEMU, cloud-hypervisor, etc.), not just QEMU
  - Uses standard PCI PM mechanisms, no device-specific hacks
  - Provides measurable value for VFIO passthrough where no reset exists
Happy to adjust based on your feedback

Thanks

Best regards
José Ignacio


      reply	other threads:[~2026-05-18 12:44 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-13 12:23 Jose Ignacio Tornos Martinez
2026-05-13 12:23 ` [PATCH v3 2/2] PCI: Disable broken bus reset on Qualcomm devices Jose Ignacio Tornos Martinez
2026-05-13 13:31 ` [PATCH v3 1/2] PCI: Add D3cold as general reset method Alex Williamson
2026-05-14 12:23   ` Jose Ignacio Tornos Martinez
2026-05-15 16:52     ` Alex Williamson
2026-05-13 14:39 ` Lukas Wunner
2026-05-14 12:30   ` Jose Ignacio Tornos Martinez
2026-05-14 20:54     ` Alex Williamson
2026-05-18 12:44       ` Jose Ignacio Tornos Martinez [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=20260518124422.460518-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 \
    --cc=lukas@wunner.de \
    /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®