ATH79 - kernel 5.4 (swconfig + libnl tiny issue)

Hey there,

i tried to get kernel 5.4 running and i managed to get it booting based on the work here https://git.openwrt.org/?p=openwrt/staging/blocktrron.git;a=shortlog;h=refs/heads/k54 and some pretty serious tweaks to some patches + the kernel (spi-ath79 driver on 5.4 is broken 4.19 needs to be used).

I manged to load everything and the wifi works correctly, but my network connection doesnt work.

swconfig output:

root@OpenWrt:/proc# swconfig dev switch0 show
Global attributes:
        enable_vlan: 1
        ar8xxx_mib_poll_interval: 0
        ar8xxx_mib_type: 0
        enable_mirror_rx: 0
        enable_mirror_tx: 0
        mirror_monitor_port: 0
        mirror_source_port: 0
        arl_age_time: 300
        arl_table: address resolution table

        igmp_snooping: 0
        igmp_v3: 0
Port 0:
        mib: ???
        enable_eee: ???
        igmp_snooping: 0
        vlan_prio: 0
        pvid: 0
        link: port:0 link:up speed:1000baseT full-duplex txflow rxflow
Port 1:
        mib: ???
        enable_eee: 0
        igmp_snooping: 0
        vlan_prio: 0
        pvid: 0
        link: port:1 link:down
Port 2:
        mib: ???
        enable_eee: 0
        igmp_snooping: 0
        vlan_prio: 0
        pvid: 0
        link: port:2 link:up speed:1000baseT full-duplex txflow rxflow auto
Port 3:
        mib: ???
        enable_eee: 0
        igmp_snooping: 0
        vlan_prio: 0
        pvid: 0
        link: port:3 link:down
Port 4:
        mib: ???
        enable_eee: 0
        igmp_snooping: 0
        vlan_prio: 0
        pvid: 0
        link: port:4 link:down
Port 5:
        mib: ???
        enable_eee: 0
        igmp_snooping: 0
        vlan_prio: 0
        pvid: 0
        link: port:5 link:down
Port 6:
        mib: ???
        enable_eee: ???
        igmp_snooping: 0
        vlan_prio: 0
        pvid: 0
        link: port:6 link:up speed:10baseT half-duplex

It seems like my switch vlan configuration is not applied for some reason, as pvid is empty and the vlan entries are missing.

config switch_vlan
        option device 'switch0'
        option vlan '1'
        option ports '2 0t'

config switch_vlan
        option device 'switch0'
        option vlan '2'
        option ports '3 0t'

How does this work?

Bingo
Thats also the output below:

swconfig dev switch0 vlan 2 set ports "0t 3"
Failed to set attribute: Invalid input data or parameter

Now i only need to figure out why that fails...

dmesg:

[    0.000000] Linux version 5.4.2 (openwrt@buildhasryzen) (gcc version 9.2.0 (OpenWrt GCC 9.2.0 r11685+1-f45a16dead)) #0 Tue Dec 17 14:29:07 2019
[    0.000000] printk: bootconsole [early0] enabled
[    0.000000] CPU0 revision is: 00019750 (MIPS 74Kc)
[    0.000000] MIPS: machine is Ubiquiti UniFi-AC-PRO
[    0.000000] SoC: Qualcomm Atheros QCA956X ver 1 rev 0
[    0.000000] Initrd not found or empty - disabling initrd
[    0.000000] Primary instruction cache 64kB, VIPT, 4-way, linesize 32 bytes.
[    0.000000] Primary data cache 32kB, 4-way, VIPT, cache aliases, linesize 32 bytes
[    0.000000] Zone ranges:
[    0.000000]   Normal   [mem 0x0000000000000000-0x0000000007ffffff]
[    0.000000] Movable zone start for each node
[    0.000000] Early memory node ranges
[    0.000000]   node   0: [mem 0x0000000000000000-0x0000000007ffffff]
[    0.000000] Initmem setup node 0 [mem 0x0000000000000000-0x0000000007ffffff]
[    0.000000] On node 0 totalpages: 32768
[    0.000000]   Normal zone: 288 pages used for memmap
[    0.000000]   Normal zone: 0 pages reserved
[    0.000000]   Normal zone: 32768 pages, LIFO batch:7
[    0.000000] pcpu-alloc: s0 r0 d32768 u32768 alloc=1*32768
[    0.000000] pcpu-alloc: [0] 0
[    0.000000] Built 1 zonelists, mobility grouping on.  Total pages: 32480
[    0.000000] Kernel command line: console=ttyS0,115200n8 rootfstype=squashfs,jffs2
[    0.000000] Dentry cache hash table entries: 16384 (order: 4, 65536 bytes, linear)
[    0.000000] Inode-cache hash table entries: 8192 (order: 3, 32768 bytes, linear)
[    0.000000] Writing ErrCtl register=00000000
[    0.000000] Readback ErrCtl register=00000000
[    0.000000] mem auto-init: stack:off, heap alloc:off, heap free:off
[    0.000000] Memory: 122324K/131072K available (4741K kernel code, 179K rwdata, 1092K rodata, 1212K init, 196K bss, 8748K reserved, 0K cma-reserved)
[    0.000000] SLUB: HWalign=32, Order=0-3, MinObjects=0, CPUs=1, Nodes=1
[    0.000000] NR_IRQS: 51
[    0.000000] random: get_random_bytes called from start_kernel+0x32c/0x51c with crng_init=0
[    0.000000] CPU clock: 775.000 MHz
[    0.000000] clocksource: MIPS: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 4932285024 ns
[    0.000007] sched_clock: 32 bits at 387MHz, resolution 2ns, wraps every 5541893118ns
[    0.008218] Calibrating delay loop... 385.84 BogoMIPS (lpj=1929216)
[    0.074754] pid_max: default: 32768 minimum: 301
[    0.079739] Mount-cache hash table entries: 1024 (order: 0, 4096 bytes, linear)
[    0.087448] Mountpoint-cache hash table entries: 1024 (order: 0, 4096 bytes, linear)
[    0.099325] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 19112604462750000 ns
[    0.109724] futex hash table entries: 256 (order: -1, 3072 bytes, linear)
[    0.117003] pinctrl core: initialized pinctrl subsystem
[    0.123406] NET: Registered protocol family 16
[    0.135516] PCI host bridge /ahb/pcie-controller@18250000 ranges:
[    0.141950]  MEM 0x0000000012000000..0x0000000013ffffff
[    0.147500]   IO 0x0000000000000000..0x0000000000000000
[    0.172124] PCI host bridge to bus 0000:00
[    0.176447] pci_bus 0000:00: root bus resource [mem 0x12000000-0x13ffffff]
[    0.183740] pci_bus 0000:00: root bus resource [io  0x0000]
[    0.189602] pci_bus 0000:00: root bus resource [??? 0x00000000 flags 0x0]
[    0.196759] pci_bus 0000:00: No busn resource found for root bus, will use [bus 00-ff]
[    0.205129] pci 0000:00:00.0: [168c:003c] type 00 class 0x028000
[    0.211510] pci 0000:00:00.0: reg 0x10: [mem 0x00000000-0x001fffff 64bit]
[    0.218699] pci 0000:00:00.0: reg 0x30: [mem 0x00000000-0x0000ffff pref]
[    0.225836] pci 0000:00:00.0: supports D1
[    0.230053] pci 0000:00:00.0: PME# supported from D0 D1 D3hot
[    0.236949] pci_bus 0000:00: busn_res: [bus 00-ff] end is updated to 00
[    0.243931] pci 0000:00:00.0: BAR 0: assigned [mem 0x12000000-0x121fffff 64bit]
[    0.251678] pci 0000:00:00.0: BAR 6: assigned [mem 0x12200000-0x1220ffff pref]
[    0.262509] clocksource: Switched to clocksource MIPS
[    0.268862] NET: Registered protocol family 2
[    0.274189] tcp_listen_portaddr_hash hash table entries: 512 (order: 0, 4096 bytes, linear)
[    0.283067] TCP established hash table entries: 1024 (order: 0, 4096 bytes, linear)
[    0.291147] TCP bind hash table entries: 1024 (order: 0, 4096 bytes, linear)
[    0.298598] TCP: Hash tables configured (established 1024 bind 1024)
[    0.305424] UDP hash table entries: 256 (order: 0, 4096 bytes, linear)
[    0.312322] UDP-Lite hash table entries: 256 (order: 0, 4096 bytes, linear)
[    0.320002] NET: Registered protocol family 1
[    0.324673] PCI: CLS 0 bytes, default 32
[    0.332476] workingset: timestamp_bits=14 max_order=15 bucket_order=1
[    0.345231] squashfs: version 4.0 (2009/01/31) Phillip Lougher
[    0.351374] jffs2: version 2.2 (NAND) (SUMMARY) (LZMA) (RTIME) (CMODE_PRIORITY) (c) 2001-2006 Red Hat, Inc.
[    0.374367] ar7200-usb-phy usb-phy: phy reset is missing
[    0.381424] pinctrl-single 1804002c.pinmux: 544 pins, size 68
[    0.388514] Serial: 8250/16550 driver, 1 ports, IRQ sharing disabled
[    0.395873] printk: console [ttyS0] disabled
[    0.400412] 18020000.uart: ttyS0 at MMIO 0x18020000 (irq = 9, base_baud = 1562500) is a 16550A
[    0.409555] printk: console [ttyS0] enabled
[    0.418621] printk: bootconsole [early0] disabled
[    0.435521] spi-nor spi0.0: mx25l12805d (16384 Kbytes)
[    0.440868] 7 fixed-partitions partitions found on MTD device spi0.0
[    0.447477] Creating 7 MTD partitions on "spi0.0":
[    0.452442] 0x000000000000-0x000000060000 : "u-boot"
[    0.458389] 0x000000060000-0x000000070000 : "u-boot-env"
[    0.464716] 0x000000070000-0x000000800000 : "firmware"
[    0.473920] 2 uimage-fw partitions found on MTD device firmware
[    0.480037] Creating 2 MTD partitions on "firmware":
[    0.485217] 0x000000000000-0x0000001f0000 : "kernel"
[    0.491080] 0x0000001f0000-0x000000790000 : "rootfs"
[    0.496963] mtd: device 4 (rootfs) set to be root filesystem
[    0.504538] 1 squashfs-split partitions found on MTD device rootfs
[    0.510934] 0x000000510000-0x000000790000 : "rootfs_data"
[    0.517378] 0x000000800000-0x000000f90000 : "ubnt-airos"
[    0.523729] 0x000000f90000-0x000000fb0000 : "bs"
[    0.529251] 0x000000fb0000-0x000000ff0000 : "cfg"
[    0.534966] 0x000000ff0000-0x000001000000 : "art"
[    0.541611] libphy: Fixed MDIO Bus: probed
[    1.232869] libphy: ag71xx_mdio: probed
[    1.239909] switch0: Atheros AR8337 rev. 2 switch registered on mdio-bus.0
[    1.894011] ag71xx 19000000.eth: connected to PHY at mdio-bus.0:00 [uid=004dd036, driver=Atheros AR8216/AR8236/AR8316]
[    1.905599] eth0: Atheros AG71xx at 0xb9000000, irq 4, mode: mii
[    1.913766] NET: Registered protocol family 10
[    1.922324] Segment Routing with IPv6
[    1.926259] NET: Registered protocol family 17
[    1.930921] 8021q: 802.1Q VLAN Support v1.8
[    1.945658] VFS: Mounted root (squashfs filesystem) readonly on device 31:4.
[    1.959620] Freeing unused kernel memory: 1212K
[    1.964331] This architecture does not have kernel memory protection.
[    1.970979] Run /sbin/init as init process
[    2.562517] random: fast init done
[    2.814412] init: Console is alive
[    2.818127] init: - watchdog -
[    4.077174] kmodloader: loading kernel modules from /etc/modules-boot.d/*
[    4.389322] kmodloader: done loading kernel modules from /etc/modules-boot.d/*
[    4.407409] init: - preinit -
[    5.592936] random: jshn: uninitialized urandom read (4 bytes read)
[    5.652362] random: jshn: uninitialized urandom read (4 bytes read)
[    5.744829] random: jshn: uninitialized urandom read (4 bytes read)
[    6.825400] Atheros AR8216/AR8236/AR8316 mdio-bus.0:00: Port 2 is up
[    6.833993] eth0: link up (1000Mbps/Full duplex)
[    6.852160] IPv6: ADDRCONF(NETDEV_CHANGE): eth0: link becomes ready
[    6.868613] IPv6: ADDRCONF(NETDEV_CHANGE): eth0.1: link becomes ready
[    6.900764] urandom_read: 4 callbacks suppressed
[    6.900771] random: procd: uninitialized urandom read (4 bytes read)
[   10.144325] jffs2_scan_eraseblock(): End of filesystem marker found at 0x10000
[   10.151789] jffs2_build_filesystem(): unlocking the mtd device...
[   10.151792] done.
[   10.160176] jffs2_build_filesystem(): erasing all blocks after the end marker...
[   22.873647] done.
[   22.883404] jffs2: notice: (492) jffs2_build_xattr_subsystem: complete building xattr subsystem, 0 of xdatum (0 unchecked, 0 orphan) and 0 of xref (0 dead, 0 orphan) found.
[   22.900703] mount_root: overlay filesystem has not been fully initialized yet
[   22.917353] mount_root: switching to jffs2 overlay
[   22.938190] overlayfs: upper fs does not support tmpfile.
[   23.262036] urandom-seed: Seed file not found (/etc/urandom.seed)
[   23.335965] eth0: link down
[   23.356201] procd: - early -
[   23.359259] procd: - watchdog -
[   23.961504] procd: - watchdog -
[   23.965055] procd: - ubus -
[   24.018440] random: ubusd: uninitialized urandom read (4 bytes read)
[   24.025425] random: ubusd: uninitialized urandom read (4 bytes read)
[   24.032811] procd: - init -
[   25.002356] kmodloader: loading kernel modules from /etc/modules.d/*
[   25.024441] Loading modules backported from Linux version v5.4-rc8-0-gaf42d3466bdc
[   25.032262] Backport generated by backports.git v5.4-rc8-1-0-g368e8c51
[   25.089462] xt_time: kernel timezone is -0000
[   25.204873] urngd: v1.0.1 started.
[   25.275870] ath10k 5.1 driver, optimized for CT firmware, probing pci device: 0x3c.
[   25.303321] ath10k_pci 0000:00:00.0: enabling device (0000 -> 0002)
[   25.312047] ath10k_pci 0000:00:00.0: pci irq legacy oper_irq_mode 1 irq_mode 0 reset_mode 0
[   25.369395] random: crng init done
[   26.376605] ath10k_pci 0000:00:00.0: qca988x hw2.0 target 0x4100016c chip_id 0x043202ff sub 0000:0000
[   26.386183] ath10k_pci 0000:00:00.0: kconfig debug 0 debugfs 1 tracing 0 dfs 1 testmode 0
[   26.398317] ath10k_pci 0000:00:00.0: firmware ver 10.1-ct-8x-__fH-022-b0e1b7cd api 2 features wmi-10.x,mfp,txstatus-noack,wmi-10.x-CT,ratemask-CT,txrate-CT,get-temp-CT,tx-rc-CT,cust-stats-CT,retry-gt2-CT,txrate2-CT,beacon-cb-CT,wmi-block-ack-CT crc32 3da57462
[   26.526515] ath10k_pci 0000:00:00.0: board_file api 1 bmi_id N/A crc32 bebc7c08
[   27.459491] ath10k_pci 0000:00:00.0: unsupported HTC service id: 1536
[   27.466560] ath10k_pci 0000:00:00.0: 10.1 wmi init: vdevs: 16  peers: 127  tid: 256
[   27.484316] ath10k_pci 0000:00:00.0: wmi print 'P 128 V 8 T 410'
[   27.490737] ath10k_pci 0000:00:00.0: wmi print 'msdu-desc: 1424  sw-crypt: 0 ct-sta: 0'
[   27.499033] ath10k_pci 0000:00:00.0: wmi print 'alloc rem: 20920 iram: 26344'
[   27.538920] ath10k_pci 0000:00:00.0: htt-ver 2.2 wmi-op 2 htt-op 2 cal file max-sta 128 raw 0 hwcrypto 1
[   27.567338] ath10k_pci 0000:00:00.0: NOTE:  Firmware DBGLOG output disabled in debug_mask: 0x10000000
[   27.705966] ath: EEPROM regdomain: 0x0
[   27.705973] ath: EEPROM indicates default country code should be used
[   27.705976] ath: doing EEPROM country->regdmn map search
[   27.705988] ath: country maps to regdmn code: 0x3a
[   27.705993] ath: Country alpha2 being used: US
[   27.705996] ath: Regpair used: 0x3a
[   27.818533] ath: EEPROM regdomain: 0x0
[   27.818541] ath: EEPROM indicates default country code should be used
[   27.818544] ath: doing EEPROM country->regdmn map search
[   27.818556] ath: country maps to regdmn code: 0x3a
[   27.818561] ath: Country alpha2 being used: US
[   27.818564] ath: Regpair used: 0x3a
[   27.831138] ieee80211 phy1: Selected rate control algorithm 'minstrel_ht'
[   27.832499] ieee80211 phy1: Atheros AR9561 Rev:0 mem=0xb8100000, irq=2
[   27.842266] kmodloader: done loading kernel modules from /etc/modules.d/*
[   37.123416] eth0: link up (1000Mbps/Full duplex)
[   37.146884] br-lan: port 1(eth0.1) entered blocking state
[   37.152466] br-lan: port 1(eth0.1) entered disabled state
[   37.158368] device eth0.1 entered promiscuous mode
[   37.163361] device eth0 entered promiscuous mode
[   37.172604] IPv6: ADDRCONF(NETDEV_CHANGE): eth0: link becomes ready
[   37.241648] br-lan: port 1(eth0.1) entered blocking state
[   37.247278] br-lan: port 1(eth0.1) entered forwarding state
[   38.122618] IPv6: ADDRCONF(NETDEV_CHANGE): br-lan: link becomes ready
[   42.213443] ath10k_pci 0000:00:00.0: failed to receive initialized event from target: 00000000
[   43.514953] ath10k_pci 0000:00:00.0: unsupported HTC service id: 1536
[   43.521655] ath10k_pci 0000:00:00.0: 10.1 wmi init: vdevs: 16  peers: 127  tid: 256
[   43.539270] ath10k_pci 0000:00:00.0: wmi print 'P 128 V 8 T 410'
[   43.545750] ath10k_pci 0000:00:00.0: wmi print 'msdu-desc: 1424  sw-crypt: 0 ct-sta: 0'
[   43.554066] ath10k_pci 0000:00:00.0: wmi print 'alloc rem: 20920 iram: 26344'
[   43.622643] ath10k_pci 0000:00:00.0: pdev param 0 not supported by firmware
[   43.642077] br-lan: port 2(wlan0) entered blocking state
[   43.647620] br-lan: port 2(wlan0) entered disabled state
[   43.653412] device wlan0 entered promiscuous mode
[   43.772237] IPv6: ADDRCONF(NETDEV_CHANGE): wlan0: link becomes ready
[   43.779021] br-lan: port 2(wlan0) entered blocking state
[   43.784551] br-lan: port 2(wlan0) entered forwarding state

I published my hacky wip here https://github.com/MartB/openwrt

1 Like

Alert
This is an issue with libnl-tiny but im not sure where it exactly lies, i ported swconfig back to libnl3 and it works now.

1 Like

Hi! I also tried to work with kernel 5.4. With an Archer C7 V2, I ran into a similar issue; wireless was working, but ethernet and switch was not, so I started hacking around. I tried moving some of the ag71xx patches out of the way, but eventually wound up renaming 'files-4.19' to 'file-5.4' in order to get the more complicated ag71xx driver (5.4 ag71xx patches still moved out of the way, plus had to change the Makefile in the atheros driver directory to use the ag71xx directory instead of ag71xx.o). My first test with that did work, but seemed a bit slow. Going to speedtest.net and making sure to use the same target server, the working 5.4.25 install was about 20% slower than the stable 19.07.2 firmware. I'm definitely going to try a cleaner (aka less hacky) build, but would appreciate any other suggestions on where to look. Thanks to all who've made 5.4 adjustments, and (in advance) for any suggestions.

I see commits in ath79 to upgrade the kernel from July 2020, but when I tested 19.07.4 it seemed to still be using the older 4.19 kernel. Am I missing something? I don't see an updated kernel package in opkg or anything... and 5.4 seems to be working ok on the SFE fork.

5.4 in only used in the development master, not in the 1.5 years old 19.07 branch.

The old stable 19.07 branch still uses the 4.14 kernel. (not 4.19...)

Stable 19.07 is quite separate from the development "master" branch.

Thanks! That helps a lot, not overly familiar with your builds yet, just have been using the ones I've found already compiled for my Archer C7. Are there processes documented anywhere on how to upgrade the kernel, or am I looking at a full compile from source?

Any thoughts on when we might expect to see 5.4 make it's way into a stable release?

Once the forthcoming 20.xx release branches. (that was supposed to happen already earlier this year, but let's see if that turns out to be 21.xx in the end. But there is a few days left of this year)

You can't.

You are just looking for using the master builds, either self-compiled by you or from the buildbot snapshot download repo.