From f81d800e5c7a98c8abd8f9a66325adedebed3da1 Mon Sep 17 00:00:00 2001 From: Len Brown Date: Tue, 22 Jun 2004 05:15:18 -0400 Subject: [PATCH] [ACPI] ACPICA 20040514 from Bob Moore Fixed a problem where hardware GPE enable bits sometimes not set properly during and after GPE method execution. Result of ACPICA 20040427 changes. Removed extra "clear all GPEs" when sleeping/waking. Removed acpi_ht_enable_gpe and acpi_hw_disable_gpe, replaced by the single acpi_hw_write_gpe_enable_reg. Changed a couple of calls to the functions above to the new acpi_ev* calls as appropriate. ACPI_OS_NAME was removed from the OS-specific headers. The default name is now "Microsoft Windows NT" for maximum compatibility. However this can be changed by modifying the acconfig.h file. Fixes EHCI probe issue: http://bugme.osdl.org/show_bug.cgi?id=1762 Allow a single invocation of acpi_install_notify_handler for a handler that traps both types of notifies (System, Device). Use ACPI_ALL_NOTIFY flag. Run _INI methods on ThermalZone objects. This is against the ACPI specification, but there is apparently ASL code in the field that has these _INI methods, and apparently "other" AML interpreters execute them. Performed a full 16/32/64 bit lint that resulted in some small changes. --- drivers/acpi/dispatcher/dsmethod.c | 2 +- drivers/acpi/events/evgpe.c | 35 ++++++++------ drivers/acpi/events/evgpeblk.c | 21 ++++++--- drivers/acpi/events/evmisc.c | 4 +- drivers/acpi/events/evxface.c | 76 ++++++++++++++++++------------ drivers/acpi/events/evxfevnt.c | 9 +--- drivers/acpi/events/evxfregn.c | 1 - drivers/acpi/executer/exresolv.c | 8 ++-- drivers/acpi/hardware/hwgpe.c | 67 +++++++------------------- drivers/acpi/hardware/hwsleep.c | 4 +- drivers/acpi/namespace/nsalloc.c | 2 +- drivers/acpi/namespace/nseval.c | 2 +- drivers/acpi/namespace/nsinit.c | 15 +++--- drivers/acpi/parser/psxface.c | 5 +- drivers/acpi/resources/rsxface.c | 3 +- drivers/acpi/utilities/utglobal.c | 2 +- include/acpi/acconfig.h | 12 ++++- include/acpi/acdebug.h | 4 ++ include/acpi/achware.h | 11 +++-- include/acpi/acmacros.h | 2 +- include/acpi/actypes.h | 7 +-- include/acpi/platform/acenv.h | 8 +--- include/acpi/platform/aclinux.h | 2 - 23 files changed, 149 insertions(+), 153 deletions(-) diff --git a/drivers/acpi/dispatcher/dsmethod.c b/drivers/acpi/dispatcher/dsmethod.c index 5af958fcea20d..afe8f55c2d724 100644 --- a/drivers/acpi/dispatcher/dsmethod.c +++ b/drivers/acpi/dispatcher/dsmethod.c @@ -386,7 +386,7 @@ acpi_ds_call_control_method ( /* On error, we must delete the new walk state */ cleanup: - if (next_walk_state->method_desc) { + if (next_walk_state && (next_walk_state->method_desc)) { /* Decrement the thread count on the method parse tree */ next_walk_state->method_desc->method.thread_count--; diff --git a/drivers/acpi/events/evgpe.c b/drivers/acpi/events/evgpe.c index dba66b50c3470..4370ae14988b0 100644 --- a/drivers/acpi/events/evgpe.c +++ b/drivers/acpi/events/evgpe.c @@ -67,6 +67,9 @@ acpi_ev_set_gpe_type ( struct acpi_gpe_event_info *gpe_event_info, u8 type) { + acpi_status status; + + ACPI_FUNCTION_TRACE ("ev_set_gpe_type"); @@ -84,13 +87,13 @@ acpi_ev_set_gpe_type ( /* Disable the GPE if currently enabled */ - acpi_ev_disable_gpe (gpe_event_info); + status = acpi_ev_disable_gpe (gpe_event_info); /* Type was validated above */ gpe_event_info->flags &= ~ACPI_GPE_TYPE_MASK; /* Clear type bits */ gpe_event_info->flags |= type; /* Insert type */ - return_ACPI_STATUS (AE_OK); + return_ACPI_STATUS (status); } @@ -198,7 +201,7 @@ acpi_ev_enable_gpe ( case ACPI_GPE_TYPE_WAKE_RUN: gpe_event_info->flags |= ACPI_GPE_WAKE_ENABLED; - /* Fallthrough */ + /*lint -fallthrough */ case ACPI_GPE_TYPE_RUNTIME: @@ -214,7 +217,7 @@ acpi_ev_enable_gpe ( /* Enable the requested runtime GPE */ - status = acpi_hw_enable_gpe (gpe_event_info); + status = acpi_hw_write_gpe_enable_reg (gpe_event_info); } break; @@ -269,14 +272,14 @@ acpi_ev_disable_gpe ( case ACPI_GPE_TYPE_WAKE_RUN: gpe_event_info->flags &= ~ACPI_GPE_WAKE_ENABLED; - /* Fallthrough */ + /*lint -fallthrough */ case ACPI_GPE_TYPE_RUNTIME: /* Disable the requested runtime GPE */ gpe_event_info->flags &= ~ACPI_GPE_RUN_ENABLED; - status = acpi_hw_disable_gpe (gpe_event_info); + status = acpi_hw_write_gpe_enable_reg (gpe_event_info); break; default: @@ -381,8 +384,8 @@ acpi_ev_gpe_detect ( u32 enable_reg; acpi_status status; struct acpi_gpe_block_info *gpe_block; - u32 i; - u32 j; + acpi_native_uint i; + acpi_native_uint j; ACPI_FUNCTION_NAME ("ev_gpe_detect"); @@ -454,7 +457,7 @@ acpi_ev_gpe_detect ( */ int_status |= acpi_ev_gpe_dispatch ( &gpe_block->event_info[(i * ACPI_GPE_REGISTER_WIDTH) + j], - j + gpe_register_info->base_gpe_number); + (u32) j + gpe_register_info->base_gpe_number); } } } @@ -511,6 +514,10 @@ acpi_ev_asynch_execute_gpe_method ( return_VOID; } + /* Set the GPE flags for return to enabled state */ + + (void) acpi_ev_enable_gpe (gpe_event_info, FALSE); + /* * Take a snapshot of the GPE info for this level - we copy the * info to prevent a race condition with remove_handler/remove_block. @@ -558,7 +565,7 @@ acpi_ev_asynch_execute_gpe_method ( /* Enable this GPE */ - (void) acpi_hw_enable_gpe (&local_gpe_event_info); + (void) acpi_hw_write_gpe_enable_reg (&local_gpe_event_info); return_VOID; } @@ -624,7 +631,7 @@ acpi_ev_gpe_dispatch ( /* Invoke the installed handler (at interrupt level) */ - gpe_event_info->dispatch.handler->address ( + gpe_event_info->dispatch.handler->address ((void *) gpe_event_info->dispatch.handler->context); /* It is now safe to clear level-triggered events. */ @@ -646,7 +653,7 @@ acpi_ev_gpe_dispatch ( * Disable GPE, so it doesn't keep firing before the method has a * chance to run. */ - status = acpi_hw_disable_gpe (gpe_event_info); + status = acpi_ev_disable_gpe (gpe_event_info); if (ACPI_FAILURE (status)) { ACPI_REPORT_ERROR (( "acpi_ev_gpe_dispatch: Unable to disable GPE[%2X]\n", @@ -679,7 +686,7 @@ acpi_ev_gpe_dispatch ( * Disable the GPE. The GPE will remain disabled until the ACPI * Core Subsystem is restarted, or a handler is installed. */ - status = acpi_hw_disable_gpe (gpe_event_info); + status = acpi_ev_disable_gpe (gpe_event_info); if (ACPI_FAILURE (status)) { ACPI_REPORT_ERROR (( "acpi_ev_gpe_dispatch: Unable to disable GPE[%2X]\n", @@ -725,7 +732,7 @@ acpi_ev_check_for_wake_only_gpe ( ((gpe_event_info->flags & ACPI_GPE_SYSTEM_MASK) == ACPI_GPE_SYSTEM_RUNNING)) /* System state at GPE time */ { /* This must be a wake-only GPE, disable it */ - status = acpi_hw_disable_gpe (gpe_event_info); + status = acpi_ev_disable_gpe (gpe_event_info); /* Set GPE to wake-only. Do not change wake disabled/enabled status */ diff --git a/drivers/acpi/events/evgpeblk.c b/drivers/acpi/events/evgpeblk.c index 9f756e0ed7aea..9af8177c2d636 100644 --- a/drivers/acpi/events/evgpeblk.c +++ b/drivers/acpi/events/evgpeblk.c @@ -174,8 +174,11 @@ acpi_ev_delete_gpe_handlers ( struct acpi_gpe_block_info *gpe_block) { struct acpi_gpe_event_info *gpe_event_info; - u32 i; - u32 j; + acpi_native_uint i; + acpi_native_uint j; + + + ACPI_FUNCTION_TRACE ("ev_delete_gpe_handlers"); /* Examine each GPE Register within the block */ @@ -194,7 +197,7 @@ acpi_ev_delete_gpe_handlers ( } } - return (AE_OK); + return_ACPI_STATUS (AE_OK); } @@ -232,6 +235,7 @@ acpi_ev_save_method_info ( u32 gpe_number; char name[ACPI_NAME_SIZE + 1]; u8 type; + acpi_status status; ACPI_FUNCTION_TRACE ("ev_save_method_info"); @@ -309,12 +313,12 @@ acpi_ev_save_method_info ( /* Update enable mask, but don't enable the HW GPE as of yet */ - acpi_ev_enable_gpe (gpe_event_info, FALSE); + status = acpi_ev_enable_gpe (gpe_event_info, FALSE); ACPI_DEBUG_PRINT ((ACPI_DB_LOAD, "Registered GPE method %s as GPE number 0x%.2X\n", name, gpe_number)); - return_ACPI_STATUS (AE_OK); + return_ACPI_STATUS (status); } @@ -425,8 +429,11 @@ acpi_ev_match_prw_and_gpe ( /* Mark GPE for WAKE-ONLY but WAKE_DISABLED */ gpe_event_info->flags &= ~(ACPI_GPE_WAKE_ENABLED | ACPI_GPE_RUN_ENABLED); - acpi_ev_set_gpe_type (gpe_event_info, ACPI_GPE_TYPE_WAKE); - acpi_ev_update_gpe_enable_masks (gpe_event_info, ACPI_GPE_DISABLE); + status = acpi_ev_set_gpe_type (gpe_event_info, ACPI_GPE_TYPE_WAKE); + if (ACPI_FAILURE (status)) { + goto cleanup; + } + status = acpi_ev_update_gpe_enable_masks (gpe_event_info, ACPI_GPE_DISABLE); } cleanup: diff --git a/drivers/acpi/events/evmisc.c b/drivers/acpi/events/evmisc.c index de0a6fa24c500..342b0685d1bdf 100644 --- a/drivers/acpi/events/evmisc.c +++ b/drivers/acpi/events/evmisc.c @@ -196,8 +196,8 @@ acpi_ev_queue_notify_request ( /* There is no per-device notify handler for this device */ ACPI_DEBUG_PRINT ((ACPI_DB_INFO, - "No notify handler for [%4.4s] node %p\n", - acpi_ut_get_node_name (node), node)); + "No notify handler for Notify(%4.4s, %X) node %p\n", + acpi_ut_get_node_name (node), notify_value, node)); } return (status); diff --git a/drivers/acpi/events/evxface.c b/drivers/acpi/events/evxface.c index 1d2bf4e57de68..f52a685f5e9e3 100644 --- a/drivers/acpi/events/evxface.c +++ b/drivers/acpi/events/evxface.c @@ -188,6 +188,7 @@ acpi_remove_fixed_event_handler ( * handler_type - The type of handler: * ACPI_SYSTEM_NOTIFY: system_handler (00-7f) * ACPI_DEVICE_NOTIFY: driver_handler (80-ff) + * ACPI_ALL_NOTIFY: both system and device * Handler - Address of the handler * Context - Value passed to the handler on each GPE * @@ -243,20 +244,21 @@ acpi_install_notify_handler ( if (device == ACPI_ROOT_OBJECT) { /* Make sure the handler is not already installed */ - if (((handler_type == ACPI_SYSTEM_NOTIFY) && - acpi_gbl_system_notify.handler) || - ((handler_type == ACPI_DEVICE_NOTIFY) && + if (((handler_type & ACPI_SYSTEM_NOTIFY) && + acpi_gbl_system_notify.handler) || + ((handler_type & ACPI_DEVICE_NOTIFY) && acpi_gbl_device_notify.handler)) { status = AE_ALREADY_EXISTS; goto unlock_and_exit; } - if (handler_type == ACPI_SYSTEM_NOTIFY) { + if (handler_type & ACPI_SYSTEM_NOTIFY) { acpi_gbl_system_notify.node = node; acpi_gbl_system_notify.handler = handler; acpi_gbl_system_notify.context = context; } - else /* ACPI_DEVICE_NOTIFY */ { + + if (handler_type & ACPI_DEVICE_NOTIFY) { acpi_gbl_device_notify.node = node; acpi_gbl_device_notify.handler = handler; acpi_gbl_device_notify.context = context; @@ -284,9 +286,9 @@ acpi_install_notify_handler ( if (obj_desc) { /* Object exists - make sure there's no handler */ - if (((handler_type == ACPI_SYSTEM_NOTIFY) && + if (((handler_type & ACPI_SYSTEM_NOTIFY) && obj_desc->common_notify.system_notify) || - ((handler_type == ACPI_DEVICE_NOTIFY) && + ((handler_type & ACPI_DEVICE_NOTIFY) && obj_desc->common_notify.device_notify)) { status = AE_ALREADY_EXISTS; goto unlock_and_exit; @@ -308,7 +310,6 @@ acpi_install_notify_handler ( /* Remove local reference to the object */ acpi_ut_remove_reference (obj_desc); - if (ACPI_FAILURE (status)) { goto unlock_and_exit; } @@ -326,12 +327,19 @@ acpi_install_notify_handler ( notify_obj->notify.handler = handler; notify_obj->notify.context = context; - if (handler_type == ACPI_SYSTEM_NOTIFY) { + if (handler_type & ACPI_SYSTEM_NOTIFY) { obj_desc->common_notify.system_notify = notify_obj; } - else /* ACPI_DEVICE_NOTIFY */ { + + if (handler_type & ACPI_DEVICE_NOTIFY) { obj_desc->common_notify.device_notify = notify_obj; } + + if (handler_type == ACPI_ALL_NOTIFY) { + /* Extra ref if installed in both */ + + acpi_ut_add_reference (notify_obj); + } } @@ -349,6 +357,7 @@ unlock_and_exit: * handler_type - The type of handler: * ACPI_SYSTEM_NOTIFY: system_handler (00-7f) * ACPI_DEVICE_NOTIFY: driver_handler (80-ff) + * ACPI_ALL_NOTIFY: both system and device * Handler - Address of the handler * RETURN: Status * @@ -398,20 +407,21 @@ acpi_remove_notify_handler ( if (device == ACPI_ROOT_OBJECT) { ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "Removing notify handler for ROOT object.\n")); - if (((handler_type == ACPI_SYSTEM_NOTIFY) && - !acpi_gbl_system_notify.handler) || - ((handler_type == ACPI_DEVICE_NOTIFY) && + if (((handler_type & ACPI_SYSTEM_NOTIFY) && + !acpi_gbl_system_notify.handler) || + ((handler_type & ACPI_DEVICE_NOTIFY) && !acpi_gbl_device_notify.handler)) { status = AE_NOT_EXIST; goto unlock_and_exit; } - if (handler_type == ACPI_SYSTEM_NOTIFY) { + if (handler_type & ACPI_SYSTEM_NOTIFY) { acpi_gbl_system_notify.node = NULL; acpi_gbl_system_notify.handler = NULL; acpi_gbl_system_notify.context = NULL; } - else { + + if (handler_type & ACPI_DEVICE_NOTIFY) { acpi_gbl_device_notify.node = NULL; acpi_gbl_device_notify.handler = NULL; acpi_gbl_device_notify.context = NULL; @@ -439,29 +449,33 @@ acpi_remove_notify_handler ( /* Object exists - make sure there's an existing handler */ - if (handler_type == ACPI_SYSTEM_NOTIFY) { + if (handler_type & ACPI_SYSTEM_NOTIFY) { notify_obj = obj_desc->common_notify.system_notify; - } - else { - notify_obj = obj_desc->common_notify.device_notify; - } - - if ((!notify_obj) || - (notify_obj->notify.handler != handler)) { - status = AE_BAD_PARAMETER; - goto unlock_and_exit; - } + if ((!notify_obj) || + (notify_obj->notify.handler != handler)) { + status = AE_BAD_PARAMETER; + goto unlock_and_exit; + } - /* Remove the handler */ + /* Remove the handler */ - if (handler_type == ACPI_SYSTEM_NOTIFY) { obj_desc->common_notify.system_notify = NULL; + acpi_ut_remove_reference (notify_obj); } - else { + + if (handler_type & ACPI_DEVICE_NOTIFY) { + notify_obj = obj_desc->common_notify.device_notify; + if ((!notify_obj) || + (notify_obj->notify.handler != handler)) { + status = AE_BAD_PARAMETER; + goto unlock_and_exit; + } + + /* Remove the handler */ + obj_desc->common_notify.device_notify = NULL; + acpi_ut_remove_reference (notify_obj); } - - acpi_ut_remove_reference (notify_obj); } diff --git a/drivers/acpi/events/evxfevnt.c b/drivers/acpi/events/evxfevnt.c index 5d51a04f6e0c2..e941678ceae82 100644 --- a/drivers/acpi/events/evxfevnt.c +++ b/drivers/acpi/events/evxfevnt.c @@ -241,14 +241,7 @@ acpi_set_gpe_type ( return_ACPI_STATUS (AE_OK); } - /* Disable the GPE if enabled */ - - status = acpi_ev_disable_gpe (gpe_event_info); - if (ACPI_FAILURE (status)) { - return_ACPI_STATUS (status); - } - - /* Set the new type */ + /* Set the new type (will disable GPE if currently enabled) */ status = acpi_ev_set_gpe_type (gpe_event_info, type); diff --git a/drivers/acpi/events/evxfregn.c b/drivers/acpi/events/evxfregn.c index 4ebe506a6ef00..8eeb938f77950 100644 --- a/drivers/acpi/events/evxfregn.c +++ b/drivers/acpi/events/evxfregn.c @@ -46,7 +46,6 @@ #include #include #include -#include #define _COMPONENT ACPI_EVENTS ACPI_MODULE_NAME ("evxfregn") diff --git a/drivers/acpi/executer/exresolv.c b/drivers/acpi/executer/exresolv.c index e998da7cd7ea4..504d53f4a7e66 100644 --- a/drivers/acpi/executer/exresolv.c +++ b/drivers/acpi/executer/exresolv.c @@ -187,15 +187,15 @@ acpi_ex_resolve_object_to_value ( return_ACPI_STATUS (status); } + ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "[Arg/Local %X] value_obj is %p\n", + stack_desc->reference.offset, obj_desc)); + /* * Now we can delete the original Reference Object and - * replace it with the resolve value + * replace it with the resolved value */ acpi_ut_remove_reference (stack_desc); *stack_ptr = obj_desc; - - ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "[Arg/Local %d] value_obj is %p\n", - stack_desc->reference.offset, obj_desc)); break; diff --git a/drivers/acpi/hardware/hwgpe.c b/drivers/acpi/hardware/hwgpe.c index da8b4002fc40d..ff51b4ca0606b 100644 --- a/drivers/acpi/hardware/hwgpe.c +++ b/drivers/acpi/hardware/hwgpe.c @@ -51,19 +51,20 @@ /****************************************************************************** * - * FUNCTION: acpi_hw_enable_gpe + * FUNCTION: acpi_hw_write_gpe_enable_reg * * PARAMETERS: gpe_event_info - Info block for the GPE to be enabled * * RETURN: Status * - * DESCRIPTION: Enable a single GPE. Note: The bit for this GPE must already - * be set in the parent register enable_for_run mask. + * DESCRIPTION: Write a GPE enable register. Note: The bit for this GPE must + * already be cleared or set in the parent register + * enable_for_run mask. * ******************************************************************************/ acpi_status -acpi_hw_enable_gpe ( +acpi_hw_write_gpe_enable_reg ( struct acpi_gpe_event_info *gpe_event_info) { struct acpi_gpe_register_info *gpe_register_info; @@ -80,7 +81,7 @@ acpi_hw_enable_gpe ( return (AE_NOT_EXIST); } - /* Write GPE enable register with the new GPE bit enabled */ + /* Write the entire GPE (runtime) enable register */ status = acpi_hw_low_level_write (8, gpe_register_info->enable_for_run, &gpe_register_info->enable_address); @@ -89,44 +90,6 @@ acpi_hw_enable_gpe ( } -/****************************************************************************** - * - * FUNCTION: acpi_hw_disable_gpe - * - * PARAMETERS: gpe_event_info - Info block for the GPE to be disabled - * - * RETURN: Status - * - * DESCRIPTION: Disable a single GPE. - * - ******************************************************************************/ - -acpi_status -acpi_hw_disable_gpe ( - struct acpi_gpe_event_info *gpe_event_info) -{ - struct acpi_gpe_register_info *gpe_register_info; - acpi_status status; - - - ACPI_FUNCTION_ENTRY (); - - - /* Get the info block for the entire GPE register */ - - gpe_register_info = gpe_event_info->register_info; - if (!gpe_register_info) { - return (AE_NOT_EXIST); - } - - /* Write the GPE enable register with this GPE bit cleared */ - - status = acpi_hw_low_level_write (8, gpe_register_info->enable_for_run, - &gpe_register_info->enable_address); - return (status); -} - - /****************************************************************************** * * FUNCTION: acpi_hw_clear_gpe @@ -380,6 +343,10 @@ acpi_hw_enable_wakeup_gpe_block ( /* Examine each GPE Register within the block */ for (i = 0; i < gpe_block->register_count; i++) { + if (!gpe_block->register_info[i].enable_for_wake) { + continue; + } + /* Enable all "wake" GPEs in this register */ status = acpi_hw_low_level_write (8, gpe_block->register_info[i].enable_for_wake, @@ -412,12 +379,12 @@ acpi_hw_disable_all_gpes ( acpi_status status; - ACPI_FUNCTION_ENTRY (); + ACPI_FUNCTION_TRACE ("hw_disable_all_gpes"); status = acpi_ev_walk_gpe_list (acpi_hw_disable_gpe_block); status = acpi_ev_walk_gpe_list (acpi_hw_clear_gpe_block); - return (status); + return_ACPI_STATUS (status); } @@ -440,12 +407,11 @@ acpi_hw_enable_all_runtime_gpes ( acpi_status status; - ACPI_FUNCTION_ENTRY (); + ACPI_FUNCTION_TRACE ("hw_enable_all_runtime_gpes"); - status = acpi_ev_walk_gpe_list (acpi_hw_clear_gpe_block); status = acpi_ev_walk_gpe_list (acpi_hw_enable_runtime_gpe_block); - return (status); + return_ACPI_STATUS (status); } @@ -468,11 +434,10 @@ acpi_hw_enable_all_wakeup_gpes ( acpi_status status; - ACPI_FUNCTION_ENTRY (); + ACPI_FUNCTION_TRACE ("hw_enable_all_wakeup_gpes"); - status = acpi_ev_walk_gpe_list (acpi_hw_clear_gpe_block); status = acpi_ev_walk_gpe_list (acpi_hw_enable_wakeup_gpe_block); - return (status); + return_ACPI_STATUS (status); } diff --git a/drivers/acpi/hardware/hwsleep.c b/drivers/acpi/hardware/hwsleep.c index e5e3cfc22c1de..9e6ed20834418 100644 --- a/drivers/acpi/hardware/hwsleep.c +++ b/drivers/acpi/hardware/hwsleep.c @@ -570,9 +570,9 @@ acpi_leave_sleep_state ( /* Enable power button */ - acpi_set_register(acpi_gbl_fixed_event_info[ACPI_EVENT_POWER_BUTTON].enable_register_id, + (void) acpi_set_register(acpi_gbl_fixed_event_info[ACPI_EVENT_POWER_BUTTON].enable_register_id, 1, ACPI_MTX_DO_NOT_LOCK); - acpi_set_register(acpi_gbl_fixed_event_info[ACPI_EVENT_POWER_BUTTON].status_register_id, + (void) acpi_set_register(acpi_gbl_fixed_event_info[ACPI_EVENT_POWER_BUTTON].status_register_id, 1, ACPI_MTX_DO_NOT_LOCK); /* Enable BM arbitration */ diff --git a/drivers/acpi/namespace/nsalloc.c b/drivers/acpi/namespace/nsalloc.c index f7a216c2f6d57..87fe614ae3323 100644 --- a/drivers/acpi/namespace/nsalloc.c +++ b/drivers/acpi/namespace/nsalloc.c @@ -267,7 +267,7 @@ acpi_ns_install_node ( else { #ifdef ACPI_ALPHABETIC_NAMESPACE /* - * Walk the list whilst searching for the the correct + * Walk the list whilst searching for the correct * alphabetic placement. */ previous_child_node = NULL; diff --git a/drivers/acpi/namespace/nseval.c b/drivers/acpi/namespace/nseval.c index 4a7bcf2cb6198..418f03ee2a553 100644 --- a/drivers/acpi/namespace/nseval.c +++ b/drivers/acpi/namespace/nseval.c @@ -494,7 +494,7 @@ acpi_ns_get_object_value ( status = AE_CTRL_RETURN_VALUE; info->return_object = ACPI_CAST_PTR (union acpi_operand_object, resolved_node); ACPI_DEBUG_PRINT ((ACPI_DB_NAMES, "Returning object %p [%s]\n", - *info->return_object, acpi_ut_get_object_type_name (info->return_object))); + info->return_object, acpi_ut_get_object_type_name (info->return_object))); } } diff --git a/drivers/acpi/namespace/nsinit.c b/drivers/acpi/namespace/nsinit.c index 7d40734184d2d..861787520957d 100644 --- a/drivers/acpi/namespace/nsinit.c +++ b/drivers/acpi/namespace/nsinit.c @@ -149,7 +149,7 @@ acpi_ns_initialize_devices ( return_ACPI_STATUS (status); } - /* Walk namespace for all objects of type Device or Processor */ + /* Walk namespace for all objects */ status = acpi_ns_walk_namespace (ACPI_TYPE_ANY, ACPI_ROOT_OBJECT, ACPI_UINT32_MAX, TRUE, acpi_ns_init_one_device, &info, NULL); @@ -355,10 +355,11 @@ acpi_ns_init_one_device ( } /* - * We will run _STA/_INI on Devices and Processors only + * We will run _STA/_INI on Devices, Processors and thermal_zones only */ - if ((pinfo.node->type != ACPI_TYPE_DEVICE) && - (pinfo.node->type != ACPI_TYPE_PROCESSOR)) { + if ((pinfo.node->type != ACPI_TYPE_DEVICE) && + (pinfo.node->type != ACPI_TYPE_PROCESSOR) && + (pinfo.node->type != ACPI_TYPE_THERMAL)) { return_ACPI_STATUS (AE_OK); } @@ -381,7 +382,7 @@ acpi_ns_init_one_device ( return_ACPI_STATUS (AE_OK); } - /* _STA is not required for Processor objects */ + /* _STA is not required for Processor or thermal_zone objects */ } else { info->num_STA++; @@ -404,14 +405,14 @@ acpi_ns_init_one_device ( if (status != AE_NOT_FOUND) { /* Ignore error and move on to next device */ - #ifdef ACPI_DEBUG_OUTPUT +#ifdef ACPI_DEBUG_OUTPUT char *scope_name = acpi_ns_get_external_pathname (pinfo.node); ACPI_DEBUG_PRINT ((ACPI_DB_WARN, "%s._INI failed: %s\n", scope_name, acpi_format_exception (status))); ACPI_MEM_FREE (scope_name); - #endif +#endif } status = AE_OK; diff --git a/drivers/acpi/parser/psxface.c b/drivers/acpi/parser/psxface.c index 456172fe80390..9281f6aec88a0 100644 --- a/drivers/acpi/parser/psxface.c +++ b/drivers/acpi/parser/psxface.c @@ -103,9 +103,8 @@ acpi_psx_execute ( return_ACPI_STATUS (status); } - if (info && - (info->parameter_type == ACPI_PARAM_ARGS) && - (info->parameters)) { + if ((info->parameter_type == ACPI_PARAM_ARGS) && + (info->parameters)) { /* * The caller "owns" the parameters, so give each one an extra * reference diff --git a/drivers/acpi/resources/rsxface.c b/drivers/acpi/resources/rsxface.c index 362f6252bf784..d02aa1df32855 100644 --- a/drivers/acpi/resources/rsxface.c +++ b/drivers/acpi/resources/rsxface.c @@ -259,7 +259,8 @@ acpi_walk_resources ( /* Setup pointers */ resource = (struct acpi_resource *) buffer.pointer; - buffer_end = (struct acpi_resource *) ((u8 *) buffer.pointer + buffer.length); + buffer_end = ACPI_CAST_PTR (struct acpi_resource, + ((u8 *) buffer.pointer + buffer.length)); /* Walk the resource list */ diff --git a/drivers/acpi/utilities/utglobal.c b/drivers/acpi/utilities/utglobal.c index 51d4b052f7bdb..8daece8c2ca78 100644 --- a/drivers/acpi/utilities/utglobal.c +++ b/drivers/acpi/utilities/utglobal.c @@ -226,7 +226,7 @@ const struct acpi_predefined_names acpi_gbl_pre_defined_names[] = {"_PR_", ACPI_TYPE_LOCAL_SCOPE, NULL}, {"_SB_", ACPI_TYPE_DEVICE, NULL}, {"_SI_", ACPI_TYPE_LOCAL_SCOPE, NULL}, - {"_TZ_", ACPI_TYPE_LOCAL_SCOPE, NULL}, + {"_TZ_", ACPI_TYPE_THERMAL, NULL}, {"_REV", ACPI_TYPE_INTEGER, "2"}, {"_OS_", ACPI_TYPE_STRING, ACPI_OS_NAME}, {"_GL_", ACPI_TYPE_MUTEX, "0"}, diff --git a/include/acpi/acconfig.h b/include/acpi/acconfig.h index 50e17c4e869df..76f0345ecef62 100644 --- a/include/acpi/acconfig.h +++ b/include/acpi/acconfig.h @@ -64,7 +64,17 @@ /* Version string */ -#define ACPI_CA_VERSION 0x20040427 +#define ACPI_CA_VERSION 0x20040514 + +/* + * OS name, used for the _OS object. The _OS object is essentially obsolete, + * but there is a large base of ASL/AML code in existing machines that check + * for the string below. The use of this string usually guarantees that + * the ASL will execute down the most tested code path. Also, there is some + * code that will not execute the _OSI method unless _OS matches the string + * below. Therefore, change this string at your own risk. + */ +#define ACPI_OS_NAME "Microsoft Windows NT" /* Maximum objects in the various object caches */ diff --git a/include/acpi/acdebug.h b/include/acpi/acdebug.h index bb8411e89d16a..6beb5bbf4bfce 100644 --- a/include/acpi/acdebug.h +++ b/include/acpi/acdebug.h @@ -164,6 +164,10 @@ void acpi_db_set_scope ( char *name); +acpi_status +acpi_db_sleep ( + char *object_arg); + void acpi_db_find_references ( char *object_arg); diff --git a/include/acpi/achware.h b/include/acpi/achware.h index a3e067c010e30..7b5f26eb965df 100644 --- a/include/acpi/achware.h +++ b/include/acpi/achware.h @@ -114,11 +114,7 @@ acpi_hw_clear_acpi_status ( /* GPE support */ acpi_status -acpi_hw_enable_gpe ( - struct acpi_gpe_event_info *gpe_event_info); - -acpi_status -acpi_hw_disable_gpe ( +acpi_hw_write_gpe_enable_reg ( struct acpi_gpe_event_info *gpe_event_info); acpi_status @@ -157,6 +153,11 @@ acpi_hw_enable_runtime_gpe_block ( struct acpi_gpe_xrupt_info *gpe_xrupt_info, struct acpi_gpe_block_info *gpe_block); +acpi_status +acpi_hw_enable_wakeup_gpe_block ( + struct acpi_gpe_xrupt_info *gpe_xrupt_info, + struct acpi_gpe_block_info *gpe_block); + /* ACPI Timer prototypes */ diff --git a/include/acpi/acmacros.h b/include/acpi/acmacros.h index 245bc0bc5734b..71428b8c138b0 100644 --- a/include/acpi/acmacros.h +++ b/include/acpi/acmacros.h @@ -97,7 +97,7 @@ * printf() format helpers */ -/* Split 64-bit integer into two 32-bit values. use with %8,8_x%8.8X */ +/* Split 64-bit integer into two 32-bit values. Use with %8.8X%8.8X */ #define ACPI_FORMAT_UINT64(i) ACPI_HIDWORD(i),ACPI_LODWORD(i) diff --git a/include/acpi/actypes.h b/include/acpi/actypes.h index cde7e1454d986..6c36cb840593f 100644 --- a/include/acpi/actypes.h +++ b/include/acpi/actypes.h @@ -614,9 +614,10 @@ typedef u32 acpi_event_status; /* Notify types */ -#define ACPI_SYSTEM_NOTIFY 0 -#define ACPI_DEVICE_NOTIFY 1 -#define ACPI_MAX_NOTIFY_HANDLER_TYPE 1 +#define ACPI_SYSTEM_NOTIFY 0x1 +#define ACPI_DEVICE_NOTIFY 0x2 +#define ACPI_ALL_NOTIFY 0x3 +#define ACPI_MAX_NOTIFY_HANDLER_TYPE 0x3 #define ACPI_MAX_SYS_NOTIFY 0x7f diff --git a/include/acpi/platform/acenv.h b/include/acpi/platform/acenv.h index 9a0cd41084653..7964aaf6bc979 100644 --- a/include/acpi/platform/acenv.h +++ b/include/acpi/platform/acenv.h @@ -152,12 +152,8 @@ #define COMPILER_DEPENDENT_INT64 long long #define COMPILER_DEPENDENT_UINT64 unsigned long long - -/* Name of host operating system (returned by the _OS_ namespace object) */ - -#define ACPI_OS_NAME "Intel ACPI/CA Core Subsystem" - -/* This macro is used to tag functions as "printf-like" because +/* + * This macro is used to tag functions as "printf-like" because * some compilers can catch printf format string problems. MSVC * doesn't, so this is proprocessed away. */ diff --git a/include/acpi/platform/aclinux.h b/include/acpi/platform/aclinux.h index 82db061afdaa9..f0b87de713c17 100644 --- a/include/acpi/platform/aclinux.h +++ b/include/acpi/platform/aclinux.h @@ -44,8 +44,6 @@ #ifndef __ACLINUX_H__ #define __ACLINUX_H__ -#define ACPI_OS_NAME "Linux" - #define ACPI_USE_SYSTEM_CLIBRARY #define ACPI_USE_DO_WHILE_0 -- 2.53.0