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 Leonardo - 14.10.2020

FS#3386 - Regression: Broadcom Roboswitch B53

Hi,

in the current trunk version, Broadcom Roboswitch will not work for certain router models. However, in the past it did work.

Building OpenWrt from scratch results in a working switch with v17.01.5 (from 15 Jul 2018 21:25:16) for target profile “Broadcom SOC, BCM43xx Wifi (brcmsmac)”. Building OpenWrt from scratch for v18.06.0 (from 30 Jul 2018 18:44:34) results in the switch not working for the same target. So the problematic commit must have been between 15 Jul 2018 and 30 Jul 2018, and the problem is still present today.


For v17.01.5
# dmesg | grep switch
[ 3.596260] bgmac_bcma bcma0:2: Support for Roboswitch not implemented
[ 3.683106] b53_common: found switch: BCM5325, rev 4

Despite the message “Roboswitch not implemented” the switch comes up automatically and I can ping other computers connected through the switch.

# swconfig dev switch0 show
Global attributes:

      enable_vlan: 1
      ports: 0x003f

Port 0:

      pvid: 2
      link: port:0 link:down

Port 1:

      pvid: 1
      link: port:1 link:down

Port 2:

      pvid: 1
      link: port:2 link:down

Port 3:

      pvid: 1
      link: port:3 link:up speed:100baseT full-duplex auto

Port 4:

      pvid: 1
      link: port:4 link:down

Port 5:

      pvid: 0
      link: port:5 link:up speed:100baseT full-duplex

VLAN 1:

      ports: 1 2 3 4 5t

VLAN 2:

      ports: 0 5t

For v18.06.0
# dmesg | grep switch
[ 4.174603] bgmac_bcma bcma0:2: Support for Roboswitch not implemented
[ 4.275337] b53_common: unsupported switch detected (BCM5304/BCM4)
[ 4.281640] Broadcom B53 (2) bcma_mdio-0-0:1e: failed to register switch: -22

The switch does not come up and thus I cannot ping.


I tested this for the (unsuported) router Huawei B593u-12. You can find details about the router, logs, etc. under https://openwrt.org/toh/huawei/b593u-12

This also seems to address other routers, e.g. ZTE H218N, see https://forum.openwrt.org/t/b53-failed-to-detect-switch-on-bcm5358/20011

Leonardo commented on 16.10.2020 12:36

Hi, I did some more research. Support of the switch stopped working with this commit:

commit 97f3c0f041e7299884985ac4459f4668a2ceb726
brcm47xx: switch to the kernel 4.14

https://git.openwrt.org/?p=openwrt/openwrt.git;a=commit;h=97f3c0f041e7299884985ac4459f4668a2ceb726

Leonardo commented on 21.10.2020 14:02

Hi,

continuing my research, here are the main differences between Kernel 4.9 and Kernel 4.14 (up to today), also prior to the commit mentioned above.

Adding some debugging variables, I found out that relating to the following dmesg output:

libphy: Fixed MDIO Bus: probed
bgmac_bcma bcma0:2: Found PHY addr: 30 (NOREGS)

In this part, both kernels call "b53_switch_detect" in b53_common.c. Both kernels detect the right switch, i.e. "dev→chip_id = BCM5325_DEVICE_ID;"

libphy: bcma_mdio mii bus: probed
bgmac_bcma bcma0:2: Support for Roboswitch not implemented

In this part, both kernels call "b53_switch_detect" in b53_common.c again. Kernel 4.9 finds the right switch, i.e. "dev→chip_id = BCM5325_DEVICE_ID;". Kernel 4.14 however doesnt go into "case 0:", and thus can't find the correct switch.

Leonardo commented on 21.10.2020 20:48

Hi,

it seems that the bug was already present in Kernel 4.14: commit "brcm47xx: add kernel 4.14 support" from 13 Mar 2018, de79f4ab882b2955432eb8104fd5426745262e83, already has this bug when compiling for Kernel 4.14.

And the last commit before "brcm47xx: remove linux 4.9 support" does not has this bug when compiling for Kernel 4.9.

So I am running out of ideas on how to find this bug... Any ideas? When is DSA coming – might this solve the problem?

Loading...

Available keyboard shortcuts

Tasklist

Task Details

Task Editing