From 8f81dd149806bc53c68c92f34d61f88427079039 Mon Sep 17 00:00:00 2001 From: Bjorn Helgaas Date: Tue, 8 May 2007 00:35:54 -0700 Subject: PNP: notice whether we have PNP devices (PNPBIOS or PNPACPI) This series converts i386 and x86_64 legacy serial ports to be platform devices and prevents probing for them if we have PNP. This prevents double discovery, where a device was found both by the legacy probe and by 8250_pnp. This also prevents the serial driver from claiming IRDA devices (unless they have a UART PNP ID). The serial legacy probe sometimes assumed the wrong IRQ, so the user had to use "setserial" to fix it. Removing the need for setserial to make IRDA devices work seems good, but it does break some things. In particular, you may need to keep setserial from poking legacy UART stuff back in by doing something like "dpkg-reconfigure setserial" with the "kernel" option. Otherwise, the setserial-discovered "UART" will claim resources and prevent the IRDA driver from loading. This patch: If we can discover devices using PNP, we can skip some legacy probes. This flag ("pnp_platform_devices") indicates that PNPBIOS or PNPACPI is enabled and should tell us about builtin devices. Signed-off-by: Bjorn Helgaas Cc: Keith Owens Cc: Len Brown Cc: Adam Belay Cc: Matthieu CASTET Cc: Jean Tourrilhes Cc: Matthew Garrett Cc: Ville Syrjala Cc: Russell King Cc: Samuel Ortiz Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- drivers/pnp/core.c | 8 ++++++++ drivers/pnp/pnpacpi/core.c | 1 + drivers/pnp/pnpbios/core.c | 1 + 3 files changed, 10 insertions(+) (limited to 'drivers') diff --git a/drivers/pnp/core.c b/drivers/pnp/core.c index d8d75541552..3e20b1cc777 100644 --- a/drivers/pnp/core.c +++ b/drivers/pnp/core.c @@ -23,6 +23,14 @@ static LIST_HEAD(pnp_protocols); LIST_HEAD(pnp_global); DEFINE_SPINLOCK(pnp_lock); +/* + * ACPI or PNPBIOS should tell us about all platform devices, so we can + * skip some blind probes. ISAPNP typically enumerates only plug-in ISA + * devices, not built-in things like COM ports. + */ +int pnp_platform_devices; +EXPORT_SYMBOL(pnp_platform_devices); + void *pnp_alloc(long size) { void *result; diff --git a/drivers/pnp/pnpacpi/core.c b/drivers/pnp/pnpacpi/core.c index 7eb8275185b..a00548799e9 100644 --- a/drivers/pnp/pnpacpi/core.c +++ b/drivers/pnp/pnpacpi/core.c @@ -285,6 +285,7 @@ static int __init pnpacpi_init(void) acpi_get_devices(NULL, pnpacpi_add_device_handler, NULL, NULL); pnp_info("PnP ACPI: found %d devices", num); unregister_acpi_bus_type(&acpi_pnp_bus); + pnp_platform_devices = 1; return 0; } subsys_initcall(pnpacpi_init); diff --git a/drivers/pnp/pnpbios/core.c b/drivers/pnp/pnpbios/core.c index b71aff21b3f..3a201b77b96 100644 --- a/drivers/pnp/pnpbios/core.c +++ b/drivers/pnp/pnpbios/core.c @@ -570,6 +570,7 @@ static int __init pnpbios_init(void) /* scan for pnpbios devices */ build_devlist(); + pnp_platform_devices = 1; return 0; } -- cgit v1.2.3