From: Vardan Mikayelyan Date: Thu, 28 Apr 2016 03:20:48 +0000 (-0700) Subject: usb: dwc2: gadget: Prevent handling of host interrupts X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=ee3de8d750134703c702534173cd8623d1b32c38;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git usb: dwc2: gadget: Prevent handling of host interrupts 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 Signed-off-by: John Youn Signed-off-by: Felipe Balbi --- diff --git a/drivers/usb/dwc2/gadget.c b/drivers/usb/dwc2/gadget.c index d330190f58ef..4c5e3005e1dc 100644 --- a/drivers/usb/dwc2/gadget.c +++ b/drivers/usb/dwc2/gadget.c @@ -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);