From nobody Mon Dec 15 21:49:51 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 91FDE1F4736; Thu, 8 May 2025 03:25:54 +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=1746674754; cv=none; b=u1nlTdGyfpeiyoUnIQHoGx83NoQ+J0z9QV9t8FhF98AUs4N9rCx+xWaBZ8tvcdw9cj4xjAscUembUlS2w+KHCARtrIEvUfswpsK8pJbAZ93vXA/btyHeppaDTWHWi6mlxt043RpFFq/cK9RgSACZ/esG2s0/IpmASwVd+r+YF+0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1746674754; c=relaxed/simple; bh=9FN4e+9q1iQnxjAeLllxG2YEgg/RjuG3V6jT5Cc3/I8=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=l5UnRVeqibyBPBi2p0omchrZR87swviM9JryoMBK0Cx08f7q8UzThtii8ZXAjZi9v1glODHRWr1BPGdJDFL63gb7yW9rp/XKmMplzd7zIAXYRv9nJHn+hdzHq8ptz1/Gaf3KWFHztnSPYW6GgANM+A0g5V8pMxj54ewNkTsoISg= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=aqmgEZwf; 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="aqmgEZwf" Received: by smtp.kernel.org (Postfix) with ESMTPS id 151F2C4CEEB; Thu, 8 May 2025 03:25:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1746674754; bh=9FN4e+9q1iQnxjAeLllxG2YEgg/RjuG3V6jT5Cc3/I8=; h=From:Date:Subject:References:In-Reply-To:To:Cc:Reply-To:From; b=aqmgEZwfQs6C478DF1mfn7fFY7uzh1X5I+N5ei8S1FeI6ytAp6UgJmvTgY94Z7hW2 EFmAfFbfs2wpM2cZa9tmcaJmEWrMeaw7EHHfLK2HNcUd/2Rvc8QcJLlrw9etht/8g0 l4yxARRn74cc3JDTjVMJOV3uxe2niYcsLdEyIX5DUxUugByGme3O+ZMolJFar1xj4t Rqm6k5not1iCP93XMBpVz4XtbPGS8uhqZCvyo/RkjkxINQ2FJkpbk9jkUekmARU8e2 ZZ1E4Hj+SeiD9g+Yzq7u5X43XFqDb1jFFbiHA/xDRIK3hN844gnyBYq6NkabZEbyUQ BGyz5ek5T2QbQ== 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 0984FC3ABC0; Thu, 8 May 2025 03:25:54 +0000 (UTC) From: Aaron Kling via B4 Relay Date: Wed, 07 May 2025 22:25:52 -0500 Subject: [PATCH v6 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: <20250507-pci-tegra-module-v6-1-5fe363eaa302@gmail.com> References: <20250507-pci-tegra-module-v6-0-5fe363eaa302@gmail.com> In-Reply-To: <20250507-pci-tegra-module-v6-0-5fe363eaa302@gmail.com> To: Thomas Gleixner , Lorenzo Pieralisi , =?utf-8?q?Krzysztof_Wilczy=C5=84ski?= , Manivannan Sadhasivam , Rob Herring , Bjorn Helgaas , Thierry Reding , Jonathan Hunter , "Rafael J. Wysocki" , Daniel Lezcano 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=1746674753; l=813; i=webgeek1234@gmail.com; s=20250217; h=from:subject:message-id; bh=HMpL5ZC0u0zHUx7X6iaMy1A5L01kC5VZDDTCKB3qS7U=; b=yNLWjKrlPioYJb28O/Qirs4sZiLKKFoYgaQMQj2YGLEysic2Q97uljDn0Hz1TEQFsIXL7JwIi BVmBC/xy6ArANd+VC9d+jaqJ6Md+HkTrVNMWbmepYZqEBxNMvF/mY7X 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 ec6d8e72d980f604ded2bfa2143420e0e0095920..36cd79a8a2ce960b07b03c40067= 343ec8f632452 100644 --- a/kernel/irq/irqdomain.c +++ b/kernel/irq/irqdomain.c @@ -1890,6 +1890,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.48.1 From nobody Mon Dec 15 21:49:51 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 A11FB1F63F9; Thu, 8 May 2025 03:25:54 +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=1746674754; cv=none; b=bHMUZpBGQTXC0P+BcW2CWq8iT1g5fAY6UBPcXPCs/Auw2URbEz6aN4oCt1dai+nEcO3vB5u3bVs6dFH604Am4GvqBoCg4m3U+uz3K1SThfuTswQ9DJZyJqBgPPQXVXoXJo6VljFwTtHNsZCAQ2uxYtpyvSq5o6/+Ui7VTOkLesU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1746674754; c=relaxed/simple; bh=BTogwoPQhqDb5Lb0ED+JhY3WyEMYPQZBPF+4Xj5VUFY=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=cU0XMJmEgQdzjv8wnkZrSty2bI1ZYDXJvnb4tEtSc6oC0awV+ub3DUDLeE0Ic/SMIohhb0kDhH9R07YFzEDNAnMAr6uCabAPIlJb9Yj/gYIfsWWmDuqkLkd3RoIi6DgKTkr36mbrF19kdt8LKZefeAnEKOq44ogRjI1t2A5G1NI= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=P+JdQB4t; 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="P+JdQB4t" Received: by smtp.kernel.org (Postfix) with ESMTPS id 21025C4CEEE; Thu, 8 May 2025 03:25:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1746674754; bh=BTogwoPQhqDb5Lb0ED+JhY3WyEMYPQZBPF+4Xj5VUFY=; h=From:Date:Subject:References:In-Reply-To:To:Cc:Reply-To:From; b=P+JdQB4tAi+TiDVPILWH5+ddlj5ErAeVXCgjBQPmgivU5S2Z5sGV1eJPAzcQVdXji VkouQ6h6FW4mKpGw8SlhVEE/x9yBGgVZ2mhjv1tI6u/5dsYczK2/QkMsMS/IM0i3A7 XR8fvFDYHqIJXQhsl8jA6iBhih5HPLIkonwUr7+kotCUe+U0V3pyh0/EYrM2LHlHFf OTFzUAGX7sI8h/j+5SYAV3AHF40t1qOaWxbzhBVqS+bYVJa0uO1V/Vmns14Wy0sPX5 2GJ3KqhjS1wEjfkZ/PJMx7dxpUfpx3FvrsZUAp8tOU1Vl/yZfya0uOcmWlmcVN++3Q rFKmbGHvx1ZNA== 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 15EC1C3ABCA; Thu, 8 May 2025 03:25:54 +0000 (UTC) From: Aaron Kling via B4 Relay Date: Wed, 07 May 2025 22:25:53 -0500 Subject: [PATCH v6 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: <20250507-pci-tegra-module-v6-2-5fe363eaa302@gmail.com> References: <20250507-pci-tegra-module-v6-0-5fe363eaa302@gmail.com> In-Reply-To: <20250507-pci-tegra-module-v6-0-5fe363eaa302@gmail.com> To: Thomas Gleixner , Lorenzo Pieralisi , =?utf-8?q?Krzysztof_Wilczy=C5=84ski?= , Manivannan Sadhasivam , Rob Herring , Bjorn Helgaas , Thierry Reding , Jonathan Hunter , "Rafael J. Wysocki" , Daniel Lezcano 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=1746674753; l=805; i=webgeek1234@gmail.com; s=20250217; h=from:subject:message-id; bh=VxJ9HgkNV4IxH20jYpaAA9e5Ei6kk4ytu1PVu0wpNxM=; b=jQ5uhYJxgIm/O3kgeqGTl+rnw8R8GlbKBUwE8eXdNvKwfkQLnHXHG+wyTdLYhO476ZT9ln/Yh WWDn7CHnFGQDXye1BtJu7iGJu6Z++Oq64YAD5f7fpKIh8z+D3twuY0w 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.48.1 From nobody Mon Dec 15 21:49:51 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 A28411F6694; Thu, 8 May 2025 03:25:54 +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=1746674754; cv=none; b=m0FLHP9e+t1M8uYl32ib2Tt6yHLYmVLHyE/W9fJCaebrfOdIuKIZlTbhjYD5PevoQSbY+lqOKHMq82fv/oY06U924pmRHnv0ch5qd2NRUWptgk1HrnrA7gft+Ocx15z+VTSOn1JC61vM8b6YicYCWe48lF9+vyB001ZKIHBPjD0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1746674754; c=relaxed/simple; bh=GzDz9cR5SrtBbqbUWibsnN39s607NfNtC5D1DtPjxYo=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=T3sAYVCgnmSy4upc/7qIlZMVuO2SPRqdEg3SRkdEIZBgylGTH8GBdeJJw5d5AWxut8RpK+m2FOfh+9XDXeOOzi2bbCqb+5kR/VCAVrTBCsk9AVJmylXya1y9TdyeVYDYhBnEiG6KXp9o1FtZAKas72sE6xGPXVqeAtmZWUznIA8= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=ViGvOYdE; 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="ViGvOYdE" Received: by smtp.kernel.org (Postfix) with ESMTPS id 2EF48C4CEF1; Thu, 8 May 2025 03:25:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1746674754; bh=GzDz9cR5SrtBbqbUWibsnN39s607NfNtC5D1DtPjxYo=; h=From:Date:Subject:References:In-Reply-To:To:Cc:Reply-To:From; b=ViGvOYdEFcCG6ym5ojCHbV2tgVV3jjOdu76Bd65apWj0H5LfQh28N5JFMQY1BcFCb UKZwITNt1Hh7njKcfvmqneHHErZnPLnBniyCL8UXvGbXnFNNaqvIE/X68FB8YUBCTB DjnT6g8ki2nl92OJMA99fRYE3j8P0SqKovE8QTCHZQhiwwEjh1UqRANoZclYgCYxHj LCPRh9eBpd1+ZGyLPloxFQPMFdsFqGbD/bTj8rc8TF/V9O6aoogcdRXseWTS9Bo6jI eUzq+SzF8Y2+pw7ZzZBV8uA3hctVVHGoF48pBmSFZ8FBKDU4Wu5L4BUsXPRmz6N6kV C5rEPNyQefmqg== 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 222B0C3ABC6; Thu, 8 May 2025 03:25:54 +0000 (UTC) From: Aaron Kling via B4 Relay Date: Wed, 07 May 2025 22:25:54 -0500 Subject: [PATCH v6 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: <20250507-pci-tegra-module-v6-3-5fe363eaa302@gmail.com> References: <20250507-pci-tegra-module-v6-0-5fe363eaa302@gmail.com> In-Reply-To: <20250507-pci-tegra-module-v6-0-5fe363eaa302@gmail.com> To: Thomas Gleixner , Lorenzo Pieralisi , =?utf-8?q?Krzysztof_Wilczy=C5=84ski?= , Manivannan Sadhasivam , Rob Herring , Bjorn Helgaas , Thierry Reding , Jonathan Hunter , "Rafael J. Wysocki" , Daniel Lezcano 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=1746674753; l=2980; i=webgeek1234@gmail.com; s=20250217; h=from:subject:message-id; bh=tWH6XnYSJoKkGmqKp04RuLk3D4LqSklOTfArIboe1ug=; b=of4e30l6Q5p6L2vyQe1n44ANBVQOEv1tT4Zvbhb4bdV9bB16+KqpcfevsAoHq7s9Mm512MqkZ jZJ0dsZSmCSDZ6kKdTNI/ccqUKvlBXpZBgunztzBhuuC7RrwHmP/vGV 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 9800b768105402d6dd1ba4b134c2ec23da6e4201..a9164dd2eccaead5ae9348c24a5= ad75fcb40f507 100644 --- a/drivers/pci/controller/Kconfig +++ b/drivers/pci/controller/Kconfig @@ -224,7 +224,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 help diff --git a/drivers/pci/controller/pci-tegra.c b/drivers/pci/controller/pc= i-tegra.c index b3cdbc5927de3742161310610dc5dcb836f5dd69..b902c696f63310f8f70651976d0= fa2d9337134a2 100644 --- a/drivers/pci/controller/pci-tegra.c +++ b/drivers/pci/controller/pci-tegra.c @@ -2595,12 +2595,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); @@ -2674,29 +2668,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); @@ -2800,6 +2771,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.48.1