Opened 19 years ago

Closed 19 years ago

#1772 closed defect (fixed)

New wait_for_sysfs rules for linux-2.6.16

Reported by: alexander@… Owned by: archaic@…
Priority: high Milestone: 6.2
Component: Book Version: SVN
Severity: normal Keywords:
Cc:

Description

Instead of the current 10-wait_for_sysfs.rules file, the etc/udev/05-udev-early.rules file should be copied from the udev tarball, because the old net rule is no longer relevant. Also, either the kernel patch pasted below should be applied (strongly preferred), or this rule added:

ACTION=="add", SUBSYSTEM=="net", WAIT_FOR_SYSFS="device/driver"

WARNING: this rule spins needlessly with virtual devices. Kernel patch that makes the net rule above unneeded:

--- orig/net/core/dev.c
+++ new/net/core/dev.c
@@ -2932,11 +2932,11 @@

              switch(dev->reg_state) {
              case NETREG_REGISTERING:
+                       dev->reg_state = NETREG_REGISTERED;
                      err = netdev_register_sysfs(dev);
                      if (err)
                              printk(KERN_ERR "%s: failed sysfs registration (%d)\n",
                                     dev->name, err);
-                       dev->reg_state = NETREG_REGISTERED;
                      break;

              case NETREG_UNREGISTERING: 

Change History (9)

comment:1 by dbn.lists@…, 19 years ago

Because I'm not a fan of patches, here's an sed which accomplishes the above fix:

sed -i.bak \
    -e '/case NETREG_REG/a \\t\t\tdev->reg_state = NETREG_REGISTERED;' \
    -e '/reg_state =.*_REGISTERED/d' net/core/dev.c

comment:2 by archaic@…, 19 years ago

Owner: changed from lfs-book@… to archaic@…
Status: newassigned

In this case, I would prefer a patch. While it is a very simple patch, it is easy to see what is going on and thus provides a little more value, IMO.

comment:3 by dbn.lists@…, 19 years ago

No biggie. I'll probably won't use the patch in my own scripts since I know what it's altering and so I don't have to track it, but you're probably right about the patch being better in this case.

comment:4 by martyman99999@…, 19 years ago

One could envision a scenario where a sed would apply improperly with no warning because of some other future change to the file.

Any indication if this will appear soon in a released kernel patch? [We had a mere two kernels yesterday, for a total of .7]

For the record I am up on 090 with udevtrigger, udevsettle, new rules, the sleeping workaround removed, and no trouble.

comment:5 by archaic@…, 19 years ago

Summary: New wait_for_sysfs rules for linux-2.6.16New wait_for_sysfs rules for linux-2.6.17

comment:6 by archaic@…, 19 years ago

Summary: New wait_for_sysfs rules for linux-2.6.17New wait_for_sysfs rules for linux-2.6.16

Just checking trac emails.

comment:7 by Matthew Burgess, 19 years ago

Note that the patch Alexander mentioned will be appearing in 2.6.16.10 (http://www.ussg.iu.edu/hypermail/linux/kernel/0604.2/1348.html).

comment:8 by archaic@…, 19 years ago

And the patch is indeed in the kernel now. Running a test build with this and some other changes.

comment:9 by archaic@…, 19 years ago

Resolution: fixed
Status: assignedclosed

Fixed in r7569.

Note: See TracTickets for help on using tickets.