All of lore.kernel.org
 help / color / mirror / Atom feed
From: Alberto Garcia <berto@igalia.com>
To: linux-bluetooth@vger.kernel.org
Cc: Alberto Garcia <berto@igalia.com>,
	Marcel Holtmann <marcel@holtmann.org>,
	Luiz Augusto von Dentz <luiz.dentz@gmail.com>,
	Matthias Brugger <matthias.bgg@gmail.com>,
	AngeloGioacchino Del Regno
	<angelogioacchino.delregno@collabora.com>
Subject: [RFC PATCH 0/1] Bluetooth: btmtk: add USB autopm support to btmtk_usb_setup()
Date: Tue, 24 Mar 2026 11:34:03 +0100	[thread overview]
Message-ID: <cover.1774348119.git.berto@igalia.com> (raw)

Hello,

I've been having problems with the btmtk bluetooth driver for a long
time. What happens is a failure during initialization and the loading
of the firmware, with errors like these:

   kernel: Bluetooth: hci0: Failed to get device id (-108)
   kernel: Bluetooth: hci0: Failed to get fw version (-108)

The device is MediaTek MT7921 (0489:e0cd), there are more details in
this bug report:

   https://bugzilla.kernel.org/show_bug.cgi?id=217475

Passing btusb.enable_autosuspend=n seems to solve the problem for me.
My computer's hard drive is encrypted so it can take a long time
before the bluetooth firmware is loaded, so I interpret that this
causes the device to autosuspend during boot and that's why
initialization fails. Does that make sense?

I saw that commit 67dba2c28fe0 fixed similar errors during shutdown by
using usb_autopm_get_interface() so I tried the same approach for the
btusb_mtk_setup() function. I confirm that this solves the problem for
me and with this patch the bluetooth adapter works reliably.

I was also suggested to try the simpler approach of using setup_on_usb
instead:

        if (IS_ENABLED(CONFIG_BT_HCIBTUSB_MTK) &&
            (id->driver_info & BTUSB_MEDIATEK)) {
-               hdev->setup = btusb_mtk_setup;
+               data->setup_on_usb = btusb_mtk_setup;
                hdev->shutdown = btusb_mtk_shutdown;
                hdev->manufacturer = 70;

However this does not solve the problem:

   kernel: usbcore: registered new interface driver btusb
   kernel: Bluetooth: hci0: HW/SW Version: 0x008a008a, Build Time: 20241106151414
   kernel: Bluetooth: hci0: Execution of wmt command timed out
   kernel: Bluetooth: hci0: Failed to send wmt patch dwnld (-110)
   kernel: Bluetooth: hci0: Failed to set up firmware (-110)

So I would like to know if a patch like the one I'm sending is a good
approach or if I should try something else.

Regards,

Berto

Alberto Garcia (1):
  Bluetooth: btmtk: add USB autopm support to btmtk_usb_setup()

 drivers/bluetooth/btmtk.c | 17 ++++++++++++++++-
 1 file changed, 16 insertions(+), 1 deletion(-)

-- 
2.47.3


             reply	other threads:[~2026-03-24 10:34 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-03-24 10:34 Alberto Garcia [this message]
2026-03-24 10:34 ` [RFC PATCH 1/1] Bluetooth: btmtk: add USB autopm support to btmtk_usb_setup() Alberto Garcia
2026-03-24 11:06   ` bluez.test.bot
2026-04-09 20:02   ` bluez.test.bot

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=cover.1774348119.git.berto@igalia.com \
    --to=berto@igalia.com \
    --cc=angelogioacchino.delregno@collabora.com \
    --cc=linux-bluetooth@vger.kernel.org \
    --cc=luiz.dentz@gmail.com \
    --cc=marcel@holtmann.org \
    --cc=matthias.bgg@gmail.com \
    /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 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.