Modify

Opened 3 years ago

Closed 3 years ago

Last modified 3 years ago

#17800 closed defect (fixed)

AR8327N switch: under 3.14 negotiates 10MBit/half only with certain 1GBit devices

Reported by: anonymous Owned by: developers
Priority: normal Milestone: Chaos Calmer 15.05
Component: base system Version: Trunk
Keywords: AR8327N Cc:

Description

On r42452:
I have two TPLink routers, WDR4300 (ar71xx) and WDR4900 (mpc85xx).
Both have a AR8327N switch and show the same behavior when OpenWRT is compiled with a 3.14 kernel (mpc85xx patches manually adjusted for 3.14 as not yet officially supported):
When connected to certain 1GBit network devices (e.g. Fritz!Box router) the respective switch port negotiates 10MBit/half only.
Compiled with kernel 3.10 they negotiate the normal 1GBit/full with these devices.

Attachments (0)

Change History (15)

comment:1 Changed 3 years ago by robnitro@…

I occasionally have the same problem after reboot on my eth1 wan interface with WNDR3800 ar71xx with a different switch. It has 3.14 patches too.

try installing ethtool

So, I put this into rc.local as it fixed a few cases of the 10 half duplex.
ethtool eth1 autoneg off
ethtool eth1 autoneg on

comment:2 Changed 3 years ago by anonymous

sorry, ethtool -s eth1 autoneg off
and same for the on

comment:3 Changed 3 years ago by arokh

Same problem here, no solution yet :/ We probably need to get nbd or felix' attention as they wrote ar8216.c which is the switch driver.

The issue does not occur with 3.12, it's introduced in 3.14.

comment:4 Changed 3 years ago by anonymous

Could you please release the updated patches (or just the diff files) for the tp-link 4900? Would be great if we could use them for the new kernel.

comment:5 Changed 3 years ago by arokh

The 3.10 patches apply fine, just take out 200+220 which are patches to the gianfar driver that went upstream.

comment:6 Changed 3 years ago by arokh

I got 3.16 up and running and the WAN link still gets connected at 10 half duplex. This needs to be fixed in ar8216 driver.

With 3.10:

{code}
# swconfig dev switch0 show | grep port:1

link: port:1 link:up speed:1000baseT full-duplex auto

{/code}

With 3.14 or 3.16:

{code}
# swconfig dev switch0 show | grep port:1

link: port:1 link:up speed:10baseT half-duplex auto

{/code}

comment:7 Changed 3 years ago by anonymous

I got 3.16 up and running and the WAN link still gets connected at 10 half duplex. This needs to be fixed in ar8216 driver.

With 3.10:

{code}
# swconfig dev switch0 show | grep port:1

link: port:1 link:up speed:1000baseT full-duplex auto

{/code}

With 3.14 or 3.16:

{code}
# swconfig dev switch0 show | grep port:1

link: port:1 link:up speed:10baseT half-duplex auto

{/code}

comment:8 Changed 3 years ago by arokh

With 3.10:

[code] # dmesg | grep libphy
[ 0.707081] libphy: Freescale PowerQUICC MII Bus: probed
[ 6.222924] libphy: mdio@ffe24000:00 - Link is Up - 1000/Full
[ 20.070985] libphy: mdio@ffe24000:00 - Link is Up - 1000/Full
[/code]

With 3.14:
[code]
# dmesg | grep libphy
[ 1.508196] libphy: Freescale PowerQUICC MII Bus: probed
[/code]

comment:9 Changed 3 years ago by arokh

Found a quick-fix on my wdr4900: "miitool -r eth0.2" renegotiates successfully to 1000baseT-FD

comment:10 Changed 3 years ago by robnitro@…

Does ethtool work for 4900?
(mii tool can be buggy)
replace eth1 with your wan interface
ethtool -s eth1 autoneg off
ethtool -s eth1 autoneg on

comment:11 Changed 3 years ago by arokh

No it doesn't. mii-tool works great, and it's only 6KB compared to ethtool which is like 80KB.

"miitool -r eth0" seems to be sufficient. Makes sense since the switch only has one physical interface, eth0.1 is LAN and eth0.2 is WAN. So the trick is to trigger a new renegotiation, it works great after bootup. Maybe the first negotiation is too early in the boot process or something?

comment:12 Changed 3 years ago by anonymous

For me the sequence
ethtool -s eth1 autoneg off
ethtool -s eth1 autoneg on
doesn't solve the issue on a TPLINK TL-WDR4300.

I found the following differences:
3.10

  • port negotiates 1000/full
  • "ethtool eth0" reports Advertised auto-negotiation: No

3.14

  • port negotiates 10/half
  • "ethtool eth0" reports Advertised auto-negotiation: Yes

It's strange however that in both cases "ethtool eth0" reports
Supports auto-negotiation: No
Not sure whether it's a bug or a feature ..

comment:13 Changed 3 years ago by anonymous

OK, found the reason for the issue.
Kernel 3.14 introduced an additional reset of the switch in
drivers/net/phy/phy_device.c, function phy_init_hw.
This reset clears the Autoneg flag in the switch.

A quick fix is to change this new reset command.
Change BMCR_RESET to BMCR_RESET | BMCR_ANENABLE

However this might not be the ideal fix.
I raised this topic on the openwrt devel mailing list and hope
that the maintainers of the ar8216 driver can come up with a
suggestion for a proper fix.

comment:14 Changed 3 years ago by nbd

  • Resolution set to fixed
  • Status changed from new to closed

fixed in current trunk

comment:15 Changed 3 years ago by robnitro@…

Leaving as closed, but since the fix I've been getting random disconnects, like micro disconnects... having pandora radio on, it will lose the stream. Logs show nothing out of the normal, just dhcp activity. But I'm wondering if the changes are causing these tiny hiccups that affect streaming?

I will test the older version I have saved in a few days and see if the issue persists.

WNDR3800 on fiber 75/75

Add Comment

Modify Ticket

Action
as closed .
The resolution will be deleted. Next status will be 'reopened'.
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.