From nobody Sun Oct 5 16:14:14 2025 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 073142512D7; Thu, 31 Jul 2025 21:59:29 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1753999170; cv=none; b=FI43vqqK3C+2SqxvXzWGyQyx4SGfu8xd5Fp6Rrl7tP2cSPN95GLAsmEJlwxt/+Tma7GefkoUgXrlyIUiwPzbl2G0cJ6uqU3Iw3c5FMw6zGWoMvFUiS3roSxdFijifOnm6gsdUx31YCJIshq0NOM4jp6oOaj3XXxM5gydusPuV1U= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1753999170; c=relaxed/simple; bh=y9EfpfER3iG3oJpzB7Uv3sr7TbGqdJp799v9Smx2dtw=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=hMizuyxMavdtMI89chXCVIy3/idAYr40wQ/g3Vb+/p5Vy1GyX+xQLfznsZJMSLIqkKm9JZKMNxODfEveldzgE/dnkPoXq6EDqo1HlvNmWL9OEMuGTw+MeYCeFUjvGnwPsU03Mep0CEp4EGrHn5rG6q0oZkIUjn6LIiIAJoAD0JA= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=djiJg1l4; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="djiJg1l4" Received: by smtp.kernel.org (Postfix) with ESMTPS id A201DC4CEF7; Thu, 31 Jul 2025 21:59:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1753999169; bh=y9EfpfER3iG3oJpzB7Uv3sr7TbGqdJp799v9Smx2dtw=; h=From:Date:Subject:References:In-Reply-To:To:Cc:Reply-To:From; b=djiJg1l4ih+UsnPUwY18CbuRXx1laKZBwwOCnAT6OOw6QYTCAO2WwpsCRZVH4ESF/ oDgcrp1n3vDYOv7DVTPqstO4L5NKk5lGN7UsV6TAqSbktWFVzOr1RQuozw7raZRwbG hg5ABhjse2nuHnQDVDWgk4H1Wus7Xxz55z7N7yQYIvEckhp5/Rt01GqNGIMMjpOKUI uCFX0E+7eYoZq5enLQwL8+WgS33ADQlGv72DDwu/R3hKaOOi0SZFT/oru2e03HmISt nF+8QDeMIGZwaMjCCSTbhA/pHWkcrfn9HSP+rCBjiYFtH973uOUik3EuDc6X2AOHLx Txe6xScz7FCWw== Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8FC8FC87FCA; Thu, 31 Jul 2025 21:59:29 +0000 (UTC) From: Aaron Kling via B4 Relay Date: Thu, 31 Jul 2025 16:59:24 -0500 Subject: [PATCH v7 1/3] irqdomain: Export irq_domain_free_irqs Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20250731-pci-tegra-module-v7-1-cad4b088b8fb@gmail.com> References: <20250731-pci-tegra-module-v7-0-cad4b088b8fb@gmail.com> In-Reply-To: <20250731-pci-tegra-module-v7-0-cad4b088b8fb@gmail.com> To: Thomas Gleixner , Lorenzo Pieralisi , Rob Herring , Bjorn Helgaas , Thierry Reding , Jonathan Hunter , "Rafael J. Wysocki" , Daniel Lezcano , =?utf-8?q?Krzysztof_Wilczy=C5=84ski?= , Manivannan Sadhasivam , =?utf-8?q?Krzysztof_Wilczy=C5=84ski?= Cc: linux-kernel@vger.kernel.org, linux-pci@vger.kernel.org, linux-tegra@vger.kernel.org, linux-pm@vger.kernel.org, Aaron Kling X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1753999168; l=813; i=webgeek1234@gmail.com; s=20250217; h=from:subject:message-id; bh=zJfRZvCFTASylxqukHtONT8I03A9oylELli++Nq/N/o=; b=ziUT+U5OXljSSxWG75aYDzENmEmMIKimjN6dg8rDSrrFJWgzsmIfThorogDkzvbLqnhEBKRgg rMgixqVsE2cAAdM99wuBTqH30UNpSzUrq0GG4TUFU1QXep1hO2BMgM8 X-Developer-Key: i=webgeek1234@gmail.com; a=ed25519; pk=TQwd6q26txw7bkK7B8qtI/kcAohZc7bHHGSD7domdrU= X-Endpoint-Received: by B4 Relay for webgeek1234@gmail.com/20250217 with auth_id=342 X-Original-From: Aaron Kling Reply-To: webgeek1234@gmail.com From: Aaron Kling Export irq_domain_free_irqs() to allow PCI/MSI drivers like pci-tegra to be built as a module. Reviewed-by: Thomas Gleixner Signed-off-by: Aaron Kling --- kernel/irq/irqdomain.c | 1 + 1 file changed, 1 insertion(+) diff --git a/kernel/irq/irqdomain.c b/kernel/irq/irqdomain.c index c8b6de09047be768624b622a7a31fad1441de6d2..eb8eb9ee147cdc5d27a4da53ab6= 2f852b78841f4 100644 --- a/kernel/irq/irqdomain.c +++ b/kernel/irq/irqdomain.c @@ -1877,6 +1877,7 @@ void irq_domain_free_irqs(unsigned int virq, unsigned= int nr_irqs) irq_domain_free_irq_data(virq, nr_irqs); irq_free_descs(virq, nr_irqs); } +EXPORT_SYMBOL_GPL(irq_domain_free_irqs); =20 static void irq_domain_free_one_irq(struct irq_domain *domain, unsigned in= t virq) { --=20 2.50.1 From nobody Sun Oct 5 16:14:14 2025 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 07377256C9C; Thu, 31 Jul 2025 21:59:29 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1753999170; cv=none; b=rW/76QYs3uI94NVudFWVWS4B35o3CrIza/SI4ZFXpH4UqPl9U7JswaiVRugCb7riaROGcDI8zzIBiPVgqFyLt65smoPwWoqBpGR7huSYrwfn4cQ3dClZIsfmYHnnKkk3dVc0FSoVpLjREDzJDqxUNwpfMz4dYWQr9Ya26Hlba5Y= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1753999170; c=relaxed/simple; bh=F9e9tSYIordXZeE5OqM2JTzyisbrcH2j1AtrPQ2LZuE=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=qEOsMPVoWuf5frz8xPkRf2T9JqBZ++tgyYNmMzXuzXLrA9yze7E0AJAb48ga6yoHLJahSoKy+1x1FtiERHsGMMbo1gBK3hdqJmnKEVvyf2ZwhcvK3n/3/jy+y9HhmhJ6lTFsVeE5Wn+h3fTCR3rsDn43JhG0GsIbCCDFvKrHaXg= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=IuSZViBu; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="IuSZViBu" Received: by smtp.kernel.org (Postfix) with ESMTPS id B08E8C4CEF4; Thu, 31 Jul 2025 21:59:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1753999169; bh=F9e9tSYIordXZeE5OqM2JTzyisbrcH2j1AtrPQ2LZuE=; h=From:Date:Subject:References:In-Reply-To:To:Cc:Reply-To:From; b=IuSZViBukNwZ1H5iO3RNSBrnvWZi3SFdRE4TBd7fjKn6vzjUoAqAk8pQoMwEPB60E 4mr4Omc1f1X8cyuuSC5RXwcnUJKxvl0vTkW2X6byenbheZswD0jSREekb+SdJ21+2T o9jwavJxXTKrASheQfCCKCtSffc6O+KoLaCokSCqGVFl0UFTxdlMDZtybXkOrqMy24 jeG0JUA2ebRZ4hHtL0JBFhGYBB6pdR5kbR/QBFzAaQiWxkFjGE+W+C/Ufqs3oVak3Q JxB23jE7UAEmgPMr0iOvWuuwD6X3nDRov9LwnoN9eYFr53sNw4MmdJcD57NT0oLzUs 4Wq8zWfXjiwVg== Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id A0253C87FDA; Thu, 31 Jul 2025 21:59:29 +0000 (UTC) From: Aaron Kling via B4 Relay Date: Thu, 31 Jul 2025 16:59:25 -0500 Subject: [PATCH v7 2/3] cpuidle: tegra: Export tegra_cpuidle_pcie_irqs_in_use Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20250731-pci-tegra-module-v7-2-cad4b088b8fb@gmail.com> References: <20250731-pci-tegra-module-v7-0-cad4b088b8fb@gmail.com> In-Reply-To: <20250731-pci-tegra-module-v7-0-cad4b088b8fb@gmail.com> To: Thomas Gleixner , Lorenzo Pieralisi , Rob Herring , Bjorn Helgaas , Thierry Reding , Jonathan Hunter , "Rafael J. Wysocki" , Daniel Lezcano , =?utf-8?q?Krzysztof_Wilczy=C5=84ski?= , Manivannan Sadhasivam , =?utf-8?q?Krzysztof_Wilczy=C5=84ski?= Cc: linux-kernel@vger.kernel.org, linux-pci@vger.kernel.org, linux-tegra@vger.kernel.org, linux-pm@vger.kernel.org, Aaron Kling X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1753999168; l=805; i=webgeek1234@gmail.com; s=20250217; h=from:subject:message-id; bh=BQaFZtR7Fm7B7nsp2ZQnjqbnUiyMM8zRmZn2k2TW44w=; b=wfFDEDELw372gFNOlZws1E4tAwNhCQGy1Cm8MSywVcEUzrZorttMs/ZN4oswzg/oR2LxGkIB3 iBjhF90b2H5Chb8th6Tx0XoU/S3JD6V4zCpe4TVJdhD/RRtWdlHoaRo X-Developer-Key: i=webgeek1234@gmail.com; a=ed25519; pk=TQwd6q26txw7bkK7B8qtI/kcAohZc7bHHGSD7domdrU= X-Endpoint-Received: by B4 Relay for webgeek1234@gmail.com/20250217 with auth_id=342 X-Original-From: Aaron Kling Reply-To: webgeek1234@gmail.com From: Aaron Kling Add export for tegra_cpuidle_pcie_irqs_in_use() so that drivers like pci-tegra can be loaded as a module. Signed-off-by: Aaron Kling --- drivers/cpuidle/cpuidle-tegra.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/cpuidle/cpuidle-tegra.c b/drivers/cpuidle/cpuidle-tegr= a.c index b203a93deac5f378572be90e22c73e7417adb99e..aca907a62bb5de4ee4c71c1900e= acedd4b90bc0a 100644 --- a/drivers/cpuidle/cpuidle-tegra.c +++ b/drivers/cpuidle/cpuidle-tegra.c @@ -336,6 +336,7 @@ void tegra_cpuidle_pcie_irqs_in_use(void) pr_info("disabling CC6 state, since PCIe IRQs are in use\n"); tegra_cpuidle_disable_state(TEGRA_CC6); } +EXPORT_SYMBOL_GPL(tegra_cpuidle_pcie_irqs_in_use); =20 static void tegra_cpuidle_setup_tegra114_c7_state(void) { --=20 2.50.1 From nobody Sun Oct 5 16:14:14 2025 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 072B9246BD7; Thu, 31 Jul 2025 21:59:29 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1753999170; cv=none; b=i/53LWbaHibAemDA1jl5bvHhMWd9FpxtPGNvdzZRGDfF77pf+ZM87LMunhiSwrIhz4LaHwANf1ktwnywIa1lEmWoYMa0cvforDAHxN9Qf5MYsbjKWEbXYu/+CAJRV5TG2tSPiAnf9i7y/tjYIFyHNiuAjTVJmEng92l+n0ictxo= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1753999170; c=relaxed/simple; bh=PbT0lVg7+nffEx9KE6DhWbXKwrEe1ngsB9+NqasUVCI=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=SwnzhA6GOe7I1cK8BY5Z53OMhK+gLho958dXa1pB9XdzNvsUSYm34jxQMiq4E8EaYGttY2RBMsDhOSyYVQC3w062jt8xJoVYPfx4nJwPoV674CVOjNOiqveTmNyt4HEPmF4UR+yTDhRmLI5rmrIdXNTAjuWA9dWjJhJHfzk74Os= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=e5JHR1ll; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="e5JHR1ll" Received: by smtp.kernel.org (Postfix) with ESMTPS id B9F3CC4CEFA; Thu, 31 Jul 2025 21:59:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1753999169; bh=PbT0lVg7+nffEx9KE6DhWbXKwrEe1ngsB9+NqasUVCI=; h=From:Date:Subject:References:In-Reply-To:To:Cc:Reply-To:From; b=e5JHR1ll6MptrfN85F0zITDx2mvvwyYiLJ6s8RlS2Zn9tvUcP08g4+JNjY44DHt3H vx3U1rHgFGKSkGg7/vskamVihPJm7lT54v+81ufdOZqtE6jCUy+ENCDJcZonRzFuYm 8IoB8UjA5lPYhUvzS+faB4xgp/0V+EiABiJ8vtU9tP+69U6218lq+IjLsGmCVanWIw iHm1cOHTkk/vgP9zdz22RVQu3lBNKSVkmmozkxt4yFw70/xQgI0ucSkqV+zNJPW3Cn L00Gf2RD9Z6X3oBJtHVbq7mRq1jQ7G4k1gF2BhvRw860lZYQQ0+z9UMDM1l0tMYcGk DSIn+ApDnF0Dg== Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id AF713C87FD2; Thu, 31 Jul 2025 21:59:29 +0000 (UTC) From: Aaron Kling via B4 Relay Date: Thu, 31 Jul 2025 16:59:26 -0500 Subject: [PATCH v7 3/3] PCI: tegra: Allow building as a module Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20250731-pci-tegra-module-v7-3-cad4b088b8fb@gmail.com> References: <20250731-pci-tegra-module-v7-0-cad4b088b8fb@gmail.com> In-Reply-To: <20250731-pci-tegra-module-v7-0-cad4b088b8fb@gmail.com> To: Thomas Gleixner , Lorenzo Pieralisi , Rob Herring , Bjorn Helgaas , Thierry Reding , Jonathan Hunter , "Rafael J. Wysocki" , Daniel Lezcano , =?utf-8?q?Krzysztof_Wilczy=C5=84ski?= , Manivannan Sadhasivam , =?utf-8?q?Krzysztof_Wilczy=C5=84ski?= Cc: linux-kernel@vger.kernel.org, linux-pci@vger.kernel.org, linux-tegra@vger.kernel.org, linux-pm@vger.kernel.org, Aaron Kling X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1753999168; l=2994; i=webgeek1234@gmail.com; s=20250217; h=from:subject:message-id; bh=NwL1zgJJcNaVJMzJ4xbw0cEqWe0gRrA6/IT+IAjXFD0=; b=Hx8LT+bsI6wEqRQWtMV1xj/rCHIxQHr0EGrVFgqMOAZ06cbWwoRRXKHoXQuYwJimkhWxRNDBq zBC82thbtqnBHEyBd9EIgxwJqnKoUfNVULsJGILBhNI5JvNIZQr8JGJ X-Developer-Key: i=webgeek1234@gmail.com; a=ed25519; pk=TQwd6q26txw7bkK7B8qtI/kcAohZc7bHHGSD7domdrU= X-Endpoint-Received: by B4 Relay for webgeek1234@gmail.com/20250217 with auth_id=342 X-Original-From: Aaron Kling Reply-To: webgeek1234@gmail.com From: Aaron Kling This changes the module macro back to builtin, which does not define an exit function. This will prevent the module from being unloaded. There are concerns with modules not cleaning up IRQs on unload, thus this needs specifically disallowed. The remove callback is also dropped as it is unused. Signed-off-by: Aaron Kling --- drivers/pci/controller/Kconfig | 2 +- drivers/pci/controller/pci-tegra.c | 35 ++++------------------------------- 2 files changed, 5 insertions(+), 32 deletions(-) diff --git a/drivers/pci/controller/Kconfig b/drivers/pci/controller/Kconfig index 886f6f43a895f8f56ce3bcabbea382b6cd3b15c2..abdc17ff7b8f54c6b1cd3ee6556= 753f68ae546e9 100644 --- a/drivers/pci/controller/Kconfig +++ b/drivers/pci/controller/Kconfig @@ -225,7 +225,7 @@ config PCI_HYPERV_INTERFACE driver. =20 config PCI_TEGRA - bool "NVIDIA Tegra PCIe controller" + tristate "NVIDIA Tegra PCIe controller" depends on ARCH_TEGRA || COMPILE_TEST depends on PCI_MSI select IRQ_MSI_LIB diff --git a/drivers/pci/controller/pci-tegra.c b/drivers/pci/controller/pc= i-tegra.c index 467ddc701adce28c5edeb6d1b423ce56068f069a..c020822bdf0b72c4cc56817a9e6= 89256b964e9cd 100644 --- a/drivers/pci/controller/pci-tegra.c +++ b/drivers/pci/controller/pci-tegra.c @@ -2546,12 +2546,6 @@ static const struct seq_operations tegra_pcie_ports_= sops =3D { =20 DEFINE_SEQ_ATTRIBUTE(tegra_pcie_ports); =20 -static void tegra_pcie_debugfs_exit(struct tegra_pcie *pcie) -{ - debugfs_remove_recursive(pcie->debugfs); - pcie->debugfs =3D NULL; -} - static void tegra_pcie_debugfs_init(struct tegra_pcie *pcie) { pcie->debugfs =3D debugfs_create_dir("pcie", NULL); @@ -2625,29 +2619,6 @@ static int tegra_pcie_probe(struct platform_device *= pdev) return err; } =20 -static void tegra_pcie_remove(struct platform_device *pdev) -{ - struct tegra_pcie *pcie =3D platform_get_drvdata(pdev); - struct pci_host_bridge *host =3D pci_host_bridge_from_priv(pcie); - struct tegra_pcie_port *port, *tmp; - - if (IS_ENABLED(CONFIG_DEBUG_FS)) - tegra_pcie_debugfs_exit(pcie); - - pci_stop_root_bus(host->bus); - pci_remove_root_bus(host->bus); - pm_runtime_put_sync(pcie->dev); - pm_runtime_disable(pcie->dev); - - if (IS_ENABLED(CONFIG_PCI_MSI)) - tegra_pcie_msi_teardown(pcie); - - tegra_pcie_put_resources(pcie); - - list_for_each_entry_safe(port, tmp, &pcie->ports, list) - tegra_pcie_port_free(port); -} - static int tegra_pcie_pm_suspend(struct device *dev) { struct tegra_pcie *pcie =3D dev_get_drvdata(dev); @@ -2751,6 +2722,8 @@ static struct platform_driver tegra_pcie_driver =3D { .pm =3D &tegra_pcie_pm_ops, }, .probe =3D tegra_pcie_probe, - .remove =3D tegra_pcie_remove, }; -module_platform_driver(tegra_pcie_driver); +builtin_platform_driver(tegra_pcie_driver); +MODULE_AUTHOR("Thierry Reding "); +MODULE_DESCRIPTION("NVIDIA PCI host controller driver"); +MODULE_LICENSE("GPL"); --=20 2.50.1