Felipe Balbi wrote:
From: Arnaud Mandy <ext-arnaud.2.mandy@xxxxxxxxx>
calling rx routine directly if request is still pending.
removing the use of m_ep_restart for rx.
Signed-off-by: Arnaud Mandy <ext-arnaud.2.mandy@xxxxxxxxx>
[ make it actually compile and do something useful ]
Signed-off-by: Felipe Balbi <felipe.balbi@xxxxxxxxx>
---
drivers/usb/musb/musb_gadget.c | 34 ++++++++++++++++++++++------------
drivers/usb/musb/musb_gadget.h | 6 +++++-
2 files changed, 27 insertions(+), 13 deletions(-)
diff --git a/drivers/usb/musb/musb_gadget.c b/drivers/usb/musb/musb_gadget.c
index 9e4ba68..ad6b735 100644
--- a/drivers/usb/musb/musb_gadget.c
+++ b/drivers/usb/musb/musb_gadget.c
[...]
@@ -745,9 +741,23 @@ static int musb_gadget_queue(struct usb_ep *ep, struct usb_request *req,
/* add request to the list */
list_add_tail(&(request->request.list), &(musb_ep->req_list));
- /* it this is the head of the queue, start i/o ... */
- if (!musb_ep->busy && &request->request.list == musb_ep->req_list.next)
+ /* we can only start i/o if this is the head of the queue and
+ * endpoint is not stalled (halted) or busy
+ */
+ if (!musb_ep->stalled && !musb_ep->busy &&
I don't see where 'stalled' gets set, so the first check will always be
true, and hence its addition is pointless in the context of this patch.
+ &request->request.list == musb_ep->req_list.next &&
+ request->tx) {
+ DBG(1, "restarting\n");
musb_ep_restart(musb, request);
[...]
diff --git a/drivers/usb/musb/musb_gadget.h b/drivers/usb/musb/musb_gadget.h
index 59502da..f9cb3a8 100644
--- a/drivers/usb/musb/musb_gadget.h
+++ b/drivers/usb/musb/musb_gadget.h
@@ -76,7 +76,11 @@ struct musb_ep {
struct list_head req_list;
/* true if lock must be dropped but req_list may not be advanced */
- u8 busy;
+ u8 busy:1;
+ u8 rx_pending:1;
+
+ /* true if endpoint is stalled */
+ u8 stalled:1;
Are you sure this 'stalled' thing shouldn't be a part of some other patch?
WBR, Sergei
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html