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 52DFEC3DA7F for ; Fri, 26 Jul 2024 10:25:07 +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=wwNAQqMZTOfeHyckA0S42XeXv2UW3eBc8gvudOtAbiM=; b=bqBuNrTCk9ohkEXRWReXhD2pJt /jdIt5ouZepr8fSiwE7IQFRE3cw3D+sYhbzIiyGwhSeEyF/D7A7MTpiv68Jx1NmB+sugBRBT3608w abILSXmpn5+h1M49ru29yoPVIEJ3GdzsXiMdF+rKpWCXhgYAxkfWNr0Qjyb8eNYIpGMvjYKSpZRqG qBWiVej7TXQXD9U3NcmzQ1obKJlpK8FIxX5QqQ1GNyFC5JRS6bYp420HRqdJthHRQJ2mYIpHB/LGI 2jc2MaqjXAz0aH533JjDTwC5m7yuS7YGfXuyqiW2+7SBxvFSxy4kyzBnzXdrnUTUby1gCbzem1g3h cAIlz7sg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sXI89-00000003YUq-3rQB; Fri, 26 Jul 2024 10:24: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 1sXI7k-00000003YQI-0Uy6 for linux-arm-kernel@lists.infradead.org; Fri, 26 Jul 2024 10:24: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 46QAOIPB015133; Fri, 26 Jul 2024 05:24:18 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1721989458; bh=wwNAQqMZTOfeHyckA0S42XeXv2UW3eBc8gvudOtAbiM=; h=Date:From:To:CC:Subject:References:In-Reply-To; b=q3YK29yEzypwF7a1nBjNzhCIb1/4JRqaQKejP7CXp0v6CNaZYMPnlDqiPSuYzBb+l bd4xOAMi36h1ZQgDpGkeDNKvlqP27g2/wBVgObRVbFaJKW6J666f0txpMlJVptzlro Gvw93jZfcogys5Blgskabiwa2497+VO14nMznleM= Received: from DLEE115.ent.ti.com (dlee115.ent.ti.com [157.170.170.26]) by fllv0035.itg.ti.com (8.15.2/8.15.2) with ESMTPS id 46QAOI5g086465 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Fri, 26 Jul 2024 05:24:18 -0500 Received: from DLEE102.ent.ti.com (157.170.170.32) by DLEE115.ent.ti.com (157.170.170.26) 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 05:24:18 -0500 Received: from lelvsmtp6.itg.ti.com (10.180.75.249) 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 05:24:18 -0500 Received: from localhost (uda0492258.dhcp.ti.com [10.24.72.81]) by lelvsmtp6.itg.ti.com (8.15.2/8.15.2) with ESMTP id 46QAOHZ5110895; Fri, 26 Jul 2024 05:24:18 -0500 Date: Fri, 26 Jul 2024 15:54:17 +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: <4cb79826-5945-40d5-b52c-22959a5df41a@ti.com> References: <20240724065048.285838-1-s-vadapalli@ti.com> <20240724161916.GG3349@thinkpad> <69f8c45c-29b4-4090-8034-8c5a19efa4f8@ti.com> <20240725074708.GB2770@thinkpad> <5f7328f8-eabc-4a8c-87a3-b27e2f6c0c1f@ti.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: <5f7328f8-eabc-4a8c-87a3-b27e2f6c0c1f@ti.com> 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_032432_289204_6ABF3C97 X-CRM114-Status: GOOD ( 27.38 ) 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 02:01:48PM +0530, Siddharth Vadapalli wrote: > On Thu, Jul 25, 2024 at 01:17:08PM +0530, Manivannan Sadhasivam wrote: > > On Thu, Jul 25, 2024 at 10:50:13AM +0530, Siddharth Vadapalli wrote: > > > On Wed, Jul 24, 2024 at 09:49:16PM +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. > > > > > > While 'swizzle_irq' won't be invoked if 'map_irq' is NULL, having a > > > non-NULL 'swizzle_irq' (pci_common_swizzle in this case) with a NULL > > > 'map_irq' seems inconsistent to me though the code-path may never invoke > > > it. Wouldn't a non-NULL 'swizzle_irq' imply that Legacy Interrupts are > > > supported, while a NULL 'map_irq' indicates that they aren't? Since they > > > are always described in pairs, whether it is in the initial commit that > > > added support for the Cadence PCIe Host controller (used by pci-j721e.c): > > > https://github.com/torvalds/linux/commit/1b79c5284439 > > > OR the commit which moved the shared 'map_irq' and 'swizzle_irq' defaults > > > from all the host drivers into the common 'devm_of_pci_bridge_init()' > > > function: > > > https://github.com/torvalds/linux/commit/b64aa11eb2dd > > > I have set both of them to NULL for the sake of consistency. > > > > > > > Since both callbacks are populated in the pci/of driver, this consistency won't > > be visible in the controller drivers. From the functionality pov, setting both > > callbacks to NULL is *not* required to disable INTx, right? > > Yes, setting 'swizzle_irq' to NULL isn't required. The execution sequence > with 'swizzle_irq' set to 'pci_common_swizzle()' is as follows: > > pci_assign_irq() > if (pin) { > if (hbrg->swizzle_irq) > slot = (*(hbrg->swizzle_irq))(dev, &pin); > pci_common_swizzle() > while (!pci_is_root_bus(dev->bus)) <= NOT entered > ..continue execution similar to 'swizzle_irq' being NULL. > > Having 'swizzle_irq' set to 'pci_common_swizzle()' will only result > in a no-op which could have been avoided by setting it to NULL. So there > is no difference w.r.t. functionality. Mani, I prefer setting 'swizzle_irq' to NULL as well unless you have an objection to it. Kindly let me know. I plan to post the v2 for this patch addressing Bjorn's feedback and collecting Andrew's "Tested-by" tag as well. Regards, Siddharth.