[PATCH v2] Bluetooth: Properly disable remote wakeup for MT7922/MT7925 on Ryzen platform
Rong Zhang
i at rong.moe
Wed Dec 2 04:07:21 PST 2026
Hi Chris, Rafael, Luiz,
On Fri, 2026-07-24 at 09:54 +0000, Chris Lu (陸稚泓) wrote:
> Hi Rong,
>
> Sorry for not getting back you sooner,
> MediaTek BT team is currently looking for an AMD platform that can
> reproduce this issue, but we haven't found a environment which has
> similar problem.
I did some more experiments about the issue. Now I really believe the
issue has nothing to do with AMD's root hubs.
I bought a M.2 Key M to Key E adapter to connect the exact same NIC via a
Thunderbolt to NVMe adapter (JHL7440 based), so that I don't need to
power cycle the whole platform to make it recover.
The Key M to Key E adapter provides a dedicated USB cable for Bluetooth.
In this case I am able to physically replug the Bluetooth interface.
Bluetooth on the SoC's USB root hub
===================================
The issue can be reliably reproduced in this setup, no matter whether the
WLAN interface (i.e., PCIe) is enabled.
+--------+ Thunderbolt +-----------+ PCIe +-----------+ PCIe, 3V3 +---------+
| Laptop | ============= | M.2 Key M | ====== | M.2 Key E | =========== | MT7925e |
+--------+ 5V +-----------+ 3V3 +-----------+ USB 2.0 +---------+
|| ||
++=============================================++
USB 2.0
Once the Bluetooth interface is dead, physically replugging the USB cable
or connecting it to an external hub makes no difference, i.e., leads to
enumeration failure again. The USB port/hub itself works totally fine
when plugging other devices.
The only way to make it recover is to power cycle the MT7925e. This can
be done by replugging the Thunderbolt to NVMe adapter.
Bluetooth on the PCH's USB root hub
===================================
I have an AMD Promontory 21 chipset (i.e., the PCH of B650/X670/X870
motherboards) add-in card [1], and I successfully reproduced the same
issue on its USB root hub, with completely the same symptoms.
[1]: https://oshwhub.com/wesd/b650
+-----------------+
++== | AHCI controller |
|| +-----------------+
||
+------------+ 12V || +-----------------+
| AC adapter | ====================================++ ++== | xHCI controller | ==++
+------------+ || internal PCIe || +-----------------+ ||
|| || ||
+--------+ Thunderbolt +-----------+ PCIe +-----------+ PCIe +-------------------------------+ ||
| Laptop | ============= | M.2 Key M | ====== | PCIe slot | ========== | AMD Promontory 21 add-in card | ||
+--------+ 5V +-----------+ 3V3 +-----------+ 3V3, 12V +-------------------------------+ ||
PCIe || 3V3 ||
|| ||
++==========++==========++ || USB 2.0
|| || ||
+-----------+ +-----------+ ||
| M.2 Key M | | M.2 Key M | ||
+-----------+ +-----------+ ||
PCIe || 3V3 ||
|| ||
+-----------+ ||
| M.2 Key E | ==++
+-----------+
PCIe || USB 2.0
3V3 ||
+---------+
| MT9725e |
+---------+
Bluetooth on an external USB HS hub
===================================
By inserting an external USB HS hub (or a chain of multiple hubs) to both
setups above, the issue can still be reproducible reliably with
completely the same symptoms.
However, as long as the last hub connects to at least one HS device other
than MT7925e, the issue becomes hardly reproducible. Having other LS/FS
devices makes no difference, i.e., still reliably reproducible.
In short, when the last hub connects to
- only MT7925e: reproducible
- MT7925e + FS/LS device(s): reproducible
- MT7925e + HS device(s): irreproducible
- MT7925e + HS + FS/LS: irreproducible
This matches my daily setup in office exactly. My laptop's M.2 Key E
slot's USB shares the same root hub with all external USB ports, except
for the Thunderbolt port.
My setup in office is MT7925e + an FS device:
- USB root hub
- MT7925e
- Logitecc Unifying Receiver (FS)
- Thunderbolt port (w/ dedicated USB root hub)
- Thunderbolt dock
- ...
My setup at home is MT7925e + HS + FS:
- USB root hub
- MT7925e
- Logitecc Unifying Receiver (FS)
- USB dock (SS + HS)
- ...
- Thunderbolt port (w/ dedicated USB root hub)
- nothing
I assume this is one of the reasons why the same device behaves
differently in office and at home.
Inspecting with oscilloscope and logic analyzer
===============================================
Once I triggered the issue, I replugged the device with an oscilloscope
or logic analyzer attached.
The oscilloscope showed that MT7925e successfully finished the HS
negotiation, so the device's USB PHY have nothing to do with the failure.
My oscilloscope and logic analyzer don't have enough bandwidth to capture
HS signals, so I must downgrade the speed to FS to capture USB signals.
xHCI manages HS/FS/LS in hardware, so downgrading to FS in software is
impossible and an FS hub is needed.
It's hard to find USB FS hubs nowadays but some manufacturers are still
producing them, so I managed to buy a new one. It was surprisingly cheap,
i.e., less than $1. With it, I was able to force the device to run in FS
mode, so that I could attach a logic analyzer.
Surprisingly, the device's SIE was also functioning. It ACKed every SETUP
request (GET_DESCRIPTOR), but NAKed every IN request (to read the
descriptor).
I also successfully reproduced the autosuspend issue on this hub, with
only MT7925e plugged to the hub. I haven't tried plugging other device to
the same hub though.
Conclusion
==========
The issue is reproducible on AMD's root hub and external SS/HS/FS hubs.
The USB PHY and SIE still functions properly, so it's very likely a
firmware or MCU issue.
It's irreproducible when the same hub connects to other HS devices, so I
recommend MediaTek folks to try to reproduce the issue without any other
device on the same hub, i.e., ensure MT7925e is the only device on the
hub.
Still, it remains unclear whether the issue exists on other USB
controllers. Unfortunately, I don't have any Intel platform or
xHCI/EHCI/OHCI add-in card for the time being, but I believe the USB root
hub should be anyway irrelevant to the issue as long as the issue is
reproducible when chaining a lot of external hubs.
Thanks,
Rong
>
> About the patch, LGTM.
> Your change can limit setting wakeup up capable to false to platform
> with X86_FEATURE_ZEN. I also tried this patch locally with Arm-based
> platform and it successfully avoids the issue of incorrectly disable BT
> wakeup.
>
> Thanks,
> Chris Lu
>
> On Thu, 2026-07-23 at 21:38 +0800, Rong Zhang wrote:
> >
> > External email : Please do not click links or open attachments until
> > you have verified the sender or the content.
> >
> >
> > Hi Luiz, Chris,
> >
> > Could you kindly take a look at the patch?
> >
> > Thanks,
> > Rong
> >
> > On Wed, 2026-07-01 at 23:43 +0800, Rong Zhang wrote:
> > > It is reported that a remote wakeup could cause MT7922/MT7925's
> > > btusb
> > > interface completely unresponsive. Resetting the xHCI root hub
> > > doesn't
> > > help at all, and recovering from such a state needs a power cycle.
> > >
> > > All reports seen to be relevant to Ryzen-based laptops. These NICs
> > > are
> > > usually used as OEM components thanks to some sort of reference
> > > designs.
> > > Their popularity on other platforms is unclear. While there is
> > > still a
> > > chance that the quirk may exist on other platforms, be cautious and
> > > only
> > > apply the quirk to direct children of Ryzen platforms's root hubs
> > > for
> > > the time being. In most cases the root hub is on the SoC or PCH,
> > > which
> > > needs the quirk. Unfortunately, this can't distinguish root hubs on
> > > PCIe
> > > add-in cards. Such roughness should be acceptable, as PCIe USB
> > > controller add-in cards are less commonly used nowadays. On the
> > > other
> > > hand, applying the quirk doesn't hurt any functionalities either,
> > > as the
> > > device can still be used as a wakeup source if desired.
> > > Theoretically,
> > > we could retrieve the root hub's PCI vendor ID with some hierarchy
> > > magic, but that's too intrusive...
> > >
> > > Meanwhile, though device_set_wakeup_capable(false) is the correct
> > > fix
> > > for other NICs with fake remote wakeup capabilities, doing so for
> > > MT7922/MT7925 effectively prevents it from being used as wakeup
> > > sources as per userspace requests. Hence, return -EBUSY on runtime
> > > suspend to prevent the interface from being autosuspended while
> > > it's
> > > still opened, which has the same effect as
> > > device_set_wakeup_capable(false), since disabling remote wakeup
> > > simply
> > > causes the USB core to gate runtime autosuspend as well due to
> > > needs_remote_wakeup == 1. The interface can be safely autosuspended
> > > as
> > > long as remote wakeup is disabled, i.e., after closing the HCI
> > > device.
> > >
> > > Specifically, the interface may still take the advantage of remote
> > > wakeup in order to wake up the system from sleep if userspace has
> > > enabled it as a wakeup source.
> > >
> > > Fixes: e31d761628ad ("Bluetooth: btmtk: Disable remote wakeup for
> > > MT7922/MT7925")
> > > Signed-off-by: Rong Zhang <i at rong.moe>
> > > ---
> > > Changes in v2:
> > > - Only apply the quirk to to direct children of Ryzen platforms's
> > > root
> > > hubs
> > > - Theoretically, we could retrieve the root hub's PCI vendor ID
> > > with
> > > some hierarchy magic to further limit the range down to only
> > > root
> > > hubs on the SoC or PCH, but that's too intrusive -- the
> > > hierarchy
> > > magic really made me nervous once I saw what I have wrote, so I
> > > gave
> > > it up
> > > - Link to v1:
> > > https://urldefense.com/v3/__https://patch.msgid.link/20260629-btmtk-ryzen-remote-wakeup-v1-1-1d2f1cee6d22@rong.moe__;!!CTRNKA9wMg0ARbw!iS1xt56hol42azIYmHUZP_NI-N6WX6yn7_A1lf72MMvo1ZG_CNJRRSLgAbMx_AWK4kGyC2yBMQ$
> > > ---
> > > drivers/bluetooth/btmtk.c | 10 -------
> > > drivers/bluetooth/btusb.c | 73
> > > ++++++++++++++++++++++++++++++++++++++++++++---
> > > 2 files changed, 69 insertions(+), 14 deletions(-)
> > >
> > > diff --git a/drivers/bluetooth/btmtk.c b/drivers/bluetooth/btmtk.c
> > > index 02a96342e964..4614434dd57b 100644
> > > --- a/drivers/bluetooth/btmtk.c
> > > +++ b/drivers/bluetooth/btmtk.c
> > > @@ -1381,16 +1381,6 @@ int btmtk_usb_setup(struct hci_dev *hdev)
> > > break;
> > > case 0x7922:
> > > case 0x7925:
> > > - /*
> > > - * A remote wakeup could cause the device completely
> > > unresponsive, and
> > > - * recovering from such a state needs a power cycle.
> > > - *
> > > - * Since the remote wakeup capability is super
> > > broken, just disable it
> > > - * to get rid of the troubles. The device can still
> > > be autosuspended
> > > - * when the bluetooth interface is closed.
> > > - */
> > > - device_set_wakeup_capable(&btmtk_data->udev->dev,
> > > false);
> > > - fallthrough;
> > > case 0x7961:
> > > case 0x7902:
> > > case 0x6639:
> > > diff --git a/drivers/bluetooth/btusb.c b/drivers/bluetooth/btusb.c
> > > index 08c0a99a62c5..eef6e3b43bf9 100644
> > > --- a/drivers/bluetooth/btusb.c
> > > +++ b/drivers/bluetooth/btusb.c
> > > @@ -6,6 +6,7 @@
> > > * Copyright (C) 2005-2008 Marcel Holtmann <marcel at holtmann.org>
> > > */
> > >
> > > +#include <linux/cpufeature.h>
> > > #include <linux/dmi.h>
> > > #include <linux/module.h>
> > > #include <linux/usb.h>
> > > @@ -957,6 +958,7 @@ struct qca_dump_info {
> > > #define BTUSB_USE_ALT3_FOR_WBS 15
> > > #define BTUSB_ALT6_CONTINUOUS_TX 16
> > > #define BTUSB_HW_SSR_ACTIVE 17
> > > +#define BTUSB_WAKEUP_BROKEN 18
> > >
> > > struct btusb_data {
> > > struct hci_dev *hdev;
> > > @@ -2936,10 +2938,25 @@ static int btusb_send_frame_mtk(struct
> > > hci_dev *hdev, struct sk_buff *skb)
> > > }
> > > }
> > >
> > > +static inline bool platform_is_ryzen(void)
> > > +{
> > > +#ifdef CONFIG_X86
> > > + return boot_cpu_has(X86_FEATURE_ZEN);
> > > +#else
> > > + return false;
> > > +#endif
> > > +}
> > > +
> > > +static inline bool is_direct_child_of_root_hub(struct usb_device
> > > *udev)
> > > +{
> > > + return udev->parent == udev->bus->root_hub;
> > > +}
> > > +
> > > static int btusb_mtk_setup(struct hci_dev *hdev)
> > > {
> > > struct btusb_data *data = hci_get_drvdata(hdev);
> > > struct btmtk_data *btmtk_data = hci_get_priv(hdev);
> > > + int err;
> > >
> > > /* MediaTek WMT vendor cmd requiring below USB resources to
> > > * complete the handshake.
> > > @@ -2956,7 +2973,40 @@ static int btusb_mtk_setup(struct hci_dev
> > > *hdev)
> > > btusb_mtk_claim_iso_intf(data);
> > > }
> > >
> > > - return btmtk_usb_setup(hdev);
> > > + err = btmtk_usb_setup(hdev);
> > > + if (err)
> > > + return err;
> > > +
> > > + switch (btmtk_data->dev_id) {
> > > + case 0x7922:
> > > + case 0x7925:
> > > + /*
> > > + * All reports seen to be relevant to Ryzen-based
> > > laptops. These
> > > + * NICs are usually used as OEM components thanks to
> > > some sort
> > > + * of reference designs.
> > > + *
> > > + * Their popularity on other platforms is unclear.
> > > While there
> > > + * is still a chance that the quirk may exist on
> > > other
> > > + * platforms, be cautious and only apply the quirk to
> > > direct
> > > + * children of Ryzen platforms's root hubs for the
> > > time being.
> > > + *
> > > + * In most cases the root hub is on the SoC or PCH,
> > > which needs
> > > + * the quirk. Unfortunately, this can't distinguish
> > > root hubs on
> > > + * PCIe add-in cards. Such roughness should be
> > > acceptable, as
> > > + * PCIe USB controller add-in cards are less commonly
> > > used
> > > + * nowadays. On the other hand, applying the quirk
> > > doesn't hurt
> > > + * any functionalities either, as the device can
> > > still be used
> > > + * as a wakeup source if desired.
> > > + *
> > > + * Theoretically, we could retrieve the root hub's
> > > PCI vendor ID
> > > + * with some hierarchy magic, but that's too
> > > intrusive...
> > > + */
> > > + if (platform_is_ryzen() &&
> > > is_direct_child_of_root_hub(data->udev))
> > > + set_bit(BTUSB_WAKEUP_BROKEN, &data->flags);
> > > + break;
> > > + }
> > > +
> > > + return 0;
> > > }
> > >
> > > static int btusb_mtk_shutdown(struct hci_dev *hdev)
> > > @@ -4532,11 +4582,26 @@ static int btusb_suspend(struct
> > > usb_interface *intf, pm_message_t message)
> > >
> > > BT_DBG("intf %p", intf);
> > >
> > > - /* Don't auto-suspend if there are connections or discovery
> > > in
> > > - * progress; external suspend calls shall never fail.
> > > + /*
> > > + * It is reported that remote wakeup events could sometimes
> > > cause some
> > > + * adapters completely unresponsive. Resetting the xHCI root
> > > hub doesn't
> > > + * help at all, and recovering from such a state needs a
> > > power cycle.
> > > + * Since disabling remote wakeup simply causes the USB core
> > > to gate
> > > + * runtime autosuspend as well due to needs_remote_wakeup ==
> > > 1, let's do
> > > + * this ourselves to make our life easier. The interface can
> > > be safely
> > > + * autosuspended as long as remote wakeup is disabled, i.e.,
> > > after
> > > + * closing the HCI device.
> > > + *
> > > + * Don't auto-suspend if there are connections or discovery
> > > in progress.
> > > + *
> > > + * External suspend calls shall never fail. Specifically, a
> > > device with
> > > + * broken remote wakeup may still take the advantage of
> > > remote wakeup in
> > > + * order to wake up the system from sleep if userspace has
> > > enabled it as
> > > + * a wakeup source.
> > > */
> > > if (PMSG_IS_AUTO(message) &&
> > > - (hci_conn_count(data->hdev) || hci_discovery_active(data-
> > > > hdev)))
> > > + ((test_bit(BTUSB_WAKEUP_BROKEN, &data->flags) && data-
> > > > intf->needs_remote_wakeup) ||
> > > + hci_conn_count(data->hdev) || hci_discovery_active(data-
> > > > hdev)))
> > > return -EBUSY;
> > >
> > > if (data->suspend_count++)
> > >
> > > ---
> > > base-commit: dc59e4fea9d83f03bad6bddf3fa2e52491777482
> > > change-id: 230ba8c9-btmtk-ryzen-remote-wakeup-055a407682ef
> > >
> > > Thanks,
> > > Rong
More information about the linux-arm-kernel
mailing list