FEC driver does not set "DRIVER" property in udev which makes network-manager fail

Bug #438687 reported by Oliver Grawert
12
This bug affects 1 person
Affects Status Importance Assigned to Milestone
linux-fsl-imx51 (Ubuntu)
Fix Released
High
Jeremy Kerr
Karmic
Fix Released
High
Jeremy Kerr
network-manager (Ubuntu)
Invalid
High
Unassigned
Karmic
Invalid
High
Unassigned

Bug Description

the current FEC driver in the imx51 kernel does not set the DRIVER property for udev

ogra@babbage2:~$ udevadm info --query=all --path=/devices/virtual/net/eth0
P: /devices/virtual/net/eth0
E: UDEV_LOG=3
E: DEVPATH=/devices/virtual/net/eth0
E: INTERFACE=eth0
E: IFINDEX=2
E: SUBSYSTEM=net

network-manager only manages devcies for which it finds this property:

        driver = g_udev_device_get_property (device, "DRIVER");
        if (!driver) {
                parent = g_udev_device_get_parent (device);
                if (parent)
                        driver = g_udev_device_get_property (parent, "DRIVER");
        }

either the FEC driver needs to export this property to udev or network-manager needs to be changed to not refuse to manage a device for which this property does not exists.

Oliver Grawert (ogra)
Changed in linux-fsl-imx51 (Ubuntu Karmic):
importance: Undecided → High
milestone: none → ubuntu-9.10
tags: added: armel
Changed in linux-fsl-imx51 (Ubuntu Karmic):
assignee: nobody → Amit Kucheria (amitk)
Changed in network-manager (Ubuntu Karmic):
importance: Undecided → High
milestone: none → ubuntu-9.10
assignee: nobody → Alexander Sack (asac)
Revision history for this message
Steve Langasek (vorlon) wrote :

Not an either-or; the driver needs to be fixed. Having NM manage driverless interfaces breaks behavior with various VPNs and other virtual devices.

Changed in network-manager (Ubuntu Karmic):
status: New → Invalid
Loïc Minier (lool)
Changed in linux-fsl-imx51 (Ubuntu Karmic):
status: New → Confirmed
status: Confirmed → Triaged
Revision history for this message
Jeremy Kerr (jk-ozlabs) wrote :

From looking at the udev code, it would seem that this is due to a missing driver symlink in the sysfs directory for this device. Could you confirm by pasting the output of:

ls -l /sys/class/net/eth0/device/

?

Revision history for this message
Loïc Minier (lool) wrote :

ls: cannot access /sys/class/net/eth0/device/: No such file or directory
lool@babbage20:~$ ls -l /sys/class/net/eth0/
total 0
-r--r--r-- 1 root root 4096 2009-10-04 14:33 address
-r--r--r-- 1 root root 4096 2009-10-04 14:33 addr_len
-r--r--r-- 1 root root 4096 2009-10-06 09:26 broadcast
-r--r--r-- 1 root root 4096 2009-10-06 09:26 carrier
-r--r--r-- 1 root root 4096 2009-10-06 09:26 dev_id
-r--r--r-- 1 root root 4096 2009-10-06 09:26 dormant
-r--r--r-- 1 root root 4096 2009-10-06 09:26 features
-rw-r--r-- 1 root root 4096 2009-10-04 14:33 flags
-rw-r--r-- 1 root root 4096 2009-10-06 09:26 ifalias
-r--r--r-- 1 root root 4096 2009-10-04 14:33 ifindex
-r--r--r-- 1 root root 4096 2009-10-06 09:26 iflink
-r--r--r-- 1 root root 4096 2009-10-06 09:26 link_mode
-rw-r--r-- 1 root root 4096 2009-10-06 09:26 mtu
-r--r--r-- 1 root root 4096 2009-10-06 09:26 operstate
drwxr-xr-x 2 root root 0 2009-10-06 09:26 power
drwxr-xr-x 2 root root 0 2009-10-06 09:26 statistics
lrwxrwxrwx 1 root root 0 2009-10-06 09:26 subsystem -> ../../../../class/net
-rw-r--r-- 1 root root 4096 2009-10-06 09:26 tx_queue_len
-r--r--r-- 1 root root 4096 2009-10-04 14:33 type
-rw-r--r-- 1 root root 4096 2009-10-06 09:26 uevent

Revision history for this message
Jeremy Kerr (jk-ozlabs) wrote :

Looks like the struct netdevice for the fec interfaces don't have a "parent", and hence no driver. I'm currently building a test kernel to add a parent device for the interface, will let you know how that goes.

Changed in linux-fsl-imx51 (Ubuntu Karmic):
status: Triaged → Won't Fix
status: Won't Fix → In Progress
Revision history for this message
Alexander Sack (asac) wrote :

Jeremy, if that works that would be fantastic ... these drivers without a parent are causing pain for NM for a while already ;)

Loïc Minier (lool)
Changed in network-manager (Ubuntu Karmic):
assignee: Alexander Sack (asac) → nobody
Changed in linux-fsl-imx51 (Ubuntu Karmic):
assignee: Amit Kucheria (amitk) → Jeremy Kerr (jk-ozlabs)
Revision history for this message
Loïc Minier (lool) wrote :

I've tested a couple of kernels from jk; latest being http://kernel.ubuntu.com/~jk/bugs/438687/linux-image-2.6.31-102-imx51_2.6.31-102.10.jk1_armel.deb.

I will attach dmesg of the latest test.

Revision history for this message
Jeremy Kerr (jk-ozlabs) wrote :

I'm in the process of adding some minimal platform_driver infrastructure to the fec code; this should give the appropriate entries in sysfs. Will report back with a patch tomorrow.

Revision history for this message
Loïc Minier (lool) wrote :
Revision history for this message
Jeremy Kerr (jk-ozlabs) wrote :

New test kernel up at http://kernel.ubuntu.com/~jk/bugs/438687/ - the jk2 version is my most recent build. This has a minimal platform_device for the FEC driver. We may need to provide more details to the core driver code, but try this one to see how it goes.

Loïc: try this and let me know how it goes. dmesg from a boot would be handy if you could attach it here.

Revision history for this message
Loïc Minier (lool) wrote :

Latest kernel comes up with network (jk2) but no DRIVER property still

Revision history for this message
Loïc Minier (lool) wrote :
Revision history for this message
Loïc Minier (lool) wrote :
Revision history for this message
Loïc Minier (lool) wrote :

% ls /sys/class/net/eth0/
address carrier features ifindex mtu statistics type
addr_len dev_id flags iflink operstate subsystem uevent
broadcast dormant ifalias link_mode power tx_queue_len

Revision history for this message
Jeremy Kerr (jk-ozlabs) wrote :

New kernel is up (jk3). Let me know how that goes, and thanks for the continued testing.

Revision history for this message
Loïc Minier (lool) wrote :

With jk3, ethernet comes up with ifup but udevadm can't query the virtual pathname anymore.

$ udevadm info --query=all --path=/devices/virtual/net/eth0
device path not found

However I see a fec.0 dir:
$ udevadm info --query=all --path=/devices/platform/fec.0/net/eth0
P: /devices/platform/fec.0/net/eth0
E: UDEV_LOG=3
E: DEVPATH=/devices/platform/fec.0/net/eth0
E: INTERFACE=eth0
E: IFINDEX=2
E: SUBSYSTEM=net

no DRIVER= though, so I didn't try NM.

Revision history for this message
Paul Larson (pwlars) wrote :

I'm seeing pretty much the same thing, however network-manager does seem to connect, as I now have it up and running without having to manually run dhclient. I can't seem to control it with ifup/ifdown though. I just get "Ignoring unknown interface eth0=eth0.

Revision history for this message
Jeremy Kerr (jk-ozlabs) wrote :

Loïc: the updated driver uses the 'platform' bus rather than 'virtual', so the device has moved in sysfs. Is this going to be a problem?

Also, could you see if NM works as it does for Paul? It's possible that the DRIVER property is being exposed through a different node in sysfs. Try a recursive query:

udevadm info --query=all --path=/class/net/eth0 --attribute-walk

Paul; IIRC, ifup will only work if you have an entry in /etc/network/interfaces, which would preclude NM from managing the device. If you want to try ifup/ifdown, you may need to add the following to /etc/network/interfaces:

auto eth0
iface eth0 inet dhcp

If all is OK with the updated driver, I will remove debug code and send a patch.

Revision history for this message
Oliver Grawert (ogra) wrote :

i can confirm that NM sees the interface but there is something wrong with the driver now, my dmesg gets spammed with 100s of:

eth0: tx queue full !

messages at some boots ...
it worked on the third boot without the queue full messages, but there i see:

FEC ENET: rcv is not +last

so there seems to be still a minor breakage here. i'm using the linux-image-2.6.31-102-imx51_2.6.31-102.10.jk3_armel.deb kernel atm.

Revision history for this message
Jeremy Kerr (jk-ozlabs) wrote :

Oliver: My changes should only affect the probe code, so I'd be surprised if we seen any difference with the rx/tx paths.

However, I've been surprised before, so I've done a "baseline" build, version jk0:

 http://kernel.ubuntu.com/~jk/bugs/438687/linux-image-2.6.31-102-imx51_2.6.31-102.10.jk0_armel.deb

- this is the fsl-imx51 branch, built without my changes. Could you test this to see if you still have the same errors in dmesg? Of course, the interface will need to be brought up manually, as NM won't work.

Revision history for this message
Oliver Grawert (ogra) wrote :

trying the linux-image-2.6.31-102-imx51_2.6.31-102.10.jk0_armel.deb kernel shows the
FEC ENET: rcv is not +last
message as well, so this is not caused by your patches ...

after bringing up teh interface and trying to ping i got the symptoms of bug 356975 again though ...

Revision history for this message
Jeremy Kerr (jk-ozlabs) wrote :

OK, thanks for the testing. Patch coming.

Revision history for this message
Loïc Minier (lool) wrote :

Jeremy, ah right, I expected the DRIVER property to be set on that other node; the recursive query indeed shows the property on some nodes:
lool@babbage20:~$ udevadm info --query=all --path=/class/net/eth0 --attribute-walk
...
  looking at device '/devices/platform/fec.0/net/eth0':
    KERNEL=="eth0"
    SUBSYSTEM=="net"
    DRIVER==""
    ATTR{addr_len}=="6"
    ATTR{dev_id}=="0x0"
    ATTR{ifalias}==""
    ATTR{iflink}=="2"
    ATTR{ifindex}=="2"
    ATTR{features}=="0x0"
    ATTR{type}=="1"
    ATTR{link_mode}=="0"
    ATTR{address}=="00:04:9f:00:cd:14"
    ATTR{broadcast}=="ff:ff:ff:ff:ff:ff"
    ATTR{carrier}=="1"
    ATTR{dormant}=="0"
    ATTR{operstate}=="unknown"
    ATTR{mtu}=="1500"
    ATTR{flags}=="0x1003"
    ATTR{tx_queue_len}=="1000"

  looking at parent device '/devices/platform/fec.0':
    KERNELS=="fec.0"
    SUBSYSTEMS=="platform"
    DRIVERS=="fec"
    ATTRS{modalias}=="platform:fec"

  looking at parent device '/devices/platform':
    KERNELS=="platform"
    SUBSYSTEMS==""
    DRIVERS==""

I did not try Network-Manager and can't try it out right now (not near the board), it probably works according to other comments in this bug.

Thanks and well done!

Revision history for this message
Jeremy Kerr (jk-ozlabs) wrote :

Patch to convert fec to a platform device. I've sent to k-t@u.c. Suggest we track the dmesg errors in a separate bug, as they seem to be independent of this.

From the patch comments:

[PATCH] drivers/net/fec: Convert to a platform bus driver

BugLink: https://bugs.launchpad.net/bugs/438687

Currently, the FEC device is placed on the 'virtual' bus, and so has no
driver symlink in sysfs. This symlink is required for network manager to
handle the device properly, so FEC devices are currently ignored.

This change converts the FEC driver to use the platform bus, so we get
the proper symlinks set up in sysfs. With this change, NM will bring up
the network as expected.

We're doing the platform_device_register in the driver itself, rather
than in machine-specific code. This is a bit of a hack: the driver will
always attempt to initialise a FEC even if one isn't present in the
system. However, this is no different from the existing driver.

Signed-off-by: Jeremy Kerr <email address hidden>

Jeremy Kerr (jk-ozlabs)
Changed in linux-fsl-imx51 (Ubuntu Karmic):
status: In Progress → Won't Fix
status: Won't Fix → In Progress
Andy Whitcroft (apw)
Changed in linux-fsl-imx51 (Ubuntu Karmic):
status: In Progress → Fix Committed
Revision history for this message
Loïc Minier (lool) wrote :

I think it's interesting to chase FEC2, but better suited for lucid than karmic.

Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package linux-fsl-imx51 - 2.6.31-104.12

---------------
linux-fsl-imx51 (2.6.31-104.12) karmic; urgency=low

  [ Alan Tull ]

  * SAUCE: IMX51: A hack which allows the sound driver to initialize.

  [ Amit Kucheria ]

  * Disable CONFIG_UEVENT_HELPER_PATH

  [ Andy Whitcroft ]

  * rebase to Ubuntu-2.6.31-13.42
  * rebase to Ubuntu-2.6.31-13.43

  [ Brad Figg ]

  * CONFIG: IMX51: change SGTL5000 driver to be builtin instead of a
    module.

  [ Colin Watson ]

  * Use section 'admin' rather than 'base'

  [ Jeremy Kerr ]

  * SAUCE: drivers/net/fec: Convert to a platform bus driver
    - LP: #438687

  [ Tim Gardner ]

  * [Config] CONFIG_GFS2_FS_LOCKING_DLM=y
    - LP: #416325

  [ Upstream Kernel Changes ]

  * ENGR00107785 sgtl5000: adc power savings
  * sgtl5000 audio: more porting to 2.6.31
  * sgtl5000: add line in function

  [ Ubuntu: 2.6.31-13.43 ]

  * Revert "[Upstream] acerhdf: Limit modalias matching to supported
    boards"
  * Use section 'admin' rather than 'base'
  * SAUCE: AppArmor: Set error code after structure initialization.
    - LP: #427948
  * SAUCE: AppArmor: Fix off by 2 error in getprocattr mem allocation
    - LP: #446595
  * SAUCE: Add sr_mod to the scsi-modules udeb for powerpc
  * [Upstream] acerhdf: Limit modalias matching to supported boards
    (supersedes previous revert made by Andy Whitcroft)
    - LP: #435958

  [ Ubuntu: 2.6.31-13.42 ]

  * SAUCE: (drop after 2.6.31) input: Add support for filtering input
    events
    - LP: #430809
  * SAUCE: (drop after 2.6.31) dell-laptop: Trigger rfkill updates on wifi
    toggle switch press
    - LP: #430809
  * SAUCE: Raise the default console 'quiet' level to 2
    This supresses all but critical and emergency level messages.
    https://lists.ubuntu.com/archives/kernel-team/2009-October/007476.html
  * TTY: fix typos
  * Linux 2.6.31.3
  * V4L/DVB (12439): cx88: add support for WinFast DTV2000H rev. J
    - LP: #433904

  [ Ubuntu: 2.6.31-12.41 ]

  * [Config] CONFIG_GFS2_FS_LOCKING_DLM=y
    - LP: #416325
  * SAUCE: Fix MODULE_IMPORT/MODULE_EXPORT
    The original patch failed to work for amd64.
    - LP: #430694
  * ALSA: hda - Add a white-list for MSI option
    Upstream cherry-pick: Infrastructure support for #445580
  * ALSA: hda - Add HP Pavilion dv4t-1300 to MSI whitelist
    - LP: #445580
  * ALSA: intel8x0 - Mute External Amplifier by default for Sony VAIO
    VGN-T350P
    - LP: #410933
  * ALSA: intel8x0 - Mute External Amplifier by default for Sony VAIO
    VGN-B1VP
    - LP: #410933

  [ Ubuntu: 2.6.31-12.40 ]

  * SAUCE: Created MODULE_EXPORT/MODULE_IMPORT macros
    - LP: #430694
  * SAUCE: Use MODULE_IMPORT macro to tie intel_agp to i915
    - LP: #430694
  * V4L/DVB (12352): gspca - vc032x: Fix mi1310_soc preview and LED
    - LP: #310760

 -- Andy Whitcroft <email address hidden> Fri, 09 Oct 2009 14:50:27 +0100

Changed in linux-fsl-imx51 (Ubuntu Karmic):
status: Fix Committed → Fix Released
tags: added: iso-testing
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.