1
0
Fork 0

MA-15789-1 usb: cdns3: gadget: move USB interrupt handling to thread irq

Since the endpoint interrupt handling is at thread irq, to align with
it, move USB interrupt handling to thread irq, otherwise, it may has
lock recursion issue.

Reviewed-by: Jun Li <jun.li@nxp.com>
Signed-off-by: Peter Chen <peter.chen@nxp.com>
5.4-rM2-2.2.x-imx-squashed
Peter Chen 2019-11-07 13:49:51 +08:00
parent 6970ad778e
commit 32b92522ec
No known key found for this signature in database
GPG Key ID: 4859298150D671BB
1 changed files with 19 additions and 4 deletions

View File

@ -1091,11 +1091,18 @@ static irqreturn_t cdns3_device_irq_handler(struct cdns3 *cdns)
/* check USB device interrupt */
reg = readl(&priv_dev->regs->usb_ists);
writel(reg, &priv_dev->regs->usb_ists);
if (reg) {
cdns3_check_usb_interrupt_proceed(priv_dev, reg);
ret = IRQ_HANDLED;
/* After masking interrupts the new interrupts won't be
* reported in usb_ists/ep_ists. In order to not lose some
* of them driver disables only detected interrupts.
* They will be enabled ASAP after clearing source of
* interrupt. This an unusual behavior only applies to
* usb_ists register.
*/
reg = ~reg & readl(&priv_dev->regs->usb_ien);
/* mask deferred interrupt. */
writel(reg, &priv_dev->regs->usb_ien);
ret = IRQ_WAKE_THREAD;
}
/* check endpoint interrupt */
@ -1134,6 +1141,14 @@ static irqreturn_t cdns3_device_thread_irq_handler(struct cdns3 *cdns)
priv_dev = cdns->gadget_dev;
spin_lock_irqsave(&priv_dev->lock, flags);
reg = readl(&priv_dev->regs->usb_ists);
if (reg) {
writel(reg, &priv_dev->regs->usb_ists);
writel(USB_IEN_INIT, &priv_dev->regs->usb_ien);
cdns3_check_usb_interrupt_proceed(priv_dev, reg);
ret = IRQ_HANDLED;
}
reg = readl(&priv_dev->regs->ep_ists);
/* handle default endpoint OUT */