[PATCH 3/3] agp/amd64: Remove support for probing unlisted PCI devices

Hans de Goede hansg at kernel.org
Mon Jul 7 17:37:10 UTC 2025


AMD64 boards with AGP support are so old that the agp_amd64_pci_table
should be complete and there is no need to probe unlisted PCI devices,
so lets completely remove support for probing unlisted PCI devices.

Suggested-by: Andi Kleen <ak at linux.intel.com>
Signed-off-by: Hans de Goede <hansg at kernel.org>
---
 drivers/char/agp/Kconfig     |  3 +--
 drivers/char/agp/agp.h       |  1 -
 drivers/char/agp/amd64-agp.c | 41 +-----------------------------------
 drivers/char/agp/backend.c   |  4 ----
 4 files changed, 2 insertions(+), 47 deletions(-)

diff --git a/drivers/char/agp/Kconfig b/drivers/char/agp/Kconfig
index c47eb7bf06d4..752b18901613 100644
--- a/drivers/char/agp/Kconfig
+++ b/drivers/char/agp/Kconfig
@@ -63,8 +63,7 @@ config AGP_AMD64
 	  This option gives you AGP support for the GLX component of
 	  X using the on-CPU northbridge of the AMD Athlon64/Opteron CPUs.
 	  You still need an external AGP bridge like the AMD 8151, VIA
-	  K8T400M, SiS755. It may also support other AGP bridges when loaded
-	  with agp_try_unsupported=1.
+	  K8T400M, SiS755.
 
 config AGP_INTEL
 	tristate "Intel 440LX/BX/GX, I8xx and E7x05 chipset support"
diff --git a/drivers/char/agp/agp.h b/drivers/char/agp/agp.h
index 67d7be800a7c..9fbe100c8f5e 100644
--- a/drivers/char/agp/agp.h
+++ b/drivers/char/agp/agp.h
@@ -237,7 +237,6 @@ void agp3_generic_cleanup(void);
 extern const struct aper_size_info_16 agp3_generic_sizes[];
 
 extern int agp_off;
-extern int agp_try_unsupported_boot;
 
 long compat_agp_ioctl(struct file *file, unsigned int cmd, unsigned long arg);
 
diff --git a/drivers/char/agp/amd64-agp.c b/drivers/char/agp/amd64-agp.c
index f883c06b538a..e63827724bb1 100644
--- a/drivers/char/agp/amd64-agp.c
+++ b/drivers/char/agp/amd64-agp.c
@@ -34,7 +34,6 @@
 #define ULI_X86_64_ENU_SCR_REG		0x54
 
 static struct resource *aperture_resource;
-static bool agp_try_unsupported __initdata;
 static int agp_bridges_found;
 
 static void amd64_tlbflush(struct agp_memory *temp)
@@ -734,47 +733,10 @@ static struct pci_driver agp_amd64_pci_driver = {
 /* Not static due to IOMMU code calling it early. */
 int __init agp_amd64_init(void)
 {
-	struct pci_dev *pdev = NULL;
-	int err = 0;
-
 	if (agp_off)
 		return -EINVAL;
 
-	err = pci_register_driver(&agp_amd64_pci_driver);
-	if (err < 0)
-		return err;
-
-	if (agp_bridges_found == 0) {
-		if (!agp_try_unsupported && !agp_try_unsupported_boot) {
-			printk(KERN_INFO PFX "No supported AGP bridge found.\n");
-#ifdef MODULE
-			printk(KERN_INFO PFX "You can try agp_try_unsupported=1\n");
-#else
-			printk(KERN_INFO PFX "You can boot with agp=try_unsupported\n");
-#endif
-			pci_unregister_driver(&agp_amd64_pci_driver);
-			return -ENODEV;
-		}
-
-		/* First check that we have at least one AMD64 NB */
-		if (!amd_nb_num()) {
-			pci_unregister_driver(&agp_amd64_pci_driver);
-			return -ENODEV;
-		}
-
-		/* Look for any AGP bridge */
-		for_each_pci_dev(pdev)
-			if (pci_find_capability(pdev, PCI_CAP_ID_AGP))
-				pci_add_dynid(&agp_amd64_pci_driver,
-					      pdev->vendor, pdev->device,
-					      pdev->subsystem_vendor,
-					      pdev->subsystem_device, 0, 0, 0);
-		if (agp_bridges_found == 0) {
-			pci_unregister_driver(&agp_amd64_pci_driver);
-			err = -ENODEV;
-		}
-	}
-	return err;
+	return pci_register_driver(&agp_amd64_pci_driver);
 }
 
 static int __init agp_amd64_mod_init(void)
@@ -801,6 +763,5 @@ module_init(agp_amd64_mod_init);
 module_exit(agp_amd64_cleanup);
 
 MODULE_AUTHOR("Dave Jones, Andi Kleen");
-module_param(agp_try_unsupported, bool, 0);
 MODULE_DESCRIPTION("GART driver for the AMD Opteron/Athlon64 on-CPU northbridge");
 MODULE_LICENSE("GPL");
diff --git a/drivers/char/agp/backend.c b/drivers/char/agp/backend.c
index 1776afd3ee07..ca9c3472d4b7 100644
--- a/drivers/char/agp/backend.c
+++ b/drivers/char/agp/backend.c
@@ -319,9 +319,7 @@ void agp_remove_bridge(struct agp_bridge_data *bridge)
 EXPORT_SYMBOL_GPL(agp_remove_bridge);
 
 int agp_off;
-int agp_try_unsupported_boot;
 EXPORT_SYMBOL(agp_off);
-EXPORT_SYMBOL(agp_try_unsupported_boot);
 
 static int __init agp_init(void)
 {
@@ -340,8 +338,6 @@ static __init int agp_setup(char *s)
 {
 	if (!strcmp(s,"off"))
 		agp_off = 1;
-	if (!strcmp(s,"try_unsupported"))
-		agp_try_unsupported_boot = 1;
 	return 1;
 }
 __setup("agp=", agp_setup);
-- 
2.49.0



More information about the dri-devel mailing list