* [PATCH] usbback: fix invalid urb->interval for highspeed interrupt endpoint
@ 2009-04-06 7:56 Noboru Iwamatsu
0 siblings, 0 replies; only message in thread
From: Noboru Iwamatsu @ 2009-04-06 7:56 UTC (permalink / raw)
To: xen-devel
[-- Attachment #1: Type: text/plain, Size: 656 bytes --]
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@jp.fujitsu.com>
[-- Attachment #2: usbback_interrupt_urb_interval_fix.patch --]
[-- Type: text/plain, Size: 891 bytes --]
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;
[-- Attachment #3: Type: text/plain, Size: 138 bytes --]
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xensource.com
http://lists.xensource.com/xen-devel
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2009-04-06 7:56 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-04-06 7:56 [PATCH] usbback: fix invalid urb->interval for highspeed interrupt endpoint Noboru Iwamatsu
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.