diff mbox series

[UC22] Add firmware files for Atheros bluetooth modules

Message ID 36107ffc-65d6-efa3-5a7d-7806d97b8e8f@canonical.com
State New
Headers show
Series [UC22] Add firmware files for Atheros bluetooth modules | expand

Commit Message

Sergio Costas Rodriguez June 27, 2023, 8:24 a.m. UTC
BugLink: https://bugs.launchpad.net/ubuntu/+bug/2025054

When using the Ubuntu Core 22 kernel in an Asus Zenbook UX21, this error 
is shown in journalctl:

         usb 1-1-1: Direct firmware load for ar3k/AthrBT_0x01020200.dfu 
failed with error -2
         Bluetooth: Patch file not found ar3k/AthrBT_0x01020200.dfu
         Bluetooth: Loading patch file failed
         ath3k: probe of 1-1.1:1.0 failed with error -2

Also, the bluetooth module doesn't work. This is because the current 
PC-KERNEL snap used in Ubuntu Core/Ubuntu Core Desktop (UC22) lacks the 
Atheros AR3K firmware files, which means that devices with an Atheros 
Bluetooth device (like the specified Asus Zenbook UX21) won't be able to 
use it.

This patch adds the missing files.

Comments

Juerg Haefliger June 29, 2023, 8:58 a.m. UTC | #1
On Tue, 27 Jun 2023 10:24:00 +0200
Sergio Costas <sergio.costas@canonical.com> wrote:

> BugLink: https://bugs.launchpad.net/ubuntu/+bug/2025054
> 
> When using the Ubuntu Core 22 kernel in an Asus Zenbook UX21, this error 
> is shown in journalctl:
> 
>          usb 1-1-1: Direct firmware load for ar3k/AthrBT_0x01020200.dfu 
> failed with error -2
>          Bluetooth: Patch file not found ar3k/AthrBT_0x01020200.dfu
>          Bluetooth: Loading patch file failed
>          ath3k: probe of 1-1.1:1.0 failed with error -2
> 
> Also, the bluetooth module doesn't work. This is because the current 
> PC-KERNEL snap used in Ubuntu Core/Ubuntu Core Desktop (UC22) lacks the 
> Atheros AR3K firmware files, which means that devices with an Atheros 
> Bluetooth device (like the specified Asus Zenbook UX21) won't be able to 
> use it.
> 
> This patch adds the missing files.

1) Please no attachments (best to use git format-patch and git
send-email).
2) Your patch blindly copies the ar3k files regardless of whether
they're actually used or not. The script is used by multiple/different
kernels (pc, pi, intel-iotg). Hm, the kernel doesn't reference the ar3k files
(I tried to fix that upstream but it was rejected) so you need to copy the
ar3k files based on the presence of the ath3k module.
3) Please add an LP bug reference to the comment in the patch.

...JUerg
diff mbox series

Patch

diff --git a/trim-firmware b/trim-firmware
index 148c964..bb70869 100755
--- a/trim-firmware
+++ b/trim-firmware
@@ -68,6 +68,12 @@  if [ -e "${DESTDIR}"/firmware/regulatory.db ] ; then
 	cp "${DESTDIR}"/firmware/regulatory.* "${DESTDIR}"/firmware.new
 fi
 
+# Copy all AthrBT files, because they are needed for some devices
+# like the original Asus Zenbook
+if [ -d "${DESTDIR}"/firmware/ar3k ] ; then
+	cp -a "${DESTDIR}"/firmware/ar3k "${DESTDIR}"/firmware.new/
+fi
+
 # Move kernel firmware files to the new firmware directory
 for d in "${DESTDIR}"/modules/* ; do
 	if [ -d "${DESTDIR}"/firmware/"${d##*/}" ] ; then