Re: [PATCH 006/149] USB: m66592-udc: peripheral controller driver for M66592

Yoshihiro Shimoda <[email protected]>
Newsgroups gmane.linux.usb.devel
Message-ID <[email protected]>
David Brownell wrote:
> On Thursday 12 July 2007, Greg KH wrote:
>> On Thu, Jul 12, 2007 at 05:23:41PM -0700, David Brownell wrote:
> 
>>> What I'll do is provide a patch to update this to the latest
>>> version of this code which I have (as soon as Linus pulls),
>>> and ask Renesas to expedite addressing the other review issues.
>> Sounds good to me.
> 
> Here ... I just did a test build.  Powernow-k8 needs a patch too.

Thank you very much for your feedback.
I tested in my development environment.
When I tested "usbtest", there was the problem that
NULL pointer access in transfer_complete().
I made the following patch. I would appreciate it if you could
check this patch.

Thanks,
Y.Shimoda

---
--- m66592-udc.c.orig	2007-07-13 21:08:46.000000000 +0900
+++ m66592-udc.c	2007-07-13 21:07:13.000000000 +0900
@@ -681,9 +681,17 @@ __acquires(m66592->lock)
 	if (!list_empty(&ep->queue))
 		restart = 1;

-	spin_unlock(&ep->m66592->lock);
-	req->req.complete(&ep->ep, &req->req);
-	spin_lock(&ep->m66592->lock);
+	/*
+	 * When this driver handle GET_STATUS request, it calls m66592_queue()
+	 * for oneself. In this case this driver do not call
+	 * req->req.complete() because it is not the request from gadget
+	 * driver.
+	 */
+	if (likely(req->req.complete)) {
+		spin_unlock(&ep->m66592->lock);
+		req->req.complete(&ep->ep, &req->req);
+		spin_lock(&ep->m66592->lock);
+	}

 	if (restart) {
 		req = list_entry(ep->queue.next, struct m66592_request, queue);

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
[email protected]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.