* Re: [PATCH v3 1/2] PCI: Ignore Immediate Readiness on Samsung 990 PRO NVMe
[not found] <sashiko-outbox-167396@kernel.org>
@ 2026-10-11 19:20 ` Alexander Gruhlke
0 siblings, 0 replies; 2+ messages in thread
From: Alexander Gruhlke @ 2026-10-11 19:20 UTC (permalink / raw)
To: Bjorn Helgaas
Cc: Lukas Wunner, Rafael J . Wysocki, Alex Williamson, Hui Wang,
Linux-Fan, sashiko-reviews, linux-pci, linux-kernel, regressions
On Sun, Oct 11, 2026 at 07:14:44PM +0000, sashiko-bot@kernel.org wrote:
> Can this result in a C bitfield data race where either the imm_ready = 0
> update or the sysfs attribute update is silently lost, potentially breaking
> the VFIO passthrough (the bug this patch intended to fix) or corrupting PCI
> power management state?
imm_ready is set in pci_init_capabilities(), after the header fixups, so
a final fixup is the earliest place a quirk can clear it. At boot, final
fixups run before userspace starts, and other final quirks such as
quirk_no_msi() and quirk_broken_intx_masking() set pci_dev bitfields the
same way. So I'd leave it as is.
Thanks,
Alexander
^ permalink raw reply [flat|nested] 2+ messages in thread
* [PATCH v3 1/2] PCI: Ignore Immediate Readiness on Samsung 990 PRO NVMe
2026-10-11 19:01 [PATCH v3 0/2] PCI: Wait after FLR for devices that don't honor Immediate Readiness Alexander Gruhlke
@ 2026-10-11 19:01 ` Alexander Gruhlke
0 siblings, 0 replies; 2+ messages in thread
From: Alexander Gruhlke @ 2026-10-11 19:01 UTC (permalink / raw)
To: Bjorn Helgaas
Cc: Lukas Wunner, Rafael J . Wysocki, Alex Williamson, Hui Wang,
Linux-Fan, linux-pci, linux-kernel, regressions,
Alexander Gruhlke
The Samsung 990 PRO [144d:a80c] advertises Immediate Readiness, so
pcie_flr() doesn't wait after FLR, but the drive returns ~0 for up to
7 ms. Since commit 10baa9b4df40 ("PCI: Drop unnecessary retries when
restoring BARs"), the config restore after FLR is lost, which breaks
VFIO passthrough of the drive. Firmware 8B2QJXD7 responds right after
FLR, but older firmware such as 1B2QJXD7 doesn't, and the firmware
version isn't visible here.
Ignore Immediate Readiness on this device, so pcie_flr() waits.
Fixes: 10baa9b4df40 ("PCI: Drop unnecessary retries when restoring BARs")
Link: https://bbs.archlinux.org/viewtopic.php?id=314833
Link: https://lore.kernel.org/r/20261010160529.27974-1-gruhlke@mailbox.org
Suggested-by: Lukas Wunner <lukas@wunner.de>
Assisted-by: Claude:claude-opus-5-5
Reviewed-by: Lukas Wunner <lukas@wunner.de>
Signed-off-by: Alexander Gruhlke <gruhlke@mailbox.org>
---
drivers/pci/quirks.c | 11 +++++++++++
1 file changed, 11 insertions(+)
diff --git a/drivers/pci/quirks.c b/drivers/pci/quirks.c
index 0500d5fd4f..e8597d1209 100644
--- a/drivers/pci/quirks.c
+++ b/drivers/pci/quirks.c
@@ -5623,6 +5623,17 @@ static void quirk_no_flr_snet(struct pci_dev *dev)
}
DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_SOLIDRUN, 0x1000, quirk_no_flr_snet);
+/* Samsung 990 PRO advertises Immediate Readiness, but isn't ready after FLR */
+static void quirk_no_imm_ready(struct pci_dev *dev)
+{
+ if (!dev->imm_ready)
+ return;
+
+ pci_info(dev, "Ignoring incorrectly advertised Immediate Readiness support\n");
+ dev->imm_ready = 0;
+}
+DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_SAMSUNG, 0xa80c, quirk_no_imm_ready);
+
static void quirk_no_ext_tags(struct pci_dev *pdev)
{
struct pci_host_bridge *bridge = pci_find_host_bridge(pdev->bus);
--
2.56.0
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2026-10-11 19:20 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
[not found] <sashiko-outbox-167396@kernel.org>
2026-10-11 19:20 ` [PATCH v3 1/2] PCI: Ignore Immediate Readiness on Samsung 990 PRO NVMe Alexander Gruhlke
2026-10-11 19:01 [PATCH v3 0/2] PCI: Wait after FLR for devices that don't honor Immediate Readiness Alexander Gruhlke
2026-10-11 19:01 ` [PATCH v3 1/2] PCI: Ignore Immediate Readiness on Samsung 990 PRO NVMe Alexander Gruhlke
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®