chiark / gitweb /
[PATCH] change max time to wait in wait_for_sysfs to 10 seconds to hopefully handle...
[elogind.git] / wait_for_sysfs.c
index 2504b2e0c3fa98f6b5677364b567bbb61fd1d5df..f87253d0449c2401655db53039d33382e47d82d3 100644 (file)
@@ -32,6 +32,7 @@
 #include <sys/stat.h>
 
 #include "logging.h"
+#include "udev_version.h"
 #include "libsysfs/sysfs/libsysfs.h"
 
 #ifdef LOG
@@ -46,7 +47,7 @@ void log_message(int level, const char *format, ...)
 }
 #endif
 
-#define WAIT_MAX_SECONDS               5
+#define WAIT_MAX_SECONDS               10
 #define WAIT_LOOP_PER_SECOND           20
 
 /* wait for specific file to show up, normally the "dev"-file */
@@ -63,6 +64,10 @@ static int wait_for_class_device_attributes(struct sysfs_class_device *class_dev
                { .subsystem = "usb_host",      .file = NULL },
                { .subsystem = "bluetooth",     .file = "address" },
                { .subsystem = "i2c-adapter",   .file = NULL },
+               { .subsystem = "pci_bus",       .file = NULL },
+               { .subsystem = "ieee1394",      .file = NULL },
+               { .subsystem = "ieee1394_host", .file = NULL },
+               { .subsystem = "ieee1394_node", .file = NULL },
                { NULL, NULL }
        };
        struct class_file *classfile;
@@ -126,8 +131,7 @@ static int class_device_expect_no_device_link(struct sysfs_class_device *class_d
                { .subsystem = "input",         .device = "mice" },
                { .subsystem = "input",         .device = "mouse" },
                { .subsystem = "input",         .device = "ts" },
-               { .subsystem = "vc",            .device = "vcs" },
-               { .subsystem = "vc",            .device = "vcsa" },
+               { .subsystem = "vc",            .device = NULL },
                { .subsystem = "tty",           .device = NULL },
                { .subsystem = "cpuid",         .device = "cpu" },
                { .subsystem = "graphics",      .device = "fb" },
@@ -135,9 +139,22 @@ static int class_device_expect_no_device_link(struct sysfs_class_device *class_d
                { .subsystem = "misc",          .device = NULL },
                { .subsystem = "msr",           .device = NULL },
                { .subsystem = "netlink",       .device = NULL },
+               { .subsystem = "net",           .device = "sit" },
+               { .subsystem = "net",           .device = "ppp" },
+               { .subsystem = "net",           .device = "lo" },
+               { .subsystem = "net",           .device = "tap" },
                { .subsystem = "sound",         .device = NULL },
-               { .subsystem = "snd",           .device = NULL },
                { .subsystem = "printer",       .device = "lp" },
+               { .subsystem = "nvidia",        .device = NULL },
+               { .subsystem = "video4linux",   .device = "vbi" },
+               { .subsystem = "lirc",          .device = NULL },
+               { .subsystem = "firmware",      .device = NULL },
+               { .subsystem = "drm",           .device = NULL },
+               { .subsystem = "pci_bus",       .device = NULL },
+               { .subsystem = "ieee1394",      .device = NULL },
+               { .subsystem = "ieee1394_host", .device = NULL },
+               { .subsystem = "ieee1394_node", .device = NULL },
+               { .subsystem = "raw",           .device = NULL },
                { NULL, NULL }
        };
        struct class_device *classdevice;
@@ -395,9 +412,10 @@ exit:
        if (rc == 0)
                dbg("result: waiting for sysfs successful '%s'", devpath);
        else
-               info("error: wait_for_sysfs needs an update to handle the device '%s' "
-                    "properly, please report to <linux-hotplug-devel@lists.sourceforge.net>",
-                    devpath);
+               info("either wait_for_sysfs (udev %s) needs an update to handle the device '%s' "
+                    "properly (%d) or the sysfs-support of your device's driver needs to be fixed, "
+                    "please report to <linux-hotplug-devel@lists.sourceforge.net>",
+                    UDEV_VERSION, devpath, rc);
 
        return rc;
 }