aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorLen Brown <len.brown@intel.com>2004-08-03 15:13:00 -0400
committerLen Brown <lenb@dhcppc3.>2004-08-03 15:13:00 -0400
commitb34b79113f292ce1fd2e2a9cebfb4549cd7b567e (patch)
tree19590c56d08ea19928016df58010368412ebd156 /drivers
parent2888a36a897409355672837e2a27e7676f02915e (diff)
downloadhistory-b34b79113f292ce1fd2e2a9cebfb4549cd7b567e.tar.gz
[ACPI] BIOS workaround allowing devices to use reserved IO ports
Author: David Shaohua Li http://bugzilla.kernel.org/show_bug.cgi?id=3049
Diffstat (limited to 'drivers')
-rw-r--r--drivers/acpi/motherboard.c20
1 files changed, 16 insertions, 4 deletions
diff --git a/drivers/acpi/motherboard.c b/drivers/acpi/motherboard.c
index 310b1647e9d7d5..5475a7737f70b4 100644
--- a/drivers/acpi/motherboard.c
+++ b/drivers/acpi/motherboard.c
@@ -17,6 +17,8 @@
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
*/
+/* Purpose: Prevent PCMCIA cards from using motherboard resources. */
+
#include <linux/kernel.h>
#include <linux/init.h>
#include <linux/types.h>
@@ -43,9 +45,17 @@ ACPI_MODULE_NAME ("acpi_motherboard")
(((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_reserve_io_ranges (struct acpi_resource *res, void *data)
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;
}