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 7485DC3DA49 for ; Fri, 26 Jul 2024 11:30:57 +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-Transfer-Encoding:Content-Type:MIME-Version:References:Message-ID: Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=RndSCR9HYmtlUSyMNNv/4RT5OOPlZlJZmp3kOybopPY=; b=hpwjyy1KInAJ26ykeTCywEgC45 fejvv48zvKBqn8GhPfOxJtQcE8/TpBcT/juB2GZQasssaU0CFOGbbtgQsfHwc4+RKtbLTHg4upYCI WR2JeJrTX/PK2omk5JgxzVTKU1qqAORn06XDylo6CDGsxiksFobZWFBQ8bQRIeW3/DutZGBOZeopj 6m0s2U1nMWEoJ34iyaVe3aKYhvSwbMbcpshStTlZlyfrO89gUNWu98YhHyVJaUMxqDPrzqJCReMez mEHFr0P91DDz+hyW0ywBKO34qw54o4oJdcAUSiOLV1D+hlD/E48SK1aOFn2VGlUC+rrp8OxBdtYOc pny3GwkA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sXJ9p-00000003jA0-372F; Fri, 26 Jul 2024 11:30:45 +0000 Received: from mail-pl1-x62d.google.com ([2607:f8b0:4864:20::62d]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sXJ9M-00000003j10-1xpu for linux-arm-kernel@lists.infradead.org; Fri, 26 Jul 2024 11:30:18 +0000 Received: by mail-pl1-x62d.google.com with SMTP id d9443c01a7336-1fd66cddd4dso5247715ad.2 for ; Fri, 26 Jul 2024 04:30:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1721993415; x=1722598215; darn=lists.infradead.org; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:from:date:from:to :cc:subject:date:message-id:reply-to; bh=RndSCR9HYmtlUSyMNNv/4RT5OOPlZlJZmp3kOybopPY=; b=l5zUNjQh/iYn/h+MSZwau5DNnTrzkeDDJjZT/ZKoanVDeF7N9KL84sAOHAfmVGXwr1 kVwjCPKu+USJ5Yqfp1LUWVn1KuyugbN98AjlLRsBaXL+z1SjaBOgrf0GEX1VZh974NL9 xx1oLFAK9xNnvXMhuS6IAVpYrsn+UJg4TXGTL0uK3ZaA/+gAdlnHshGVUNpptoN9nc1S gkGwcnab2lzjWHgYFdrsfdhyoFEdF3/esVa9Lk+CZj9MfSCxYIUE4T9Ai9Cy9ZJCymhW LJmvXTHmvoXbvcOxtlYSBgONXgUKFNZoP3N4AglD3wSUdXEZZujrsXjy1NfVplfL2Wlx D3HQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1721993415; x=1722598215; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=RndSCR9HYmtlUSyMNNv/4RT5OOPlZlJZmp3kOybopPY=; b=pNx4aG/oE36DvtVhd24potNsxxF4s/0HjGHIcr4DRMse2k1I9HvpC26HWNVU9gb5pj NBYocet0LJyAcESZjf4OYTxlnV02ftdBx7G00SSDc7KgCKYvKGOkIvdLtMdM/oKPymEK 59Fd0GxWhPN7yZ7NwZOSjsV656PyI2DVVZpRZ3xpCS/VG6SPcwZ72fWRDlqZpWD7BdTi d7CwQifYL1rowM3jkqUPzQdn2BvEEQ0zxa6FZQD3RmQmh0K7hPBCTu37qqKFKhu5HiUQ RERrA/WXp6ldLVGOs3+rl0gWZNW4gENo28NIcmenIYt9L3P5i0i1NgQsWMu2A3NQUl/m Scwg== X-Forwarded-Encrypted: i=1; AJvYcCWPAGmdONm1BApHGVkDzpopYioScSOKS3G7uO8IYJWLEwVuW9Ns/acuWOtQQmABiacRiHEWXoycnlPpDXG3f2ZVcpnS/9P4utYNq1CDB9NM8Z2ivzo= X-Gm-Message-State: AOJu0Yy+do30HwgYvOg2hrQ7afDa+cA3/op3NS2+BEQEn3LchANL2LUN D4RNDOhTZfMjkwPrAMb8pLtnh+EupithTa0nx8na+odxoNSine1m3bs5IQ1f/g== X-Google-Smtp-Source: AGHT+IFFDs1pJ4blYTtGgWC7JM93sHxQ90BWTwmCih/f3uvHFvkKnEUdPrSg7Zp1i2/tvUTdJ3f9cw== X-Received: by 2002:a17:902:dacb:b0:1fd:9d0c:9996 with SMTP id d9443c01a7336-1fed38c7af8mr61791785ad.35.1721993415136; Fri, 26 Jul 2024 04:30:15 -0700 (PDT) Received: from thinkpad ([2409:40f4:201d:928a:9e8:14a5:7572:42b6]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-1fed7c7fda4sm29979565ad.22.2024.07.26.04.30.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 26 Jul 2024 04:30:14 -0700 (PDT) Date: Fri, 26 Jul 2024 17:00:08 +0530 From: Manivannan Sadhasivam To: Siddharth Vadapalli Cc: bhelgaas@google.com, lpieralisi@kernel.org, kw@linux.com, robh@kernel.org, vigneshr@ti.com, kishon@kernel.org, linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, stable@vger.kernel.org, ahalaney@redhat.com, srk@ti.com Subject: Re: [PATCH] PCI: j721e: Set .map_irq and .swizzle_irq to NULL Message-ID: <20240726113008.GE2628@thinkpad> 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> <4cb79826-5945-40d5-b52c-22959a5df41a@ti.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <4cb79826-5945-40d5-b52c-22959a5df41a@ti.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240726_043016_600922_247EE437 X-CRM114-Status: GOOD ( 29.01 ) 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 Fri, Jul 26, 2024 at 03:54:17PM +0530, Siddharth Vadapalli wrote: > 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. > Ok, fine with me. - Mani -- மணிவண்ணன் சதாசிவம்