From c81da66608d65dab04730582dfdfcdcab779e2fe Mon Sep 17 00:00:00 2001 From: Bob Moore Date: Fri, 2 Feb 2007 19:48:18 +0300 Subject: ACPICA: Delete recursive feature of ACPI Global Lock Completed a new design and implementation for the ACPI Global Lock support. On the OS side, the global lock is now treated as a standard AML mutex. Previously, multiple OS threads could acquire the global lock simultaneously, but this could cause the BIOS to be starved by the lock in cases such as the Embedded Controller driver, where there is a tight coupling between the OS and the BIOS. Signed-off-by: Alexey Starikovskiy Signed-off-by: Len Brown --- drivers/acpi/namespace/nsaccess.c | 36 ++++++++++++++++-------------------- 1 file changed, 16 insertions(+), 20 deletions(-) (limited to 'drivers/acpi/namespace') diff --git a/drivers/acpi/namespace/nsaccess.c b/drivers/acpi/namespace/nsaccess.c index c1c6c236df9..b2ef6730be8 100644 --- a/drivers/acpi/namespace/nsaccess.c +++ b/drivers/acpi/namespace/nsaccess.c @@ -195,31 +195,27 @@ acpi_status acpi_ns_root_initialize(void) obj_desc->mutex.sync_level = (u8) (ACPI_TO_INTEGER(val) - 1); - if (ACPI_STRCMP(init_val->name, "_GL_") == 0) { - - /* Create a counting semaphore for the global lock */ + /* Create a mutex */ + + status = + acpi_os_create_mutex(&obj_desc->mutex. + os_mutex); + if (ACPI_FAILURE(status)) { + acpi_ut_remove_reference(obj_desc); + goto unlock_and_exit; + } - status = - acpi_os_create_semaphore - (ACPI_NO_UNIT_LIMIT, 1, - &acpi_gbl_global_lock_semaphore); - if (ACPI_FAILURE(status)) { - acpi_ut_remove_reference - (obj_desc); - goto unlock_and_exit; - } + /* Special case for ACPI Global Lock */ - /* Mark this mutex as very special */ + if (ACPI_STRCMP(init_val->name, "_GL_") == 0) { + acpi_gbl_global_lock_mutex = + obj_desc->mutex.os_mutex; - obj_desc->mutex.os_mutex = - ACPI_GLOBAL_LOCK; - } else { - /* Create a mutex */ + /* Create additional counting semaphore for global lock */ status = - acpi_os_create_mutex(&obj_desc-> - mutex. - os_mutex); + acpi_os_create_semaphore(1, 1, + &acpi_gbl_global_lock_semaphore); if (ACPI_FAILURE(status)) { acpi_ut_remove_reference (obj_desc); -- cgit v1.2.3