[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Xen-changelog] [xen-unstable] [XENBUS] Do not wait for devices with no driver to connect.
# HG changeset patch # User kfraser@xxxxxxxxxxxxxxxxxxxxxxx # Node ID 9633faf65e224a875042c3adc7152f2761a50679 # Parent 640d3bc77ea6ce6fb679da83f8c683978a05937c [XENBUS] Do not wait for devices with no driver to connect. Signed-off-by: Keir Fraser <keir@xxxxxxxxxxxxx> --- linux-2.6-xen-sparse/drivers/xen/xenbus/xenbus_probe.c | 60 ++++++++++++----- 1 files changed, 43 insertions(+), 17 deletions(-) diff -r 640d3bc77ea6 -r 9633faf65e22 linux-2.6-xen-sparse/drivers/xen/xenbus/xenbus_probe.c --- a/linux-2.6-xen-sparse/drivers/xen/xenbus/xenbus_probe.c Fri Jun 30 17:12:31 2006 +0100 +++ b/linux-2.6-xen-sparse/drivers/xen/xenbus/xenbus_probe.c Fri Jun 30 17:53:52 2006 +0100 @@ -886,19 +886,6 @@ EXPORT_SYMBOL_GPL(unregister_xenstore_no EXPORT_SYMBOL_GPL(unregister_xenstore_notifier); -static int find_disconnected_device_(struct device *dev, void *data) -{ - struct xenbus_device *xendev = to_xenbus_device(dev); - - return (xendev->state == XenbusStateConnected) ? 0 : 1; -} - -static struct device *find_disconnected_device(struct device *start) -{ - return bus_find_device(&xenbus_frontend.bus, start, NULL, - find_disconnected_device_); -} - void xenbus_probe(void *unused) { BUG_ON((xenstored_ready <= 0)); @@ -1050,6 +1037,37 @@ postcore_initcall(xenbus_probe_init); postcore_initcall(xenbus_probe_init); +static int find_disconnected_device_(struct device *dev, void *data) +{ + struct xenbus_device *xendev = to_xenbus_device(dev); + + /* + * A device with no driver will never connect. We care only about + * devices which should currently be in the process of connecting. + */ + if (!dev->driver) + return 0; + + return (xendev->state != XenbusStateConnected); +} + +static struct device *find_disconnected_device(struct device *start) +{ + return bus_find_device(&xenbus_frontend.bus, start, NULL, + find_disconnected_device_); +} + +static int find_driverless_device_(struct device *dev, void *data) +{ + return !dev->driver; +} + +static struct device *find_driverless_device(struct device *start) +{ + return bus_find_device(&xenbus_frontend.bus, start, NULL, + find_driverless_device_); +} + /* * On a 10 second timeout, wait for all devices currently configured. We need * to do this to guarantee that the filesystems and / or network devices @@ -1075,18 +1093,26 @@ static int __init wait_for_devices(void) while (time_before(jiffies, timeout)) { if ((dev = find_disconnected_device(NULL)) == NULL) - return 0; + break; put_device(dev); schedule_timeout_interruptible(HZ/10); } + /* List devices which have drivers but are not yet connected. */ while (dev != NULL) { xendev = to_xenbus_device(dev); - printk(KERN_WARNING "XENBUS: Timeout connecting to device: %s\n", + printk(KERN_WARNING "XENBUS: Timeout connecting " + "to device: %s\n", xendev->nodename); + + dev = find_disconnected_device(dev); + } + + /* List devices with no driver (this is not necessarily an error). */ + while ((dev = find_driverless_device(dev)) != NULL) { + xendev = to_xenbus_device(dev); + printk(KERN_INFO "XENBUS: Device with no driver: %s\n", xendev->nodename); - - dev = find_disconnected_device(dev); } return 0; _______________________________________________ Xen-changelog mailing list Xen-changelog@xxxxxxxxxxxxxxxxxxx http://lists.xensource.com/xen-changelog
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |