Skip to contentSkip to conversation

Provide acpi_check_{mem_}region (update)

PATCH New Jean Delvare 1 participant 1 message Nov 7, 2007

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Provide acpi_check_{mem_}region (update)

From: Thomas Renninger <[email protected]>

Provide acpi_check_{mem_}region.

Drivers can additionally check against possible ACPI interference by also invoking this shortly before they call request_region.
If -EBUSY is returned, the driver must not load.
Use acpi_enforce_resources=strict/lax/no options to:
- strict: let conflicting drivers fail to load with an error message
- lax: let conflicting driver work normal with a warning message
- no: no functional change at all

---
This is an updated version of Thomas' patch, that applies after the <linux/acpi.h> cleanup patch I've just sent. Andrew, this replaces small-acpica-extension-to-be-able-to-store-the-name-of.pach in your tree (including your fix thereto.)

 drivers/acpi/dispatcher/dsopcode.c |    4 
 drivers/acpi/osl.c                 |  175 +++++++++++++++++++++++++++++++++++-
 include/acpi/acpiosxf.h            |    4 
 include/linux/acpi.h               |   18 +++
 4 files changed, 196 insertions(+), 5 deletions(-)
drivers/acpi/dispatcher/dsopcode.c +3 -1
@@ -359,7 +359,9 @@ acpi_status acpi_ds_get_region_arguments
 
 	status = acpi_os_validate_address(obj_desc->region.space_id,
 					  obj_desc->region.address,
-					  (acpi_size) obj_desc->region.length);
+					  (acpi_size) obj_desc->region.length,
+					  acpi_ut_get_node_name(node));
+
 	if (ACPI_FAILURE(status)) {
 		/*
 		 * Invalid address/length. We will emit an error message and mark
include/acpi/acpiosxf.h +2 -2
@@ -239,8 +239,8 @@ acpi_status acpi_os_validate_interface(c
 acpi_status acpi_osi_invalidate(char* interface);
 
 acpi_status
-acpi_os_validate_address(u8 space_id,
-			 acpi_physical_address address, acpi_size length);
+acpi_os_validate_address(u8 space_id, acpi_physical_address address,
+			 acpi_size length, char *name);
 
 u64 acpi_os_get_timer(void);
 
drivers/acpi/osl.c +173 -2

201 lines not on this page · raw message

include/linux/acpi.h +18 -0
@@ -195,6 +195,12 @@ extern int pnpacpi_disabled;
 #define PXM_INVAL	(-1)
 #define NID_INVAL	(-1)
 
+int acpi_check_region(resource_size_t start, resource_size_t n,
+		      const char *name);
+
+int acpi_check_mem_region(resource_size_t start, resource_size_t n,
+			  const char *name);
+
 #else	/* CONFIG_ACPI */
 
 static inline int acpi_boot_init(void)
@@ -207,5 +213,17 @@ static inline int acpi_boot_table_init(v
 	return 0;
 }
 
+static inline int acpi_check_region(resource_size_t start, resource_size_t n,
+				    const char *name)
+{
+	return 0;
+}
+
+static inline int acpi_check_mem_region(resource_size_t start,
+					resource_size_t n, const char *name)
+{
+	return 0;
+}
+
 #endif	/* CONFIG_ACPI */
 #endif	/*_LINUX_ACPI_H*/
Signature · 2 lines
Jean Delvare
Suse L3