Bug 1214133

Summary: bluetooth disabled after update to 20230808, firmware load for mediatek/BT_RAM_CODE_MT7922_1_1_hdr.bin failes
Product: [openSUSE] openSUSE Tumbleweed Reporter: Jürgen Hofmann <hofmann>
Component: KernelAssignee: openSUSE Kernel Bugs <kernel-bugs>
Status: IN_PROGRESS --- QA Contact: E-mail List <qa-bugs>
Severity: Normal    
Priority: P5 - None CC: andrea.ippo, hofmann, suse.omit097, tiwai
Version: Current   
Target Milestone: ---   
Hardware: Other   
OS: Other   
Whiteboard:
Found By: --- Services Priority:
Business Priority: Blocker: ---
Marketing QA Status: --- IT Deployment: ---
Attachments: dmesg on TW 20230808
dmesg on TW 20230808

Description Jürgen Hofmann 2023-08-09 21:00:12 UTC
Created attachment 868726 [details]
dmesg on TW 20230808

After update to Tumbleweed 20230808 bluetooth is disabled and can not be enabled again.

dmesg | grep luetooth  (on TW 20230806)

[    6.098671] Bluetooth: Core ver 2.22
[    6.098681] Bluetooth: HCI device and connection manager initialized
[    6.098683] Bluetooth: HCI socket layer initialized
[    6.098684] Bluetooth: L2CAP socket layer initialized
[    6.098685] Bluetooth: SCO socket layer initialized
[   26.836464] Bluetooth: hci0: Device setup in 20228164 usecs
[   26.836469] Bluetooth: hci0: HCI Enhanced Setup Synchronous Connection command is advertised, but not supported.
[   27.115864] Bluetooth: hci0: AOSP extensions version v1.00
[   27.115870] Bluetooth: hci0: AOSP quality report is supported


dmesg | grep luetooth  (on TW 20230808)

[    4.355787] Bluetooth: Core ver 2.22
[    4.355794] Bluetooth: HCI device and connection manager initialized
[    4.355797] Bluetooth: HCI socket layer initialized
[    4.355798] Bluetooth: L2CAP socket layer initialized
[    4.355799] Bluetooth: SCO socket layer initialized
[    4.368031] bluetooth hci0: Direct firmware load for mediatek/BT_RAM_CODE_MT7922_1_1_hdr.bin failed with error -2
[    4.368034] Bluetooth: hci0: Failed to load firmware file (-2)
[    4.368045] Bluetooth: hci0: Failed to set up firmware (-2)
[    4.368053] Bluetooth: hci0: HCI Enhanced Setup Synchronous Connection command is advertised, but not supported.
[    4.438485] Bluetooth: BNEP (Ethernet Emulation) ver 1.3
[    4.438487] Bluetooth: BNEP filters: protocol multicast
[    4.438489] Bluetooth: BNEP socket layer initialized

unfortunately I can not say if it was working in TW 20230807
Comment 1 Jürgen Hofmann 2023-08-09 21:00:55 UTC
Created attachment 868727 [details]
dmesg on TW 20230808
Comment 2 Takashi Iwai 2023-08-10 06:50:13 UTC
Might it bluetooth module loaded in initrd by some reason in the latest boot?
Check the contents of lsinitrd for both cases.
Comment 3 Jürgen Hofmann 2023-08-10 09:28:55 UTC
Thanks for your support. In fact diff -y initrd_20230806 initrd_20230808 shows the addition of dbus and bluetooth modul. The 20230806 was the initial install. I installed additional packages afterwards but bluetooth kept working until update to 20230808 (but probably I did not reboot often). Is loading of the bluetooth modul in initrd wrong or unexpected?


Image: /boot/initrd-6.4.8-1-default: 46M                      | Image: /boot/initrd-6.4.8-1-default: 59M
=============================================================   =============================================================
Early CPIO image                                                Early CPIO image
=============================================================   =============================================================
drwxr-xr-x   2 root     root            0 Aug  4 16:07 .        drwxr-xr-x   2 root     root            0 Aug  4 16:07 .
-rw-r--r--   1 root     root            2 Aug  4 16:07 early_   -rw-r--r--   1 root     root            2 Aug  4 16:07 early_
drwxr-xr-x   2 root     root            0 Aug  4 16:07 kernel   drwxr-xr-x   2 root     root            0 Aug  4 16:07 kernel
drwxr-xr-x   2 root     root            0 Aug  4 16:07 kernel   drwxr-xr-x   2 root     root            0 Aug  4 16:07 kernel
drwxr-xr-x   2 root     root            0 Aug  4 16:07 kernel   drwxr-xr-x   2 root     root            0 Aug  4 16:07 kernel
-rw-r--r--   1 root     root        16804 Aug  4 16:07 kernel   -rw-r--r--   1 root     root        16804 Aug  4 16:07 kernel
=============================================================   =============================================================
Version: dracut-059+suse.488.g81715832-1.1                      Version: dracut-059+suse.488.g81715832-1.1

Arguments:  --kver '6.4.8-1-default' --force                  | Arguments:  --kver '6.4.8-1-default' -f

dracut modules:                                                 dracut modules:
systemd                                                         systemd
systemd-initrd                                                  systemd-initrd
                                                              > dbus-daemon
                                                              > dbus
i18n                                                            i18n
drm                                                             drm
plymouth                                                        plymouth
                                                              > bluetooth
btrfs                                                           btrfs
dm                                                              dm
kernel-modules                                                  kernel-modules
kernel-modules-extra                                            kernel-modules-extra
lvm                                                             lvm
resume                                                          resume
rootfs-block                                                    rootfs-block
suse-btrfs                                                      suse-btrfs
suse-xfs                                                        suse-xfs
terminfo                                                        terminfo
udev-rules                                                      udev-rules
dracut-systemd                                                  dracut-systemd
ostree                                                          ostree
usrmount                                                        usrmount
base                                                            base
fs-lib                                                          fs-lib
shutdown                                                        shutdown
suse                                                            suse
suse-initrd                                                     suse-initrd
Comment 4 Jürgen Hofmann 2023-08-10 10:46:13 UTC
I guess the problem popped up, because I attached a bluetooth keyboard, which was not present at the initial install.
Comment 5 Jürgen Hofmann 2023-08-10 11:28:54 UTC
It seems that the MT7922 is not present in initrd but only MT7961.

lsinitrd | grep BT_RAM_CODE
-rw-r--r--   1 root     root       343052 Aug  3 17:36 usr/lib/firmware/mediatek/BT_RAM_CODE_MT7961_1_2_hdr.bin.xz

ls -l /usr/lib/firmware/mediatek/BT_RAM_CODE*
-rw-r--r-- 1 root root 512104  3. Aug 17:36 /usr/lib/firmware/mediatek/BT_RAM_CODE_MT7922_1_1_hdr.bin.xz
-rw-r--r-- 1 root root 343052  3. Aug 17:36 /usr/lib/firmware/mediatek/BT_RAM_CODE_MT7961_1_2_hdr.bin.xz

Is there an eays way to add it without breaking things (dracut?)?
Comment 6 Takashi Iwai 2023-08-10 12:02:16 UTC
(In reply to Jürgen Hofmann from comment #4)
> I guess the problem popped up, because I attached a bluetooth keyboard,
> which was not present at the initial install.

That makes sense.  Then dracut tries to import the BT stuff in initrd.
The problem is that initrd didn't take the required firmware in initrd, likely because the module didn't list up the file in modinfo.  It's a sort of driver bug.

As a workaround, you can put the missing firmware manually into initrd.
Create a file in /etc/dracut.conf.d/ (e.g. /etc/dracut.conf.d/50-bt.conf) containing a line:
  install_items+=" /usr/lib/firmware/BT_RAM_CODE_MT7922_1_1_hdr.bin.xz"

And rebuilt initrd.
Comment 7 Jürgen Hofmann 2023-08-10 14:02:00 UTC
> The problem is that initrd didn't take the required firmware in initrd,
> likely because the module didn't list up the file in modinfo.  It's a sort
> of driver bug.

Where and how should this bug be reported then? Am I supposed to do that?


> As a workaround, you can put the missing firmware manually into initrd.
> Create a file in /etc/dracut.conf.d/ (e.g. /etc/dracut.conf.d/50-bt.conf)
> containing a line:
>   install_items+=" /usr/lib/firmware/BT_RAM_CODE_MT7922_1_1_hdr.bin.xz"
> 
> And rebuilt initrd.

Thank you, that did the trick!
Comment 8 Takashi Iwai 2023-08-10 14:05:25 UTC
(In reply to Jürgen Hofmann from comment #7)
> > The problem is that initrd didn't take the required firmware in initrd,
> > likely because the module didn't list up the file in modinfo.  It's a sort
> > of driver bug.
> 
> Where and how should this bug be reported then? Am I supposed to do that?

At best, you report to the upstream devs.  For a BT, linux-bluetooth ML.
A secondary option would be to report to bugzilla.kernel.org, but it's often overlooked.  In either way, you can put me (tiwai@usse.de) to Cc.
Comment 9 Badke 2024-02-25 11:21:43 UTC
For me it's now the same problem, starting with one of the February-Snapshots. In January my bluetooth adapter still worked. Unfortunately I cannot specify the last snapshot where it worked.

I didn't plug in any bluetooth adapter or keyboard. I just want to use my headphones with mouse and keyboard via the internal adapter (MT7922).

The command outputs are comparable to the first reporter's (see below). My machine is an HP elitebook 845 G10 with Ryzen 8740HS and Radeon 780M Graphics 64GB RAM, if that helps in any way.
Seeing myself as a junior-amateur in handling linux, but a complete rookie regarding Bug reports, do you have any suggestion to solve the problem for me? Would it be a technically safe way to manually import the firmware and rebuild initrd myself, as you mentioned before? Is this procedure compatbible with further upgrades? Or should I rather wait, until the problem is resolved?
Unfortunately a downgrade to Leap or Slowroll is not an Option for me (Bluetooth not supprted on Leap, since Kernel is too old, and Slowroll shows the same Bluetooth bug).

Let me know, if I can help with additional information.

Thanks for advice.



dmesg | grep luetooth

[    3.199354] Bluetooth: Core ver 2.22
[    3.199385] Bluetooth: HCI device and connection manager initialized
[    3.199393] Bluetooth: HCI socket layer initialized
[    3.199396] Bluetooth: L2CAP socket layer initialized
[    3.199398] Bluetooth: SCO socket layer initialized
[    3.204375] bluetooth hci0: Direct firmware load for mediatek/BT_RAM_CODE_MT7922_1_1_hdr.bin failed with error -2
[    3.204381] Bluetooth: hci0: Failed to load firmware file (-2)
[    3.204391] Bluetooth: hci0: Failed to set up firmware (-2)
[    3.204398] Bluetooth: hci0: HCI Enhanced Setup Synchronous Connection command is advertised, but not supported.
[    3.261655] Bluetooth: BNEP (Ethernet Emulation) ver 1.3
[    3.261657] Bluetooth: BNEP filters: protocol multicast
[    3.261661] Bluetooth: BNEP socket layer initialized


lsinitrd | grep BT_RAM_CODE

-rw-r--r--   1 root     root       343196 Feb 15 22:08 usr/lib/firmware/mediatek/BT_RAM_CODE_MT7961_1_2_hdr.bin.xz
-rw-r--r--   1 root     root       446012 Feb 15 22:08 usr/lib/firmware/mediatek/mt7925/BT_RAM_CODE_MT7925_1_1_hdr.bin.xz


ls -l /usr/lib/firmware/mediatek/BT_RAM_CODE*

-rw-r--r-- 1 root root 513960 23. Feb 17:25 /usr/lib/firmware/mediatek/BT_RAM_CODE_MT7922_1_1_hdr.bin.xz
-rw-r--r-- 1 root root 343196 23. Feb 17:25 /usr/lib/firmware/mediatek/BT_RAM_CODE_MT7961_1_2_hdr.bin.xz
Comment 10 Takashi Iwai 2024-02-27 10:29:08 UTC
OK, I'm going to submit a simple patch to add the missing MODULE_FIRMWARE entry for MT7922.  This should fix the problem.
Comment 11 Takashi Iwai 2024-02-27 10:31:13 UTC
The upstream submission
  https://lore.kernel.org/all/20240227102914.8341-1-tiwai@suse.de/
Comment 12 Antonio Feijoo 2024-03-04 14:39:43 UTC
*** Bug 1220888 has been marked as a duplicate of this bug. ***