From 90f98dd08923ba1e2136182d2aca3fa3a4ec2125 Mon Sep 17 00:00:00 2001 From: Kuninori Morimoto Date: Mon, 6 Jun 2011 14:18:54 +0900 Subject: [PATCH] --- yaml --- r: 259213 b: refs/heads/master c: 0432eed008024e0e90f16207ab406ac6ec877cac h: refs/heads/master i: 259211: e544fabde46ba900a78d4591fdae1416dc0b734c v: v3 --- [refs] | 2 +- trunk/drivers/usb/renesas_usbhs/fifo.c | 6 +++++- trunk/drivers/usb/renesas_usbhs/mod_gadget.c | 22 ++++++-------------- 3 files changed, 12 insertions(+), 18 deletions(-) diff --git a/[refs] b/[refs] index af9bbb96253a..cee5bebf8dc8 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: d77e3f4e1743834c7b4acb54004ffd7f57c82582 +refs/heads/master: 0432eed008024e0e90f16207ab406ac6ec877cac diff --git a/trunk/drivers/usb/renesas_usbhs/fifo.c b/trunk/drivers/usb/renesas_usbhs/fifo.c index 8852423313a3..0efee5fc034b 100644 --- a/trunk/drivers/usb/renesas_usbhs/fifo.c +++ b/trunk/drivers/usb/renesas_usbhs/fifo.c @@ -74,6 +74,8 @@ void usbhs_pkt_push(struct usbhs_pipe *pipe, struct usbhs_pkt *pkt, usbhs_unlock(priv, flags); /******************** spin unlock ******************/ + + usbhs_pkt_start(pipe); } static void __usbhsf_pkt_del(struct usbhs_pkt *pkt) @@ -148,8 +150,10 @@ int __usbhs_pkt_handler(struct usbhs_pipe *pipe, int type) usbhs_unlock(priv, flags); /******************** spin unlock ******************/ - if (is_done) + if (is_done) { info->done(pkt); + usbhs_pkt_start(pipe); + } return ret; } diff --git a/trunk/drivers/usb/renesas_usbhs/mod_gadget.c b/trunk/drivers/usb/renesas_usbhs/mod_gadget.c index b5a5ba7efb5e..3c582482ec44 100644 --- a/trunk/drivers/usb/renesas_usbhs/mod_gadget.c +++ b/trunk/drivers/usb/renesas_usbhs/mod_gadget.c @@ -125,23 +125,16 @@ static void usbhsg_queue_push(struct usbhsg_uep *uep, struct usbhs_pkt *pkt = usbhsg_ureq_to_pkt(ureq); struct usb_request *req = &ureq->req; - usbhs_pkt_push(pipe, pkt, uep->handler, - req->buf, req->length, req->zero); req->actual = 0; req->status = -EINPROGRESS; + usbhs_pkt_push(pipe, pkt, uep->handler, + req->buf, req->length, req->zero); dev_dbg(dev, "pipe %d : queue push (%d)\n", usbhs_pipe_number(pipe), req->length); } -static void usbhsg_queue_start(struct usbhsg_uep *uep) -{ - struct usbhs_pipe *pipe = usbhsg_uep_to_pipe(uep); - - usbhs_pkt_start(pipe); -} - static void usbhsg_queue_pop(struct usbhsg_uep *uep, struct usbhsg_request *ureq, int status) @@ -154,10 +147,6 @@ static void usbhsg_queue_pop(struct usbhsg_uep *uep, ureq->req.status = status; ureq->req.complete(&uep->ep, &ureq->req); - - /* more request ? */ - if (0 == status) - usbhsg_queue_start(uep); } static void usbhsg_queue_done(struct usbhs_pkt *pkt) @@ -222,6 +211,7 @@ static int usbhsg_recip_run_handle(struct usbhs_priv *priv, struct usbhsg_gpriv *gpriv = usbhsg_priv_to_gpriv(priv); struct device *dev = usbhsg_gpriv_to_dev(gpriv); struct usbhsg_uep *uep; + struct usbhs_pipe *pipe; int recip = ctrl->bRequestType & USB_RECIP_MASK; int nth = le16_to_cpu(ctrl->wIndex) & USB_ENDPOINT_NUMBER_MASK; int ret; @@ -230,7 +220,8 @@ static int usbhsg_recip_run_handle(struct usbhs_priv *priv, char *msg; uep = usbhsg_gpriv_to_nth_uep(gpriv, nth); - if (!usbhsg_uep_to_pipe(uep)) { + pipe = usbhsg_uep_to_pipe(uep); + if (!pipe) { dev_err(dev, "wrong recip request\n"); ret = -EINVAL; goto usbhsg_recip_run_handle_end; @@ -268,7 +259,7 @@ static int usbhsg_recip_run_handle(struct usbhs_priv *priv, } usbhsg_recip_run_handle_end: - usbhsg_queue_start(uep); + usbhs_pkt_start(pipe); return ret; } @@ -470,7 +461,6 @@ static int usbhsg_ep_queue(struct usb_ep *ep, struct usb_request *req, return -ESHUTDOWN; usbhsg_queue_push(uep, ureq); - usbhsg_queue_start(uep); return 0; }