* [PATCH v3] PCI: Disable broken FLR on MediaTek MT7925
@ 2026-05-21 6:12 Jose Ignacio Tornos Martinez
2026-05-21 16:19 ` Bjorn Helgaas
0 siblings, 1 reply; 3+ messages in thread
From: Jose Ignacio Tornos Martinez @ 2026-05-21 6:12 UTC (permalink / raw)
To: bhelgaas, alex
Cc: nbd, lorenzo, shayne.chen, sean.wang, linux-pci, linux-wireless,
linux-kernel, Jose Ignacio Tornos Martinez
The MediaTek MT7925 WiFi device (14c3:7925) advertises FLR capability
but the implementation is broken - reset always fails, leaving the device
in an undefined state.
This manifests in VFIO passthrough scenarios: Normal VM operation works
fine, including clean shutdown/reboot. However, when the VM terminates
uncleanly (crash, force-off), VFIO attempts to reset the device before
it can be assigned to another VM. Because FLR is broken, the reset fails
and the device remains in an undefined state, preventing reuse.
Disable FLR for this device so the PCI core falls back to working reset
methods (PM reset or bus reset).
This follows the existing pattern used for the MediaTek MT7922 WiFi
(14c3:0616), which is the predecessor device and already uses this quirk.
Signed-off-by: Jose Ignacio Tornos Martinez <jtornosm@redhat.com>
---
v3: Resend with MediaTek wireless maintainers CC'd
v2: https://lore.kernel.org/all/20260508145153.717641-1-jtornosm@redhat.com/
drivers/pci/quirks.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/pci/quirks.c b/drivers/pci/quirks.c
index 000000000000..111111111111 100644
--- a/drivers/pci/quirks.c
+++ b/drivers/pci/quirks.c
@@ -5607,6 +5607,7 @@
* Intel 82579LM Gigabit Ethernet Controller 0x1502
* Intel 82579V Gigabit Ethernet Controller 0x1503
* Mediatek MT7922 802.11ax PCI Express Wireless Network Adapter
+ * Mediatek MT7925 802.11be PCI Express Wireless Network Adapter
*/
static void quirk_no_flr(struct pci_dev *dev)
{
@@ -5617,6 +5618,7 @@ DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_AMD, 0x7901, quirk_no_flr);
DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_INTEL, 0x1502, quirk_no_flr);
DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_INTEL, 0x1503, quirk_no_flr);
DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_MEDIATEK, 0x0616, quirk_no_flr);
+DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_MEDIATEK, 0x7925, quirk_no_flr);
/* FLR may cause the SolidRun SNET DPU (rev 0x1) to hang */
static void quirk_no_flr_snet(struct pci_dev *dev)
--
2.53.0
^ permalink raw reply related [flat|nested] 3+ messages in thread* Re: [PATCH v3] PCI: Disable broken FLR on MediaTek MT7925
2026-05-21 6:12 [PATCH v3] PCI: Disable broken FLR on MediaTek MT7925 Jose Ignacio Tornos Martinez
@ 2026-05-21 16:19 ` Bjorn Helgaas
2026-05-22 6:48 ` Jose Ignacio Tornos Martinez
0 siblings, 1 reply; 3+ messages in thread
From: Bjorn Helgaas @ 2026-05-21 16:19 UTC (permalink / raw)
To: Jose Ignacio Tornos Martinez
Cc: bhelgaas, alex, nbd, lorenzo, shayne.chen, sean.wang, linux-pci,
linux-wireless, linux-kernel, Ryder Lee
[+cc Ryder]
On Thu, May 21, 2026 at 08:12:05AM +0200, Jose Ignacio Tornos Martinez wrote:
> The MediaTek MT7925 WiFi device (14c3:7925) advertises FLR capability
> but the implementation is broken - reset always fails, leaving the device
> in an undefined state.
>
> This manifests in VFIO passthrough scenarios: Normal VM operation works
> fine, including clean shutdown/reboot. However, when the VM terminates
> uncleanly (crash, force-off), VFIO attempts to reset the device before
> it can be assigned to another VM. Because FLR is broken, the reset fails
> and the device remains in an undefined state, preventing reuse.
How do we know the device is an "undefined state"? Does it just not
respond to config accesses? Is there something in dmesg that shows
the problem?
I suppose it's similar to 81f64e925c29 ("PCI: Avoid FLR for Mediatek
MT7922 WiFi")?
I guess I'm just looking for some text more specific than "undefined
state".
Can we get any of the MediaTek folks to comment on this:
https://sashiko.dev/#/patchset/20260508145153.717641-1-jtornosm@redhat.com?part=1
Sashiko suggested that Device ID 0x0717 might have the same FLR
problem.
> Disable FLR for this device so the PCI core falls back to working reset
> methods (PM reset or bus reset).
>
> This follows the existing pattern used for the MediaTek MT7922 WiFi
> (14c3:0616), which is the predecessor device and already uses this quirk.
>
> Signed-off-by: Jose Ignacio Tornos Martinez <jtornosm@redhat.com>
> ---
> v3: Resend with MediaTek wireless maintainers CC'd
> v2: https://lore.kernel.org/all/20260508145153.717641-1-jtornosm@redhat.com/
>
> drivers/pci/quirks.c | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/drivers/pci/quirks.c b/drivers/pci/quirks.c
> index 000000000000..111111111111 100644
> --- a/drivers/pci/quirks.c
> +++ b/drivers/pci/quirks.c
> @@ -5607,6 +5607,7 @@
> * Intel 82579LM Gigabit Ethernet Controller 0x1502
> * Intel 82579V Gigabit Ethernet Controller 0x1503
> * Mediatek MT7922 802.11ax PCI Express Wireless Network Adapter
> + * Mediatek MT7925 802.11be PCI Express Wireless Network Adapter
> */
> static void quirk_no_flr(struct pci_dev *dev)
> {
> @@ -5617,6 +5618,7 @@ DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_AMD, 0x7901, quirk_no_flr);
> DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_INTEL, 0x1502, quirk_no_flr);
> DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_INTEL, 0x1503, quirk_no_flr);
> DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_MEDIATEK, 0x0616, quirk_no_flr);
> +DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_MEDIATEK, 0x7925, quirk_no_flr);
>
> /* FLR may cause the SolidRun SNET DPU (rev 0x1) to hang */
> static void quirk_no_flr_snet(struct pci_dev *dev)
> --
> 2.53.0
>
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: [PATCH v3] PCI: Disable broken FLR on MediaTek MT7925
2026-05-21 16:19 ` Bjorn Helgaas
@ 2026-05-22 6:48 ` Jose Ignacio Tornos Martinez
0 siblings, 0 replies; 3+ messages in thread
From: Jose Ignacio Tornos Martinez @ 2026-05-22 6:48 UTC (permalink / raw)
To: helgaas
Cc: Ryder.Lee, alex, bhelgaas, jtornosm, linux-kernel, linux-pci,
linux-wireless, lorenzo, nbd, sean.wang, shayne.chen
Hello Bjorn,
Thank you for the feedback.
> How do we know the device is an "undefined state"? Does it just not
> respond to config accesses? Is there something in dmesg that shows
> the problem?
> I suppose it's similar to 81f64e925c29 ("PCI: Avoid FLR for Mediatek
> MT7922 WiFi")?
> I guess I'm just looking for some text more specific than "undefined
> state".
You're right, "undefined state" is too vague.
I can prepare v4 with what I've seen is happening . The
symptoms are similar to MT7922 but not identical:
**First VM start (works fine):**
mt7925e 0000:08:00.0: ASIC revision: 79250000
mt7925e 0000:08:00.0: WM Firmware Version: ____000000, Build Time: 20260106153120
**After force reset/VM crash (FLR attempted, firmware communication broken):**
mt7925e 0000:08:00.0: ASIC revision: 79250000
mt7925e 0000:08:00.0: Message 00000010 (seq 1) timeout
mt7925e 0000:08:00.0: Failed to get patch semaphore
(Repeats 10 times with increasing seq numbers)
mt7925e 0000:08:00.0: hardware init failed
Unlike MT7922 which shows config read failures, MT7925e config reads work
correctly after FLR (lspci shows all capabilities). However, firmware
communication is broken - the driver cannot acquire the patch semaphore
needed for firmware initialization. The device remains broken until
physical power cycle.
Secondary Bus Reset (fallback after quirk_no_flr) successfully resets the
device and allows reinitialization.
> Can we get any of the MediaTek folks to comment on this:
> https://sashiko.dev/#/patchset/20260508145153.717641-1-jtornosm@redhat.com?part=1
>
> Sashiko suggested that Device ID 0x0717 might have the same FLR
> problem.
I don't have that device to confirm the same behavior. I'll wait for
MediaTek maintainers (now CC'd) to confirm whether 0x0717 exhibits the
same FLR issue. If confirmed, I can add it in a follow-up patch or the
next version.
Thanks
Best regards
José Ignacio
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2026-05-22 6:49 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-05-21 6:12 [PATCH v3] PCI: Disable broken FLR on MediaTek MT7925 Jose Ignacio Tornos Martinez
2026-05-21 16:19 ` Bjorn Helgaas
2026-05-22 6:48 ` Jose Ignacio Tornos Martinez
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox