LZ77 in mikrotik

Hi,
any new information on how to decode the calibration data in the Mikrotik that uses the LZ77?

Hi

We have problems with the new Mikrotik. We have a fairly large group of hAP ac2 and hAP ac3 Routers.
The latest boards are different from the old ones (without changing the hardware version).

@johnth explains in this thread that it's a board reading problem with the openwrt driver. Missing "unpack LZ77" https://github.com/openwrt/openwrt/blob/e722b667c5a59bbd5aff787002f7f5457d0bf721/target/linux/generic/files/drivers/platform/mikrotik/rb_hardconfig.c#L566

@johnth has already worked on the topic talking about it on github. I'm not developing and I don't see how to fix the problem.

He talks about it here and did some research https://github.com/openwrt/openwrt/pull/4679

I think that reading the LZ77 format should be integrated into the driver because the new boards will arrive like that. hAP ax2 and ax3 are like that too. Adding support for Mikrotik Hap AX2 - #48 by dchard

We can provide boards to test the patch and submit the correction

Thank you for the work you provide.

Best Regard

test PR for lz77 decompress here. Very WIP.

see also: Mikrotik RouterOS v7.x and OpenWrt sysupgrade - #60 by johnth

Hi @johnth

I tested your draft code on my plateform

git pull https://github.com/john-tho/openwrt.git mikrotik_wlan_lz77
Depuis https://github.com/john-tho/openwrt
 * branch                  mikrotik_wlan_lz77 -> FETCH_HEAD
Mise à jour e0fb38f4ee..b3a98ec9bf
Fast-forward
 target/linux/generic/files/drivers/platform/mikrotik/Makefile             |   3 ++
 target/linux/generic/files/drivers/platform/mikrotik/rb_hardconfig.c      |  45 +++++++++++++++-
 target/linux/generic/files/drivers/platform/mikrotik/rb_hardconfig_lz77.c | 430 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 target/linux/generic/files/drivers/platform/mikrotik/rb_hardconfig_lz77.h |  36 +++++++++++++
 target/linux/generic/files/drivers/platform/mikrotik/routerboot.h         |   1 +
 5 files changed, 514 insertions(+), 1 deletion(-)
 create mode 100644 target/linux/generic/files/drivers/platform/mikrotik/rb_hardconfig_lz77.c
 create mode 100644 target/linux/generic/files/drivers/platform/mikrotik/rb_hardconfig_lz77.h

I then compiled for my hAP ac3 board

At the moment it doesn't work. Here is the return of the console with your debugs

[    0.000000] Booting Linux on physical CPU 0x0
[    0.000000] Linux version 5.15.118 (root@2ISSV034) (arm-openwrt-linux-muslgnueabi-gcc (OpenWrt GCC 12.3.0 r23422+1-e0fb38f4ee) 12.3.0, GNU ld (GNU Binutils) 2.40.0) #0 SMP Sat Jun 24 08:16:29 2023
[    0.000000] CPU: ARMv7 Processor [410fc075] revision 5 (ARMv7), cr=10c5387d
[    0.000000] CPU: div instructions available: patching division code
[    0.000000] CPU: PIPT / VIPT nonaliasing data cache, VIPT aliasing instruction cache
[    0.000000] OF: fdt: Machine model: MikroTik hAP ac3
[    0.000000] Memory policy: Data cache writealloc
[    0.000000] Zone ranges:
[    0.000000]   Normal   [mem 0x0000000080000000-0x000000008fffffff]
[    0.000000]   HighMem  empty
[    0.000000] Movable zone start for each node
[    0.000000] Early memory node ranges
[    0.000000]   node   0: [mem 0x0000000080000000-0x0000000087dfffff]
[    0.000000]   node   0: [mem 0x0000000087e00000-0x0000000087ffffff]
[    0.000000]   node   0: [mem 0x0000000088000000-0x000000008fffffff]
[    0.000000] Initmem setup node 0 [mem 0x0000000080000000-0x000000008fffffff]
[    0.000000] percpu: Embedded 11 pages/cpu s16268 r8192 d20596 u45056
[    0.000000] pcpu-alloc: s16268 r8192 d20596 u45056 alloc=11*4096
[    0.000000] pcpu-alloc: [0] 0 [0] 1 [0] 2 [0] 3
[    0.000000] Built 1 zonelists, mobility grouping on.  Total pages: 64960
[    0.000000] Kernel command line:
[    0.000000] Dentry cache hash table entries: 32768 (order: 5, 131072 bytes, linear)
[    0.000000] Inode-cache hash table entries: 16384 (order: 4, 65536 bytes, linear)
[    0.000000] mem auto-init: stack:off, heap alloc:off, heap free:off
[    0.000000] Memory: 246220K/262144K available (6522K kernel code, 608K rwdata, 1668K rodata, 1024K init, 239K bss, 15924K reserved, 0K cma-reserved, 0K highmem)
[    0.000000] SLUB: HWalign=64, Order=0-3, MinObjects=0, CPUs=4, Nodes=1
[    0.000000] rcu: Hierarchical RCU implementation.
[    0.000000]  Tracing variant of Tasks RCU enabled.
[    0.000000] rcu: RCU calculated value of scheduler-enlistment delay is 10 jiffies.
[    0.000000] NR_IRQS: 16, nr_irqs: 16, preallocated irqs: 16
[    0.000000] arch_timer: cp15 timer(s) running at 48.00MHz (virt).
[    0.000000] clocksource: arch_sys_counter: mask: 0xffffffffffffff max_cycles: 0xb11fd3bfb, max_idle_ns: 440795203732 ns
[    0.000001] sched_clock: 56 bits at 48MHz, resolution 20ns, wraps every 4398046511096ns
[    0.000024] Switching to timer-based delay loop, resolution 20ns
[    0.000314] Calibrating delay loop (skipped), value calculated using timer frequency.. 96.00 BogoMIPS (lpj=480000)
[    0.000343] pid_max: default: 32768 minimum: 301
[    0.001248] Mount-cache hash table entries: 1024 (order: 0, 4096 bytes, linear)
[    0.001281] Mountpoint-cache hash table entries: 1024 (order: 0, 4096 bytes, linear)
[    0.002955] CPU: Testing write buffer coherency: ok
[    0.003435] qcom_scm: convention: smc legacy
[    0.004694] Setting up static identity map for 0x80300000 - 0x8030003c
[    0.004882] rcu: Hierarchical SRCU implementation.
[    0.005509] smp: Bringing up secondary CPUs ...
[    0.009100] smp: Brought up 1 node, 4 CPUs
[    0.009139] SMP: Total of 4 processors activated (384.00 BogoMIPS).
[    0.009154] CPU: All CPU(s) started in SVC mode.
[    0.015287] VFP support v0.3: implementor 41 architecture 2 part 30 variant 7 rev 5
[    0.015499] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 19112604462750000 ns
[    0.015538] futex hash table entries: 1024 (order: 4, 65536 bytes, linear)
[    0.015956] pinctrl core: initialized pinctrl subsystem
[    0.018023] NET: Registered PF_NETLINK/PF_ROUTE protocol family
[    0.018438] DMA: preallocated 256 KiB pool for atomic coherent allocations
[    0.019824] thermal_sys: Registered thermal governor 'step_wise'
[    0.020386] cpuidle: using governor ladder
[    0.020460] cpuidle: using governor menu
[    0.028455] gpio-456 (enable USB power): hogged as output/high
[    0.048557] cryptd: max_cpu_qlen set to 1000
[    0.053372] usbcore: registered new interface driver usbfs
[    0.053453] usbcore: registered new interface driver hub
[    0.053512] usbcore: registered new device driver usb
[    0.053608] pps_core: LinuxPPS API ver. 1 registered
[    0.053622] pps_core: Software ver. 5.3.6 - Copyright 2005-2007 Rodolfo Giometti <giometti@linux.it>
[    0.053678] PTP clock support registered
[    0.055886] clocksource: Switched to clocksource arch_sys_counter
[    0.057201] NET: Registered PF_INET protocol family
[    0.057429] IP idents hash table entries: 4096 (order: 3, 32768 bytes, linear)
[    0.058295] tcp_listen_portaddr_hash hash table entries: 512 (order: 0, 6144 bytes, linear)
[    0.058369] Table-perturb hash table entries: 65536 (order: 6, 262144 bytes, linear)
[    0.058398] TCP established hash table entries: 2048 (order: 1, 8192 bytes, linear)
[    0.058444] TCP bind hash table entries: 2048 (order: 2, 16384 bytes, linear)
[    0.058499] TCP: Hash tables configured (established 2048 bind 2048)
[    0.058665] UDP hash table entries: 256 (order: 1, 8192 bytes, linear)
[    0.058719] UDP-Lite hash table entries: 256 (order: 1, 8192 bytes, linear)
[    0.059093] NET: Registered PF_UNIX/PF_LOCAL protocol family
[    0.059155] PCI: CLS 0 bytes, default 64
[    0.061391] workingset: timestamp_bits=14 max_order=16 bucket_order=2
[    0.067431] squashfs: version 4.0 (2009/01/31) Phillip Lougher
[    0.067467] jffs2: version 2.2 (NAND) (SUMMARY) (LZMA) (RTIME) (CMODE_PRIORITY) (c) 2001-2006 Red Hat, Inc.
[    0.204065] bam-dma-engine 8e04000.dma: num-channels unspecified in dt
[    0.204101] bam-dma-engine 8e04000.dma: num-ees unspecified in dt
[    0.205589] tcsr 1949000.tcsr: setting wifi_glb_cfg = 41000000
[    0.205707] tcsr 194b000.tcsr: setting usb hs phy mode select = e700e7
[    0.205842] tcsr 1953000.ess_tcsr: setting ess interface select = 0
[    0.206046] tcsr 1957000.tcsr: setting wifi_noc_memtype_m0_m2 = 2222222
[    0.206400] Serial: 8250/16550 driver, 2 ports, IRQ sharing disabled
[    0.207090] msm_serial 78af000.serial: msm_serial: detected port #0
[    0.207144] msm_serial 78af000.serial: uartclk = 1843200
[    0.207199] 78af000.serial: ttyMSM0 at MMIO 0x78af000 (irq = 33, base_baud = 115200) is a MSM
[    0.207241] msm_serial: console setup on port #0
[    0.749888] printk: console [ttyMSM0] enabled
[    0.755066] msm_serial: driver initialized
[    0.765137] loop: module loaded
[    0.767061] nand: device found, Manufacturer ID: 0xef, Chip ID: 0xf1
[    0.767110] nand: Winbond W29N01HV
[    0.773692] nand: 128 MiB, SLC, erase size: 128 KiB, page size: 2048, OOB size: 64
[    0.777030] 2 fixed-partitions partitions found on MTD device qcom_nand.0
[    0.784466] Creating 2 MTD partitions on "qcom_nand.0":
[    0.791344] 0x000000000000-0x000000a00000 : "kernel"
[    0.812685] 0x000000a00000-0x000008000000 : "ubi"
[    0.998953] spi_qup 78b5000.spi: IN:block:16, fifo:64, OUT:block:16, fifo:64
[    1.000567] spi-nor spi0.0: w25q128jv (16384 Kbytes)
[    1.005131] 2 fixed-partitions partitions found on MTD device spi0.0
[    1.010126] OF: Bad cell count for /soc/spi@78b5000/flash@0/partitions
[    1.016424] OF: Bad cell count for /soc/spi@78b5000/flash@0/partitions
[    1.022989] Creating 2 MTD partitions on "spi0.0":
[    1.029276] 0x000000000000-0x000000080000 : "Qualcomm"
[    1.034649] 0x000000080000-0x000000100000 : "RouterBoot"
[    1.044643] 3 routerbootpart partitions found on MTD device RouterBoot
[    1.044697] Creating 3 MTD partitions on "RouterBoot":
[    1.050993] 0x00000000e000-0x000000010000 : "hard_config"
[    1.056720] 0x000000010000-0x000000017ea4 : "dtb_config"
[    1.062059] 0x00000003d000-0x00000003e000 : "soft_config"
[    1.094257] ipqess-edma c080000.ethernet: generated random MAC address 26:a7:60:22:84:56
[    1.119578] i2c_dev: i2c /dev entries driver
[    1.121657] sdhci: Secure Digital Host Controller Interface driver
[    1.122931] sdhci: Copyright(c) Pierre Ossman
[    1.129011] sdhci-pltfm: SDHCI platform and OF driver helper
[    1.139098] [rb_hardconfig lz77] lz77 decompressed from 2776 to 11928
[    1.139156] [rb_hardconfig] LZ77: decompressed from 2776 to 11928
[    1.145671] MikroTik RouterBOARD hardware configuration sysfs driver v0.08
[    1.152755] MikroTik RouterBOARD software configuration sysfs driver v0.05
[    1.159668] NET: Registered PF_INET6 protocol family
[    1.166970] Segment Routing with IPv6
[    1.170302] In-situ OAM (IOAM) with IPv6
[    1.173918] NET: Registered PF_PACKET protocol family
[    1.178118] 8021q: 802.1Q VLAN Support v1.8
[    1.182783] Registering SWP/SWPB emulation handler
[    1.201680] qca8k-ipq4019 c000000.switch: configuring for fixed/internal link mode
[    1.201954] qca8k-ipq4019 c000000.switch: Link is Up - 1Gbps/Full - flow control rx/tx
[    1.290434] qca8k-ipq4019 c000000.switch lan4 (uninitialized): PHY [90000.mdio-1:00] driver [Qualcomm QCA8075] (irq=POLL)
[    1.390242] qca8k-ipq4019 c000000.switch lan3 (uninitialized): PHY [90000.mdio-1:01] driver [Qualcomm QCA8075] (irq=POLL)
[    1.480384] qca8k-ipq4019 c000000.switch lan2 (uninitialized): PHY [90000.mdio-1:02] driver [Qualcomm QCA8075] (irq=POLL)
[    1.571013] qca8k-ipq4019 c000000.switch lan1 (uninitialized): PHY [90000.mdio-1:03] driver [Qualcomm QCA8075] (irq=POLL)
[    1.662446] qca8k-ipq4019 c000000.switch wan (uninitialized): PHY [90000.mdio-1:04] driver [Qualcomm QCA8075] (irq=POLL)
[    1.673981] DSA: tree 0 setup
[    1.678008] UBI: auto-attach mtd1
[    1.678056] ubi0: attaching mtd1
[    3.258135] ubi0: scanning is finished
[    3.282050] ubi0: attached mtd1 (name "ubi", size 118 MiB)
[    3.282165] ubi0: PEB size: 131072 bytes (128 KiB), LEB size: 126976 bytes
[    3.286615] ubi0: min./max. I/O unit sizes: 2048/2048, sub-page size 2048
[    3.293370] ubi0: VID header offset: 2048 (aligned 2048), data offset: 4096
[    3.300323] ubi0: good PEBs: 944, bad PEBs: 0, corrupted PEBs: 0
[    3.307057] ubi0: user volume: 2, internal volumes: 1, max. volumes count: 128
[    3.313249] ubi0: max/mean erase counter: 1/0, WL threshold: 4096, image sequence number: 1095831599
[    3.320376] ubi0: available PEBs: 0, total reserved PEBs: 944, PEBs reserved for bad PEB handling: 20
[    3.329691] ubi0: background thread "ubi_bgt0d" started, PID 131
[    3.331352] block ubiblock0_0: created from ubi0:0(rootfs)
[    3.344749] ubiblock: device ubiblock0_0 (rootfs) set to be root filesystem
[    3.357157] VFS: Mounted root (squashfs filesystem) readonly on device 254:0.
[    3.359247] Freeing unused kernel image (initmem) memory: 1024K
[    3.386927] Run /sbin/init as init process
[    3.387007]   with arguments:
[    3.387025]     /sbin/init
[    3.387046]   with environment:
[    3.387062]     HOME=/
[    3.387083]     TERM=linux
[    4.285633] init: Console is alive
[    4.286134] init: - watchdog -
[    5.536067] kmodloader: loading kernel modules from /etc/modules-boot.d/*
[    5.781399] xhci-hcd xhci-hcd.0.auto: xHCI Host Controller
[    5.781521] xhci-hcd xhci-hcd.0.auto: new USB bus registered, assigned bus number 1
[    5.786164] xhci-hcd xhci-hcd.0.auto: hcc params 0x0220f665 hci version 0x100 quirks 0x0000000002010010
[    5.793461] xhci-hcd xhci-hcd.0.auto: irq 104, io mem 0x06000000
[    5.803071] xhci-hcd xhci-hcd.0.auto: xHCI Host Controller
[    5.809046] xhci-hcd xhci-hcd.0.auto: new USB bus registered, assigned bus number 2
[    5.814304] xhci-hcd xhci-hcd.0.auto: Host supports USB 3.0 SuperSpeed
[    5.822715] hub 1-0:1.0: USB hub found
[    5.828524] hub 1-0:1.0: 1 port detected
[    5.832640] usb usb2: We don't know the algorithms for LPM for this host, disabling LPM.
[    5.837591] hub 2-0:1.0: USB hub found
[    5.844365] hub 2-0:1.0: config failed, hub doesn't have any ports! (err -19)
[    5.851255] kmodloader: done loading kernel modules from /etc/modules-boot.d/*
[    5.857522] init: - preinit -
[    7.065956] random: crng init done
[    7.950358] ipqess-edma c080000.ethernet eth0: configuring for fixed/internal link mode
[    7.951296] qca8k-ipq4019 c000000.switch lan1: configuring for phy/psgmii link mode
[    7.957389] ipqess-edma c080000.ethernet eth0: Link is Up - 1Gbps/Full - flow control rx/tx
[    9.043505] IPv6: ADDRCONF(NETDEV_CHANGE): eth0: link becomes ready
[   11.383388] UBIFS (ubi0:1): default file-system created
[   11.384690] UBIFS (ubi0:1): Mounting in unauthenticated mode
[   11.387751] UBIFS (ubi0:1): background thread "ubifs_bgt0_1" started, PID 242
[   11.526402] UBIFS (ubi0:1): UBIFS: mounted UBI device 0, volume 1, name "rootfs_data"
[   11.526537] UBIFS (ubi0:1): LEB size: 126976 bytes (124 KiB), min./max. I/O unit sizes: 2048 bytes/2048 bytes
[   11.533318] UBIFS (ubi0:1): FS size: 111865856 bytes (106 MiB, 881 LEBs), max 892 LEBs, journal size 5586944 bytes (5 MiB, 44 LEBs)
[   11.543308] UBIFS (ubi0:1): reserved for root: 4952683 bytes (4836 KiB)
[   11.554904] UBIFS (ubi0:1): media format: w5/r0 (latest is w5/r0), UUID 12F9A2DB-8BE0-4A87-A9BA-5E89EE3AE6BF, small LPT model
[   11.564689] mount_root: overlay filesystem has not been fully initialized yet
[   11.573607] mount_root: switching to ubifs overlay
[   11.587329] urandom-seed: Seed file not found (/etc/urandom.seed)
[   11.797966] procd: - early -
[   11.798246] procd: - watchdog -
[   12.410086] procd: - watchdog -
[   12.715188] procd: - ubus -
[   12.878130] procd: - init -
[   13.657429] kmodloader: loading kernel modules from /etc/modules.d/*
[   13.738629] urngd: v1.0.2 started.
[   13.777269] Loading modules backported from Linux version v6.1.24-0-g0102425ac76b
[   13.777328] Backport generated by backports.git v5.15.92-1-44-gd6ea70fafd36
[   13.897974] PPP generic driver version 2.4.2
[   13.899312] NET: Registered PF_PPPOX protocol family
[   14.823795] [rb_hardconfig lz77] lz77 decompressed from 2776 to 11928
[   14.823864] [rb_hardconfig] LZ77: decompressed from 2776 to 11928
[   14.832544] [rb_hardconfig lz77] lz77 decompressed from 2776 to 11928
[   14.835339] [rb_hardconfig] LZ77: decompressed from 2776 to 11928
[   14.844785] [rb_hardconfig lz77] lz77 decompressed from 2776 to 11928
[   14.847850] [rb_hardconfig] LZ77: decompressed from 2776 to 11928
[   15.646434] ath10k_ahb a000000.wifi: qca4019 hw1.0 target 0x01000000 chip_id 0x003b00ff sub 0000:0000
[   15.646506] ath10k_ahb a000000.wifi: kconfig debug 0 debugfs 1 tracing 0 dfs 1 testmode 0
[   15.658409] ath10k_ahb a000000.wifi: firmware ver 10.4b-ct-4019-fW-13-5ae337bb1 api 5 features mfp,peer-flow-ctrl,txstatus-noack,wmi-10.x-CT,ratemask-CT,regdump-CT,txrate-CT,flush-all-CT,pingpong-CT,ch-regs-CT,nop-CT,set-special-CT,tx-rc-CT,cust-stats-CT,txrate2-CT,beacon-cb-CT,wmi-block-ack-CT,wmi-bcn-rc-CT crc32 6b2b5c5b
[   15.932284] [rb_hardconfig lz77] lz77 decompressed from 2776 to 11928
[   15.932345] [rb_hardconfig] LZ77: decompressed from 2776 to 11928
[   15.939049] [rb_hardconfig lz77] lz77 decompressed from 2776 to 11928
[   15.943812] [rb_hardconfig] LZ77: decompressed from 2776 to 11928
[   15.951568] [rb_hardconfig lz77] lz77 decompressed from 2776 to 11928
[   15.956383] [rb_hardconfig] LZ77: decompressed from 2776 to 11928
[   15.964524] ath10k_ahb a000000.wifi: board_file api 1 bmi_id 0:18 crc32 baafe10e
[   18.316784] ath10k_ahb a000000.wifi: failed to receive control response completion, polling..
[   19.356746] ath10k_ahb a000000.wifi: ctl_resp never came in (-110)
[   19.357137] ath10k_ahb a000000.wifi: failed to connect to HTC: -110
[   19.416454] ------------[ cut here ]------------
[   19.416513] WARNING: CPU: 1 PID: 9 at kernel/workqueue.c:3084 __flush_work+0x2d8/0x310
[   19.420169] Modules linked in: ath10k_pci(+) ath10k_core ath pppox ppp_generic nft_reject_ipv6 nft_reject_ipv4 nft_reject_inet nft_reject nft_redir nft_quota nft_objref nft_numgen nft_nat nft_masq nft_log nft_limit nft_hash nft_flow_offload nft_fib_ipv6 nft_fib_ipv4 nft_fib nft_ct nft_counter nft_chain_nat nf_tables nf_nat nf_flow_table nf_conntrack mac80211 cfg80211 slhc nfnetlink nf_reject_ipv6 nf_reject_ipv4 nf_log_syslog nf_defrag_ipv6 nf_defrag_ipv4 libcrc32c hwmon crc_ccitt compat ledtrig_gpio sha512_arm ghash_arm_ce cmac leds_gpio xhci_plat_hcd xhci_pci xhci_hcd dwc3 dwc3_qcom gpio_button_hotplug crc32c_generic
[   19.460502] CPU: 1 PID: 9 Comm: kworker/u8:0 Not tainted 5.15.118 #0
[   19.482664] Hardware name: Generic DT based system
[   19.489091] Workqueue: ath10k_wq ath10k_core_register_work [ath10k_core]
[   19.493702] [<c030d4a4>] (unwind_backtrace) from [<c030986c>] (show_stack+0x10/0x14)
[   19.500553] [<c030986c>] (show_stack) from [<c0602ae0>] (dump_stack_lvl+0x40/0x4c)
[   19.508277] [<c0602ae0>] (dump_stack_lvl) from [<c032276c>] (__warn+0x8c/0x100)
[   19.515656] [<c032276c>] (__warn) from [<c0322848>] (warn_slowpath_fmt+0x68/0x78)
[   19.522861] [<c0322848>] (warn_slowpath_fmt) from [<c033c9c8>] (__flush_work+0x2d8/0x310)
[   19.530501] [<c033c9c8>] (__flush_work) from [<c033cbbc>] (__cancel_work_timer+0xe0/0x1d0)
[   19.538658] [<c033cbbc>] (__cancel_work_timer) from [<bf2fa4e8>] (ath10k_htc_stop_hl+0x18/0x50 [ath10k_core])
[   19.546841] [<bf2fa4e8>] (ath10k_htc_stop_hl [ath10k_core]) from [<bf303a60>] (ath10k_htt_tx_free+0x14/0x48 [ath10k_core])
[   19.556808] [<bf303a60>] (ath10k_htt_tx_free [ath10k_core]) from [<bf2f6fc4>] (ath10k_core_start+0xb10/0x15bc [ath10k_core])
[   19.567746] [<bf2f6fc4>] (ath10k_core_start [ath10k_core]) from [<bf2f88cc>] (ath10k_core_register_work+0x634/0xb70 [ath10k_core])
[   19.579116] [<bf2f88cc>] (ath10k_core_register_work [ath10k_core]) from [<c033b628>] (process_one_work+0x210/0x478)
[   19.590660] [<c033b628>] (process_one_work) from [<c033c1a4>] (worker_thread+0x4c/0x598)
[   19.600985] [<c033c1a4>] (worker_thread) from [<c0342b28>] (kthread+0x148/0x164)
[   19.609320] [<c0342b28>] (kthread) from [<c0300110>] (ret_from_fork+0x14/0x24)
[   19.616696] Exception stack(0xc1461fb0 to 0xc1461ff8)
[   19.623726] 1fa0:                                     00000000 00000000 00000000 00000000
[   19.628855] 1fc0: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
[   19.637012] 1fe0: 00000000 00000000 00000000 00000000 00000013 00000000
[   19.645225] ---[ end trace 2cf0b8fe89079323 ]---
[   19.651614] ------------[ cut here ]------------
[   19.656461] WARNING: CPU: 1 PID: 9 at kernel/workqueue.c:3084 __flush_work+0x2d8/0x310
[   19.661055] Modules linked in: ath10k_pci(+) ath10k_core ath pppox ppp_generic nft_reject_ipv6 nft_reject_ipv4 nft_reject_inet nft_reject nft_redir nft_quota nft_objref nft_numgen nft_nat nft_masq nft_log nft_limit nft_hash nft_flow_offload nft_fib_ipv6 nft_fib_ipv4 nft_fib nft_ct nft_counter nft_chain_nat nf_tables nf_nat nf_flow_table nf_conntrack mac80211 cfg80211 slhc nfnetlink nf_reject_ipv6 nf_reject_ipv4 nf_log_syslog nf_defrag_ipv6 nf_defrag_ipv4 libcrc32c hwmon crc_ccitt compat ledtrig_gpio sha512_arm ghash_arm_ce cmac leds_gpio xhci_plat_hcd xhci_pci xhci_hcd dwc3 dwc3_qcom gpio_button_hotplug crc32c_generic
[   19.701338] CPU: 1 PID: 9 Comm: kworker/u8:0 Tainted: G        W         5.15.118 #0
[   19.723551] Hardware name: Generic DT based system
[   19.731364] Workqueue: ath10k_wq ath10k_core_register_work [ath10k_core]
[   19.735970] [<c030d4a4>] (unwind_backtrace) from [<c030986c>] (show_stack+0x10/0x14)
[   19.742825] [<c030986c>] (show_stack) from [<c0602ae0>] (dump_stack_lvl+0x40/0x4c)
[   19.750551] [<c0602ae0>] (dump_stack_lvl) from [<c032276c>] (__warn+0x8c/0x100)
[   19.757930] [<c032276c>] (__warn) from [<c0322848>] (warn_slowpath_fmt+0x68/0x78)
[   19.765133] [<c0322848>] (warn_slowpath_fmt) from [<c033c9c8>] (__flush_work+0x2d8/0x310)
[   19.772772] [<c033c9c8>] (__flush_work) from [<c033cbbc>] (__cancel_work_timer+0xe0/0x1d0)
[   19.780932] [<c033cbbc>] (__cancel_work_timer) from [<bf2fa4fc>] (ath10k_htc_stop_hl+0x2c/0x50 [ath10k_core])
[   19.789098] [<bf2fa4fc>] (ath10k_htc_stop_hl [ath10k_core]) from [<bf303a60>] (ath10k_htt_tx_free+0x14/0x48 [ath10k_core])
[   19.799082] [<bf303a60>] (ath10k_htt_tx_free [ath10k_core]) from [<bf2f6fc4>] (ath10k_core_start+0xb10/0x15bc [ath10k_core])
[   19.810019] [<bf2f6fc4>] (ath10k_core_start [ath10k_core]) from [<bf2f88cc>] (ath10k_core_register_work+0x634/0xb70 [ath10k_core])
[   19.821391] [<bf2f88cc>] (ath10k_core_register_work [ath10k_core]) from [<c033b628>] (process_one_work+0x210/0x478)
[   19.832932] [<c033b628>] (process_one_work) from [<c033c1a4>] (worker_thread+0x4c/0x598)
[   19.843258] [<c033c1a4>] (worker_thread) from [<c0342b28>] (kthread+0x148/0x164)
[   19.851593] [<c0342b28>] (kthread) from [<c0300110>] (ret_from_fork+0x14/0x24)
[   19.858967] Exception stack(0xc1461fb0 to 0xc1461ff8)
[   19.866002] 1fa0:                                     00000000 00000000 00000000 00000000
[   19.871128] 1fc0: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
[   19.879290] 1fe0: 00000000 00000000 00000000 00000000 00000013 00000000
[   19.887479] ---[ end trace 2cf0b8fe89079324 ]---
[   19.894070] ath10k_ahb a000000.wifi: could not init core (-110)
[   19.899005] ath10k_ahb a000000.wifi: could not probe fw (-110)
[   20.302494] [rb_hardconfig lz77] lz77 decompressed from 2776 to 11928
[   20.302557] [rb_hardconfig] LZ77: decompressed from 2776 to 11928
[   20.309388] [rb_hardconfig lz77] lz77 decompressed from 2776 to 11928
[   20.314025] [rb_hardconfig] LZ77: decompressed from 2776 to 11928
[   20.321736] [rb_hardconfig lz77] lz77 decompressed from 2776 to 11928
[   20.326569] [rb_hardconfig] LZ77: decompressed from 2776 to 11928
[   20.775166] ath10k_ahb a800000.wifi: qca4019 hw1.0 target 0x01000000 chip_id 0x003b00ff sub 0000:0000
[   20.775236] ath10k_ahb a800000.wifi: kconfig debug 0 debugfs 1 tracing 0 dfs 1 testmode 0
[   20.787302] ath10k_ahb a800000.wifi: firmware ver 10.4b-ct-4019-fW-13-5ae337bb1 api 5 features mfp,peer-flow-ctrl,txstatus-noack,wmi-10.x-CT,ratemask-CT,regdump-CT,txrate-CT,flush-all-CT,pingpong-CT,ch-regs-CT,nop-CT,set-special-CT,tx-rc-CT,cust-stats-CT,txrate2-CT,beacon-cb-CT,wmi-block-ack-CT,wmi-bcn-rc-CT crc32 6b2b5c5b
[   21.059989] [rb_hardconfig lz77] lz77 decompressed from 2776 to 11928
[   21.060049] [rb_hardconfig] LZ77: decompressed from 2776 to 11928
[   21.066494] [rb_hardconfig lz77] lz77 decompressed from 2776 to 11928
[   21.071517] [rb_hardconfig] LZ77: decompressed from 2776 to 11928
[   21.079939] ath10k_ahb a800000.wifi: board_file api 1 bmi_id N/A crc32 bba9ed79
[   21.125946] ath10k_ahb a800000.wifi: failed to get board id: -95
[   23.436591] ath10k_ahb a800000.wifi: failed to receive control response completion, polling..
[   24.476723] ath10k_ahb a800000.wifi: ctl_resp never came in (-110)
[   24.477126] ath10k_ahb a800000.wifi: failed to connect to HTC: -110
[   24.537567] ------------[ cut here ]------------
[   24.537626] WARNING: CPU: 0 PID: 9 at kernel/workqueue.c:3084 __flush_work+0x2d8/0x310
[   24.541284] Modules linked in: ath10k_pci(+) ath10k_core ath pppox ppp_generic nft_reject_ipv6 nft_reject_ipv4 nft_reject_inet nft_reject nft_redir nft_quota nft_objref nft_numgen nft_nat nft_masq nft_log nft_limit nft_hash nft_flow_offload nft_fib_ipv6 nft_fib_ipv4 nft_fib nft_ct nft_counter nft_chain_nat nf_tables nf_nat nf_flow_table nf_conntrack mac80211 cfg80211 slhc nfnetlink nf_reject_ipv6 nf_reject_ipv4 nf_log_syslog nf_defrag_ipv6 nf_defrag_ipv4 libcrc32c hwmon crc_ccitt compat ledtrig_gpio sha512_arm ghash_arm_ce cmac leds_gpio xhci_plat_hcd xhci_pci xhci_hcd dwc3 dwc3_qcom gpio_button_hotplug crc32c_generic
[   24.581614] CPU: 0 PID: 9 Comm: kworker/u8:0 Tainted: G        W         5.15.118 #0
[   24.603782] Hardware name: Generic DT based system
[   24.611592] Workqueue: ath10k_wq ath10k_core_register_work [ath10k_core]
[   24.616204] [<c030d4a4>] (unwind_backtrace) from [<c030986c>] (show_stack+0x10/0x14)
[   24.623057] [<c030986c>] (show_stack) from [<c0602ae0>] (dump_stack_lvl+0x40/0x4c)
[   24.630783] [<c0602ae0>] (dump_stack_lvl) from [<c032276c>] (__warn+0x8c/0x100)
[   24.638161] [<c032276c>] (__warn) from [<c0322848>] (warn_slowpath_fmt+0x68/0x78)
[   24.645364] [<c0322848>] (warn_slowpath_fmt) from [<c033c9c8>] (__flush_work+0x2d8/0x310)
[   24.653005] [<c033c9c8>] (__flush_work) from [<c033cbbc>] (__cancel_work_timer+0xe0/0x1d0)
[   24.661162] [<c033cbbc>] (__cancel_work_timer) from [<bf2fa4e8>] (ath10k_htc_stop_hl+0x18/0x50 [ath10k_core])
[   24.669331] [<bf2fa4e8>] (ath10k_htc_stop_hl [ath10k_core]) from [<bf303a60>] (ath10k_htt_tx_free+0x14/0x48 [ath10k_core])
[   24.679313] [<bf303a60>] (ath10k_htt_tx_free [ath10k_core]) from [<bf2f6fc4>] (ath10k_core_start+0xb10/0x15bc [ath10k_core])
[   24.690251] [<bf2f6fc4>] (ath10k_core_start [ath10k_core]) from [<bf2f88cc>] (ath10k_core_register_work+0x634/0xb70 [ath10k_core])
[   24.701622] [<bf2f88cc>] (ath10k_core_register_work [ath10k_core]) from [<c033b628>] (process_one_work+0x210/0x478)
[   24.713164] [<c033b628>] (process_one_work) from [<c033c1a4>] (worker_thread+0x4c/0x598)
[   24.723491] [<c033c1a4>] (worker_thread) from [<c0342b28>] (kthread+0x148/0x164)
[   24.731824] [<c0342b28>] (kthread) from [<c0300110>] (ret_from_fork+0x14/0x24)
[   24.739200] Exception stack(0xc1461fb0 to 0xc1461ff8)
[   24.746232] 1fa0:                                     00000000 00000000 00000000 00000000
[   24.751357] 1fc0: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
[   24.759516] 1fe0: 00000000 00000000 00000000 00000000 00000013 00000000
[   24.767722] ---[ end trace 2cf0b8fe89079325 ]---
[   24.774093] ------------[ cut here ]------------
[   24.778972] WARNING: CPU: 0 PID: 9 at kernel/workqueue.c:3084 __flush_work+0x2d8/0x310
[   24.783559] Modules linked in: ath10k_pci(+) ath10k_core ath pppox ppp_generic nft_reject_ipv6 nft_reject_ipv4 nft_reject_inet nft_reject nft_redir nft_quota nft_objref nft_numgen nft_nat nft_masq nft_log nft_limit nft_hash nft_flow_offload nft_fib_ipv6 nft_fib_ipv4 nft_fib nft_ct nft_counter nft_chain_nat nf_tables nf_nat nf_flow_table nf_conntrack mac80211 cfg80211 slhc nfnetlink nf_reject_ipv6 nf_reject_ipv4 nf_log_syslog nf_defrag_ipv6 nf_defrag_ipv4 libcrc32c hwmon crc_ccitt compat ledtrig_gpio sha512_arm ghash_arm_ce cmac leds_gpio xhci_plat_hcd xhci_pci xhci_hcd dwc3 dwc3_qcom gpio_button_hotplug crc32c_generic
[   24.823843] CPU: 0 PID: 9 Comm: kworker/u8:0 Tainted: G        W         5.15.118 #0
[   24.846057] Hardware name: Generic DT based system
[   24.853868] Workqueue: ath10k_wq ath10k_core_register_work [ath10k_core]
[   24.858474] [<c030d4a4>] (unwind_backtrace) from [<c030986c>] (show_stack+0x10/0x14)
[   24.865329] [<c030986c>] (show_stack) from [<c0602ae0>] (dump_stack_lvl+0x40/0x4c)
[   24.873056] [<c0602ae0>] (dump_stack_lvl) from [<c032276c>] (__warn+0x8c/0x100)
[   24.880434] [<c032276c>] (__warn) from [<c0322848>] (warn_slowpath_fmt+0x68/0x78)
[   24.887636] [<c0322848>] (warn_slowpath_fmt) from [<c033c9c8>] (__flush_work+0x2d8/0x310)
[   24.895277] [<c033c9c8>] (__flush_work) from [<c033cbbc>] (__cancel_work_timer+0xe0/0x1d0)
[   24.903435] [<c033cbbc>] (__cancel_work_timer) from [<bf2fa4fc>] (ath10k_htc_stop_hl+0x2c/0x50 [ath10k_core])
[   24.911602] [<bf2fa4fc>] (ath10k_htc_stop_hl [ath10k_core]) from [<bf303a60>] (ath10k_htt_tx_free+0x14/0x48 [ath10k_core])
[   24.921586] [<bf303a60>] (ath10k_htt_tx_free [ath10k_core]) from [<bf2f6fc4>] (ath10k_core_start+0xb10/0x15bc [ath10k_core])
[   24.932521] [<bf2f6fc4>] (ath10k_core_start [ath10k_core]) from [<bf2f88cc>] (ath10k_core_register_work+0x634/0xb70 [ath10k_core])
[   24.943895] [<bf2f88cc>] (ath10k_core_register_work [ath10k_core]) from [<c033b628>] (process_one_work+0x210/0x478)
[   24.955436] [<c033b628>] (process_one_work) from [<c033c1a4>] (worker_thread+0x4c/0x598)
[   24.965763] [<c033c1a4>] (worker_thread) from [<c0342b28>] (kthread+0x148/0x164)
[   24.974095] [<c0342b28>] (kthread) from [<c0300110>] (ret_from_fork+0x14/0x24)
[   24.981475] Exception stack(0xc1461fb0 to 0xc1461ff8)
[   24.988505] 1fa0:                                     00000000 00000000 00000000 00000000
[   24.993632] 1fc0: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
[   25.001791] 1fe0: 00000000 00000000 00000000 00000000 00000013 00000000
[   25.009988] ---[ end trace 2cf0b8fe89079326 ]---
[   25.016556] ath10k_ahb a800000.wifi: could not init core (-110)
[   25.021491] ath10k_ahb a800000.wifi: could not probe fw (-110)
[   25.034395] kmodloader: done loading kernel modules from /etc/modules.d/*
[   46.620593] ipqess-edma c080000.ethernet eth0: Link is Down
[   46.627136] ipqess-edma c080000.ethernet eth0: configuring for fixed/internal link mode
[   46.627446] ipqess-edma c080000.ethernet eth0: Link is Up - 1Gbps/Full - flow control rx/tx
[   46.634119] IPv6: ADDRCONF(NETDEV_CHANGE): eth0: link becomes ready
[   46.646192] device eth0 entered promiscuous mode
[   46.651074] qca8k-ipq4019 c000000.switch lan1: configuring for phy/psgmii link mode
[   46.659763] br-lan: port 1(lan1) entered blocking state
[   46.659832] br-lan: port 1(lan1) entered disabled state
[   46.664585] device lan1 entered promiscuous mode
[   46.681330] qca8k-ipq4019 c000000.switch lan2: configuring for phy/psgmii link mode
[   46.683516] br-lan: port 2(lan2) entered blocking state
[   46.687929] br-lan: port 2(lan2) entered disabled state
[   46.693578] device lan2 entered promiscuous mode
[   46.702424] qca8k-ipq4019 c000000.switch lan3: configuring for phy/psgmii link mode
[   46.705293] br-lan: port 3(lan3) entered blocking state
[   46.710619] br-lan: port 3(lan3) entered disabled state
[   46.716378] device lan3 entered promiscuous mode
[   46.724148] qca8k-ipq4019 c000000.switch lan4: configuring for phy/psgmii link mode
[   46.728163] br-lan: port 4(lan4) entered blocking state
[   46.733152] br-lan: port 4(lan4) entered disabled state
[   46.739166] device lan4 entered promiscuous mode
[   46.755112] qca8k-ipq4019 c000000.switch wan: configuring for phy/psgmii link mode
[   49.758154] qca8k-ipq4019 c000000.switch lan1: Link is Up - 1Gbps/Full - flow control rx/tx
[   49.758868] br-lan: port 1(lan1) entered blocking state
[   49.765763] br-lan: port 1(lan1) entered forwarding state
[   49.778103] IPv6: ADDRCONF(NETDEV_CHANGE): br-lan: link becomes ready

I can test again if you commit a new version

1 Like

Thanks for testing!

Good to see lz77 decompress seemed to work.

I think I need to add the routerboot_tag_find same as lzor. It seems currently RLE decoding entire buffer, but only want specific tags. Will compile test, then push to git.
Edit: above now pushed

Hi @johnth

You are the best. Congratulations !!! The patch is functional.

Everything works correctly. You can submit your code to the official branch of OpenWRT. I think you will unlock some platforms like HAP AX2 or AX3 which are blocked by this problem?

Here is the return of my router console and my tests. Either way, it's functional. The card is detected in SSH and in LUCI. Everything works thank you!!! If you want to optimize or clean up your code I can still test!

Here is my board to confirm that it is indeed an LZ77

root@OpenWrt:~# hexdump -C -s $((0x140)) -n 32 "/dev/mtd$(find_mtd_index hard_config)"
00000140  cc 02 00 00 00 00 00 00  16 00 dc 0a 37 37 5a 4c  |............77ZL|
00000150  83 a8 88 92 28 00 60 10  1d e6 1f 01 3d d0 1f 10  |....(.`.....=...|

root@OpenWrt:~# iwinfo
phy0-ap0  ESSID: "OpenWrt"
          Access Point: 48:A9:8A:21:6D:BC
          Mode: Master  Channel: 1 (2.412 GHz)  HT Mode: HT20
          Center Channel 1: 1 2: unknown
          Tx-Power: 30 dBm  Link Quality: unknown/70
          Signal: unknown  Noise: -103 dBm
          Bit Rate: unknown
          Encryption: none
          Type: nl80211  HW Mode(s): 802.11b/g/n
          Hardware: embedded [Qualcomm Atheros IPQ4019]
          TX power offset: none
          Frequency offset: none
          Supports VAPs: yes  PHY name: phy0

phy1-ap0  ESSID: "OpenWrt"
          Access Point: 48:A9:8A:21:6D:BD
          Mode: Master  Channel: 36 (5.180 GHz)  HT Mode: VHT80
          Center Channel 1: 42 2: unknown
          Tx-Power: 23 dBm  Link Quality: 70/70
          Signal: -36 dBm  Noise: -107 dBm
          Bit Rate: 866.7 MBit/s
          Encryption: none
          Type: nl80211  HW Mode(s): 802.11ac/n
          Hardware: embedded [Qualcomm Atheros IPQ4019]
          TX power offset: none
          Frequency offset: none
          Supports VAPs: yes  PHY name: phy1

Console of my router

[    0.000000] Booting Linux on physical CPU 0x0
[    0.000000] Linux version 5.15.118 (root@2ISSV034) (arm-openwrt-linux-muslgnueabi-gcc (OpenWrt GCC 12.3.0 r23422+1-e0fb38f4ee) 12.3.0, GNU ld (GNU Binutils) 2.40.0) #0 SMP Sat Jun 24 12:56:11 2023
[    0.000000] CPU: ARMv7 Processor [410fc075] revision 5 (ARMv7), cr=10c5387d
[    0.000000] CPU: div instructions available: patching division code
[    0.000000] CPU: PIPT / VIPT nonaliasing data cache, VIPT aliasing instruction cache
[    0.000000] OF: fdt: Machine model: MikroTik hAP ac3
[    0.000000] Memory policy: Data cache writealloc
[    0.000000] Zone ranges:
[    0.000000]   Normal   [mem 0x0000000080000000-0x000000008fffffff]
[    0.000000]   HighMem  empty
[    0.000000] Movable zone start for each node
[    0.000000] Early memory node ranges
[    0.000000]   node   0: [mem 0x0000000080000000-0x0000000087dfffff]
[    0.000000]   node   0: [mem 0x0000000087e00000-0x0000000087ffffff]
[    0.000000]   node   0: [mem 0x0000000088000000-0x000000008fffffff]
[    0.000000] Initmem setup node 0 [mem 0x0000000080000000-0x000000008fffffff]
[    0.000000] percpu: Embedded 11 pages/cpu s16268 r8192 d20596 u45056
[    0.000000] Built 1 zonelists, mobility grouping on.  Total pages: 64960
[    0.000000] Kernel command line:
[    0.000000] Dentry cache hash table entries: 32768 (order: 5, 131072 bytes, linear)
[    0.000000] Inode-cache hash table entries: 16384 (order: 4, 65536 bytes, linear)
[    0.000000] mem auto-init: stack:off, heap alloc:off, heap free:off
[    0.000000] Memory: 246216K/262144K available (6565K kernel code, 608K rwdata, 1676K rodata, 1024K init, 239K bss, 15928K reserved, 0K cma-reserved, 0K highmem)
[    0.000000] SLUB: HWalign=64, Order=0-3, MinObjects=0, CPUs=4, Nodes=1
[    0.000000] rcu: Hierarchical RCU implementation.
[    0.000000]  Tracing variant of Tasks RCU enabled.
[    0.000000] rcu: RCU calculated value of scheduler-enlistment delay is 10 jiffies.
[    0.000000] NR_IRQS: 16, nr_irqs: 16, preallocated irqs: 16
[    0.000000] arch_timer: cp15 timer(s) running at 48.00MHz (virt).
[    0.000000] clocksource: arch_sys_counter: mask: 0xffffffffffffff max_cycles: 0xb11fd3bfb, max_idle_ns: 440795203732 ns
[    0.000002] sched_clock: 56 bits at 48MHz, resolution 20ns, wraps every 4398046511096ns
[    0.000024] Switching to timer-based delay loop, resolution 20ns
[    0.000315] Calibrating delay loop (skipped), value calculated using timer frequency.. 96.00 BogoMIPS (lpj=480000)
[    0.000345] pid_max: default: 32768 minimum: 301
[    0.001249] Mount-cache hash table entries: 1024 (order: 0, 4096 bytes, linear)
[    0.001280] Mountpoint-cache hash table entries: 1024 (order: 0, 4096 bytes, linear)
[    0.002948] CPU: Testing write buffer coherency: ok
[    0.003427] qcom_scm: convention: smc legacy
[    0.004670] Setting up static identity map for 0x80300000 - 0x8030003c
[    0.004851] rcu: Hierarchical SRCU implementation.
[    0.005481] smp: Bringing up secondary CPUs ...
[    0.009059] smp: Brought up 1 node, 4 CPUs
[    0.009098] SMP: Total of 4 processors activated (384.00 BogoMIPS).
[    0.009113] CPU: All CPU(s) started in SVC mode.
[    0.015216] VFP support v0.3: implementor 41 architecture 2 part 30 variant 7 rev 5
[    0.015425] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 19112604462750000 ns
[    0.015464] futex hash table entries: 1024 (order: 4, 65536 bytes, linear)
[    0.015877] pinctrl core: initialized pinctrl subsystem
[    0.017966] NET: Registered PF_NETLINK/PF_ROUTE protocol family
[    0.018379] DMA: preallocated 256 KiB pool for atomic coherent allocations
[    0.019758] thermal_sys: Registered thermal governor 'step_wise'
[    0.020320] cpuidle: using governor ladder
[    0.020394] cpuidle: using governor menu
[    0.028394] gpio-456 (enable USB power): hogged as output/high
[    0.048405] cryptd: max_cpu_qlen set to 1000
[    0.053238] usbcore: registered new interface driver usbfs
[    0.053317] usbcore: registered new interface driver hub
[    0.053380] usbcore: registered new device driver usb
[    0.053476] pps_core: LinuxPPS API ver. 1 registered
[    0.053489] pps_core: Software ver. 5.3.6 - Copyright 2005-2007 Rodolfo Giometti <giometti@linux.it>
[    0.053542] PTP clock support registered
[    0.055762] clocksource: Switched to clocksource arch_sys_counter
[    0.057101] NET: Registered PF_INET protocol family
[    0.057334] IP idents hash table entries: 4096 (order: 3, 32768 bytes, linear)
[    0.058190] tcp_listen_portaddr_hash hash table entries: 512 (order: 0, 6144 bytes, linear)
[    0.058259] Table-perturb hash table entries: 65536 (order: 6, 262144 bytes, linear)
[    0.058291] TCP established hash table entries: 2048 (order: 1, 8192 bytes, linear)
[    0.058338] TCP bind hash table entries: 2048 (order: 2, 16384 bytes, linear)
[    0.058395] TCP: Hash tables configured (established 2048 bind 2048)
[    0.058563] UDP hash table entries: 256 (order: 1, 8192 bytes, linear)
[    0.058615] UDP-Lite hash table entries: 256 (order: 1, 8192 bytes, linear)
[    0.058997] NET: Registered PF_UNIX/PF_LOCAL protocol family
[    0.059065] PCI: CLS 0 bytes, default 64
[    0.061551] workingset: timestamp_bits=14 max_order=16 bucket_order=2
[    0.067446] squashfs: version 4.0 (2009/01/31) Phillip Lougher
[    0.067484] jffs2: version 2.2 (NAND) (SUMMARY) (LZMA) (RTIME) (CMODE_PRIORITY) (c) 2001-2006 Red Hat, Inc.
[    0.198679] bam-dma-engine 8e04000.dma: num-channels unspecified in dt
[    0.198716] bam-dma-engine 8e04000.dma: num-ees unspecified in dt
[    0.200207] tcsr 1949000.tcsr: setting wifi_glb_cfg = 41000000
[    0.200327] tcsr 194b000.tcsr: setting usb hs phy mode select = e700e7
[    0.200480] tcsr 1953000.ess_tcsr: setting ess interface select = 0
[    0.200582] tcsr 1957000.tcsr: setting wifi_noc_memtype_m0_m2 = 2222222
[    0.200916] Serial: 8250/16550 driver, 2 ports, IRQ sharing disabled
[    0.201532] msm_serial 78af000.serial: msm_serial: detected port #0
[    0.201583] msm_serial 78af000.serial: uartclk = 1843200
[    0.201639] 78af000.serial: ttyMSM0 at MMIO 0x78af000 (irq = 33, base_baud = 115200) is a MSM
[    0.201678] msm_serial: console setup on port #0
[    0.744314] printk: console [ttyMSM0] enabled
[    0.749558] msm_serial: driver initialized
[    0.759499] loop: module loaded
[    0.761631] nand: device found, Manufacturer ID: 0xef, Chip ID: 0xf1
[    0.761681] nand: Winbond W29N01HV
[    0.768113] nand: 128 MiB, SLC, erase size: 128 KiB, page size: 2048, OOB size: 64
[    0.771371] 2 fixed-partitions partitions found on MTD device qcom_nand.0
[    0.778861] Creating 2 MTD partitions on "qcom_nand.0":
[    0.785682] 0x000000000000-0x000000a00000 : "kernel"
[    0.806394] 0x000000a00000-0x000008000000 : "ubi"
[    0.982926] spi_qup 78b5000.spi: IN:block:16, fifo:64, OUT:block:16, fifo:64
[    0.984681] spi-nor spi0.0: w25q128jv (16384 Kbytes)
[    0.989158] 2 fixed-partitions partitions found on MTD device spi0.0
[    0.994043] OF: Bad cell count for /soc/spi@78b5000/flash@0/partitions
[    1.000403] OF: Bad cell count for /soc/spi@78b5000/flash@0/partitions
[    1.006948] Creating 2 MTD partitions on "spi0.0":
[    1.013242] 0x000000000000-0x000000080000 : "Qualcomm"
[    1.018667] 0x000000080000-0x000000100000 : "RouterBoot"
[    1.030804] 3 routerbootpart partitions found on MTD device RouterBoot
[    1.030856] Creating 3 MTD partitions on "RouterBoot":
[    1.036271] 0x00000000e000-0x000000010000 : "hard_config"
[    1.041966] 0x000000010000-0x000000017ea4 : "dtb_config"
[    1.047395] 0x00000003d000-0x00000003e000 : "soft_config"
[    1.079226] ipqess-edma c080000.ethernet: generated random MAC address e2:81:1d:95:f2:6c
[    1.104301] i2c_dev: i2c /dev entries driver
[    1.106531] sdhci: Secure Digital Host Controller Interface driver
[    1.107657] sdhci: Copyright(c) Pierre Ossman
[    1.113639] sdhci-pltfm: SDHCI platform and OF driver helper
[    1.125281] MikroTik RouterBOARD hardware configuration sysfs driver v0.08
[    1.126550] MikroTik RouterBOARD software configuration sysfs driver v0.05
[    1.132379] NET: Registered PF_INET6 protocol family
[    1.140446] Segment Routing with IPv6
[    1.143137] In-situ OAM (IOAM) with IPv6
[    1.146841] NET: Registered PF_PACKET protocol family
[    1.150975] 8021q: 802.1Q VLAN Support v1.8
[    1.155602] Registering SWP/SWPB emulation handler
[    1.174637] qca8k-ipq4019 c000000.switch: configuring for fixed/internal link mode
[    1.174910] qca8k-ipq4019 c000000.switch: Link is Up - 1Gbps/Full - flow control rx/tx
[    1.260422] qca8k-ipq4019 c000000.switch lan4 (uninitialized): PHY [90000.mdio-1:00] driver [Qualcomm QCA8075] (irq=POLL)
[    1.349954] qca8k-ipq4019 c000000.switch lan3 (uninitialized): PHY [90000.mdio-1:01] driver [Qualcomm QCA8075] (irq=POLL)
[    1.440712] qca8k-ipq4019 c000000.switch lan2 (uninitialized): PHY [90000.mdio-1:02] driver [Qualcomm QCA8075] (irq=POLL)
[    1.530716] qca8k-ipq4019 c000000.switch lan1 (uninitialized): PHY [90000.mdio-1:03] driver [Qualcomm QCA8075] (irq=POLL)
[    1.622453] qca8k-ipq4019 c000000.switch wan (uninitialized): PHY [90000.mdio-1:04] driver [Qualcomm QCA8075] (irq=POLL)
[    1.633988] DSA: tree 0 setup
[    1.637925] UBI: auto-attach mtd1
[    1.637973] ubi0: attaching mtd1
[    3.276250] ubi0: scanning is finished
[    3.299222] ubi0: attached mtd1 (name "ubi", size 118 MiB)
[    3.299286] ubi0: PEB size: 131072 bytes (128 KiB), LEB size: 126976 bytes
[    3.303633] ubi0: min./max. I/O unit sizes: 2048/2048, sub-page size 2048
[    3.310543] ubi0: VID header offset: 2048 (aligned 2048), data offset: 4096
[    3.317371] ubi0: good PEBs: 944, bad PEBs: 0, corrupted PEBs: 0
[    3.324117] ubi0: user volume: 2, internal volumes: 1, max. volumes count: 128
[    3.330409] ubi0: max/mean erase counter: 1/0, WL threshold: 4096, image sequence number: 1095831599
[    3.337427] ubi0: available PEBs: 0, total reserved PEBs: 944, PEBs reserved for bad PEB handling: 20
[    3.346756] ubi0: background thread "ubi_bgt0d" started, PID 133
[    3.348261] block ubiblock0_0: created from ubi0:0(rootfs)
▒[    3.374498] VFS: Mounted root (squashfs filesystem) readonly on device 254:0.
[    3.376650] Freeing unused kernel image (initmem) memory: 1024K
[    3.409550] Run /sbin/init as init process
[    4.538356] init: Console is alive
[    4.538822] init: - watchdog -
[    5.763233] kmodloader: loading kernel modules from /etc/modules-boot.d/*
[    5.903546] xhci-hcd xhci-hcd.0.auto: xHCI Host Controller
[    5.903651] xhci-hcd xhci-hcd.0.auto: new USB bus registered, assigned bus number 1
[    5.908359] xhci-hcd xhci-hcd.0.auto: hcc params 0x0220f665 hci version 0x100 quirks 0x0000000002010010
[    5.915600] xhci-hcd xhci-hcd.0.auto: irq 104, io mem 0x06000000
[    5.925129] xhci-hcd xhci-hcd.0.auto: xHCI Host Controller
[    5.931182] xhci-hcd xhci-hcd.0.auto: new USB bus registered, assigned bus number 2
[    5.936467] xhci-hcd xhci-hcd.0.auto: Host supports USB 3.0 SuperSpeed
[    5.944813] hub 1-0:1.0: USB hub found
[    5.950678] hub 1-0:1.0: 1 port detected
[    5.954780] usb usb2: We don't know the algorithms for LPM for this host, disabling LPM.
[    5.959037] hub 2-0:1.0: USB hub found
[    5.966538] hub 2-0:1.0: config failed, hub doesn't have any ports! (err -19)
[    5.973522] kmodloader: done loading kernel modules from /etc/modules-boot.d/*
[    5.985851] init: - preinit -
[    7.765907] random: crng init done
[    8.454633] ipqess-edma c080000.ethernet eth0: configuring for fixed/internal link mode
[    8.455603] qca8k-ipq4019 c000000.switch lan1: configuring for phy/psgmii link mode
[    8.461904] ipqess-edma c080000.ethernet eth0: Link is Up - 1Gbps/Full - flow control rx/tx
[    9.564786] IPv6: ADDRCONF(NETDEV_CHANGE): eth0: link becomes ready
Press the [f] key and hit [enter] to enter failsafe mode
Press the [1], [2], [3] or [4] key and hit [enter] to select the debug level
[   12.161912] UBIFS (ubi0:1): default file-system created
[   12.163214] UBIFS (ubi0:1): Mounting in unauthenticated mode
[   12.166298] UBIFS (ubi0:1): background thread "ubifs_bgt0_1" started, PID 244
[   12.310124] UBIFS (ubi0:1): UBIFS: mounted UBI device 0, volume 1, name "rootfs_data"
[   12.310257] UBIFS (ubi0:1): LEB size: 126976 bytes (124 KiB), min./max. I/O unit sizes: 2048 bytes/2048 bytes
[   12.317177] UBIFS (ubi0:1): FS size: 110469120 bytes (105 MiB, 870 LEBs), max 881 LEBs, journal size 5586944 bytes (5 MiB, 44 LEBs)
[   12.327040] UBIFS (ubi0:1): reserved for root: 4952683 bytes (4836 KiB)
[   12.338622] UBIFS (ubi0:1): media format: w5/r0 (latest is w5/r0), UUID 104B8683-EA69-4560-9DCD-05C820715A9E, small LPT model
[   12.349317] mount_root: overlay filesystem has not been fully initialized yet
[   12.358293] mount_root: switching to ubifs overlay
[   12.383780] urandom-seed: Seed file not found (/etc/urandom.seed)
[   12.572392] procd: - early -
[   12.572924] procd: - watchdog -
[   13.189869] procd: - watchdog -
[   13.233070] procd: - ubus -
[   13.440754] procd: - init -
Please press Enter to activate this console.
[   14.198441] kmodloader: loading kernel modules from /etc/modules.d/*
[   14.210080] GACT probability on
[   14.211398] Mirror/redirect action on
[   14.220502] u32 classifier
[   14.220547]     input device check on
[   14.222116]     Actions configured
[   14.246398] Loading modules backported from Linux version v6.1.24-0-g0102425ac76b
[   14.246459] Backport generated by backports.git v5.15.92-1-44-gd6ea70fafd36
[   14.266615] urngd: v1.0.2 started.
[   14.295474] xt_time: kernel timezone is -0000
[   14.442768] PPP generic driver version 2.4.2
[   14.444437] NET: Registered PF_PPPOX protocol family
[   16.208931] ath10k_ahb a000000.wifi: qca4019 hw1.0 target 0x01000000 chip_id 0x003b00ff sub 0000:0000
[   16.209006] ath10k_ahb a000000.wifi: kconfig debug 0 debugfs 1 tracing 0 dfs 1 testmode 0
[   16.220948] ath10k_ahb a000000.wifi: firmware ver 10.4b-ct-4019-fW-13-5ae337bb1 api 5 features mfp,peer-flow-ctrl,txstatus-noack,wmi-10.x-CT,ratemask-CT,regdump-CT,txrate-CT,flush-all-CT,pingpong-CT,ch-regs-CT,nop-CT,set-special-CT,tx-rc-CT,cust-stats-CT,txrate2-CT,beacon-cb-CT,wmi-block-ack-CT,wmi-bcn-rc-CT crc32 6b2b5c5b
[   16.475075] ath10k_ahb a000000.wifi: board_file api 1 bmi_id 0:16 crc32 338a25b7
[   17.765270] ath10k_ahb a000000.wifi: 10.4 wmi init: vdevs: 16  peers: 48  tid: 96
[   17.765355] ath10k_ahb a000000.wifi: msdu-desc: 2500  skid: 32
[   17.801359] ath10k_ahb a000000.wifi: wmi print 'P 48/48 V 16 K 144 PH 176 T 186  msdu-desc: 2500  sw-crypt: 0 ct-sta: 0'
[   17.802312] ath10k_ahb a000000.wifi: wmi print 'free: 53252 iram: 13432 sram: 35752'
[   17.930532] ath10k_ahb a000000.wifi: htt-ver 2.2 wmi-op 6 htt-op 4 cal pre-cal-file max-sta 32 raw 0 hwcrypto 1
[   20.007851] ath10k_ahb a800000.wifi: qca4019 hw1.0 target 0x01000000 chip_id 0x003b00ff sub 0000:0000
[   20.007923] ath10k_ahb a800000.wifi: kconfig debug 0 debugfs 1 tracing 0 dfs 1 testmode 0
[   20.021344] ath10k_ahb a800000.wifi: firmware ver 10.4b-ct-4019-fW-13-5ae337bb1 api 5 features mfp,peer-flow-ctrl,txstatus-noack,wmi-10.x-CT,ratemask-CT,regdump-CT,txrate-CT,flush-all-CT,pingpong-CT,ch-regs-CT,nop-CT,set-special-CT,tx-rc-CT,cust-stats-CT,txrate2-CT,beacon-cb-CT,wmi-block-ack-CT,wmi-bcn-rc-CT crc32 6b2b5c5b
[   20.289576] ath10k_ahb a800000.wifi: board_file api 1 bmi_id 0:17 crc32 69e65f6d
[   21.578188] ath10k_ahb a800000.wifi: 10.4 wmi init: vdevs: 16  peers: 48  tid: 96
[   21.578270] ath10k_ahb a800000.wifi: msdu-desc: 2500  skid: 32
[   21.613920] ath10k_ahb a800000.wifi: wmi print 'P 48/48 V 16 K 144 PH 176 T 186  msdu-desc: 2500  sw-crypt: 0 ct-sta: 0'
[   21.614890] ath10k_ahb a800000.wifi: wmi print 'free: 53252 iram: 13432 sram: 35752'
[   21.738616] ath10k_ahb a800000.wifi: htt-ver 2.2 wmi-op 6 htt-op 4 cal pre-cal-file max-sta 32 raw 0 hwcrypto 1
[   21.905174] kmodloader: done loading kernel modules from /etc/modules.d/*

LUCI also works!

Thank you for the testing, and for the gratitude.

Can you tell us when your modification will be on the master branch? Will it be integrated in 23.05?
Thanks

Hi @johnth

Did you commit your change to the master branch?

This will take some time. Change needs to be tested, cleaned up, submitted, reviewed, then finally possibly accepted. Weeks at minimum, after it has been submitted.

@johnth out of the many devices, today I found one where the LZ77 decomp fails.

I have a log and a hard_config dump for you but I dont want to share it here. Please send me a PM so I can send you the files.

Log is public of course:

[    0.960517] [rb_hardconfig][lz77] input overrun
[    0.960565] [rb_hardconfig] LZ77: LZ77 decompress fail
[    0.964427] [rb_hardconfig][lz77] input overrun
[    0.969139] [rb_hardconfig] LZ77: LZ77 decompress fail
[    0.974058] [rb_hardconfig][lz77] input overrun
[    0.978735] [rb_hardconfig] LZ77: LZ77 decompress fail

Hi @johnth

Do you have new for this modification ? I don't see your commit on the rc3 branch

1 Like

Hi @johnth

Do you have any news about your commit because I don't see it in the final version 23.05 ?

Thanks