From: Kay Sievers Date: Thu, 21 Oct 2004 19:58:18 +0000 Subject: Re: [Report about error: unknown bus] Message-Id: <20041021195818.GB17999@vrfy.org> MIME-Version: 1 Content-Type: multipart/mixed; boundary="T4sUOijqQbZv57TR" List-Id: References: <1098244606.7230.7.camel@blaze.homeip.net> In-Reply-To: <1098244606.7230.7.camel@blaze.homeip.net> To: linux-hotplug@vger.kernel.org --T4sUOijqQbZv57TR Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Thu, Oct 21, 2004 at 02:40:38PM -0400, Paul Blazejowski wrote: > On Thu, 2004-10-21 at 10:11 +0200, Kay Sievers wrote: > > > > Hi Paul, > > here is a new patch, that does not try to open the attribute. It > > just waits until the file shows up. > > > > Unfortunately, I don't have this hardware to test. If you still get these > > errors please attach the output from "tree /sys" for the next round. We > > may just need to add more files to the ieee1394 list, they may be different > > from device to device. > > Thanks for the fix, i think we are getting closer... udev list only this > line this time: > > '/devices/pci0000:00/0000:00:0d.0/fw-host0/8a1cc7ffff0020ed' (bus specific file unavailable) > '/devices/pci0000:00/0000:00:0d.0/fw-host0/8a1cc7ffff0020ed/8a1cc7ffff0020ed-0' (bus specific file unavailable) Here is the 3rd round, hopefully this will do it :) The patch is agains the current bk tree. Thanks for the help, Kay --T4sUOijqQbZv57TR Content-Type: text/plain; charset=us-ascii Content-Disposition: inline; filename="wait-fixes-03.patch" ===== udev_sysfs.c 1.1 vs edited ===== --- 1.1/udev_sysfs.c 2004-10-19 03:50:52 +02:00 +++ edited/udev_sysfs.c 2004-10-21 21:52:16 +02:00 @@ -93,10 +93,8 @@ static int wait_for_class_device_attribu return 0; } - strcpy(filename, class_dev->path); - strcat(filename, "/"); - strcat(filename, file); - dbg("looking at class '%s' for specific file '%s' with full name %s", class_dev->classname, file, filename); + snprintf(filename, SYSFS_PATH_MAX-1, "%s/%s", class_dev->path, file); + dbg("looking at class '%s' for specific file '%s'", class_dev->classname, filename); loop = WAIT_MAX_SECONDS * WAIT_LOOP_PER_SECOND; while (--loop) { @@ -167,6 +165,7 @@ static int class_device_expect_no_device { .subsystem = "net", .device = "dummy" }, { .subsystem = "net", .device = "irda" }, { .subsystem = "net", .device = "ppp" }, + { .subsystem = "net", .device = "tun" }, { .subsystem = "ppp", .device = NULL }, { .subsystem = "sound", .device = NULL }, { .subsystem = "printer", .device = "lp" }, @@ -247,7 +246,10 @@ int wait_for_bus_device(struct sysfs_dev { .bus = "pci", .file = "vendor" }, { .bus = "platform", .file = "detach_state" }, { .bus = "i2c", .file = "detach_state" }, - { NULL } + { .bus = "ieee1394", .file = "node_count" }, + { .bus = "ieee1394", .file = "nodeid" }, + { .bus = "ieee1394", .file = "address" }, + { NULL, NULL } }; struct bus_file *busfile; int loop; @@ -271,19 +273,24 @@ int wait_for_bus_device(struct sysfs_dev /* wait for a bus specific file to show up */ loop = WAIT_MAX_SECONDS * WAIT_LOOP_PER_SECOND; while (--loop) { - int found = 0; + int found_bus_type = 0; for (busfile = bus_files; busfile->bus != NULL; busfile++) { if (strcmp(devices_dev->bus, busfile->bus) == 0) { - found = 1; - dbg("looking at bus '%s' for specific file '%s'", devices_dev->bus, busfile->file); - if (sysfs_get_device_attr(devices_dev, busfile->file) != NULL) { + char filename[SYSFS_PATH_MAX]; + struct stat stats; + + found_bus_type = 1; + snprintf(filename, SYSFS_PATH_MAX-1, "%s/%s", devices_dev->path, busfile->file); + dbg("looking at bus '%s' for specific file '%s'", devices_dev->bus, filename); + + if (stat(filename, &stats) == 0) { dbg("bus '%s' specific file '%s' found", devices_dev->bus, busfile->file); return 0; } } } - if (found == 0) { + if (found_bus_type == 0) { if (error) *error = "unknown bus"; info("error: unknown bus, please report to " --T4sUOijqQbZv57TR-- ------------------------------------------------------- This SF.net email is sponsored by: IT Product Guide on ITManagersJournal Use IT products in your business? Tell us what you think of them. Give us Your Opinions, Get Free ThinkGeek Gift Certificates! Click to find out more http://productguide.itmanagersjournal.com/guidepromo.tmpl _______________________________________________ Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net Linux-hotplug-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel