From patchwork Mon Aug 28 14:23:06 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lucas Stach X-Patchwork-Id: 9925715 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 4418260329 for ; Mon, 28 Aug 2017 14:41:57 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3711827FE4 for ; Mon, 28 Aug 2017 14:41:57 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2BD12280CF; Mon, 28 Aug 2017 14:41:57 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.6 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_LOW autolearn=unavailable version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id B83C927FE4 for ; Mon, 28 Aug 2017 14:41:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=cfJVzCkN3tpX5dTS9gk/ZHi3Gq1Xe5NSXHkWz8lmVZE=; b=cMPR1RKj3RPF6hc9cB8lWKWjMm ZCqF8Gkz+mjY1OP96bVImRWcqgtJ2Mmd7D8EnUKZSlBe3Nw+UUe7EByoC3vVUmOqE819anaH0Vsjc EumYe6aWj6Gt67jbkaDShvcE7qoki+3kLc5YSBtOdBG9tjq5hgiAzCcfTALYX5pn28xaW+gp6oje9 jNWhdChfbNyunCo0IhR96UhBKKVy+RhE4B5XYl5RouXGK8bS7AcJtRuMWhlBXw7SvuQRbnFlx3fns w47D0HBmBcq3TMmsuLBYDlGlqdOLCnm/ku6vkrw+5u8qouHixfdFlP7fHVuouFH9sZIxCPu+OYAoz rjWasqlQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1dmLEe-0007C4-8Z; Mon, 28 Aug 2017 14:41:52 +0000 Received: from casper.infradead.org ([2001:8b0:10b:1236::1]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1dmLDG-00058H-5B for linux-arm-kernel@bombadil.infradead.org; Mon, 28 Aug 2017 14:40:26 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=References:In-Reply-To:Message-Id:Date: Subject:Cc:To:From:Sender:Reply-To:MIME-Version:Content-Type: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=ce7hGLynGllbQ/IqY389BBve+ecUZoJpwSPTBu2rmr0=; b=Gfm4xpt/xrlXw1YK6W5jP2QUe Ii1xpL06bgY0ayfEvXD04AiJ0qunjNI0+4lBExwenyveXPMv+ziGc6vk5Qg2ev7sO/p6oKZyuvp9t oS/HWuWGT8uaHaaNl9fTB3FwEPT6P+OA7Vw34vUtbE12bc4Yok+EkUGX/gOR81mxmf95fF+0XPKa7 SgZwpyCJJW8iirllI8JB26KyXrBnU+bJPkZNmVtgoutcBzi2Ra4d9e4JlhCQKraBXweMcdC7aXpfe yDRn8kKsnLNkdtWx/QisLfxB8+j/OqdtuA7LdGsoH8282Y5myIO6t3bp/F0chy2oILQt5Q/pbTHhw mdHruHmog==; Received: from metis.ext.pengutronix.de ([2001:67c:670:201:290:27ff:fe1d:cc33]) by casper.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1dmKwz-0003sz-BH for linux-arm-kernel@lists.infradead.org; Mon, 28 Aug 2017 14:23:40 +0000 Received: from dude.hi.pengutronix.de ([2001:67c:670:100:1d::7] helo=dude.pengutronix.de.) by metis.ext.pengutronix.de with esmtp (Exim 4.84_2) (envelope-from ) id 1dmKwX-0005gz-Bs; Mon, 28 Aug 2017 16:23:09 +0200 From: Lucas Stach To: Bjorn Helgaas , Tim Harvey , Jingoo Han , Joao Pinto , Shawn Guo Subject: [PATCH 2/3] PCI: imx6: allow MSI irq to be absent Date: Mon, 28 Aug 2017 16:23:06 +0200 Message-Id: <20170828142307.30061-3-l.stach@pengutronix.de> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20170828142307.30061-1-l.stach@pengutronix.de> References: <20170828142307.30061-1-l.stach@pengutronix.de> X-SA-Exim-Connect-IP: 2001:67c:670:100:1d::7 X-SA-Exim-Mail-From: l.stach@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-arm-kernel@lists.infradead.org X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20170828_152337_430448_3DAF9293 X-CRM114-Status: GOOD ( 14.56 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-pci@vger.kernel.org, kernel@pengutronix.de, linux-arm-kernel@lists.infradead.org, patchwork-lst@pengutronix.de MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP The host can fall back to PCIe legacy IRQ only operation if the MSI irq is missing, thus allowing systems to work with peripherals that don't support MSI irqs. Signed-off-by: Lucas Stach --- .../devicetree/bindings/pci/fsl,imx6q-pcie.txt | 8 ++++---- drivers/pci/dwc/pci-imx6.c | 23 +++++++++++----------- 2 files changed, 15 insertions(+), 16 deletions(-) diff --git a/Documentation/devicetree/bindings/pci/fsl,imx6q-pcie.txt b/Documentation/devicetree/bindings/pci/fsl,imx6q-pcie.txt index cf92d3ba5a26..d85db21503f4 100644 --- a/Documentation/devicetree/bindings/pci/fsl,imx6q-pcie.txt +++ b/Documentation/devicetree/bindings/pci/fsl,imx6q-pcie.txt @@ -10,14 +10,14 @@ Required properties: - "fsl,imx6qp-pcie" - "fsl,imx7d-pcie" - reg: base address and length of the PCIe controller -- interrupts: A list of interrupt outputs of the controller. Must contain an - entry for each entry in the interrupt-names property. -- interrupt-names: Must include the following entries: - - "msi": The interrupt that is asserted when an MSI is received - clock-names: Must include the following additional entries: - "pcie_phy" Optional properties: +- interrupts: A list of interrupt outputs of the controller. Must contain an + entry for each entry in the interrupt-names property. +- interrupt-names: Must include the following entries: + - "msi": The interrupt that is asserted when an MSI is received - fsl,tx-deemph-gen1: Gen1 De-emphasis value. Default: 0 - fsl,tx-deemph-gen2-3p5db: Gen2 (3.5db) De-emphasis value. Default: 0 - fsl,tx-deemph-gen2-6db: Gen2 (6db) De-emphasis value. Default: 20 diff --git a/drivers/pci/dwc/pci-imx6.c b/drivers/pci/dwc/pci-imx6.c index bf5c3616e344..d2507272b3ab 100644 --- a/drivers/pci/dwc/pci-imx6.c +++ b/drivers/pci/dwc/pci-imx6.c @@ -671,18 +671,17 @@ static int imx6_add_pcie_port(struct imx6_pcie *imx6_pcie, if (IS_ENABLED(CONFIG_PCI_MSI)) { pp->msi_irq = platform_get_irq_byname(pdev, "msi"); - if (pp->msi_irq <= 0) { - dev_err(dev, "failed to get MSI irq\n"); - return -ENODEV; - } - - ret = devm_request_irq(dev, pp->msi_irq, - imx6_pcie_msi_handler, - IRQF_SHARED | IRQF_NO_THREAD, - "mx6-pcie-msi", imx6_pcie); - if (ret) { - dev_err(dev, "failed to request MSI irq\n"); - return ret; + if (pp->msi_irq > 0) { + ret = devm_request_irq(dev, pp->msi_irq, + imx6_pcie_msi_handler, + IRQF_SHARED | IRQF_NO_THREAD, + "mx6-pcie-msi", imx6_pcie); + if (ret) { + dev_err(dev, "failed to request MSI irq\n"); + return ret; + } + } else { + dev_info(dev, "missing MSI irq, MSI support unavailable\n"); } }