3 3
jerryc

eth0 stuck at half duplex Orange Pi Zero

Recommended Posts

Hi

 

Pulled latest git repo and build mainline image (Ubuntu/Debian both) 4.9.2-sun8i kernel.

 

Eth0 now stuck at 100mb/s and half duplex.  I have tried using ethertool to make it full duplex.   Not working. 

 

The previous image which I used and suggested was Armbian_5.24.170109_Orangepizero_Ubuntu_xenial_4.9.0 

This image works with full duplex.

 

Is this a bug or there is more configs needed when I building my own images?  From ethtool output, looks like problem with auto negotiation.

 

pi@orangepizero:~$ sudo ethtool eth0

Settings for eth0:

Supported ports: [ TP MII ]

Supported link modes:   10baseT/Half 10baseT/Full 

                        100baseT/Half 100baseT/Full 

Supported pause frame use: No

Supports auto-negotiation: Yes

Advertised link modes:  10baseT/Half 10baseT/Full 

                        100baseT/Half 100baseT/Full 

Advertised pause frame use: No

Advertised auto-negotiation: Yes

Link partner advertised link modes:  10baseT/Half 10baseT/Full 

                                    100baseT/Half 100baseT/Full 

Link partner advertised pause frame use: Symmetric

Link partner advertised auto-negotiation: Yes

Speed: 100Mb/s

Duplex: Half

Port: MII

PHYAD: 1

Transceiver: external

Auto-negotiation: on

Current message level: 0x00000000 (0)

       

 

Link detected: yes

 

 

eth0: negotiated 100baseTx-HD, link ok

  product info: vendor 00:11:05, model 0 rev 0

  basic mode:   isolate, autonegotiation enabled

  basic status: autonegotiation complete, link ok

  capabilities: 100baseTx-FD 100baseTx-HD 10baseT-FD 10baseT-HD

  advertising:  100baseTx-HD 10baseT-FD

 

  link partner: 100baseTx-FD 100baseTx-HD 10baseT-FD 10baseT-HD flow-control

 

 

-jerry

Share this post


Link to post
Share on other sites

I don't have this board yet, but I have done ethernet driver development in the past. You really want to make sure that your setup is valid. I suggest switching out the ethernet cable and switch. A lot of these embedded PHY's are quirky (that is why linux kernel is filled with vendor specific phy drivers) and different switches can cause issues. Another potential problem is a bad cable.

Share this post


Link to post
Share on other sites

@jerryc

 

Our kernel sources are attached to development branches and there are a list of patches on top of this, that things works. Building from mainline sources without additional patches is not the way to go. Waste of time. ATM.

 

That's why we have tools.

Share this post


Link to post
Share on other sites

@admin

 

The kernel was build using the github repo that you listed.   Hence my question on why the latest build locks into half duplex.  Unless you mean there are other batches beside your repo? or other ways to build? (I am following your build instructions)  Unless you are saying there are additional patches that are not in the repo that you listed.

 

Also, I am very possitive it is not switch/cable/power issue.  the test was done using two images.  One was provided by you a while back on another question, and one is the image I build using the repo.

 

any ideas?

 

-jerry

 

 

@jerryc

 

Our kernel sources are attached to development branches and there are a list of patches on top of this, that things works. Building from mainline sources without additional patches is not the way to go. Waste of time. ATM.

 

That's why we have tools.

Share this post


Link to post
Share on other sites
any ideas?

 

You are trying to use kernel built from developer branch where problems are more than expected. This kernel is not ready for usage ... we can't and we don't waste time on supporting something that changes within hours.

Share this post


Link to post
Share on other sites

You are trying to use kernel built from developer branch where problems are more than expected. This kernel is not ready for usage ... we can't and we don't waste time on supporting something that changes within hours.

 

Is there a way to tell the tool That's why we have tools, to build using different kernel?  or it is fixed?

Share this post


Link to post
Share on other sites

My OPiZero is in full duplex, either with last week's build or today's build.

@martinayotte

 

Just did a git pull and used compile.sh to create a new mainline image for orangepizero.  The half duplex is still there.   I assume you also used the compile.sh script for your images.  If not let me know, I can try your way as well.

 

 

root@orangepizero:~# uname -a

 

Linux orangepizero 4.9.3-sun8i #5 SMP Fri Jan 13 15:57:42 PST 2017 armv7l GNU/Linux

root@orangepizero:~# ethtool eth0

Settings for eth0:

Supported ports: [ TP MII ]

Supported link modes:   10baseT/Half 10baseT/Full 

                        100baseT/Half 100baseT/Full 

Supported pause frame use: No

Supports auto-negotiation: Yes

Advertised link modes:  10baseT/Half 10baseT/Full 

                        100baseT/Half 100baseT/Full 

Advertised pause frame use: No

Advertised auto-negotiation: Yes

Link partner advertised link modes:  10baseT/Half 10baseT/Full 

                                    100baseT/Half 100baseT/Full 

Link partner advertised pause frame use: Symmetric

Link partner advertised auto-negotiation: Yes

Speed: 100Mb/s

Duplex: Half

Port: MII

PHYAD: 1

Transceiver: external

Auto-negotiation: on

Current message level: 0x00000000 (0)

       

Link detected: yes

 

root@orangepizero:~# mii-tool -v

eth0: negotiated 100baseTx-HD, link ok

  product info: vendor 00:11:05, model 0 rev 0

  basic mode:   isolate, autonegotiation enabled

  basic status: autonegotiation complete, link ok

  capabilities: 100baseTx-FD 100baseTx-HD 10baseT-FD 10baseT-HD

  advertising:  100baseTx-HD 10baseT-FD

  link partner: 100baseTx-FD 100baseTx-HD 10baseT-FD 10baseT-HD flow-control

root@orangepizero:~# 

Share this post


Link to post
Share on other sites

Is there a way to tell the tool That's why we have tools, to build using different kernel?  or it is fixed?

Yes, you can change sources, branches, ... this question was brought up few times. Start here: https://www.armbian.com/search_gcse and https://docs.armbian.com/Developer-Guide_Build-Preparation if you want to start learning more about the build process.

 

I move this topic to development section, since it suits here more.

Share this post


Link to post
Share on other sites

@martinayotte

 

Just did a git pull and used compile.sh to create a new mainline image for orangepizero.  The half duplex is still there.   I assume you also used the compile.sh script for your images.  If not let me know, I can try your way as well.

Yes, it was my own builds done with compile.sh

Share this post


Link to post
Share on other sites

@martinayotte

 

Appreciate your help.  Just cloned a workspace and build a fresh image.   (no special config, just a orange pi zero debian 4.9 server image)  I am still getting the eth0 at half Duplex.   An older image given to be by @igor this image  works perfectly (with Full Duplex and solved stability issues)

 

root@orangepizero:~# uname -a

Linux orangepizero 4.9.3-sun8i #1 SMP Sat Jan 14 17:08:59 PST 2017 armv7l GNU/Linux

 

root@orangepizero:~# mii-tool eth0 -v

eth0: negotiated 100baseTx-HD, link ok

  product info: vendor 00:11:05, model 0 rev 0

  basic mode:   isolate, autonegotiation enabled

  basic status: autonegotiation complete, link ok

  capabilities: 100baseTx-FD 100baseTx-HD 10baseT-FD 10baseT-HD

  advertising:  100baseTx-HD 10baseT-FD

  link partner: 100baseTx-FD 100baseTx-HD 10baseT-FD 10baseT-HD flow-control

 

Yes, it was my own builds done with compile.sh

Share this post


Link to post
Share on other sites

@szwistak  I can't find it any more either.  I been trying to reproduce that build done by igore, but no success, so i give up and wait until some one build another working image with 4.9.4 or something like it ...

Share this post


Link to post
Share on other sites

NanoPi Neo have same problem with kernel 4.9+...4.10+. It's problem in sun8i-emac - driver. After ifconfig eth0 down && ifconfig eth0 up autonegatiation work fine. I think, that problem is garbage in PHY-state register after U-boot.

Problem can be resolved with adding:

pre-up /sbin/ifconfig eth0 down
pre-up /sbin/ifconfig eth0 up
pre-up /sbin/ifconfig eth0 down

in section eth0.

Share this post


Link to post
Share on other sites
On 2/22/2017 at 4:01 PM, bigbuba said:

After ifconfig eth0 down && ifconfig eth0 up autonegatiation work fine.

That fixes the problem on OPi PC with 4.10.1 kernel (Armbian 5.27.170309 nightly) for me too.

Share this post


Link to post
Share on other sites

Same problem here, anyone with a solution?

 

uname -a

Linux orangepizero 3.4.113-sun8i #10 SMP PREEMPT Thu Feb 23 19:55:00 CET 2017 armv7l armv7l armv7l GNU/Linux

 

Stuck at 10/Full and only Orange led is lit on the ethernet port.

   18.282122] PHY: gmac0-0:00 - Link is Up - 100/Full
[   26.280234] PHY: gmac0-0:00 - Link is Down
[   28.280327] PHY: gmac0-0:00 - Link is Up - 100/Full
[   34.281213] PHY: gmac0-0:00 - Link is Down
[   36.280262] PHY: gmac0-0:00 - Link is Up - 100/Full
[   40.280224] PHY: gmac0-0:00 - Link is Down
[   41.280426] PHY: gmac0-0:00 - Link is Up - 100/Full
[   43.280368] PHY: gmac0-0:00 - Link is Down
[   44.280429] PHY: gmac0-0:00 - Link is Up - 100/Full
[   46.280335] PHY: gmac0-0:00 - Link is Down
[   47.280425] PHY: gmac0-0:00 - Link is Up - 100/Full
[   53.280416] PHY: gmac0-0:00 - Link is Down
[   54.280439] PHY: gmac0-0:00 - Link is Up - 100/Full
[   56.280425] PHY: gmac0-0:00 - Link is Down
[   57.280474] PHY: gmac0-0:00 - Link is Up - 100/Full
[   63.280415] PHY: gmac0-0:00 - Link is Down
[   66.280470] PHY: gmac0-0:00 - Link is Up - 100/Full
[   80.280448] PHY: gmac0-0:00 - Link is Down
[   87.280431] PHY: gmac0-0:00 - Link is Up - 10/Full

If I try /sbin/ifconfig eth0 down /sbin/ifconfig eth0 up, then:

 

 

[  618.485543] gmac0 gmac0: eth0: eth0: PHY ID 00441400 at 0 IRQ poll (gmac0-0:00)
[  618.499102] ADDRCONF(NETDEV_UP): eth0: link is not ready
[  624.480374] PHY: gmac0-0:00 - Link is Up - 100/Full
[  624.481017] ADDRCONF(NETDEV_CHANGE): eth0: link becomes ready
[  634.480360] PHY: gmac0-0:00 - Link is Down
[  640.480347] PHY: gmac0-0:00 - Link is Up - 100/Full
[  642.480401] PHY: gmac0-0:00 - Link is Down
[  647.480745] PHY: gmac0-0:00 - Link is Up - 10/Full

Share this post


Link to post
Share on other sites

This topic is about (known) issues with Ethernet driver on mainline kernel, which is still in development phase and this driver is about to be rewritten AFAIK.

 

On kernel 3.4.113 we didn't notice such problems. Double check your cables and other equipment first.

Share this post


Link to post
Share on other sites

I upgraded to nightly beta.

 

I added to /etc/network/interfaces:

auto eth0

allow-hotplug eth0

iface eth0 inet manual

pre-up /sbin/ifconfig eth0 down

pre-up /sbin/ifconfig eth0 up

pre-up /sbin/ifconfig eth0 down

 

 

With this extra "pre-up" config I get full duplex connection (without only half duplex).

 

A: Macbook, Samsung TV: 100Mb/s full duplex

B: Old laptop Asus F5R, it is equipped with 10/100Lan card, but for some reason it is advertising itself 10Mb/s only (Live Ubuntu + Acronis True Image CD). Doesn't matter.

 

 

I use this little board for wlan0 to eth0 bridging and it's really good.

 

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
3 3