]> git.karo-electronics.de Git - linux-beck.git/commitdiff
usb: dwc2: gadget: Prevent handling of host interrupts
authorVardan Mikayelyan <mvardan@synopsys.com>
Thu, 28 Apr 2016 03:20:48 +0000 (20:20 -0700)
committerFelipe Balbi <felipe.balbi@linux.intel.com>
Thu, 28 Apr 2016 06:41:01 +0000 (09:41 +0300)
In host slave mode, the core asserts the rxready, txfifoempty interrupts
that get serviced in the gadget irq handler. Prevent servicing of these
when not in the gadget mode of operation.

Signed-off-by: Vardan Mikayelyan <mvardan@synopsys.com>
Signed-off-by: John Youn <johnyoun@synopsys.com>
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
drivers/usb/dwc2/gadget.c

index d330190f58ef81451452a5c1a2cf96b9f52490eb..4c5e3005e1dc780c1db4632c7f3356398e1c544b 100644 (file)
@@ -2425,6 +2425,9 @@ static irqreturn_t dwc2_hsotg_irq(int irq, void *pw)
        u32 gintsts;
        u32 gintmsk;
 
+       if (!dwc2_is_device_mode(hsotg))
+               return IRQ_NONE;
+
        spin_lock(&hsotg->lock);
 irq_retry:
        gintsts = dwc2_readl(hsotg->regs + GINTSTS);