From: Mark McLoughlin Subject: [PATCH] Improve xenbus timeout error message Date: Fri, 30 Jun 2006 16:29:45 +0100 Message-ID: <1151681386.6184.60.camel@localhost.localdomain> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-46Ym+ZuG9S+N6p3a5gbo" Return-path: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: xen-devel@lists.xensource.com List-Id: xen-devel@lists.xenproject.org --=-46Ym+ZuG9S+N6p3a5gbo Content-Type: text/plain Content-Transfer-Encoding: 7bit Hi, With latest fedora, we're seeing: XENBUS: Timeout connecting to devices! Attached is a patch to make it a little bit more useful: XENBUS: Timeout connecting to device: device/vif/0 The problem is that the timeout occurs before the xennet module can ever be loaded, which is to be expected. Anything that can be done to avoid the timeout in this case? Cheers, Mark. --=-46Ym+ZuG9S+N6p3a5gbo Content-Disposition: attachment; filename=linux-2.6.16-xenbus-timeout-message.patch Content-Type: text/x-patch; name=linux-2.6.16-xenbus-timeout-message.patch; charset=UTF-8 Content-Transfer-Encoding: 7bit --- ./linux-2.6.16.x86_64/drivers/xen/xenbus/xenbus_probe.c.timeout-message 2006-06-27 20:50:43.000000000 +0100 +++ ./linux-2.6.16.x86_64/drivers/xen/xenbus/xenbus_probe.c 2006-06-30 17:15:43.000000000 +0100 @@ -879,29 +879,19 @@ EXPORT_SYMBOL_GPL(unregister_xenstore_notifier); -static int all_devices_ready_(struct device *dev, void *data) +static int find_disconnected_device_(struct device *dev, void *data) { struct xenbus_device *xendev = to_xenbus_device(dev); - int *result = data; - if (xendev->state != XenbusStateConnected) { - *result = 0; - return 1; - } - - return 0; + return (xendev->state == XenbusStateConnected) ? 0 : 1; } - -static int all_devices_ready(void) +static struct device *find_disconnected_device(struct device *start) { - int ready = 1; - bus_for_each_dev(&xenbus_frontend.bus, NULL, &ready, - all_devices_ready_); - return ready; + return bus_find_device(&xenbus_frontend.bus, start, NULL, + find_disconnected_device_); } - void xenbus_probe(void *unused) { BUG_ON((xenstored_ready <= 0)); @@ -1066,17 +1056,28 @@ static int __init wait_for_devices(void) { unsigned long timeout = jiffies + 10*HZ; + struct device *dev = NULL; + struct xenbus_device *xendev; if (!is_running_on_xen()) return -ENODEV; while (time_before(jiffies, timeout)) { - if (all_devices_ready()) + if ((dev = find_disconnected_device(NULL)) == NULL) return 0; + put_device(dev); schedule_timeout_interruptible(HZ/10); } - printk(KERN_WARNING "XENBUS: Timeout connecting to devices!\n"); + while (dev != NULL) { + xendev = to_xenbus_device(dev); + + printk(KERN_WARNING "XENBUS: Timeout connecting to device: %s\n", + xendev->nodename); + + dev = find_disconnected_device(dev); + } + return 0; } --=-46Ym+ZuG9S+N6p3a5gbo Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel --=-46Ym+ZuG9S+N6p3a5gbo--