bluetooth controller not detected with 4.15 kernel
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
linux (Ubuntu) |
Fix Released
|
Undecided
|
Unassigned | ||
Bionic |
Fix Released
|
Medium
|
Unassigned | ||
Cosmic |
Fix Released
|
Medium
|
Unassigned | ||
linux-snapdragon (Ubuntu) |
Invalid
|
Undecided
|
Unassigned | ||
Bionic |
Fix Released
|
Undecided
|
Unassigned | ||
Cosmic |
Invalid
|
Undecided
|
Unassigned |
Bug Description
Impact:
Upon boot, no hci device is available to userspace, thus bluetooth communication is not possible.
Defect analysis:
The root of the problem lies in these two patches:
$ git log --online drivers/
...
766154b Bluetooth: btqcomsmd: retrieve BD address from DT property
6e51811 Bluetooth: btqcomsmd: Add support for BD address setup
...
Qualcomm engineer found that btqcomsmd had no BD address burned in (nor via ROM, neither internally) and it was always coming up with the same address, probably derived from manufacturer ID and / or chip ID.
To fix this, they pushed the burden of generating a unique per-board BD address to the Qualcomm bootloader and make it pass down via DTB to the live kernel - and if no address was present in the DTB, the hci was left unconfigured.
Fix:
So *technically* speaking, the kernel is correct in this case, it's our dragonboard image (e.g. Ubuntu Core) that doesn't extract the generated BD address from the Qualcomm bootloader and pass it down to the kernel.
On the other hand, having Bluetooth working out of the box (even with a dummy address), is a nice feature to have, so i slightly modified Qualcomm's code introduced in the two above patches, and made the lack of BD address in DTB non fatal:
if BD_is_present_
read_
else
let_
end if
And surrounded the modification in #ifdef...#endif brackets to keep it local.
How to test:
By default, on a patched kernel, the hci device will have a default address:
ubuntu@
Devices:
hci0 00:00:00:00:5A:AD
the address " 00:00:00:00:5A:AD" might vary, but will be consistent after every reboot.
The other option is to specify a custom BD address, e.g. using uboot to manipulate the dtb - we assume the dtb was loaded in memory at ${fdt_addr}:
dragonboard410c => fdt addr ${fdt_addr}
dragonboard410c => fdt print /soc/wcnss/
bt {
compatible = "qcom,wcnss-bt";
};
dragonboard410c => fdt resize
dragonboard410c => fdt set /soc/wcnss/
dragonboard410c => fdt print /soc/wcnss/
bt {
compatible = "qcom,wcnss-bt";
};
then proceed with the rest of the boot process and check hci:
$ hcitool dev
Devices:
hci0 00:11:22:33:44:55
In both cases, blueooth work afterward, and can be used to communicate with other devices:
ubuntu@
Scanning ...
Regression potential:
None, the fix is surronded with #ifdef...#endif thus it doesn't exist outside of it.
--
Using the core18 image from http://
Kernel snap: 4.15.0-39.42 (72)
rfkill shows there is an hci0 device:
$ rfkill list
0: hci0: Bluetooth
Soft blocked: no
Hard blocked: no
1: phy0: Wireless LAN
Soft blocked: no
Hard blocked: no
But bluetoothctl does not detect any controller:
$ sudo bluetoothctl
08:58 Agent registered
08:58 [bluetooth]# list
[...no output...]
If you revert to the 4.4 kernel [4.4.0-1106.111 (76)] it works:
$ sudo bluetoothctl
[NEW] Controller 00:00:00:00:5A:AD BlueZ 5.47 [default]
Agent registered
[bluetooth]# list
Controller 00:00:00:00:5A:AD BlueZ 5.47 [default]
[bluetooth]# show
Controller 00:00:00:00:5A:AD
Name: BlueZ 5.47
Alias: BlueZ 5.47
Class: 0x00000000
Powered: no
Discoverable: no
Pairable: yes
UUID: Generic Attribute Profile (00001801-
UUID: A/V Remote Control (0000110e-
UUID: OBEX File Transfer (00001106-
UUID: Generic Access Profile (00001800-
UUID: OBEX Object Push (00001105-
UUID: PnP Information (00001200-
UUID: A/V Remote Control Target (0000110c-
UUID: IrMC Sync (00001104-
UUID: Vendor specific (00005005-
UUID: Message Notification Se.. (00001133-
UUID: Phonebook Access Server (0000112f-
UUID: Message Access Server (00001132-
Modalias: usb:v1D6Bp0246d052F
Discovering: no
description: | updated |
tags: | added: patch |
Changed in linux-snapdragon (Ubuntu): | |
status: | New → Invalid |
Changed in linux-snapdragon (Ubuntu Bionic): | |
status: | New → Invalid |
Changed in linux (Ubuntu Bionic): | |
importance: | Undecided → Medium |
Changed in linux (Ubuntu): | |
status: | Incomplete → Fix Committed |
Changed in linux (Ubuntu Bionic): | |
status: | New → Fix Committed |
Changed in linux (Ubuntu Cosmic): | |
importance: | Undecided → Medium |
status: | New → Fix Committed |
Changed in linux-snapdragon (Ubuntu Cosmic): | |
status: | New → Invalid |
tags: | added: cscc |
This bug is missing log files that will aid in diagnosing the problem. While running an Ubuntu kernel (not a mainline or third-party kernel) please enter the following command in a terminal window:
apport-collect 1810797
and then change the status of the bug to 'Confirmed'.
If, due to the nature of the issue you have encountered, you are unable to run this command, please add a comment stating that fact and change the bug status to 'Confirmed'.
This change has been made by an automated script, maintained by the Ubuntu Kernel Team.