All of lore.kernel.org
 help / color / mirror / Atom feed
From: Kay Sievers <kay.sievers@vrfy.org>
To: linux-hotplug@vger.kernel.org
Subject: Re: [Report about error: unknown bus]
Date: Thu, 21 Oct 2004 08:11:44 +0000	[thread overview]
Message-ID: <20041021081144.GB16308@vrfy.org> (raw)
In-Reply-To: <1098244606.7230.7.camel@blaze.homeip.net>

[-- Attachment #1: Type: text/plain, Size: 1042 bytes --]

On Thu, Oct 21, 2004 at 12:15:35AM -0400, Paul Blazejowski wrote:
> On Wed, 2004-10-20 at 20:03 +0200, Kay Sievers wrote:
> 
> > 
> > This should fix the bus error and the /class/net/tun* wait error.
> 
> Kay , i applied the patch to udev-040/wait_for_sysfs.c and it still
> shows some errors:
> 
> '/devices/pci0000:00/0000:00:0d.0/fw-host0' properly (bus specific file unavailable)
> '/devices/pci0000:00/0000:00:0d.0/fw-host0/8a1cc7ffff0020ed' properly (bus specific file unavailable)
> '/devices/pci0000:00/0000:00:0d.0/fw-host0/8a1cc7ffff0020ed/8a1cc7ffff0020ed-0' properly (bus specific file unavailable)
> '/class/net/eth2' properly (bus specific file unavailable)

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,
Kay

[-- Attachment #2: wait-fixes-02.patch --]
[-- Type: text/plain, Size: 2423 bytes --]

===== 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 09:48:31 +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,8 @@ 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 = "host_id" },
+		{ NULL, NULL }
 	};
 	struct bus_file *busfile;
 	int loop;
@@ -271,19 +271,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 "

  parent reply	other threads:[~2004-10-21  8:11 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-10-20  3:56 [Report about error: unknown bus] Paul Blazejowski
2004-10-20  4:27 ` Kay Sievers
2004-10-20  5:33 ` Paul Blazejowski
2004-10-20 13:17 ` Kay Sievers
2004-10-20 17:05 ` Kay Sievers
2004-10-20 17:44 ` Paul Blazejowski
2004-10-20 17:48 ` Paul Blazejowski
2004-10-20 18:03 ` Kay Sievers
2004-10-20 20:44 ` Kay Sievers
2004-10-21  4:15 ` Paul Blazejowski
2004-10-21  8:11 ` Kay Sievers [this message]
2004-10-21 18:40 ` Paul Blazejowski
2004-10-21 19:58 ` Kay Sievers
2004-10-21 20:28 ` Paul Blazejowski

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20041021081144.GB16308@vrfy.org \
    --to=kay.sievers@vrfy.org \
    --cc=linux-hotplug@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.