From patchwork Wed Mar 8 10:47:17 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kishon Vijay Abraham I X-Patchwork-Id: 95028 Delivered-To: patch@linaro.org Received: by 10.140.82.71 with SMTP id g65csp2292784qgd; Wed, 8 Mar 2017 02:55:39 -0800 (PST) X-Received: by 10.99.163.2 with SMTP id s2mr6129306pge.43.1488970539602; Wed, 08 Mar 2017 02:55:39 -0800 (PST) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id x188si2942986pgb.6.2017.03.08.02.55.39; Wed, 08 Mar 2017 02:55:39 -0800 (PST) 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=@ti.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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=ti.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752547AbdCHKzh (ORCPT + 25 others); Wed, 8 Mar 2017 05:55:37 -0500 Received: from lelnx194.ext.ti.com ([198.47.27.80]:26791 "EHLO lelnx194.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750853AbdCHKzf (ORCPT ); Wed, 8 Mar 2017 05:55:35 -0500 Received: from dlelxv90.itg.ti.com ([172.17.2.17]) by lelnx194.ext.ti.com (8.15.1/8.15.1) with ESMTP id v28AmA20001783; Wed, 8 Mar 2017 04:48:10 -0600 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ti.com; s=ti-com-17Q1; t=1488970090; bh=O+r8pdXsXOGR539QsAympqzE8fVVwpHe0UV1kbUGX/k=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=JPXC6ghGilWMp2Rx7d9iW2aQrygleBXyX+GadNtZKOOA02bcolPEvRnK9aC/NZzye ceO83Dh3bC4MgEJDjQFNedgR4fgK4g0bPEdtb7YKt8V3Ibse/UtVM3mQjFJVzLIG2+ anLT/PGZRBDcrFQUjuiFIyxxVC4X+EKD0jDsplNg= Received: from DLEE70.ent.ti.com (dlemailx.itg.ti.com [157.170.170.113]) by dlelxv90.itg.ti.com (8.14.3/8.13.8) with ESMTP id v28AmAx9020156; Wed, 8 Mar 2017 04:48:10 -0600 Received: from dlep33.itg.ti.com (157.170.170.75) by DLEE70.ent.ti.com (157.170.170.113) with Microsoft SMTP Server id 14.3.294.0; Wed, 8 Mar 2017 04:48:09 -0600 Received: from a0393678ub.india.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 v28AlJ2E000570; Wed, 8 Mar 2017 04:48:07 -0600 From: Kishon Vijay Abraham I To: Bjorn Helgaas , Joao Pinto , , , , , , CC: , Keerthy , Kishon Vijay Abraham I Subject: [PATCH v3 7/7] PCI: dwc: dra7xx: Push request_irq call to the bottom of probe Date: Wed, 8 Mar 2017 16:17:17 +0530 Message-ID: <1488970037-17740-8-git-send-email-kishon@ti.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1488970037-17740-1-git-send-email-kishon@ti.com> References: <1488970037-17740-1-git-send-email-kishon@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 From: Keerthy Currently devm_request_irq is being called before base, pci fields of dra7xx_pcie structure are populated. It is called even before pm_runtime_enable and pm_runtime_get_sync are called. This will lead to exceptions if in case an interrupt is triggered before the all of the above are done. Hence push the devm_request_irq call to the end of the probe. Signed-off-by: Keerthy Signed-off-by: Kishon Vijay Abraham I --- drivers/pci/dwc/pci-dra7xx.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) -- 1.7.9.5 diff --git a/drivers/pci/dwc/pci-dra7xx.c b/drivers/pci/dwc/pci-dra7xx.c index c6fef0a..8c53233 100644 --- a/drivers/pci/dwc/pci-dra7xx.c +++ b/drivers/pci/dwc/pci-dra7xx.c @@ -410,13 +410,6 @@ static int __init dra7xx_pcie_probe(struct platform_device *pdev) return -EINVAL; } - ret = devm_request_irq(dev, irq, dra7xx_pcie_irq_handler, - IRQF_SHARED, "dra7xx-pcie-main", dra7xx); - if (ret) { - dev_err(dev, "failed to request irq\n"); - return ret; - } - res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "ti_conf"); base = devm_ioremap_nocache(dev, res->start, resource_size(res)); if (!base) @@ -478,6 +471,13 @@ static int __init dra7xx_pcie_probe(struct platform_device *pdev) if (ret < 0) goto err_gpio; + ret = devm_request_irq(dev, irq, dra7xx_pcie_irq_handler, + IRQF_SHARED, "dra7xx-pcie-main", dra7xx); + if (ret) { + dev_err(dev, "failed to request irq\n"); + goto err_gpio; + } + return 0; err_gpio: