OpenWrt/LEDE Project

  • Status Closed
  • Percent Complete
    100%
  • Task Type Bug Report
  • Category Kernel
  • Assigned To No-one
  • Operating System All
  • Severity Medium
  • Priority Very Low
  • Reported Version Trunk
  • Due in Version Undecided
  • Due Date Undecided
  • Votes
  • Private
Attached to Project: OpenWrt/LEDE Project
Opened by noblemtw - 11.03.2019
Last edited by Petr Štetiar - 08.04.2019

FS#2177 - ar71xx: Unusable networking with latest snapshot images

- TP Link TL-WPA8630 (Powerline wireless extender)

When updating the above device to the latest trunk, LAN access is lost, however Wireless works fine. The issue is apparent on both my own self compiled image as well as the dev openwrt snapshot, as can be seen from the below log snippet, eth0 enters a disabled state and never comes up;

boot-log-broken.txt:Sat Mar  9 19:10:05 2019 kern.info kernel: [    1.860843] ag71xx ag71xx.0: connected to PHY at ag71xx-mdio.0:18 [uid=00808008, driver=Generic PHY]
boot-log-broken.txt:Sat Mar  9 19:10:05 2019 kern.info kernel: [    1.870771] eth0: Atheros AG71xx at 0xb9000000, irq 4, mode:SGMII
boot-log-broken.txt:Sat Mar  9 19:10:05 2019 kern.info kernel: [    4.619239] IPv6: ADDRCONF(NETDEV_UP): eth0: link is not ready
boot-log-broken.txt:Sat Mar  9 19:10:12 2019 kern.info kernel: [   20.205456] br-lan: port 1(eth0) entered blocking state
boot-log-broken.txt:Sat Mar  9 19:10:12 2019 kern.info kernel: [   20.210911] br-lan: port 1(eth0) entered disabled state
boot-log-broken.txt:Sat Mar  9 19:10:12 2019 kern.info kernel: [   20.216564] device eth0 entered promiscuous mode

Expected behaviour taken from the logs of the device running the stable release;

boot-log-working.txt:Sat Mar  9 19:30:12 2019 kern.info kernel: [    2.025604] ag71xx ag71xx.0: connected to PHY at ag71xx-mdio.0:00 [uid=004dd036, driver=Atheros AR8216/AR8236/AR8316]
boot-log-working.txt:Sat Mar  9 19:30:12 2019 kern.info kernel: [    2.037168] eth0: Atheros AG71xx at 0xb9000000, irq 4, mode:SGMII
boot-log-working.txt:Sat Mar  9 19:30:12 2019 kern.info kernel: [    4.573592] IPv6: ADDRCONF(NETDEV_UP): eth0: link is not ready
boot-log-working.txt:Sat Mar  9 19:30:12 2019 kern.info kernel: [    5.635550] eth0: link up (1000Mbps/Full duplex)
boot-log-working.txt:Sat Mar  9 19:30:12 2019 kern.info kernel: [    5.640453] IPv6: ADDRCONF(NETDEV_CHANGE): eth0: link becomes ready
boot-log-working.txt:Sat Mar  9 19:30:12 2019 kern.info kernel: [   22.348036] eth0: link down
boot-log-working.txt:Sat Mar  9 19:30:20 2019 kern.info kernel: [   43.666896] br-lan: port 1(eth0) entered blocking state
boot-log-working.txt:Sat Mar  9 19:30:20 2019 kern.info kernel: [   43.672306] br-lan: port 1(eth0) entered disabled state
boot-log-working.txt:Sat Mar  9 19:30:20 2019 kern.info kernel: [   43.678060] device eth0 entered promiscuous mode
boot-log-working.txt:Sat Mar  9 19:30:21 2019 kern.info kernel: [   44.675621] eth0: link up (1000Mbps/Full duplex)
boot-log-working.txt:Sat Mar  9 19:30:21 2019 kern.info kernel: [   44.680539] br-lan: port 1(eth0) entered blocking state
boot-log-working.txt:Sat Mar  9 19:30:21 2019 kern.info kernel: [   44.685973] br-lan: port 1(eth0) entered forwarding state
boot-log-working.txt:Sat Mar  9 19:30:21 2019 daemon.notice netifd: Network device 'eth0' link is up

The problem appears to the PHY being detected incorrectly, in the broken example, the below is observed and the Generic PHY driver used;

ag71xx ag71xx.0: connected to PHY at ag71xx-mdio.0:18 [uid=00808008, driver=Generic PHY

where as this is seen on the working example, with the Atheros driver being used

ag71xx ag71xx.0: connected to PHY at ag71xx-mdio.0:00 [uid=004dd036, driver=Atheros AR8216/AR8236/AR8316]

I believe this issue is related to commit d3506d1bc160e4ce2833dff357f2a4b219772c77 and reversing the patch restores LAN connectivity, with the PHY being detected exactly as per the above working example

I’ve attached boot logs with working/non-working examples, please let me know if any other information is required or if there’s anything I can test to help resolve

Closed by  Petr Štetiar
08.04.2019 18:35
Reason for closing:  Fixed
Additional comments about closing:  

https://github.com/openwrt/op enwrt/commit/31ea08a64bd977e0dc0a65804e4 103cb52d81cea

kuehro commented on 03.04.2019 06:31

The same bug is present on Ubiquiti Nanostation M5 XW and can be resolved by the same fix:

Before

ag71xx.0: connected to PHY at ag71xx-mdio.0:01 [uid=004dd043, driver=Generic PHY]

and after reverting the commit

ag71xx ag71xx.0: connected to PHY at ag71xx-mdio.0:00 [uid=004dd043, driver=Atheros AR8216/AR8236/AR8316]

Please revert the commit.

Admin
Petr Štetiar commented on 03.04.2019 08:03

Hi,

thanks for reporting this and finding the offending commit! Could you please try following fix?

diff --git a/target/linux/ar71xx/files/drivers/net/ethernet/atheros/ag71xx/ag71xx_phy.c b/target/linux/ar71xx/files/drivers/net/ethernet/atheros/ag71xx/ag71xx_phy.c
index e92798c..f42c614 100644
--- a/target/linux/ar71xx/files/drivers/net/ethernet/atheros/ag71xx/ag71xx_phy.c
+++ b/target/linux/ar71xx/files/drivers/net/ethernet/atheros/ag71xx/ag71xx_phy.c
@@ -127,7 +127,8 @@ static int ag71xx_phy_connect_multi(struct ag71xx *ag)
 		if (ag->mii_bus->mdio_map[phy_addr] == NULL)
 			continue;
 
-		phydev = mdiobus_get_phy(ag->mii_bus, phy_addr);
+		if (phydev == NULL)
+			phydev = mdiobus_get_phy(ag->mii_bus, phy_addr);
 
 		DBG("%s: PHY found at %s, uid=%08x\n",
 		dev_name(dev),
Admin
Petr Štetiar commented on 03.04.2019 08:56

I've prepared following commit which I planto push once you confirm, that it's working for you. Could you please give me your

Tested-by: Real Name <real@email.com>

so I can add it to the commit which fixes this problem as well?

Loading...

Available keyboard shortcuts

Tasklist

Task Details

Task Editing