From patchwork Fri Jul 26 13:59:03 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Siddharth Vadapalli X-Patchwork-Id: 13742820 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 73A81C3DA49 for ; Fri, 26 Jul 2024 13:59:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Type: Content-Transfer-Encoding:MIME-Version:Message-ID:Date:Subject:CC:To:From: Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender :Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References:List-Owner; bh=jvorCvGOcAYrhGu0dno5dA4WxVxdFg+bw/5zZzT/sNU=; b=LwRYorrPzxL2N6QUZc2cO+UbU7 Ba/a/lgMx4r5CI6W++GbOBJ+hXczSCjWZ72eK1sc+OEq/Gh1FcTv0fnpFMefXLRteZETbJo8nZMoc a4NTZxOwYVvlCB+DwrVusyy/1s3n2a1N9DroWZkeBV8YT7O0+NwXgo9PEdNwTC5oI7vqTBFNoCE9x 6wicBb62xZR8U8JRrnmBqt9EP0oMn5D9dJzpd1/TBkpZt+e9xFY+euhVbjfrvkryn8E+BUOaEfmsX 1Gkh2C0sPscbWLitn3fnBFG0lLKncGND9cqwRzaRzeZJDC/9auqLb31/rmyZ6fy3NGflp17424ZHO Qe+dIJbg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sXLTz-000000044oS-1YXD; Fri, 26 Jul 2024 13:59:43 +0000 Received: from fllv0016.ext.ti.com ([198.47.19.142]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sXLTZ-000000044j4-1MkD for linux-arm-kernel@lists.infradead.org; Fri, 26 Jul 2024 13:59:19 +0000 Received: from lelv0265.itg.ti.com ([10.180.67.224]) by fllv0016.ext.ti.com (8.15.2/8.15.2) with ESMTP id 46QDx969096928; Fri, 26 Jul 2024 08:59:09 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1722002349; bh=jvorCvGOcAYrhGu0dno5dA4WxVxdFg+bw/5zZzT/sNU=; h=From:To:CC:Subject:Date; b=vRyt2KUgZdAHgmcxOe/6tOJmYo919FYfsHnwWkiVS1qcA+VQCFujWF0Rmbh5JBjKp yH1Kx5cmErQ726wknl8XKLyUMQBCO0NJoKsIKU2ibh7pq6Ec+fZCLyi2/Et8knog3A YuCwfv+1jZIMfaiqPGKfwoMF8/I1Acl2GOeo5fTs= Received: from DLEE109.ent.ti.com (dlee109.ent.ti.com [157.170.170.41]) by lelv0265.itg.ti.com (8.15.2/8.15.2) with ESMTPS id 46QDx9Zh021179 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Fri, 26 Jul 2024 08:59:09 -0500 Received: from DLEE102.ent.ti.com (157.170.170.32) by DLEE109.ent.ti.com (157.170.170.41) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2507.23; Fri, 26 Jul 2024 08:59:09 -0500 Received: from lelvsmtp5.itg.ti.com (10.180.75.250) by DLEE102.ent.ti.com (157.170.170.32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2507.23 via Frontend Transport; Fri, 26 Jul 2024 08:59:08 -0500 Received: from uda0492258.dhcp.ti.com (uda0492258.dhcp.ti.com [10.24.72.81]) by lelvsmtp5.itg.ti.com (8.15.2/8.15.2) with ESMTP id 46QDx4AW120001; Fri, 26 Jul 2024 08:59:05 -0500 From: Siddharth Vadapalli To: , , , , , , CC: , , , , , , Subject: [PATCH v2] PCI: j721e: Disable INTx mapping and swizzling Date: Fri, 26 Jul 2024 19:29:03 +0530 Message-ID: <20240726135903.1255825-1-s-vadapalli@ti.com> X-Mailer: git-send-email 2.40.1 MIME-Version: 1.0 X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240726_065917_502065_C925B17C X-CRM114-Status: GOOD ( 15.50 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Since the configuration of INTx (Legacy Interrupt) is not supported, set the .map_irq and .swizzle_irq callbacks to NULL. This fixes the error: of_irq_parse_pci: failed with rc=-22 when the pcieport driver attempts to setup INTx for the Host Bridge via "pci_assign_irq()". The device-tree node of the Host Bridge doesn't contain Legacy Interrupts. As a result, Legacy Interrupts are searched for in the MSI Interrupt Parent of the Host Bridge with the help of "of_irq_parse_raw()". Since the MSI Interrupt Parent of the Host Bridge uses 3 interrupt cells while Legacy Interrupts only use 1, the search for Legacy Interrupts is terminated prematurely by the "of_irq_parse_raw()" function with the -EINVAL error code (rc=-22). Fixes: f3e25911a430 ("PCI: j721e: Add TI J721E PCIe driver") Cc: stable@vger.kernel.org Reported-by: Andrew Halaney Tested-by: Andrew Halaney Signed-off-by: Siddharth Vadapalli --- Hello, This patch is based on commit 1722389b0d86 Merge tag 'net-6.11-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net of Mainline Linux. v1: https://lore.kernel.org/r/20240724065048.285838-1-s-vadapalli@ti.com Changes since v1: - Added "Cc: stable@vger.kernel.org" in the commit message. - Based on Bjorn's feedback at: https://lore.kernel.org/r/20240724162304.GA802428@bhelgaas/ the $subject and commit message have been updated. Additionally, the comment in the driver has also been updated to specify "INTx" instead of "Legacy Interrupts". - Collected Tested-by tag from Andrew Halaney : https://lore.kernel.org/r/vj6vtjphpmqv6hcblaalr2m4bwjujjwvom6ca4bjdzcmgazyaa@436unrb2lav7/ Patch has been tested on J721e-EVM and J784S4-EVM. Regards, Siddharth. drivers/pci/controller/cadence/pci-j721e.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/pci/controller/cadence/pci-j721e.c b/drivers/pci/controller/cadence/pci-j721e.c index 85718246016b..eaa6cfeb03c7 100644 --- a/drivers/pci/controller/cadence/pci-j721e.c +++ b/drivers/pci/controller/cadence/pci-j721e.c @@ -417,6 +417,10 @@ static int j721e_pcie_probe(struct platform_device *pdev) if (!bridge) return -ENOMEM; + /* INTx is not supported */ + bridge->map_irq = NULL; + bridge->swizzle_irq = NULL; + if (!data->byte_access_allowed) bridge->ops = &cdns_ti_pcie_host_ops; rc = pci_host_bridge_priv(bridge);