From: David Brownell Date: Fri, 20 Jan 2006 22:38:49 +0000 (-0800) Subject: [PATCH] USB: gadget zero and dma-coherent buffers X-Git-Tag: v2.6.16-rc2~177 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=69396dcfa3c50a6b8d2caaccf5d1496ecd5594be;p=linux-2.6 [PATCH] USB: gadget zero and dma-coherent buffers This makes sure that the correct length is reported when freeing a dma-coherent buffer; some platforms complain if that's wrong. It also makes two parameters readonly in sysfs, as they're not safe to change while tests are running. Signed-off-by: David Brownell Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/usb/gadget/zero.c b/drivers/usb/gadget/zero.c index 2fc110d3ad..ae7a1c0f57 100644 --- a/drivers/usb/gadget/zero.c +++ b/drivers/usb/gadget/zero.c @@ -165,8 +165,8 @@ static unsigned buflen = 4096; static unsigned qlen = 32; static unsigned pattern = 0; -module_param (buflen, uint, S_IRUGO|S_IWUSR); -module_param (qlen, uint, S_IRUGO|S_IWUSR); +module_param (buflen, uint, S_IRUGO); +module_param (qlen, uint, S_IRUGO); module_param (pattern, uint, S_IRUGO|S_IWUSR); /* @@ -1127,8 +1127,10 @@ zero_unbind (struct usb_gadget *gadget) DBG (dev, "unbind\n"); /* we've already been disconnected ... no i/o is active */ - if (dev->req) + if (dev->req) { + dev->req->length = USB_BUFSIZ; free_ep_req (gadget->ep0, dev->req); + } del_timer_sync (&dev->resume); kfree (dev); set_gadget_data (gadget, NULL);