check if the controller was in device mode in irq. If not, we just return IRQ_NONE. Signed-off-by: Neil Zhang <zhangwm@xxxxxxxxxxx> --- drivers/usb/gadget/mv_udc_core.c | 8 +++++++- 1 files changed, 7 insertions(+), 1 deletions(-) diff --git a/drivers/usb/gadget/mv_udc_core.c b/drivers/usb/gadget/mv_udc_core.c index 44d6e68..8fb7e25 100644 --- a/drivers/usb/gadget/mv_udc_core.c +++ b/drivers/usb/gadget/mv_udc_core.c @@ -1867,10 +1867,16 @@ static void irq_process_error(struct mv_udc *udc) static irqreturn_t mv_udc_irq(int irq, void *dev) { struct mv_udc *udc = (struct mv_udc *)dev; - u32 status, intr; + u32 status, intr, usbmode; spin_lock(&udc->lock); + usbmode = readl(&udc->op_regs->usbmode); + if ((usbmode & USBMODE_CTRL_MODE_MASK) != USBMODE_CTRL_MODE_DEVICE) { + spin_unlock(&udc->lock); + return IRQ_NONE; + } + status = readl(&udc->op_regs->usbsts); intr = readl(&udc->op_regs->usbintr); status &= intr; -- 1.7.1 -- 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