OpenWrt support for Linksys MX8500

@robimarko What can be done regarding the order in which the ath11k/bluetooth modules are loaded to eliminate automatic restarts?

What is the card you have in this device?

I think I saw some sequencing patches for QCA6390 BT

BT chip is NXP K32W041.

Then it makes no sense why would ath11k and Bluetooth interefe as they are not even on the same HW

I'm not sure what the main reason is, but I don't have reboots after loading the ath11k modules first.

That is super weird, sadly there is no way to force the loading order when autoprobe is used

What do you think about this change?

--- a/package/kernel/mac80211/ath.mk
+++ b/package/kernel/mac80211/ath.mk
@@ -322,7 +322,11 @@ define KernelPackage/ath11k-ahb
   URL:=https://wireless.wiki.kernel.org/en/users/drivers/ath11k
   DEPENDS+= @TARGET_qualcommax +kmod-ath11k +kmod-qrtr-smd
   FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/ath/ath11k/ath11k_ahb.ko
+ifeq ($(CONFIG_TARGET_SUBTARGET), "ipq807x")
+  AUTOLOAD:=$(call AutoLoad,99,ath11k_ahb)
+else
   AUTOLOAD:=$(call AutoProbe,ath11k_ahb)
+endif
 endef
 
 define KernelPackage/ath11k-ahb/description

I dont like it, forcing autoload shouldnt be used

Is there any way to force bluetooth modules to load later?
I'm still facing random restarts on latest 6.6 kernel.

Other than using AutoLoad not really, that is the whole point of AutoProbe

Loading only hci_uart module (https://github.com/openwrt/openwrt/pull/15118) does not help:

[    9.166717] kmodloader: loading kernel modules from /etc/modules.d/*
[    9.238464] hid: raw HID events driver (C) Jiri Kosina
[    9.245035] Bluetooth: Core ver 2.22
[    9.245148] NET: Registered PF_BLUETOOTH protocol family
[    9.247685] Bluetooth: HCI device and connection manager initialized
[    9.253062] Bluetooth: HCI socket layer initialized
[    9.259316] Bluetooth: L2CAP socket layer initialized
[    9.263938] Bluetooth: SCO socket layer initialized
[    9.270035] Bluetooth: BNEP (Ethernet Emulation) ver 1.3
[    9.273827] Bluetooth: BNEP filters: protocol multicast
[    9.279375] Bluetooth: BNEP socket layer initialized
[    9.284809] Loading modules backported from Linux version v6.6.15-0-g51f354b815c4
[    9.289528] Backport generated by backports.git 193becf2
[    9.297494] Bluetooth: HCI UART driver ver 2.3
[    9.302292] Bluetooth: HCI UART protocol H4 registered
[    9.306536] Bluetooth: HCI UART protocol BCSP registered
[    9.312308] Bluetooth: HIDP (Human Interface Emulation) ver 1.2
[    9.317140] Bluetooth: HIDP socket layer initialized
[    9.328482] NET: Registered PF_QIPCRTR protocol family
[    9.330328] Bluetooth: RFCOMM TTY layer initialized
[    9.332964] Bluetooth: RFCOMM socket layer initialized
[    9.337715] Bluetooth: RFCOMM ver 1.11
[    9.351061] urngd: v1.0.2 started.
[    9.375900] PPP generic driver version 2.4.2
[    9.376668] NET: Registered PF_PPPOX protocol family
[    9.387183] ath11k c000000.wifi: ipq8074 hw2.0
[    9.387216] ath11k c000000.wifi: FW memory mode: 0
[    9.390748] remoteproc remoteproc0: powering up cd00000.q6v5_wcss
[    9.395373] remoteproc remoteproc0: Booting fw image IPQ8074/q6_fw.mdt, size 668
[    9.746555] remoteproc remoteproc0: remote processor cd00000.q6v5_wcss is now up
[    9.748999] ath11k_pci 0000:01:00.0: BAR 0: assigned [mem 0x20400000-0x205fffff 64bit]
[    9.753104] ath11k_pci 0000:01:00.0: enabling device (0000 -> 0002)
[    9.761214] ath11k_pci 0000:01:00.0: MSI vectors: 16
[    9.766933] ath11k_pci 0000:01:00.0: qcn9074 hw1.0
[    9.772121] ath11k_pci 0000:01:00.0: FW memory mode: 2
[ 5844.356049] pcieport 0000:00:00.0: AER: Multiple Corrected error message received from 0000:00:00.0

Format: Log Type - Time(microsec) - Message - Optional Info
Log Type: B - Since Boot(Power On Reset),  D - Delta,  S - Statistic
S - QC_IMAGE_VERSION_STRING=BOOT.BF.3.3.1-00163
S - IMAGE_VARIANT_STRING=HAACANAZA
S - OEM_IMAGE_VERSION_STRING=CRM

Restarts happens even if only 2 modules bluetooth and hci_uart are loaded during boot:

[    9.252827] kmodloader: loading kernel modules from /etc/modules.d/*
[    9.319729] Bluetooth: Core ver 2.22
[    9.319844] NET: Registered PF_BLUETOOTH protocol family
[    9.322408] Bluetooth: HCI device and connection manager initialized
[    9.327685] Bluetooth: HCI socket layer initialized
[    9.334021] Bluetooth: L2CAP socket layer initialized
[    9.338620] Bluetooth: SCO socket layer initialized
[    9.344561] Loading modules backported from Linux version v6.6.15-0-g51f354b815c4
[    9.348511] Backport generated by backports.git 193becf2
[    9.356843] Bluetooth: HCI UART driver ver 2.3
[    9.361526] Bluetooth: HCI UART protocol H4 registered
[    9.365809] Bluetooth: HCI UART protocol BCSP registered
[    9.376463] NET: Registered PF_QIPCRTR protocol family
[    9.406568] PPP generic driver version 2.4.2
[    9.407206] NET: Registered PF_PPPOX protocol family
[    9.408731] urngd: v1.0.2 started.
[    9.417541] ath11k c000000.wifi: ipq8074 hw2.0
[    9.418065] ath11k c000000.wifi: FW memory mode: 0
[    9.422919] remoteproc remoteproc0: powering up cd00000.q6v5_wcss
[    9.427328] remoteproc remoteproc0: Booting fw image IPQ8074/q6_fw.mdt, size 668
[    9.778664] remoteproc remoteproc0: remote processor cd00000.q6v5_wcss is now up
[    9.781172] ath11k_pci 0000:01:00.0: BAR 0: assigned [mem 0x20400000-0x205fffff 64bit]
[    9.785218] ath11k_pci 0000:01:00.0: enabling device (0000 -> 0002)
[    9.793304] ath11k_pci 0000:01:00.0: MSI vectors: 16
[    9.799036] ath11k_pci 0000:01:00.0: qcn9074 hw1.0
[    9.804231] ath11k_pci 0000:01:00.0: FW memory mode: 2
[ 5844.405299] pcieport 0000:00:00.0: AER: Multiple Corrected error message received from 0000:00:00.0

Format: Log Type - Time(microsec) - Message - Optional Info
Log Type: B - Since Boot(Power On Reset),  D - Delta,  S - Statistic
S - QC_IMAGE_VERSION_STRING=BOOT.BF.3.3.1-00163
S - IMAGE_VARIANT_STRING=HAACANAZA

Or maybe the restarts are caused by this call:

Could any of these patches may help?
https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/commit/drivers/net/wireless/ath/ath11k?h=next-20240410&id=515bcdf587f9911f2d5de51524cb7e048d295052

https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/commit/drivers/net/wireless/ath/ath11k?h=next-20240410&id=fbb2a14afe00a5691b43cd19c946472e59e16fc6

I checked and after loading the firmware from NVMEM (without using the u-boot function), I have the following values:

root@OpenWrt:/# mdio 9* mmd 8:30 0x2680
0x0000
root@OpenWrt:/# mdio 9* mmd 8:30 0xC430
0x000f
root@OpenWrt:/# mdio 9* mmd 8:30 0xC431
0xc060
root@OpenWrt:/# mdio 9* mmd 8:7 0x0010
0x9d81
root@OpenWrt:/# mdio 9* mmd 8:7 0x0000
0x3000
root@OpenWrt:/# mdio 9* mmd 8:4 0xC441
0x0008
2 Likes

Great, the LED provision regs are obviosuly not set(Weird that they did not that with the FW provisioning), I will later see what they are changing in others.

BTW, I wrote wrong, they are not touching 7.1 but 7.10 which changes Autoneg advertising.
They are changing technology abilities and disabling pause and async pause advertising, that is rather crazy.

1 Like

Loading from u-boot using aq_load_fw:

root@OpenWrt:/# mdio 9* mmd 8:30 0x2680
0x0000
root@OpenWrt:/# mdio 9* mmd 8:30 0xC430
0xc0ef
root@OpenWrt:/# mdio 9* mmd 8:30 0xC431
0xc0e0
root@OpenWrt:/# mdio 9* mmd 8:7 0x0010
0x9d81
root@OpenWrt:/# mdio 9* mmd 8:7 0x0000
0x3000
root@OpenWrt:/# mdio 9* mmd 8:4 0xC441
0x0008

and initializing interface in u-boot and loading firmware from NVMEM:

root@OpenWrt:/# mdio 9* mmd 8:30 0x2680
0x0000
root@OpenWrt:/# mdio 9* mmd 8:30 0xC430
0x000f
root@OpenWrt:/# mdio 9* mmd 8:30 0xC431
0xc060
root@OpenWrt:/# mdio 9* mmd 8:7 0x0010
0x9d81
root@OpenWrt:/# mdio 9* mmd 8:7 0x0000
0x3000
root@OpenWrt:/# mdio 9* mmd 8:4 0xC441
0x0008

In the second case lan interfaces are not working correctly.

To be able to use interface without u-boot initialization I added this configuration to the mdio_pins:

		gpio-pins {
			pins = "gpio44";
			function = "gpio";
			bias-pull-up;
			output-high;
		};