Skip to contentSkip to conversation

remove detach_state from udev's wait_for_sysfs

PATCH Kay Sievers 4 participants 9 messages Jun 19, 2005 – Jun 20, 2005

lore
Share & tools
lore
#0 lore raw

Change udev's built-in wait-for-sysfs to wait for the "power" directory instead of the "detached_state" file which no longer exists with kernel 2.6.12. Without that patch udev will delay events for some subsystems by 5 seconds.

---

udev_sysfs.c +27 -27
@@ -297,38 +297,38 @@ int wait_for_devices_device(struct sysfs
 		{ .bus = "usb",		.file = "idVendor" },
 		{ .bus = "usb",		.file = "iInterface" },
 		{ .bus = "usb",		.file = "bNumEndpoints" },
-		{ .bus = "usb-serial",	.file = "detach_state" },
-		{ .bus = "ide",		.file = "detach_state" },
+		{ .bus = "usb-serial",	.file = "power" },
+		{ .bus = "ide",		.file = "power" },
 		{ .bus = "pci",		.file = "vendor" },
-		{ .bus = "platform",	.file = "detach_state" },
-		{ .bus = "pcmcia",	.file = "detach_state" },
-		{ .bus = "i2c",		.file = "detach_state" },
+		{ .bus = "platform",	.file = "power" },
+		{ .bus = "pcmcia",	.file = "power" },
+		{ .bus = "i2c",		.file = "power" },
 		{ .bus = "ieee1394",	.file = "node_count" },
 		{ .bus = "ieee1394",	.file = "nodeid" },
 		{ .bus = "ieee1394",	.file = "address" },
 		{ .bus = "bttv-sub",	.file = NULL },
-		{ .bus = "pnp",		.file = "detach_state" },
-		{ .bus = "eisa",	.file = "detach_state" },
-		{ .bus = "serio",	.file = "detach_state" },
-		{ .bus = "pseudo",	.file = "detach_state" },
-		{ .bus = "mmc",		.file = "detach_state" },
-		{ .bus = "macio",	.file = "detach_state" },
-		{ .bus = "of_platform",	.file = "detach_state" },
-		{ .bus = "vio",		.file = "detach_state" },
-		{ .bus = "ecard",	.file = "detach_state" },
-		{ .bus = "sa1111-rab",	.file = "detach_state" },
-		{ .bus = "amba",	.file = "detach_state" },
-		{ .bus = "locomo-bus",	.file = "detach_state" },
-		{ .bus = "logicmodule",	.file = "detach_state" },
-		{ .bus = "parisc",	.file = "detach_state" },
-		{ .bus = "ocp",		.file = "detach_state" },
-		{ .bus = "dio",		.file = "detach_state" },
-		{ .bus = "MCA",		.file = "detach_state" },
-		{ .bus = "wl",		.file = "detach_state" },
-		{ .bus = "ccwgroup",	.file = "detach_state" },
-		{ .bus = "css",		.file = "detach_state" },
-		{ .bus = "ccw",		.file = "detach_state" },
-		{ .bus = "iucv",	.file = "detach_state" },
+		{ .bus = "pnp",		.file = "power" },
+		{ .bus = "eisa",	.file = "power" },
+		{ .bus = "serio",	.file = "power" },
+		{ .bus = "pseudo",	.file = "power" },
+		{ .bus = "mmc",		.file = "power" },
+		{ .bus = "macio",	.file = "power" },
+		{ .bus = "of_platform",	.file = "power" },
+		{ .bus = "vio",		.file = "power" },
+		{ .bus = "ecard",	.file = "power" },
+		{ .bus = "sa1111-rab",	.file = "power" },
+		{ .bus = "amba",	.file = "power" },
+		{ .bus = "locomo-bus",	.file = "power" },
+		{ .bus = "logicmodule",	.file = "power" },
+		{ .bus = "parisc",	.file = "power" },
+		{ .bus = "ocp",		.file = "power" },
+		{ .bus = "dio",		.file = "power" },
+		{ .bus = "MCA",		.file = "power" },
+		{ .bus = "wl",		.file = "power" },
+		{ .bus = "ccwgroup",	.file = "power" },
+		{ .bus = "css",		.file = "power" },
+		{ .bus = "ccw",		.file = "power" },
+		{ .bus = "iucv",	.file = "power" },
 		{ NULL, NULL }
 	};
 	const struct device_file *devicefile = NULL;

-------------------------------------------------------
SF.Net email is sponsored by: Discover Easy Linux Migration Strategies from IBM. Find simple to follow Roadmaps, straightforward articles, informative Webcasts and more! Get everything you need to get up to speed, fast. http://ads.osdn.com/?ad_idt77&alloc_id492&op=click
_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel

#1 lore raw
Quoted 4 lines · Kay Sievers

Change udev's built-in wait-for-sysfs to wait for the "power" directory instead of the "detached_state" file which no longer exists with kernel 2.6.12. Without that patch udev will delay events for some subsystems by 5 seconds.

Kay,

The presence of the "power" directory is contingent to the kernel being compiled with power management support. Wouldn't a "bus" link check be a better idea?

Ananth

-------------------------------------------------------
SF.Net email is sponsored by: Discover Easy Linux Migration Strategies from IBM. Find simple to follow Roadmaps, straightforward articles, informative Webcasts and more! Get everything you need to get up to speed, fast. http://ads.osdn.com/?ad_idt77&alloc_id492&op=click
_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel

#2 lore raw
In reply to Kay Sievers
Quoted 11 lines · Ananth N Mavinakayanahalli
Quoted 4 lines · Kay Sievers

Change udev's built-in wait-for-sysfs to wait for the "power" directory instead of the "detached_state" file which no longer exists with kernel 2.6.12. Without that patch udev will delay events for some subsystems by 5 seconds.

Kay,

The presence of the "power" directory is contingent to the kernel being compiled with power management support. Wouldn't a "bus" link check be a better idea?

We depend on kernel 2.6.11 with the "bus"-link. I'm fine with dropping support for older kernels if that's ok.

Kay

-------------------------------------------------------
SF.Net email is sponsored by: Discover Easy Linux Migration Strategies from IBM. Find simple to follow Roadmaps, straightforward articles, informative Webcasts and more! Get everything you need to get up to speed, fast. http://ads.osdn.com/?ad_idt77&alloc_id492&op=click
_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel

#3 lore raw
In reply to Kay Sievers
Quoted 7 lines · Kay Sievers
Quoted 6 lines · Ananth N Mavinakayanahalli
Quoted 4 lines · Kay Sievers

Change udev's built-in wait-for-sysfs to wait for the "power" directory instead of the "detached_state" file which no longer exists with kernel 2.6.12. Without that patch udev will delay events for some subsystems by 5 seconds.

Quoted 8 lines
Quoted 5 lines

Kay,

The presence of the "power" directory is contingent to the kernel being compiled with power management support. Wouldn't a "bus" link check be a better idea?

We depend on kernel 2.6.11 with the "bus"-link. I'm fine with dropping support for older kernels if that's ok.

As this is needed for 2.6.12, I don't have a problem dropping older kernel support.

thanks,

greg k-h

-------------------------------------------------------
SF.Net email is sponsored by: Discover Easy Linux Migration Strategies from IBM. Find simple to follow Roadmaps, straightforward articles, informative Webcasts and more! Get everything you need to get up to speed, fast. http://ads.osdn.com/?ad_idt77&alloc_id492&op=click
_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel

#4 lore raw
In reply to Kay Sievers
Quoted 4 lines · Greg KH
Quoted 2 lines

We depend on kernel 2.6.11 with the "bus"-link. I'm fine with dropping support for older kernels if that's ok.

As this is needed for 2.6.12, I don't have a problem dropping older kernel support.

Can you clarify this?
udev releases >= 059 will require a kernel >= 2.6.12?

Signature · 2 lines
ciao,
Marco
#5 lore raw
In reply to Kay Sievers
Quoted 8 lines · Marco d'Itri
Quoted 4 lines · Greg KH
Quoted 2 lines

We depend on kernel 2.6.11 with the "bus"-link. I'm fine with dropping support for older kernels if that's ok.

As this is needed for 2.6.12, I don't have a problem dropping older kernel support.

Can you clarify this?
udev releases >= 059 will require a kernel >= 2.6.12?

Yes, would that be a problem?

thanks,

greg k-h

-------------------------------------------------------
SF.Net email is sponsored by: Discover Easy Linux Migration Strategies from IBM. Find simple to follow Roadmaps, straightforward articles, informative Webcasts and more! Get everything you need to get up to speed, fast. http://ads.osdn.com/?ad_idt77&alloc_id492&op=click
_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel

#6 lore raw
In reply to Kay Sievers
Quoted 3 lines · Greg KH
Quoted 2 lines

Can you clarify this?
udev releases >= 059 will require a kernel >= 2.6.12?

Yes, would that be a problem?

Yes, thinking again about this I think it could be very annoying: users would need to upgrade both the kernel and udev at the same time, but it would not be possible because the udev package should abort the installation if an old kernel is detected. Users would need to upgrade the kernel, reboot to a partially working system and then upgrade udev.

Signature · 2 lines
ciao,
Marco
#7 lore raw
In reply to Kay Sievers
Quoted 10 lines · Marco d'Itri
Quoted 3 lines · Greg KH
Quoted 2 lines

Can you clarify this?
udev releases >= 059 will require a kernel >= 2.6.12?

Yes, would that be a problem?

Yes, thinking again about this I think it could be very annoying: users would need to upgrade both the kernel and udev at the same time, but it would not be possible because the udev package should abort the installation if an old kernel is detected. Users would need to upgrade the kernel, reboot to a partially working system and then upgrade udev.

No, this doesn't "break" support on older kernels, just makes new device discover a little slow. It will all still work just fine. So a user can upgrade udev, and then their kernel.

thanks,

greg k-h

-------------------------------------------------------
SF.Net email is sponsored by: Discover Easy Linux Migration Strategies from IBM. Find simple to follow Roadmaps, straightforward articles, informative Webcasts and more! Get everything you need to get up to speed, fast. http://ads.osdn.com/?ad_idt77&alloc_id492&op=click
_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel

#8 lore raw
In reply to Kay Sievers
Quoted 11 lines · Greg KH
Quoted 8 lines
Quoted 3 lines
Quoted 2 lines

Can you clarify this?
udev releases >= 059 will require a kernel >= 2.6.12?

Yes, would that be a problem?

Yes, thinking again about this I think it could be very annoying: users would need to upgrade both the kernel and udev at the same time, but it would not be possible because the udev package should abort the installation if an old kernel is detected. Users would need to upgrade the kernel, reboot to a partially working system and then upgrade udev.

No, this doesn't "break" support on older kernels, just makes new device discover a little slow. It will all still work just fine. So a user can upgrade udev, and then their kernel.

OK, then newer kernels are not actually required. I will have the init script print a big warning instead.

Signature · 2 lines
ciao,
Marco