From mboxrd@z Thu Jan 1 00:00:00 1970 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 A4BBFC3DA5D for ; Thu, 25 Jul 2024 08:21:14 +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:In-Reply-To:Content-Type: MIME-Version:References:Message-ID:Subject:CC:To:From:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=0rYG+h9NHpo1i/+Yx3zd+2LSnykqrZcBRUaxP+6xwH4=; b=GGLEEJDLYuXErernZykcEB/RkS duMMMtJsK2Yx9nEkfJrjX7fvf0Qeuc3GqzT004xXvFduQMq6AEre1kfLnSiGm1C94krdKRpE+6CxD RLZ8R7+8+eycszuqMGI5EigcvNHYH4VmtLQItC1av8s2/iSo2VqnF9DoWVnNw4WaOsuS7pl23d1Jg AUMb/nubL4rj6q/+Mm5fWPwiP4VOFLnrxfDb6JmRJqxewSCZVYEnAu8V+ExjaHuNAMZkiKjmEaZ6I pKYOuImMAnDt+7AyTRIOZQkr7dGXWJ7VYUjlyP+EBDmk1mHffpcDOrocKLbrhPfWJYnh9oIOTSbSr E6rYQDyA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sWtia-00000000K4M-3oeN; Thu, 25 Jul 2024 08:20:57 +0000 Received: from fllv0015.ext.ti.com ([198.47.19.141]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sWtiC-00000000JxW-0eFw for linux-arm-kernel@lists.infradead.org; Thu, 25 Jul 2024 08:20:33 +0000 Received: from fllv0035.itg.ti.com ([10.64.41.0]) by fllv0015.ext.ti.com (8.15.2/8.15.2) with ESMTP id 46P8KIgA012321; Thu, 25 Jul 2024 03:20:18 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1721895618; bh=0rYG+h9NHpo1i/+Yx3zd+2LSnykqrZcBRUaxP+6xwH4=; h=Date:From:To:CC:Subject:References:In-Reply-To; b=NSg1AWdFe347Skdrgojn4FojUIAix0nklKCuQ8a9gvsMjAwDicSyNHayIWb332VuA /oEFgfR5fLtm2mmcl2L4He94RrfXT0KzVSvUYEuFKdpz2MdsM+TLzTIgJznTV2phyS ZscjG9LbvlgGBLtpPxUzzoke7/YezitaOr7OcK8M= Received: from DFLE115.ent.ti.com (dfle115.ent.ti.com [10.64.6.36]) by fllv0035.itg.ti.com (8.15.2/8.15.2) with ESMTPS id 46P8KI0Y126560 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Thu, 25 Jul 2024 03:20:18 -0500 Received: from DFLE108.ent.ti.com (10.64.6.29) by DFLE115.ent.ti.com (10.64.6.36) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2507.23; Thu, 25 Jul 2024 03:20:18 -0500 Received: from lelvsmtp5.itg.ti.com (10.180.75.250) by DFLE108.ent.ti.com (10.64.6.29) 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; Thu, 25 Jul 2024 03:20:18 -0500 Received: from localhost (uda0492258.dhcp.ti.com [10.24.72.81]) by lelvsmtp5.itg.ti.com (8.15.2/8.15.2) with ESMTP id 46P8KGBd047171; Thu, 25 Jul 2024 03:20:17 -0500 Date: Thu, 25 Jul 2024 13:50:16 +0530 From: Siddharth Vadapalli To: Manivannan Sadhasivam CC: Siddharth Vadapalli , , , , , , , , , , , , Subject: Re: [PATCH] PCI: j721e: Set .map_irq and .swizzle_irq to NULL Message-ID: <93e864fb-cf52-4cc0-84a0-d689dd829afb@ti.com> References: <20240724065048.285838-1-s-vadapalli@ti.com> <20240724161916.GG3349@thinkpad> <20240725042001.GC2317@thinkpad> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: <20240725042001.GC2317@thinkpad> 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-20240725_012032_445484_4C87E223 X-CRM114-Status: GOOD ( 21.95 ) 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 On Thu, Jul 25, 2024 at 09:50:01AM +0530, Manivannan Sadhasivam wrote: > On Wed, Jul 24, 2024 at 09:49:21PM +0530, Manivannan Sadhasivam wrote: > > On Wed, Jul 24, 2024 at 12:20:48PM +0530, Siddharth Vadapalli wrote: > > > Since the configuration of Legacy Interrupts (INTx) 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 > > > due to the absence of Legacy Interrupts in the device-tree. > > > > > > > Do you really need to set 'swizzle_irq' to NULL? pci_assign_irq() will bail out > > if 'map_irq' is set to NULL. > > > > Hold on. The errono of of_irq_parse_pci() is not -ENOENT. So the INTx interrupts > are described in DT? Then why are they not supported? No, the INTx interrupts are not described in the DT. It is the pcieport driver that is attempting to setup INTx via "of_irq_parse_and_map_pci()" which is the .map_irq callback. The sequence of execution leading to the error is as follows: pcie_port_probe_service() pci_device_probe() pci_assign_irq() hbrg->map_irq of_pciof_irq_parse_and_map_pci() of_irq_parse_pci() of_irq_parse_raw() rc = -EINVAL ... [DEBUG] OF: of_irq_parse_raw: ipar=/bus@100000/interrupt-controller@1800000, size=3 if (out_irq->args_count != intsize) goto fail return rc The call to of_irq_parse_raw() results in the Interrupt-Parent for the PCIe node in the device-tree being found via of_irq_find_parent(). The Interrupt-Parent for the PCIe node for MSI happens to be GIC_ITS: msi-map = <0x0 &gic_its 0x0 0x10000>; and the parent of GIC_ITS is: gic500: interrupt-controller@1800000 which has the following: #interrupt-cells = <3>; The "size=3" portion of the DEBUG print above corresponds to the #interrupt-cells property above. Now, "out_irq->args_count" is set to 1 as __assumed__ by of_irq_parse_pci() and mentioned as a comment in that function: /* * Ok, we don't, time to have fun. Let's start by building up an * interrupt spec. we assume #interrupt-cells is 1, which is standard * for PCI. If you do different, then don't use that routine. */ In of_irq_parse_pci(), since the PCIe-Port driver doesn't have a device-tree node, the following doesn't apply: dn = pci_device_to_OF_node(pdev); and we skip to the __assumption__ above and proceed as explained in the execution sequence above. If the device-tree nodes for the INTx interrupts were present, the "ipar" sequence to find the interrupt parent would be skipped and we wouldn't end up with the -22 (-EINVAL) error code. I hope this clarifies the relation between the -22 error code and the missing device-tree nodes for INTx. Regards, Siddharth.