Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
openwrt-bot opened this issue Apr 26, 2020 · 6 comments
Open

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

openwrt-bot opened this issue Apr 26, 2020 · 6 comments
Labels
flyspray kernel pull request/issue with Linux kernel related changes target/sunxi pull request/issue for sunxi target

Comments

@openwrt-bot
Copy link

openwrt-bot commented Apr 26, 2020

qwertz123:

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.

@openwrt-bot
Copy link
Author

Hauke:

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

@openwrt-bot
Copy link
Author

qwertz123:

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...

@openwrt-bot
Copy link
Author

qwertz123:

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 [[https://downloads.openwrt.org/snapshots/targets/sunxi/cortexa7/config.buildinfo|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.

@openwrt-bot
Copy link
Author

qwertz123:

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.

@openwrt-bot
Copy link
Author

openwrt-bot commented May 10, 2020

qwertz123:

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

I did everything according to [[https://www.kernel.org/doc/html/latest/networking/dsa/b53.html#bridge|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

@openwrt-bot
Copy link
Author

qwertz123:

Progress!

On a hunch I've tried

  • imagebuilder snapshot built from version [[https://git.openwrt.org/?p=openwrt/openwrt.git;a=commit;h=29e170dbaac0091d09ae52157cd2f1f26a9c8ca4|r13608-29e170dbaa]]
  • the device tree file (dtb) from your tree sunxi-b53 [[https://git.openwrt.org/?p=openwrt/staging/hauke.git;a=commit;h=d4bface5d3b79dae923fd96ad28c70d7da676bc5| sunxi: Switch to B53 DSA driver]]

... and this combination networking works. I assume the solution was commited as
[[https://git.openwrt.org/?p=openwrt/openwrt.git;a=commit;h=dc4ffaa5ab6830ba9c5b9d9569db2c2aef26755a|generic: fix DSA VLAN filtering
]] in openwrt master.

I'm attaching my dmesg, but at the moment everything looks good - I copied my old config to the new image and the R1 came up with the expected configuration.
Also attached is the diff between your version of the dts and the non-working one from the imagebuilder.

@aparcar aparcar added the kernel pull request/issue with Linux kernel related changes label Feb 22, 2022
@ynezz ynezz added the target/sunxi pull request/issue for sunxi target label Mar 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
flyspray kernel pull request/issue with Linux kernel related changes target/sunxi pull request/issue for sunxi target
Projects
None yet
Development

No branches or pull requests

3 participants