WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-changelog

[Xen-changelog] [linux-2.6.18-xen] usbfront: fix some bugs

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [linux-2.6.18-xen] usbfront: fix some bugs
From: "Xen patchbot-linux-2.6.18-xen" <patchbot-linux-2.6.18-xen@xxxxxxxxxxxxxxxxxxx>
Date: Mon, 15 Mar 2010 06:35:20 -0700
Delivery-date: Mon, 15 Mar 2010 06:36:36 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-id: BK change log <xen-changelog.lists.xensource.com>
List-post: <mailto:xen-changelog@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
Reply-to: xen-devel@xxxxxxxxxxxxxxxxxxx
Sender: xen-changelog-bounces@xxxxxxxxxxxxxxxxxxx
# HG changeset patch
# User Keir Fraser <keir.fraser@xxxxxxxxxx>
# Date 1268659221 0
# Node ID 505690874cd9d5220b7864f2a3c8e1b28b8add79
# Parent  f66d155ce457dab7a191bc199e878c07c2d2aead
usbfront: fix some bugs

Signed-off-by: K. Y. Srinivasan <ksrinivasan@xxxxxxxxxx>
---
 drivers/xen/usbfront/xenbus.c |   24 ++++++++++++++----------
 1 files changed, 14 insertions(+), 10 deletions(-)

diff -r f66d155ce457 -r 505690874cd9 drivers/xen/usbfront/xenbus.c
--- a/drivers/xen/usbfront/xenbus.c     Mon Mar 01 10:19:41 2010 +0000
+++ b/drivers/xen/usbfront/xenbus.c     Mon Mar 15 13:20:21 2010 +0000
@@ -192,11 +192,23 @@ static int connect(struct xenbus_device 
        usbif_conn_request_t *req;
        int i, idx, err;
        int notify;
+       char name[TASK_COMM_LEN];
+       struct usb_hcd *hcd;
+
+       hcd = info_to_hcd(info);
+       snprintf(name, TASK_COMM_LEN, "xenhcd.%d", hcd->self.busnum);
 
        err = talk_to_backend(dev, info);
        if (err)
                return err;
 
+       info->kthread = kthread_run(xenhcd_schedule, info, name);
+       if (IS_ERR(info->kthread)) {
+               err = PTR_ERR(info->kthread);
+               info->kthread = NULL;
+               xenbus_dev_fatal(dev, err, "Error creating thread");
+               return err;
+       }
        /* prepare ring for hotplug notification */
        for (idx = 0, i = 0; i < USB_CONN_RING_SIZE; i++) {
                req = RING_GET_REQUEST(&info->conn_ring, idx);
@@ -274,7 +286,6 @@ static int usbfront_probe(struct xenbus_
        int err;
        struct usb_hcd *hcd;
        struct usbfront_info *info;
-       char name[TASK_COMM_LEN];
 
        if (usb_disabled())
                return -ENODEV;
@@ -298,13 +309,6 @@ static int usbfront_probe(struct xenbus_
        }
 
        init_waitqueue_head(&info->wq);
-       snprintf(name, TASK_COMM_LEN, "xenhcd.%d", hcd->self.busnum);
-       info->kthread = kthread_run(xenhcd_schedule, info, name);
-       if (IS_ERR(info->kthread)) {
-               err = PTR_ERR(info->kthread);
-               info->kthread = NULL;
-               goto fail;
-       }
 
        return 0;
 
@@ -343,8 +347,8 @@ static void backend_changed(struct xenbu
        case XenbusStateInitWait:
                if (dev->state != XenbusStateInitialising)
                        break;
-               connect(dev);
-               xenbus_switch_state(dev, XenbusStateConnected);
+               if (!connect(dev))
+                       xenbus_switch_state(dev, XenbusStateConnected);
                break;
 
        case XenbusStateClosing:

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] [linux-2.6.18-xen] usbfront: fix some bugs, Xen patchbot-linux-2.6.18-xen <=