diff mbox series

[1/1,kernel-snaps-uc22/main] Add missing Atheros firmware files

Message ID 20231006101947.27018-1-sergio.costas@canonical.com
State New
Headers show
Series Add missing Atheros firmware files | expand

Commit Message

Sergio Costas Rodriguez Oct. 6, 2023, 10:19 a.m. UTC
BugLink: https://bugs.launchpad.net/bugs/2025054

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.

This patch adds the missing files, and makes bluetooth work.

Signed-off-by: Sergio Costas Rodriguez <sergio.costas@canonical.com>
---
 trim-firmware | 12 ++++++++++++
 1 file changed, 12 insertions(+)

Comments

Sergio Costas Rodriguez Oct. 16, 2023, 12:32 p.m. UTC | #1
I fixed this, and should be ready for another review... Maybe it got 
lost in the thread?

El 6/10/23 a las 12:19, Sergio Costas Rodriguez escribió:
> BugLink: https://bugs.launchpad.net/bugs/2025054
>
> 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.
>
> This patch adds the missing files, and makes bluetooth work.
>
> Signed-off-by: Sergio Costas Rodriguez <sergio.costas@canonical.com>
> ---
>   trim-firmware | 12 ++++++++++++
>   1 file changed, 12 insertions(+)
>
> diff --git a/trim-firmware b/trim-firmware
> index 148c964..5e5e865 100755
> --- a/trim-firmware
> +++ b/trim-firmware
> @@ -68,6 +68,18 @@ if [ -e "${DESTDIR}"/firmware/regulatory.db ] ; then
>   	cp "${DESTDIR}"/firmware/regulatory.* "${DESTDIR}"/firmware.new
>   fi
>   
> +# Copy extra AthrBT files, because they are needed for some devices
> +# like the original Asus Zenbook; but do it only if the module ath3k.ko
> +# is compiled. The file ath3k-1.fw is already being copied, so
> +# it doesn't need to be managed here.
> +if [ -n "$(find "${DESTDIR}"/modules -name 'ath3k.ko*')" ] ; then
> +	mkdir -p "${DESTDIR}"/firmware.new/ar3k
> +	cp -a "${DESTDIR}"/firmware/ar3k/AthrBT_0x*.dfu "${DESTDIR}"/firmware.new/ar3k/
> +	# the "ramps_" files are also refered in the source code of the driver, so
> +	# we must add them too.
> +	cp -a "${DESTDIR}"/firmware/ar3k/ramps_0x*.dfu "${DESTDIR}"/firmware.new/ar3k/
> +fi
> +
>   # Move kernel firmware files to the new firmware directory
>   for d in "${DESTDIR}"/modules/* ; do
>   	if [ -d "${DESTDIR}"/firmware/"${d##*/}" ] ; then
Juerg Haefliger Oct. 17, 2023, 11:54 a.m. UTC | #2
On Fri,  6 Oct 2023 12:19:47 +0200
Sergio Costas Rodriguez <sergio.costas@canonical.com> wrote:

> BugLink: https://bugs.launchpad.net/bugs/2025054
> 
> 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.
> 
> This patch adds the missing files, and makes bluetooth work.
> 
> Signed-off-by: Sergio Costas Rodriguez <sergio.costas@canonical.com>
> ---
>  trim-firmware | 12 ++++++++++++
>  1 file changed, 12 insertions(+)
> 
> diff --git a/trim-firmware b/trim-firmware
> index 148c964..5e5e865 100755
> --- a/trim-firmware
> +++ b/trim-firmware
> @@ -68,6 +68,18 @@ if [ -e "${DESTDIR}"/firmware/regulatory.db ] ; then
>  	cp "${DESTDIR}"/firmware/regulatory.* "${DESTDIR}"/firmware.new
>  fi
>  
> +# Copy extra AthrBT files, because they are needed for some devices
> +# like the original Asus Zenbook; but do it only if the module ath3k.ko
> +# is compiled. The file ath3k-1.fw is already being copied, so
> +# it doesn't need to be managed here.
> +if [ -n "$(find "${DESTDIR}"/modules -name 'ath3k.ko*')" ] ; then
> +	mkdir -p "${DESTDIR}"/firmware.new/ar3k
> +	cp -a "${DESTDIR}"/firmware/ar3k/AthrBT_0x*.dfu "${DESTDIR}"/firmware.new/ar3k/
> +	# the "ramps_" files are also refered in the source code of the driver, so
> +	# we must add them too.
> +	cp -a "${DESTDIR}"/firmware/ar3k/ramps_0x*.dfu "${DESTDIR}"/firmware.new/ar3k/
> +fi
> +
>  # Move kernel firmware files to the new firmware directory
>  for d in "${DESTDIR}"/modules/* ; do
>  	if [ -d "${DESTDIR}"/firmware/"${d##*/}" ] ; then

Acked-by: Juerg Haefliger <juerg.haefliger@canonical.com>
Portia Stephens Nov. 8, 2023, 7:10 a.m. UTC | #3
On Fri, Oct 6, 2023 at 8:20 PM Sergio Costas Rodriguez
<sergio.costas@canonical.com> wrote:
>
> BugLink: https://bugs.launchpad.net/bugs/2025054
>
> 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.
>
> This patch adds the missing files, and makes bluetooth work.
>
> Signed-off-by: Sergio Costas Rodriguez <sergio.costas@canonical.com>
> ---
>  trim-firmware | 12 ++++++++++++
>  1 file changed, 12 insertions(+)
>
> diff --git a/trim-firmware b/trim-firmware
> index 148c964..5e5e865 100755
> --- a/trim-firmware
> +++ b/trim-firmware
> @@ -68,6 +68,18 @@ if [ -e "${DESTDIR}"/firmware/regulatory.db ] ; then
>         cp "${DESTDIR}"/firmware/regulatory.* "${DESTDIR}"/firmware.new
>  fi
>
> +# Copy extra AthrBT files, because they are needed for some devices
> +# like the original Asus Zenbook; but do it only if the module ath3k.ko
> +# is compiled. The file ath3k-1.fw is already being copied, so
> +# it doesn't need to be managed here.
> +if [ -n "$(find "${DESTDIR}"/modules -name 'ath3k.ko*')" ] ; then
> +       mkdir -p "${DESTDIR}"/firmware.new/ar3k
> +       cp -a "${DESTDIR}"/firmware/ar3k/AthrBT_0x*.dfu "${DESTDIR}"/firmware.new/ar3k/
> +       # the "ramps_" files are also refered in the source code of the driver, so
> +       # we must add them too.
> +       cp -a "${DESTDIR}"/firmware/ar3k/ramps_0x*.dfu "${DESTDIR}"/firmware.new/ar3k/
> +fi
> +
>  # Move kernel firmware files to the new firmware directory
>  for d in "${DESTDIR}"/modules/* ; do
>         if [ -d "${DESTDIR}"/firmware/"${d##*/}" ] ; then

Acked-by: Portia Stephens <portia.stephens@canonical.com>

> --
> 2.39.2
>
>
> --
> kernel-team mailing list
> kernel-team@lists.ubuntu.com
> https://lists.ubuntu.com/mailman/listinfo/kernel-team
diff mbox series

Patch

diff --git a/trim-firmware b/trim-firmware
index 148c964..5e5e865 100755
--- a/trim-firmware
+++ b/trim-firmware
@@ -68,6 +68,18 @@  if [ -e "${DESTDIR}"/firmware/regulatory.db ] ; then
 	cp "${DESTDIR}"/firmware/regulatory.* "${DESTDIR}"/firmware.new
 fi
 
+# Copy extra AthrBT files, because they are needed for some devices
+# like the original Asus Zenbook; but do it only if the module ath3k.ko
+# is compiled. The file ath3k-1.fw is already being copied, so
+# it doesn't need to be managed here.
+if [ -n "$(find "${DESTDIR}"/modules -name 'ath3k.ko*')" ] ; then
+	mkdir -p "${DESTDIR}"/firmware.new/ar3k
+	cp -a "${DESTDIR}"/firmware/ar3k/AthrBT_0x*.dfu "${DESTDIR}"/firmware.new/ar3k/
+	# the "ramps_" files are also refered in the source code of the driver, so
+	# we must add them too.
+	cp -a "${DESTDIR}"/firmware/ar3k/ramps_0x*.dfu "${DESTDIR}"/firmware.new/ar3k/
+fi
+
 # Move kernel firmware files to the new firmware directory
 for d in "${DESTDIR}"/modules/* ; do
 	if [ -d "${DESTDIR}"/firmware/"${d##*/}" ] ; then