From: Martin Fuzzey Date: Fri, 1 May 2009 15:21:11 +0000 (+0200) Subject: USB: atmel-usba-udc : fix control out requests. X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=f42706c90470851fd2e97eda7a4109e8949bde8a;p=linux-beck.git USB: atmel-usba-udc : fix control out requests. usbtest #14 was failing with "udc: ep0: TXCOMP: Invalid endpoint state 2, halting endpoint..." This occured since ep0 is bidirectional and ep->is_in is not valid (must always use ep->state) Signed-off-by: Martin Fuzzey Acked-by: David Brownell Acked-by: Haavard Skinnemoen Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/usb/gadget/atmel_usba_udc.c b/drivers/usb/gadget/atmel_usba_udc.c index 563d57275448..5644897c1c5d 100644 --- a/drivers/usb/gadget/atmel_usba_udc.c +++ b/drivers/usb/gadget/atmel_usba_udc.c @@ -794,7 +794,8 @@ usba_ep_queue(struct usb_ep *_ep, struct usb_request *_req, gfp_t gfp_flags) if (ep->desc) { list_add_tail(&req->queue, &ep->queue); - if (ep->is_in || (ep_is_control(ep) + if ((!ep_is_control(ep) && ep->is_in) || + (ep_is_control(ep) && (ep->state == DATA_STAGE_IN || ep->state == STATUS_STAGE_IN))) usba_ep_writel(ep, CTL_ENB, USBA_TX_PK_RDY);