From 6897089c5f7989603ccb9c696050470ba1dbd262 Mon Sep 17 00:00:00 2001 From: "kay.sievers@vrfy.org" Date: Mon, 18 Apr 2005 21:57:31 -0700 Subject: [PATCH] add TIMEOUT to firmware_class hotplug event On Tue, 2005-03-15 at 09:25 +0100, Hannes Reinecke wrote: > The current implementation of the firmware class breaks a fundamental > assumption in udevd: that the physical device can be initialised fully > prior to executing the next event for that device. Here we add a TIMEOUT value to the hotplug environment of the firmware requesting event. I will adapt udevd not to wait for anything else, if it finds a TIMEOUT key. Signed-off-by: Kay Sievers Signed-off-by: Greg Kroah-Hartman --- drivers/base/firmware_class.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'drivers') diff --git a/drivers/base/firmware_class.c b/drivers/base/firmware_class.c index 26c9464af80..97fe13f7f07 100644 --- a/drivers/base/firmware_class.c +++ b/drivers/base/firmware_class.c @@ -102,6 +102,9 @@ firmware_class_hotplug(struct class_device *class_dev, char **envp, if (add_hotplug_env_var(envp, num_envp, &i, buffer, buffer_size, &len, "FIRMWARE=%s", fw_priv->fw_id)) return -ENOMEM; + if (add_hotplug_env_var(envp, num_envp, &i, buffer, buffer_size, &len, + "TIMEOUT=%i", loading_timeout)) + return -ENOMEM; envp[i] = NULL; -- cgit v1.2.3 From 46ea0d6c26de431a39c744f7ad63b30bfc800c1e Mon Sep 17 00:00:00 2001 From: Robert Schwebel Date: Mon, 18 Apr 2005 21:57:32 -0700 Subject: [PATCH] export platform_add_devices platform_add_devices can be used from within modules, so it should be exported. This can for example happen if you have hotpluggable firmware in an FPGA on a system on chip processor; in our case the FPGA is probed for devices and the FPGA base code registers the devices it has found with the kernel. (akpm: I think this is reasonable from a licensing POV: it's unlikely that anyone would be interested in merging such specialised modules into mainline, and it's a GPL export). Signed-off-by: Robert Schwebel Signed-off-by: Andrew Morton Signed-off-by: Greg Kroah-Hartman --- drivers/base/platform.c | 1 + 1 file changed, 1 insertion(+) (limited to 'drivers') diff --git a/drivers/base/platform.c b/drivers/base/platform.c index 996cbb4d508..cd6453905a9 100644 --- a/drivers/base/platform.c +++ b/drivers/base/platform.c @@ -341,6 +341,7 @@ EXPORT_SYMBOL_GPL(dma_get_required_mask); EXPORT_SYMBOL_GPL(platform_bus); EXPORT_SYMBOL_GPL(platform_bus_type); +EXPORT_SYMBOL_GPL(platform_add_devices); EXPORT_SYMBOL_GPL(platform_device_register); EXPORT_SYMBOL_GPL(platform_device_register_simple); EXPORT_SYMBOL_GPL(platform_device_unregister); -- cgit v1.2.3 From 0700f56bbca56bc930aab717bc5086336991441f Mon Sep 17 00:00:00 2001 From: "kay.sievers@vrfy.org" Date: Mon, 18 Apr 2005 21:57:35 -0700 Subject: [PATCH] kobject/hotplug split - class core kobject_add() and kobject_del() don't emit hotplug events anymore. Do it ourselves if we are finished populating the device directory. Signed-off-by: Kay Sievers Signed-off-by: Greg Kroah-Hartman --- drivers/base/class.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'drivers') diff --git a/drivers/base/class.c b/drivers/base/class.c index 6bf650fce78..d2a2f8f2b4e 100644 --- a/drivers/base/class.c +++ b/drivers/base/class.c @@ -430,6 +430,7 @@ int class_device_add(struct class_device *class_dev) sysfs_create_link(&class_dev->kobj, &class_dev->dev->kobj, "device"); + kobject_hotplug(&class_dev->kobj, KOBJ_ADD); register_done: if (error && parent) class_put(parent); @@ -461,6 +462,7 @@ void class_device_del(struct class_device *class_dev) sysfs_remove_link(&class_dev->kobj, "device"); class_device_remove_attrs(class_dev); + kobject_hotplug(&class_dev->kobj, KOBJ_REMOVE); kobject_del(&class_dev->kobj); if (parent) -- cgit v1.2.3 From e57cd73e2e844a3da25cc6b420674c81bbe1b387 Mon Sep 17 00:00:00 2001 From: "kay.sievers@vrfy.org" Date: Mon, 18 Apr 2005 21:57:36 -0700 Subject: [PATCH] kobject/hotplug split - devices core kobject_add() and kobject_del() don't emit hotplug events anymore. Do it ourselves if we are finished populating the device directory. Signed-off-by: Kay Sievers Signed-off-by: Greg Kroah-Hartman --- drivers/base/core.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'drivers') diff --git a/drivers/base/core.c b/drivers/base/core.c index 4e6cce8e6d3..a7cedd8cefe 100644 --- a/drivers/base/core.c +++ b/drivers/base/core.c @@ -260,6 +260,8 @@ int device_add(struct device *dev) /* notify platform of device entry */ if (platform_notify) platform_notify(dev); + + kobject_hotplug(&dev->kobj, KOBJ_ADD); Done: put_device(dev); return error; @@ -349,6 +351,7 @@ void device_del(struct device * dev) platform_notify_remove(dev); bus_remove_device(dev); device_pm_remove(dev); + kobject_hotplug(&dev->kobj, KOBJ_REMOVE); kobject_del(&dev->kobj); if (parent) put_device(parent); -- cgit v1.2.3 From 089d42b013675b028a499c61bac59954067dc668 Mon Sep 17 00:00:00 2001 From: "kay.sievers@vrfy.org" Date: Mon, 18 Apr 2005 21:57:37 -0700 Subject: [PATCH] kobject/hotplug split - usb cris kobject_add() and kobject_del() don't emit hotplug events anymore. We need to do it ourselves now. Signed-off-by: Kay Sievers Signed-off-by: Greg Kroah-Hartman --- drivers/usb/host/hc_crisv10.c | 1 + 1 file changed, 1 insertion(+) (limited to 'drivers') diff --git a/drivers/usb/host/hc_crisv10.c b/drivers/usb/host/hc_crisv10.c index 4b12be822bd..376f8a034f6 100644 --- a/drivers/usb/host/hc_crisv10.c +++ b/drivers/usb/host/hc_crisv10.c @@ -4396,6 +4396,7 @@ static int __init etrax_usb_hc_init(void) device_initialize(&fake_device); kobject_set_name(&fake_device.kobj, "etrax_usb"); kobject_add(&fake_device.kobj); + kobject_hotplug(&fake_device.kobj, KOBJ_ADD); hc->bus->controller = &fake_device; usb_register_bus(hc->bus); -- cgit v1.2.3