From 197598e593982ca4f69e3fb6bfdb735ad056885c Mon Sep 17 00:00:00 2001 From: Hemant Kumar Date: Fri, 8 Jul 2016 18:18:45 -0700 Subject: [PATCH] usb: dwc3: Change dwc3 irq to oneshot threaded irq There is a possibility of dwc3 irq being fired as soon as it gets enabled by tasklet handler. As a result dwc3 hard irq handler disables the irq and schedules tasklet. If tasklet is still running, tasklet_schedule becomes no op and dwc3 irq remains disabled permanently. Fix this issue by handling irq in threaded context with IRQF_ONESHOT flag set. Also update the shared irq flag in xhci platform driver for irq registration in HCD driver. CRs-Fixed: 1038421 Change-Id: I9291cb08c4597922131b8c2d420e834a00a72621 Signed-off-by: Hemant Kumar --- drivers/usb/dwc3/core.c | 4 ++-- drivers/usb/host/xhci-plat.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/usb/dwc3/core.c b/drivers/usb/dwc3/core.c index a395097a2098..7585c603cb3d 100644 --- a/drivers/usb/dwc3/core.c +++ b/drivers/usb/dwc3/core.c @@ -1021,8 +1021,8 @@ static int dwc3_probe(struct platform_device *pdev) /* will be enabled in dwc3_msm_resume() */ irq_set_status_flags(irq, IRQ_NOAUTOEN); - ret = devm_request_irq(dev, irq, dwc3_interrupt, IRQF_SHARED, "dwc3", - dwc); + ret = devm_request_threaded_irq(dev, irq, NULL, dwc3_interrupt, + IRQF_SHARED | IRQF_ONESHOT, "dwc3", dwc); if (ret) { dev_err(dwc->dev, "failed to request irq #%d --> %d\n", irq, ret); diff --git a/drivers/usb/host/xhci-plat.c b/drivers/usb/host/xhci-plat.c index 197757c20102..8125a8f96311 100644 --- a/drivers/usb/host/xhci-plat.c +++ b/drivers/usb/host/xhci-plat.c @@ -237,11 +237,11 @@ static int xhci_plat_probe(struct platform_device *pdev) goto put_usb3_hcd; } - ret = usb_add_hcd(hcd, irq, IRQF_SHARED); + ret = usb_add_hcd(hcd, irq, IRQF_SHARED | IRQF_ONESHOT); if (ret) goto disable_usb_phy; - ret = usb_add_hcd(xhci->shared_hcd, irq, IRQF_SHARED); + ret = usb_add_hcd(xhci->shared_hcd, irq, IRQF_SHARED | IRQF_ONESHOT); if (ret) goto dealloc_usb2_hcd;