All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] PCI: Add quirk for ID mutation of MSI Claw A8 cardreader
@ 2026-08-14  9:06 Lukas Wunner
  2026-08-14  9:24 ` sashiko-bot
  0 siblings, 1 reply; 2+ messages in thread
From: Lukas Wunner @ 2026-08-14  9:06 UTC (permalink / raw)
  To: Bjorn Helgaas
  Cc: Derek J. Clark, Matthew Schwartz, Pierre-Loup A. Griffais,
	linux-pci, x86

Derek reports a lockup on resume of the MSI Claw A8 if a card is inserted
into the onboard Realtek RTS525A cardreader.  He has root-caused it to a
mutation of the cardreader's Subsystem Vendor and Device ID:  Firmware
sets an MSI-specific ID on boot, but neglects to reset it on resume.
The ID thus changes to the generic Realtek Vendor and Device ID.

The firmware also incorrectly sets the Hot-Plug Capable bit on the Root
Port and the PCIe hotplug driver interprets the ID mutation as removal of
the cardreader during system sleep (see pciehp_device_replaced()).

The lockup is caused by the block layer being unaware of the hot-removal
and waiting indefinitely in sync_filesystem().  That is fixed with a
separate commit for the cardreader driver.  However despite that other
commit, the cardreader is still hot-removed and re-enumerated the first
time the system is put to sleep.  This is undesirable because it prevents
using an MMC card as root filesystem.

Avoid hot-removal of the cardreader by mutating the cached copy of the
Subsystem Vendor and Device ID.  This needs to be done before going to
sleep, not afterwards, because pci_pm_resume_noirq() is executed top-down
across the hierarchy and hence a pci_fixup_resume_early quirk of the
cardreader would run after hot-removal at its parent Root Port.

In the unlikely event that a fixed firmware becomes available, the quirk
can either be reverted or constrained to specific BIOS versions by way of
a dmi_get_date() conditional.

Reported-by: Derek J. Clark <derekjohn.clark@gmail.com>
Tested-by: Derek J. Clark <derekjohn.clark@gmail.com>
Closes: https://lore.kernel.org/r/20260806214808.1202819-1-derekjohn.clark@gmail.com/
Link: https://github.com/ValveSoftware/SteamOS/issues/2473
Signed-off-by: Lukas Wunner <lukas@wunner.de>
Cc: stable@vger.kernel.org
Cc: Matthew Schwartz <matthew.schwartz@linux.dev>
---
 arch/x86/pci/fixup.c | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)

diff --git a/arch/x86/pci/fixup.c b/arch/x86/pci/fixup.c
index b301c6c..9da7ae0 100644
--- a/arch/x86/pci/fixup.c
+++ b/arch/x86/pci/fixup.c
@@ -1080,4 +1080,20 @@ static void quirk_tuxeo_rp_d3(struct pci_dev *pdev)
 	}
 }
 DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_AMD, 0x1502, quirk_tuxeo_rp_d3);
+
+/*
+ * MSI Claw A8 firmware initializes the onboard Realtek RTS525A cardreader
+ * with an MSI-specific Subsystem Vendor and Device ID on boot, but neglects
+ * to re-initialize it on resume.  Avoid hot-removal of the cardreader due to
+ * the spurious ID change.
+ */
+static void quirk_msi_claw_cardreader(struct pci_dev *pdev)
+{
+	if (pdev->subsystem_vendor == 0x1462 &&
+	    pdev->subsystem_device == 0x14af) {
+		pdev->subsystem_vendor = pdev->vendor;
+		pdev->subsystem_device = pdev->device;
+	}
+}
+DECLARE_PCI_FIXUP_SUSPEND_LATE(PCI_VENDOR_ID_REALTEK, 0x525a, quirk_msi_claw_cardreader);
 #endif /* CONFIG_SUSPEND */
-- 
2.53.0


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] PCI: Add quirk for ID mutation of MSI Claw A8 cardreader
  2026-08-14  9:06 [PATCH] PCI: Add quirk for ID mutation of MSI Claw A8 cardreader Lukas Wunner
@ 2026-08-14  9:24 ` sashiko-bot
  0 siblings, 0 replies; 2+ messages in thread
From: sashiko-bot @ 2026-08-14  9:24 UTC (permalink / raw)
  To: Lukas Wunner; +Cc: linux-pci

> Derek reports a lockup on resume of the MSI Claw A8 if a card is inserted
> into the onboard Realtek RTS525A cardreader.  He has root-caused it to a
> mutation of the cardreader's Subsystem Vendor and Device ID:  Firmware
> sets an MSI-specific ID on boot, but neglects to reset it on resume.
> The ID thus changes to the generic Realtek Vendor and Device ID.
> 
> The firmware also incorrectly sets the Hot-Plug Capable bit on the Root
> Port and the PCIe hotplug driver interprets the ID mutation as removal of
> the cardreader during system sleep (see pciehp_device_replaced()).
> 
> The lockup is caused by the block layer being unaware of the hot-removal
> and waiting indefinitely in sync_filesystem().  That is fixed with a
> separate commit for the cardreader driver.  However despite that other
> commit, the cardreader is still hot-removed and re-enumerated the first
> time the system is put to sleep.  This is undesirable because it prevents
> [ ... ]
> Reported-by: Derek J. Clark <derekjohn.clark@gmail.com>
> Tested-by: Derek J. Clark <derekjohn.clark@gmail.com>
> Closes: https://lore.kernel.org/r/20260806214808.1202819-1-derekjohn.clark@gmail.com/
> Link: https://github.com/ValveSoftware/SteamOS/issues/2473
> Signed-off-by: Lukas Wunner <lukas@wunner.de>

Sashiko has reviewed this patch and found no issues. It looks great!

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/36578f6e0829bbcdf68659ffad27b65715a97768.1786698126.git.lukas@wunner.de?part=1


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2026-08-14  9:24 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-08-14  9:06 [PATCH] PCI: Add quirk for ID mutation of MSI Claw A8 cardreader Lukas Wunner
2026-08-14  9:24 ` sashiko-bot

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.