diff options
author | Hans Petter Selasky <hselasky@c2i.net> | 2011-09-02 02:17:17 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2011-09-09 18:58:02 -0400 |
commit | de76cc2ba2116322f1bcc26f5b22d6092bb63a0d (patch) | |
tree | 5ad5f66be6dd9bb938aa095049056d7a7a660a18 /drivers | |
parent | c5a48592d874ddef8c7880311581eccf0eb30c3b (diff) |
musb_gadget: Fix for spurious interrupts on endpoint zero.
There is a multi-year old bug in the MUSB hardware which is not documented.
It causes spurious interrupts and have various symptoms, like endless
"SetupEnd came in a wrong ep0stage" messages. The fix is taken from the
FreeBSD's musb driver.
How to reproduce:
For example issue clear-stall on a couple of endpoints very fast,
like one request per 125us. After a while the bug triggers and the
musb-chip becomes unusable until next re-enumeration.
Signed-off-by: Hans Petter Selasky <hps@bitfrost.no>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/usb/musb/musb_gadget_ep0.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/drivers/usb/musb/musb_gadget_ep0.c b/drivers/usb/musb/musb_gadget_ep0.c index 9378b359c1f0..6a0d0467ec74 100644 --- a/drivers/usb/musb/musb_gadget_ep0.c +++ b/drivers/usb/musb/musb_gadget_ep0.c | |||
@@ -679,6 +679,14 @@ irqreturn_t musb_g_ep0_irq(struct musb *musb) | |||
679 | musb_readb(mbase, MUSB_FADDR), | 679 | musb_readb(mbase, MUSB_FADDR), |
680 | decode_ep0stage(musb->ep0_state)); | 680 | decode_ep0stage(musb->ep0_state)); |
681 | 681 | ||
682 | if (csr & MUSB_CSR0_P_DATAEND) { | ||
683 | /* | ||
684 | * If DATAEND is set we should not call the callback, | ||
685 | * hence the status stage is not complete. | ||
686 | */ | ||
687 | return IRQ_HANDLED; | ||
688 | } | ||
689 | |||
682 | /* I sent a stall.. need to acknowledge it now.. */ | 690 | /* I sent a stall.. need to acknowledge it now.. */ |
683 | if (csr & MUSB_CSR0_P_SENTSTALL) { | 691 | if (csr & MUSB_CSR0_P_SENTSTALL) { |
684 | musb_writew(regs, MUSB_CSR0, | 692 | musb_writew(regs, MUSB_CSR0, |