From patchwork Mon Apr 11 11:34:58 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Roger Quadros X-Patchwork-Id: 65503 Delivered-To: patch@linaro.org Received: by 10.112.43.237 with SMTP id z13csp1414772lbl; Mon, 11 Apr 2016 04:38:29 -0700 (PDT) X-Received: by 10.66.197.132 with SMTP id iu4mr31902395pac.82.1460374708938; Mon, 11 Apr 2016 04:38:28 -0700 (PDT) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f75si3113548pfj.152.2016.04.11.04.38.28; Mon, 11 Apr 2016 04:38:28 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754610AbcDKLiZ (ORCPT + 29 others); Mon, 11 Apr 2016 07:38:25 -0400 Received: from comal.ext.ti.com ([198.47.26.152]:40548 "EHLO comal.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754090AbcDKLf1 (ORCPT ); Mon, 11 Apr 2016 07:35:27 -0400 Received: from dlelxv90.itg.ti.com ([172.17.2.17]) by comal.ext.ti.com (8.13.7/8.13.7) with ESMTP id u3BBZIuo006911; Mon, 11 Apr 2016 06:35:18 -0500 Received: from DFLE73.ent.ti.com (dfle73.ent.ti.com [128.247.5.110]) by dlelxv90.itg.ti.com (8.14.3/8.13.8) with ESMTP id u3BBZI1r001579; Mon, 11 Apr 2016 06:35:18 -0500 Received: from dlep33.itg.ti.com (157.170.170.75) by DFLE73.ent.ti.com (128.247.5.110) with Microsoft SMTP Server id 14.3.224.2; Mon, 11 Apr 2016 06:35:17 -0500 Received: from lta0400828d.ti.com (ileax41-snat.itg.ti.com [10.172.224.153]) by dlep33.itg.ti.com (8.14.3/8.13.8) with ESMTP id u3BBZ7FU014612; Mon, 11 Apr 2016 06:35:14 -0500 From: Roger Quadros To: CC: , , , , , , , , , , , Roger Quadros Subject: [PATCH v6 02/10] usb: dwc3: omap: Make the wrapper interrupt shared Date: Mon, 11 Apr 2016 14:34:58 +0300 Message-ID: <1460374506-9779-3-git-send-email-rogerq@ti.com> X-Mailer: git-send-email 2.5.0 In-Reply-To: <1460374506-9779-1-git-send-email-rogerq@ti.com> References: <1460374506-9779-1-git-send-email-rogerq@ti.com> MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The wrapper interrupt is shared with OTG core so mark it IRQF_SHARED. Use request_threaded_irq() to ensure that irqflags match for the shared interrupt handlers. If we don't use request_treaded_irq() then forced threaded irq will set IRQF_ONESHOT and this won't match with the OTG irq handler. Signed-off-by: Roger Quadros --- drivers/usb/dwc3/dwc3-omap.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) -- 2.5.0 diff --git a/drivers/usb/dwc3/dwc3-omap.c b/drivers/usb/dwc3/dwc3-omap.c index 22e9606..51ca098 100644 --- a/drivers/usb/dwc3/dwc3-omap.c +++ b/drivers/usb/dwc3/dwc3-omap.c @@ -274,19 +274,25 @@ static irqreturn_t dwc3_omap_interrupt(int irq, void *_omap) { struct dwc3_omap *omap = _omap; u32 reg; + int ret = IRQ_NONE; reg = dwc3_omap_read_irqmisc_status(omap); + if (reg) + ret = IRQ_HANDLED; + if (reg & USBOTGSS_IRQMISC_DMADISABLECLR) omap->dma_status = false; dwc3_omap_write_irqmisc_status(omap, reg); reg = dwc3_omap_read_irq0_status(omap); + if (reg) + ret = IRQ_HANDLED; dwc3_omap_write_irq0_status(omap, reg); - return IRQ_HANDLED; + return ret; } static void dwc3_omap_enable_irqs(struct dwc3_omap *omap) @@ -506,8 +512,8 @@ static int dwc3_omap_probe(struct platform_device *pdev) reg = dwc3_omap_readl(omap->base, USBOTGSS_SYSCONFIG); omap->dma_status = !!(reg & USBOTGSS_SYSCONFIG_DMADISABLE); - ret = devm_request_irq(dev, omap->irq, dwc3_omap_interrupt, 0, - "dwc3-omap", omap); + ret = devm_request_threaded_irq(dev, omap->irq, dwc3_omap_interrupt, + NULL, IRQF_SHARED, "dwc3-omap", omap); if (ret) { dev_err(dev, "failed to request IRQ #%d --> %d\n", omap->irq, ret);