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-devel

[Xen-devel] [PATCH] usbback: fix invalid urb->interval for highspeed int

To: xen-devel@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-devel] [PATCH] usbback: fix invalid urb->interval for highspeed interrupt endpoint
From: Noboru Iwamatsu <n_iwamatsu@xxxxxxxxxxxxxx>
Date: Mon, 06 Apr 2009 16:56:45 +0900
Delivery-date: Mon, 06 Apr 2009 00:58:20 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Thunderbird 2.0.0.21 (Windows/20090302)
Hi,

Current usbback fails to submit the interrupt urb for high-speed
endpoints. This patch fixes this issue.

usb_fill_int_urb() is a helper function to initialize a interrupt urb,
and sets the usb->interval value as follows,

void usb_fill_int_urb(struct urb *urb, ..., int interval)
{

        ...

        if (dev->speed == USB_SPEED_HIGH)
                urb->interval = 1 << (interval - 1);
        else
                urb->interval = interval;

        ...
}

The interval value that usbback got from the RING_REQ is already
modified to an exponent of two.

So, usbback must not initialize a interrupt urb with double-modified
interval value.


Signed-off-by: Noboru Iwamatsu <n_iwamatsu@xxxxxxxxxxxxxx>
diff --git a/drivers/xen/usbback/usbback.c b/drivers/xen/usbback/usbback.c
--- a/drivers/xen/usbback/usbback.c
+++ b/drivers/xen/usbback/usbback.c
@@ -470,6 +470,18 @@ static void usbbk_init_urb(usbif_request
                                pending_req->buffer, req->buffer_length,
                                usbbk_urb_complete,
                                pending_req, req->u.intr.interval);
+               /*
+                * high speed interrupt endpoints use a logarithmic encoding of
+                * the endpoint interval, and usb_fill_int_urb() initializes a
+                * interrupt urb with the encoded interval value.
+                *
+                * req->u.intr.interval is the interval value that already
+                * encoded in the frontend part, and the above 
usb_fill_int_urb()
+                * initializes the urb->interval with double encoded value.
+                *
+                * so, simply overwrite the urb->interval with original value.
+                */
+               urb->interval = req->u.intr.interval;
                urb->transfer_flags = req->transfer_flags;
 
                break;
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel
<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-devel] [PATCH] usbback: fix invalid urb->interval for highspeed interrupt endpoint, Noboru Iwamatsu <=