NACK: [PATCH] firmware: add missing firmware for ar3k Atheros bluetooth

Andrei Gherzan andrei.gherzan at canonical.com
Fri Jul 7 12:53:34 UTC 2023


On 23/07/05 08:37PM, Sergio Costas wrote:
> From: Sergio Costas Rodriguez <sergio.costas at canonical.com>
> 
> BugLink: https://bugs.launchpad.net/ubuntu/+bug/2025054
> 
> [Impact]
> 
> When using the Ubuntu Core 22 kernel in an Asus Zenbook UX22,
> 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
> 
> and, of course, bluetooth doesn't work.
> 
> [Fix]
> 
> This patch adds the missing files, and makes bluetooth work.
> ---
>  trim-firmware | 9 +++++++++
>  1 file changed, 9 insertions(+)
> 
> diff --git a/trim-firmware b/trim-firmware
> index 148c964..b2635fc 100755
> --- a/trim-firmware
> +++ b/trim-firmware
> @@ -68,6 +68,15 @@ 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

You actually copy all firmware in ar3k, not only the AthrBT ones (see
for example the ramps firmware files).

> +# like the original Asus Zenbook, but only if the module ath3k.ko
> +# is compiled
> +if [[ ! -z `find "${DESTDIR}"/modules -name ath3k.ko` ]] ; then

I would use
* "-n" instead of "! -z"
* $(...) instead of ``

> +       if [ -d "${DESTDIR}"/firmware/ar3k ] ; then

I would personally prefer it failing if the directory doesn't exist
anymore. In this way you can catch when you need to cleanup this (as no
firmware is needed anymore) or you need to change the path (if firmware
path changed).

> +               cp -a "${DESTDIR}"/firmware/ar3k "${DESTDIR}"/firmware.new/
> +       fi
> +fi
> +
>  # Move kernel firmware files to the new firmware directory
>  for d in "${DESTDIR}"/modules/* ; do
>         if [ -d "${DESTDIR}"/firmware/"${d##*/}" ] ; then
> -- 
> 2.39.2

There are a couple of other misc problems with this submission:
1. this should clearly reference that it is meant for the kernel-snaps
(probably uc22) via the subject line
2. the actual patch should be a separate email/patch with a BugLink
reference (cover + patch)

-- 
Andrei Gherzan
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <https://lists.ubuntu.com/archives/kernel-team/attachments/20230707/7dca26b1/attachment-0001.sig>


More information about the kernel-team mailing list