OpenWrt/LEDE Project

  • Status Unconfirmed
  • Percent Complete
    0%
  • Task Type Bug Report
  • Category Kernel
  • Assigned To No-one
  • Operating System All
  • Severity High
  • Priority Very Low
  • Reported Version Trunk
  • Due in Version Undecided
  • Due Date Undecided
  • Private
Attached to Project: OpenWrt/LEDE Project
Opened by John Doe - 26.04.2020

FS#3049 - sunxi / lamobo-r1: switch not working with kernel 5.4

Supply the following if possible:
- Device problem occurs on

Lamobo-R1 BananaPI Router

- Software versions of OpenWrt/LEDE release, packages, etc.

OpenWRT Snapshots (Imagebuilder) sometime after r12688-46d0ce19f1

- Steps to reproduce

Write any recent image to SD card, it boots but networking does not work.


Hello,

I’m doing regular updates with imagebuilder (about once per week) for Lamobo-R1. Some time after r12688-46d0ce19f1 the networking configuration broke.
I’m assuming the cause is kernel 5.4, because my last working image is from 2020-03-22 and it stopped working the week after, around 2020-03-29.

As far as I can tell the problem lies in the switch configuration: The switch is not found, the bootlog of kernel 5.4 contains no reference to “b53”.

  [    3.050660] init: - preinit -
  [    3.200152] sun7i-dwmac 1c50000.ethernet eth0: no phy at addr -1
  [    3.206288] sun7i-dwmac 1c50000.ethernet eth0: stmmac_open: Cannot attach to PHY (error: -19)
  ifconfig: SIOCSIFFLAGS: No such device
  Failed to connect to the switch. Use the "list" command to see which switches are available.
  Failed to connect to the switch. Use the "list" command to see which switches are available.
  Failed to connect to the switch. Use the "list" command to see which switches are available.
  [    4.358791] random: jshn: uninitialized urandom read (4 bytes read)
  [    4.388472] random: jshn: uninitialized urandom read (4 bytes read)
  [    4.431303] random: jshn: uninitialized urandom read (4 bytes read)
  Failed to connect to the switch. Use the "list" command to see which switches are available.
  Failed to connect to the switch. Use the "list" command to see which switches are available.
  Failed to connect to the switch. Use the "list" command to see which switches are available.
  Failed to connect to the switch. Use the "list" command to see which switches are available.
  [    4.505287] sun7i-dwmac 1c50000.ethernet eth0: no phy at addr -1
  [    4.511309] sun7i-dwmac 1c50000.ethernet eth0: stmmac_open: Cannot attach to PHY (error: -19)
  ip: SIOCSIFFLAGS: No such device
  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
  sendto(): Network unreachable
  sendto(): Network unreachable
  [    8.622199] mount_root: mounting /dev/root

I’m attaching screenlogs of both old and new kernel boot and the corresponding device tree files (taken from the sdcard).

Please advise, thank you.

Project Manager
Hauke Mehrtens commented on 06.05.2020 21:36

I think the device tree is probably not compatible with kernel 5.4 any more.

I tried to fix it here:
https://git.openwrt.org/?p=openwrt/staging/hauke.git;a=commitdiff;h=d38b7c40dbf8df7eebe4cba39aeb52dd5b0fb950

But I would prefer to switch to the B53 DSA driver:
https://git.openwrt.org/?p=openwrt/staging/hauke.git;a=commitdiff;h=d4bface5d3b79dae923fd96ad28c70d7da676bc5

Could you please test both patches and report back if it works again.
https://git.openwrt.org/?p=openwrt/staging/hauke.git;a=shortlog;h=refs/heads/sunxi-b53

John Doe commented on 09.05.2020 15:20

I'll try to do so, starting with the DTS patch, since it seems like I only need to compile the dts and not the whole of openwrt. Supplying a custom DTB to imagebuilder seems doable to me.

Your tree with the patches will be my next priority, but it has been quite a while since I've done any compiling of openwrt...

John Doe commented on 09.05.2020 18:28

Okay, I was unable to compile the new dts file from the imagebuilder, so I compiled your tree. This is a minimal image, I hope I've got the configuration correct - i used an checkout at d38b7c40... and the config from here, modified to build only lamobo r1 (attached to this comment).

The screenlog is also attached, the device was unable to get and IP via WAN Port and did not hand out IPs via DHCP either. Since the switch error messages are still present in the log I assume the new dts did not work.

I've also attached the dts, as far as i can see the patch was applied correctly.

Next I'll try your tree with the new driver.

John Doe commented on 10.05.2020 08:09

Testing with your tree also resulted in an non-working network.
But, the symptoms are slightly different and promising I think.

  • the switch error message in dmesg persists
  • all switch ports are visible in ifconfig
  • link state changes are detected by the kernel
  • if an lan interface is plugged in at boot I am able to get an IPv6 ULA adress from it it seems. But only once, only while booting and DHCP IPv4 does not work.
  • the interface is not ping-able at all and arp caches remain empty

So maybe there is just something wrong with the switch/vlan configuration?
I'll try to investigate this a bit further and post a new comment if I find anything.

John Doe commented on 10.05.2020 14:52

So, I tried to get the switch to work manually, without success:

I did everything according to kernel DSA bridge configuration, but i could not get any traffic to flow.

I had some errors though:

  • the "bridge" command is not included in the default image
  • command ip link set dev br-lan type bridge vlan_filtering 1 does not work, error returned is ip: either "dev" is duplicate, or "type" is garbage

Also, dmesg shows some strangeness:

  [    1.309802] b53_common: found switch: BCM53125, rev 4
  [    1.314936] bcm53xx stmmac-0:1e: failed to register switch: -517
...
  [    1.640479] b53_common: found switch: BCM53125, rev 4
  [    1.729038] libphy: dsa slave smi: probed
  [    1.733684] bcm53xx stmmac-0:1e lan2 (uninitialized): PHY [dsa-0.0:00] driver [Generic PHY]
  [    1.743522] bcm53xx stmmac-0:1e lan3 (uninitialized): PHY [dsa-0.0:01] driver [Generic PHY]
  [    1.753423] bcm53xx stmmac-0:1e lan4 (uninitialized): PHY [dsa-0.0:02] driver [Generic PHY]
  [    1.763293] bcm53xx stmmac-0:1e wan (uninitialized): PHY [dsa-0.0:03] driver [Generic PHY]
  [    1.773042] bcm53xx stmmac-0:1e lan1 (uninitialized): PHY [dsa-0.0:04] driver [Generic PHY]
  [    1.786282] bcm53xx stmmac-0:1e: Using legacy PHYLIB callbacks. Please migrate to PHYLINK!
  [    1.797145] bcm53xx stmmac-0:1e: Configured port 8 for rgmii-txid
  [    1.807853] DSA: tree 0 setup
...
  [    2.621728] init: - preinit -
  [    2.762865] sun7i-dwmac 1c50000.ethernet eth0: No Safety Features support found
  [    2.770343] sun7i-dwmac 1c50000.ethernet eth0: RX IPC Checksum Offload disabled
  [    2.777677] sun7i-dwmac 1c50000.ethernet eth0: No MAC Management Counters available
  [    2.785341] sun7i-dwmac 1c50000.ethernet eth0: PTP not supported by HW
  [    2.791870] sun7i-dwmac 1c50000.ethernet eth0: configuring for fixed/rgmii link mode
  [    2.799685] sun7i-dwmac 1c50000.ethernet eth0: Link is Up - 1Gbps/Full - flow control off
  Failed to connect to the switch. Use the "list" command to see which switches are available.
  Failed to connect to the switch. Use the "list" command to see which switches are available.
  Failed to connect to the switch. Use the "list" command to see which switches are available.
  [    3.888596] random: jshn: uninitialized urandom read (4 bytes read)
  [    3.917239] random: jshn: uninitialized urandom read (4 bytes read)
  [    3.941414] random: jshn: uninitialized urandom read (4 bytes read)
  [    3.973951] bcm53xx stmmac-0:1e lan1: configuring for phy/gmii link mode
  [    3.981034] 8021q: adding VLAN 0 to HW filter on device lan1
...
  [   12.076186] sun7i-dwmac 1c50000.ethernet eth0: Link is Down
  [   12.087840] sun7i-dwmac 1c50000.ethernet eth0: No Safety Features support found
  [   12.095369] sun7i-dwmac 1c50000.ethernet eth0: RX IPC Checksum Offload disabled
  [   12.102725] sun7i-dwmac 1c50000.ethernet eth0: No MAC Management Counters available
  [   12.110532] sun7i-dwmac 1c50000.ethernet eth0: PTP not supported by HW
  [   12.117186] sun7i-dwmac 1c50000.ethernet eth0: configuring for fixed/rgmii link mode
  [   12.125521] sun7i-dwmac 1c50000.ethernet eth0: Link is Up - 1Gbps/Full - flow control off
  [   12.141098] bcm53xx stmmac-0:1e lan1: configuring for phy/gmii link mode
  [   12.148456] 8021q: adding VLAN 0 to HW filter on device lan1
  [   12.170616] IPv6: ADDRCONF(NETDEV_CHANGE): eth0: link becomes ready
  [   12.177635] br-lan: port 1(lan1) entered blocking state
  [   12.182868] br-lan: port 1(lan1) entered disabled state
  [   12.192187] device lan1 entered promiscuous mode
  [   12.196849] device eth0 entered promiscuous mode
  [   12.224766] bcm53xx stmmac-0:1e lan2: configuring for phy/gmii link mode
  [   12.232678] 8021q: adding VLAN 0 to HW filter on device lan2
  [   12.233756] bcm53xx stmmac-0:1e lan2: Link is Up - 1Gbps/Full - flow control rx/tx
  [   12.258024] br-lan: port 2(lan2) entered blocking state
  [   12.263305] br-lan: port 2(lan2) entered disabled state
  [   12.273918] device lan2 entered promiscuous mode
  [   12.278964] br-lan: port 2(lan2) entered blocking state
  [   12.284226] br-lan: port 2(lan2) entered forwarding state
  [   12.289886] IPv6: ADDRCONF(NETDEV_CHANGE): br-lan: link becomes ready
  [   12.315827] bcm53xx stmmac-0:1e lan3: configuring for phy/gmii link mode
  [   12.323603] 8021q: adding VLAN 0 to HW filter on device lan3
  [   12.346605] br-lan: port 3(lan3) entered blocking state
  [   12.351846] br-lan: port 3(lan3) entered disabled state
  [   12.362237] device lan3 entered promiscuous mode
  [   12.381896] bcm53xx stmmac-0:1e lan4: configuring for phy/gmii link mode
  [   12.388919] 8021q: adding VLAN 0 to HW filter on device lan4
  [   12.412132] br-lan: port 4(lan4) entered blocking state
  [   12.417433] br-lan: port 4(lan4) entered disabled state
  [   12.428450] device lan4 entered promiscuous mode
  [   12.450199] bcm53xx stmmac-0:1e wan: configuring for phy/gmii link mode
  [   12.457167] 8021q: adding VLAN 0 to HW filter on device wan

Loading...

Available keyboard shortcuts

Tasklist

Task Details

Task Editing