Beagleboard XM: sysfs always reports link present for eth0 at boot

Bug #981966 reported by Martin Fox
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
linux (Ubuntu)
Fix Released
Medium
Paolo Pisati

Bug Description

When running Ubuntu 11.10 on a Beagleboard XM rev B the file /sys/class/net/eth0/carrier always contains a "1" at boot even if the ethernet cable is not plugged in; it should contain a "0". If the cable is inserted and then removed the value changes to "0" and from then on it tracks cable insertion and removal correctly. So the problem is specific to the state at boot.

Running 11.10 from the pre-packaged server (headless) images updated and upgraded. Running wicd (headless) as the network manager. Contents of /etc/network/interfaces do not affect behavior, but for what it's worth this file contains only the loopback stanzas:

# The loopback network interface
auto lo
iface lo inet loopback

This bug also occurs using 11.04 though the interface name is "usb0" instead of "eth0".

uname -a
Linux 3.0.0-17-omap #30-Ubuntu Thu Mar 8 18:16:34 UTC 2012 armv7l armv7l armv7l GNU/Linux

auction@autoauction:~$ lsb_release -rd
Description: Ubuntu 11.10
Release: 11.10

Revision history for this message
Ubuntu Foundations Team Bug Bot (crichton) wrote :

Thank you for taking the time to report this bug and helping to make Ubuntu better. It seems that your bug report is not filed about a specific source package though, rather it is just filed against Ubuntu in general. It is important that bug reports be filed about source packages so that people interested in the package can find the bugs about it. You can find some hints about determining what package your bug might be about at https://wiki.ubuntu.com/Bugs/FindRightPackage. You might also ask for help in the #ubuntu-bugs irc channel on Freenode.

To change the source package that this bug is filed about visit https://bugs.launchpad.net/ubuntu/+bug/981966/+editstatus and add the package name in the text box next to the word Package.

[This is an automated message. I apologize if it reached you inappropriately; please just reply to this message indicating so.]

tags: added: bot-comment
Revision history for this message
Fabio Marconi (fabiomarconi) wrote : Re: Beagleboard XM: sysfs always reports carrier present for eth0 at boot

Thank you for taking the time to report this bug and helping to make Ubuntu better. This bug did not have a package associated with it, which is important for ensuring that it gets looked at by the proper developers. You can learn more about finding the right package at https://wiki.ubuntu.com/Bugs/FindRightPackage . I have classified this bug as a bug in network-manager.

When reporting bugs in the future please use apport by using 'ubuntu-bug' and the name of the package affected. You can learn more about this functionality at https://help.ubuntu.com/community/ReportingBugs.

affects: ubuntu → network-manager (Ubuntu)
Revision history for this message
Mathieu Trudel-Lapierre (cyphermox) wrote :

Carrier-detection is done at the kernel level -- if sysfs reports it wrong, it gets detected wrong by the kernel driver and needs to be addressed there: reassigning to 'linux'.

affects: network-manager (Ubuntu) → linux (Ubuntu)
Revision history for this message
Brad Figg (brad-figg) wrote : Missing required logs.

This bug is missing log files that will aid in diagnosing the problem. From a terminal window please run:

apport-collect 981966

and then change the status of the bug to 'Confirmed'.

If, due to the nature of the issue you have encountered, you are unable to run this command, please add a comment stating that fact and change the bug status to 'Confirmed'.

This change has been made by an automated script, maintained by the Ubuntu Kernel Team.

Changed in linux (Ubuntu):
status: New → Incomplete
tags: added: oneiric
Changed in linux (Ubuntu):
importance: Undecided → Medium
Paolo Pisati (p-pisati)
Changed in linux (Ubuntu):
assignee: nobody → Paolo Pisati (p-pisati)
Revision history for this message
Martin Fox (belden-fox) wrote : Re: Beagleboard XM: sysfs always reports carrier present for eth0 at boot

I'm running on a headless system and the various apport incantations keep trying to launch a web browser. Finally invoked it in a way that led to a reasonable looking info file (attached) and a crash in one of the Python scripts.

Confirmed outside of sysfs using ip command.

$ ip link show eth0
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1488 qdisc pfifo_fast state UNKNOWN qlen 1000
    link/ether ba:9c:31:bf:ca:93 brd ff:ff:ff:ff:ff:ff

Changed in linux (Ubuntu):
status: Incomplete → Confirmed
Martin Fox (belden-fox)
summary: - Beagleboard XM: sysfs always reports carrier present for eth0 at boot
+ Beagleboard XM: sysfs always reports link present for eth0 at boot
Revision history for this message
Paolo Pisati (p-pisati) wrote :
Revision history for this message
Paolo Pisati (p-pisati) wrote :
Changed in linux (Ubuntu):
status: Confirmed → In Progress
tags: added: patch
Revision history for this message
Martin Fox (belden-fox) wrote :

I installed the new kernel into an existing Ubuntu 11.10 installation (having nothing else on hand) and the problem still occurs. At boot /sys/class/net/eth0/carrier reads "1" despite having no cable. Plugging and unplugging the cable corrects the problem. uname -a reports that I'm using the new kernel (previous one was 3.0.0-17)

~$ uname -a
Linux autoauction 3.2.0-23-omap #36~lp981966 Mon Apr 23 08:24:56 UTC 2012 armv7l armv7l armv7l GNU/Linux

(Not sure if dumping this new kernel into an Ubuntu 11.10 image was correct; system seems a bit unstable. Let me know if there's a better procedure to follow as I don't normally swap kernels around like this.)

Revision history for this message
Paolo Pisati (p-pisati) wrote :

weird, since that kernel turn off the NIC at boot time - please try this one: http://people.canonical.com/~ppisati/lp981966/linux-image-3.2.0-23-omap_3.2.0-23.36~lp981966dbg_armel.deb

then do a "dmesg | grep usbnet", and you should see:

flag@flag-desktop:~$ dmesg | grep usbnet
[ 14.624908] usbnet_probe::1323
[ 14.829833] usbnet_probe::1462 netif_carrier_off()
[ 14.829833] usbnet_probe::1465

do this with and without the cable, examine '/sys/class/net/eth0/carrier' in both cases and report the results.

Installing a new kernel on an old release is not a problem (and that's what backports do).

Revision history for this message
Martin Fox (belden-fox) wrote :

The bug is fixed in the debug (second) kernel you pointed me to; the contents of the "carrier" file match the state of the cable at boot. I do see the netif_carrier_off() line in dmesg whether the cable is inserted at boot or not.

root@autoauction:~# uname -a
Linux autoauction 3.2.0-23-omap #36~lp981966dbg Thu Apr 26 08:20:08 UTC 2012 armv7l armv7l armv7l GNU/Linux
root@autoauction:~# dmesg | fgrep usbnet
[ 10.667175] usbnet_probe::1323
[ 10.753784] usbnet_probe::1462 netif_carrier_off()
[ 10.753784] usbnet_probe::1465

I re-installed the first kernel you pointed to and verified that the bug was *not* fixed in that one.

(FYI, the first time I dropped your kernel into my 11.10 system it became very unstable and crashed at random. This time around I re-imaged my SD card and removed AppArmor and wicd before dropping your kernel in and ended up with a stable system.)

Revision history for this message
Paolo Pisati (p-pisati) wrote :

i did that manually, so it could be that i modified the name of the package but i forgot to include the relevant patch (in the first kernel i mean).

another question: which beagle did you have? XM? Revision (a/b/c)? can you do a reboot loop (let's say 10 reboots in a row) with the cable plugged in and tell me if the network link is always picked up?

Revision history for this message
Martin Fox (belden-fox) wrote :

It's a Beagleboard-xM rev B.

I rebooted numerous times and the network always came up without a problem. Seems to be working fine.

Revision history for this message
Paolo Pisati (p-pisati) wrote :

the patch has been accepted for stable@ and is flowing down to every release (3.0.x,3.2.x, etcetc): if it's not in the SRU kernel you are running now, should be in the next one. Closing here.

Changed in linux (Ubuntu):
status: In Progress → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.