Received: by 2002:ac0:aa62:0:0:0:0:0 with SMTP id w31-v6csp1968521ima; Thu, 25 Oct 2018 07:43:16 -0700 (PDT) X-Google-Smtp-Source: AJdET5fRjbiZCyr9q+dBPmW3KRVDOAE8bZGs+j4zEOlowWLEsprFwcQokj/dGq9JvQ4a5aAhsyEU X-Received: by 2002:a17:902:9a91:: with SMTP id w17-v6mr1733688plp.274.1540478596235; Thu, 25 Oct 2018 07:43:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1540478596; cv=none; d=google.com; s=arc-20160816; b=svXH/x3fwQjNGxw3dgfTekzRDr2oB7KZbkFvmCOe+irMJnYRRR/ISOEthxIYsPOxfx AJoHZy17qvEshht5Iebp4cp/N/IqM4Dek5Pb0rLtHH5wsmjdMrP8Zmo74LKYoRV0RHVO exKCBHljpXwK1nRPPiZVL5e4wNlFy+FVfRinvj+YRpz1kLL7CHYkQqb/e77H2X9+o/4h XkzvGjGQkNSx2ND9hWdGtVOHNY6P+h2Z0NY8jAz+AdzfOW6vmMinDy912zkvrFqbN4kj njZuaVJJEolZ8sQDTVs5JqAwRyhyG5uvjZAc/KEDYBunPnx7EQVV29nLrIl2ggjST/bc lZEA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature; bh=7XRWqALdUb3EIhkQc1sWL44e60wZK/K5I7rjrO0p/lA=; b=GOeoyCN7GjPtOJ/njoHguZ9O3rsCxY1AsLS9QSQNRAJy2Z3rbHNd4vpW6ALPsZXk+y TDCf87hFfq6ttfi0OSuW9bdzwOGZBEbH4QzAsaaf6wmAj14VEtjWWH1oahheu5cgO6vO Soh9+ssyQyc7TXUgK676yYy8vznFHGHt2d30Z757fqjki4/voh6KdiqaYdr0mC1uc3OC eHMyBW3H7zez9t95XYqD7lfHcydclKwCxTVwkvZeBjN9B3Tsf+dceORewiblI/OQJAO3 utC3SrjqlOcsDM0C2lLQSvj1eUeFgku01q+7Fw0J+5myJfoKWFI+HkQsRomxBbmtZiqn Ce+g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=nWCLKJxa; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h8-v6si8207989pgh.573.2018.10.25.07.42.59; Thu, 25 Oct 2018 07:43:16 -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; dkim=pass header.i=@kernel.org header.s=default header.b=nWCLKJxa; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729064AbeJYWsh (ORCPT + 99 others); Thu, 25 Oct 2018 18:48:37 -0400 Received: from mail.kernel.org ([198.145.29.99]:57332 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729049AbeJYWsg (ORCPT ); Thu, 25 Oct 2018 18:48:36 -0400 Received: from sasha-vm.mshome.net (unknown [167.98.65.38]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 04EA320868; Thu, 25 Oct 2018 14:15:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1540476940; bh=6ZFcpRwWtMQQ+xYMQBsilrxxHyBsJBopmVESxGeT7gs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=nWCLKJxaCgLAei7G7jnVunrlrpUfawbVm8852Ij5hvyTrS3xGa/KrPuwEe0pAgWJW JFcC1eE202K8VliRiT80xzteDPBA8v+pbuqpC4bvKhkH4yg+b+nJ1U/m/Y7BtuPSEA e/qQnK/iuMW0EVtsgyeJHbfdj2WUkm2xB8jqdCl4= From: Sasha Levin To: stable@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Vignesh R , Felipe Balbi , Sasha Levin Subject: [PATCH AUTOSEL 4.9 51/98] usb: dwc3: omap: remove IRQ_NOAUTOEN used with shared irq Date: Thu, 25 Oct 2018 10:13:36 -0400 Message-Id: <20181025141423.213774-51-sashal@kernel.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20181025141423.213774-1-sashal@kernel.org> References: <20181025141423.213774-1-sashal@kernel.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Vignesh R [ Upstream commit ee249b4554947de3be77be4e9e6077b20c0fe055 ] 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 Signed-off-by: Vignesh R Signed-off-by: Felipe Balbi Signed-off-by: Sasha Levin --- drivers/usb/dwc3/dwc3-omap.c | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/drivers/usb/dwc3/dwc3-omap.c b/drivers/usb/dwc3/dwc3-omap.c index f221cb479e14..8e69150776f5 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) /* check the DMA Status */ reg = dwc3_omap_readl(omap->base, USBOTGSS_SYSCONFIG); - irq_set_status_flags(omap->irq, IRQ_NOAUTOEN); - ret = devm_request_threaded_irq(dev, omap->irq, dwc3_omap_interrupt, - dwc3_omap_interrupt_thread, IRQF_SHARED, - "dwc3-omap", omap); - if (ret) { - dev_err(dev, "failed to request IRQ #%d --> %d\n", - omap->irq, ret); - goto err1; - } ret = dwc3_omap_extcon_register(omap); if (ret < 0) @@ -532,8 +523,15 @@ static int dwc3_omap_probe(struct platform_device *pdev) goto err2; } + ret = devm_request_threaded_irq(dev, omap->irq, dwc3_omap_interrupt, + dwc3_omap_interrupt_thread, IRQF_SHARED, + "dwc3-omap", omap); + if (ret) { + dev_err(dev, "failed to request IRQ #%d --> %d\n", + omap->irq, ret); + goto err1; + } dwc3_omap_enable_irqs(omap); - enable_irq(omap->irq); return 0; err2: -- 2.17.1