aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVignesh R <vigneshr@ti.com>2017-07-07 02:22:52 -0400
committerFelipe Balbi <felipe.balbi@linux.intel.com>2017-07-17 03:59:31 -0400
commitee249b4554947de3be77be4e9e6077b20c0fe055 (patch)
tree78b553f7f73f906afce6d80bf4fae29cef5bc84d
parent541768b08a400d9d292cfd9c898401b8178856ac (diff)
usb: dwc3: omap: remove IRQ_NOAUTOEN used with shared irq
IRQ_NOAUTOEN cannot be used with shared IRQs, since commit 04c848d39879 ("genirq: Warn when IRQ_NOAUTOEN is used with shared interrupts") and kernel now throws a warn dump. But OMAP DWC3 driver uses this flag. As per commit 12a7f17fac5b ("usb: dwc3: omap: fix race of pm runtime with irq handler in probe") that introduced this flag, PM runtime can race with IRQ handler when deferred probing happens due to extcon, therefore IRQ_NOAUTOEN needs to be set so that irq is not enabled until extcon is registered. Remove setting of IRQ_NOAUTOEN and move the registration of shared irq to a point after dwc3_omap_extcon_register() and of_platform_populate(). This avoids possibility of probe deferring and above said race condition. Reviewed-by: Grygorii Strashko <grygorii.strashko@ti.com> Signed-off-by: Vignesh R <vigneshr@ti.com> Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
-rw-r--r--drivers/usb/dwc3/dwc3-omap.c18
1 files changed, 8 insertions, 10 deletions
diff --git a/drivers/usb/dwc3/dwc3-omap.c b/drivers/usb/dwc3/dwc3-omap.c
index 98926504b55b..f5aaa0cf3873 100644
--- a/drivers/usb/dwc3/dwc3-omap.c
+++ b/drivers/usb/dwc3/dwc3-omap.c
@@ -512,15 +512,6 @@ static int dwc3_omap_probe(struct platform_device *pdev)
512 512
513 /* check the DMA Status */ 513 /* check the DMA Status */
514 reg = dwc3_omap_readl(omap->base, USBOTGSS_SYSCONFIG); 514 reg = dwc3_omap_readl(omap->base, USBOTGSS_SYSCONFIG);
515 irq_set_status_flags(omap->irq, IRQ_NOAUTOEN);
516 ret = devm_request_threaded_irq(dev, omap->irq, dwc3_omap_interrupt,
517 dwc3_omap_interrupt_thread, IRQF_SHARED,
518 "dwc3-omap", omap);
519 if (ret) {
520 dev_err(dev, "failed to request IRQ #%d --> %d\n",
521 omap->irq, ret);
522 goto err1;
523 }
524 515
525 ret = dwc3_omap_extcon_register(omap); 516 ret = dwc3_omap_extcon_register(omap);
526 if (ret < 0) 517 if (ret < 0)
@@ -532,8 +523,15 @@ static int dwc3_omap_probe(struct platform_device *pdev)
532 goto err1; 523 goto err1;
533 } 524 }
534 525
526 ret = devm_request_threaded_irq(dev, omap->irq, dwc3_omap_interrupt,
527 dwc3_omap_interrupt_thread, IRQF_SHARED,
528 "dwc3-omap", omap);
529 if (ret) {
530 dev_err(dev, "failed to request IRQ #%d --> %d\n",
531 omap->irq, ret);
532 goto err1;
533 }
535 dwc3_omap_enable_irqs(omap); 534 dwc3_omap_enable_irqs(omap);
536 enable_irq(omap->irq);
537 return 0; 535 return 0;
538 536
539err1: 537err1: