# This is a BitKeeper generated diff -Nru style patch. # # ChangeSet # 2004/11/22 21:06:37-05:00 len.brown@intel.com # [ACPI] BIOS workaround allowing devices to use reserved IO ports # Author: David Shaohua Li # http://bugzilla.kernel.org/show_bug.cgi?id=3049 # # drivers/acpi/motherboard.c # 2004/11/22 21:05:45-05:00 len.brown@intel.com +16 -4 # BIOS workaround, allow devices to use reserved IOports if they insist.. # diff -Nru a/drivers/acpi/motherboard.c b/drivers/acpi/motherboard.c --- a/drivers/acpi/motherboard.c 2004-12-05 07:42:31 -08:00 +++ b/drivers/acpi/motherboard.c 2004-12-05 07:42:31 -08:00 @@ -17,6 +17,8 @@ * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */ +/* Purpose: Prevent PCMCIA cards from using motherboard resources. */ + #include #include #include @@ -43,9 +45,17 @@ (((len) > 0) && ((base) > 0) && ((base) + (len) < IO_SPACE_LIMIT) \ && ((base) + (len) > PCIBIOS_MIN_IO)) +/* + * Clearing the flag (IORESOURCE_BUSY) allows drivers to use + * the io ports if they really know they can use it, while + * still preventing hotplug PCI devices from using it. + */ + static acpi_status acpi_reserve_io_ranges (struct acpi_resource *res, void *data) { + struct resource *requested_res = NULL; + ACPI_FUNCTION_TRACE("acpi_reserve_io_ranges"); if (res->id == ACPI_RSTYPE_IO) { @@ -57,23 +67,25 @@ ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Motherboard resources 0x%08x - 0x%08x\n", io_res->min_base_address, io_res->min_base_address + io_res->range_length)); - request_region(io_res->min_base_address, + requested_res = request_region(io_res->min_base_address, io_res->range_length, "motherboard"); } - }else if (res->id == ACPI_RSTYPE_FIXED_IO) { + } else if (res->id == ACPI_RSTYPE_FIXED_IO) { struct acpi_resource_fixed_io *fixed_io_res = &res->data.fixed_io; if (IS_RESERVED_ADDR(fixed_io_res->base_address, fixed_io_res->range_length)) { ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Motherboard resources 0x%08x - 0x%08x\n", fixed_io_res->base_address, fixed_io_res->base_address + fixed_io_res->range_length)); - request_region(fixed_io_res->base_address, + requested_res = request_region(fixed_io_res->base_address, fixed_io_res->range_length, "motherboard"); } - }else { + } else { /* Memory mapped IO? */ } + if (requested_res) + requested_res->flags &= ~IORESOURCE_BUSY; return AE_OK; }