Hello. On 31-08-2011 14:56, Hans Petter Selasky wrote:
Hi,
You should have prefixed the patch subject with "musb_gadget: " or "musb: gadget: " for clarity.
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.
This text should have really been placed in the patch changelog.
--HPS
From fad675ea9f75d4701df4b63c0a907af64a91d02d Mon Sep 17 00:00:00 2001 From: Hans Petter Selasky<hps@xxxxxxxxxxx> Date: Wed, 31 Aug 2011 12:45:56 +0200 Subject: [PATCH] Fix for spurious interrupts on endpoint zero.
Please omit this header in the future.
Signed-off-by: Hans Petter Selasky<hps@xxxxxxxxxxx> --- 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 9378b35..9dee00c 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) musb_readb(mbase, MUSB_FADDR), decode_ep0stage(musb->ep0_state)); + if (csr & MUSB_CSR0_P_DATAEND) {
Hm, this bit is descitbed as self-clearing. Do we indeed see it set?
+ /* + * If DATAEND is set we should not call the callback, + * hence the status stage is not complete. + */ + return (IRQ_HANDLED);
Parens not needed here. 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