Linux PCI subsystem development
 help / color / mirror / Atom feed
* [PATCH v2] PCI: apple: Prevent module unloading without IRQ teardown
@ 2026-11-15 11:47 Hongyan Xu
  2026-11-15 11:56 ` sashiko-bot
  0 siblings, 1 reply; 2+ messages in thread
From: Hongyan Xu @ 2026-11-15 11:47 UTC (permalink / raw)
  To: Bjorn Helgaas, linux-pci
  Cc: Marc Zyngier, Lorenzo Pieralisi,
	Krzysztof Wilczy鑹卻ki, Manivannan Sadhasivam,
	Rob Herring, linux-arm-kernel, linux-kernel, stable

The driver suppresses userspace bind attributes but still registers
a module exit callback. Unloading it leaves the PCI hierarchy and
unmanaged IRQ domains and handlers referring to released resources
and unloaded driver code. Removing only the root bus does not make
the remaining IRQ state safe.

Register the driver without an exit callback so a normally loaded
module cannot be unloaded. This follows the maintainer's suggested
first step while complete controller removal remains unsupported.
Keep the tristate option, so loading the driver as a module remains
possible. This change addresses module unload, not dynamic removal
of the platform device or existing probe-error cleanup.

Found by the author's in-house static analysis tool.

Fixes: 1e33888fbe44 ("PCI: apple: Add initial hardware bring-up")
Cc: stable@vger.kernel.org
Suggested-by: Marc Zyngier <maz@kernel.org>
Link: https://lore.kernel.org/all/87mrrj8ku6.wl-maz@kernel.org/
Signed-off-by: Hongyan Xu <getshell@seu.edu.cn>
Signed-off-by: Zehao Gao <gaozehao@iie.ac.cn>
---

Discovery: found by the author's in-house static analysis tool.

 drivers/pci/controller/pcie-apple.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/pci/controller/pcie-apple.c b/drivers/pci/controller/pcie-apple.c
index dfd0e34..061742b 100644
--- a/drivers/pci/controller/pcie-apple.c
+++ b/drivers/pci/controller/pcie-apple.c
@@ -892,7 +892,7 @@ static struct platform_driver apple_pcie_driver = {
 		.suppress_bind_attrs	= true,
 	},
 };
-module_platform_driver(apple_pcie_driver);
+builtin_platform_driver(apple_pcie_driver);
 
 MODULE_DESCRIPTION("Apple PCIe host bridge driver");
 MODULE_LICENSE("GPL v2");
-- 
2.50.1.windows.1

^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2026-11-15 11:56 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-15 11:47 [PATCH v2] PCI: apple: Prevent module unloading without IRQ teardown Hongyan Xu
2026-11-15 11:56 ` sashiko-bot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox