diff options
author | Sergei Shtylyov <sshtylyov@ru.mvista.com> | 2009-12-15 06:30:01 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2009-12-23 14:34:18 -0500 |
commit | 17be5c5f5ef99c94374e07f71effa78e93a20eda (patch) | |
tree | 4759c8d6a49232047ab483a2a43daec7f869fe77 /drivers/usb/musb/musb_gadget_ep0.c | |
parent | 93aa3dab008421789aa0f8865a62a52ae13269a3 (diff) |
USB: musb: gadget_ep0: avoid SetupEnd interrupt
Gadget stalling a zero-length SETUP request results in this error message:
SetupEnd came in a wrong ep0stage idle
In order to avoid it, always set the CSR0.DataEnd bit after detecting a zero-
length request. Add the missing '\n' to the error message itself as well...
Signed-off-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Acked-by: Anand Gadiyar <gadiyar@ti.com>
Cc: stable <stable@kernel.org>
Signed-off-by: Felipe Balbi <felipe.balbi@nokia.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/usb/musb/musb_gadget_ep0.c')
-rw-r--r-- | drivers/usb/musb/musb_gadget_ep0.c | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/drivers/usb/musb/musb_gadget_ep0.c b/drivers/usb/musb/musb_gadget_ep0.c index 8fba3f11e473..53d06451f820 100644 --- a/drivers/usb/musb/musb_gadget_ep0.c +++ b/drivers/usb/musb/musb_gadget_ep0.c | |||
@@ -664,7 +664,7 @@ irqreturn_t musb_g_ep0_irq(struct musb *musb) | |||
664 | musb->ep0_state = MUSB_EP0_STAGE_STATUSIN; | 664 | musb->ep0_state = MUSB_EP0_STAGE_STATUSIN; |
665 | break; | 665 | break; |
666 | default: | 666 | default: |
667 | ERR("SetupEnd came in a wrong ep0stage %s", | 667 | ERR("SetupEnd came in a wrong ep0stage %s\n", |
668 | decode_ep0stage(musb->ep0_state)); | 668 | decode_ep0stage(musb->ep0_state)); |
669 | } | 669 | } |
670 | csr = musb_readw(regs, MUSB_CSR0); | 670 | csr = musb_readw(regs, MUSB_CSR0); |
@@ -787,12 +787,18 @@ setup: | |||
787 | handled = service_zero_data_request( | 787 | handled = service_zero_data_request( |
788 | musb, &setup); | 788 | musb, &setup); |
789 | 789 | ||
790 | /* | ||
791 | * We're expecting no data in any case, so | ||
792 | * always set the DATAEND bit -- doing this | ||
793 | * here helps avoid SetupEnd interrupt coming | ||
794 | * in the idle stage when we're stalling... | ||
795 | */ | ||
796 | musb->ackpend |= MUSB_CSR0_P_DATAEND; | ||
797 | |||
790 | /* status stage might be immediate */ | 798 | /* status stage might be immediate */ |
791 | if (handled > 0) { | 799 | if (handled > 0) |
792 | musb->ackpend |= MUSB_CSR0_P_DATAEND; | ||
793 | musb->ep0_state = | 800 | musb->ep0_state = |
794 | MUSB_EP0_STAGE_STATUSIN; | 801 | MUSB_EP0_STAGE_STATUSIN; |
795 | } | ||
796 | break; | 802 | break; |
797 | 803 | ||
798 | /* sequence #1 (IN to host), includes GET_STATUS | 804 | /* sequence #1 (IN to host), includes GET_STATUS |