ACPICA: Namespace: Ensure \_SB._INI executed before any _REG
ACPICA commit 8ae25b8d128b6b8509010be321ff6bf2760f3807 There is BIOS code relying on the fact that \_SB._INI should get evaluated before any other control methods. This may implies a gap in ACPICA/Linux initialization/enumeration process. Before revealing Windows true behavior by more validations, this patch only ensures \_SB._INI evaluated before any _REG control methods. This can help to make progress to other initialization order fixes. Lv Zheng. Link: https://github.com/acpica/acpica/commit/8ae25b8d Signed-off-by: Lv Zheng <lv.zheng@intel.com> Signed-off-by: Bob Moore <robert.moore@intel.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
This commit is contained in:
parent
9559130b11
commit
ced043663e
@ -88,7 +88,7 @@
|
|||||||
*/
|
*/
|
||||||
acpi_status acpi_ns_initialize_objects(void);
|
acpi_status acpi_ns_initialize_objects(void);
|
||||||
|
|
||||||
acpi_status acpi_ns_initialize_devices(void);
|
acpi_status acpi_ns_initialize_devices(u32 flags);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* nsload - Namespace loading
|
* nsload - Namespace loading
|
||||||
|
@ -46,6 +46,7 @@
|
|||||||
#include "acnamesp.h"
|
#include "acnamesp.h"
|
||||||
#include "acdispat.h"
|
#include "acdispat.h"
|
||||||
#include "acinterp.h"
|
#include "acinterp.h"
|
||||||
|
#include "acevents.h"
|
||||||
|
|
||||||
#define _COMPONENT ACPI_NAMESPACE
|
#define _COMPONENT ACPI_NAMESPACE
|
||||||
ACPI_MODULE_NAME("nsinit")
|
ACPI_MODULE_NAME("nsinit")
|
||||||
@ -133,13 +134,17 @@ acpi_status acpi_ns_initialize_objects(void)
|
|||||||
*
|
*
|
||||||
******************************************************************************/
|
******************************************************************************/
|
||||||
|
|
||||||
acpi_status acpi_ns_initialize_devices(void)
|
acpi_status acpi_ns_initialize_devices(u32 flags)
|
||||||
{
|
{
|
||||||
acpi_status status;
|
acpi_status status;
|
||||||
struct acpi_device_walk_info info;
|
struct acpi_device_walk_info info;
|
||||||
|
|
||||||
ACPI_FUNCTION_TRACE(ns_initialize_devices);
|
ACPI_FUNCTION_TRACE(ns_initialize_devices);
|
||||||
|
|
||||||
|
if (!(flags & ACPI_NO_DEVICE_INIT)) {
|
||||||
|
ACPI_DEBUG_PRINT((ACPI_DB_EXEC,
|
||||||
|
"[Init] Initializing ACPI Devices\n"));
|
||||||
|
|
||||||
/* Init counters */
|
/* Init counters */
|
||||||
|
|
||||||
info.device_count = 0;
|
info.device_count = 0;
|
||||||
@ -154,8 +159,8 @@ acpi_status acpi_ns_initialize_devices(void)
|
|||||||
|
|
||||||
status = acpi_ns_walk_namespace(ACPI_TYPE_ANY, ACPI_ROOT_OBJECT,
|
status = acpi_ns_walk_namespace(ACPI_TYPE_ANY, ACPI_ROOT_OBJECT,
|
||||||
ACPI_UINT32_MAX, FALSE,
|
ACPI_UINT32_MAX, FALSE,
|
||||||
acpi_ns_find_ini_methods, NULL, &info,
|
acpi_ns_find_ini_methods, NULL,
|
||||||
NULL);
|
&info, NULL);
|
||||||
if (ACPI_FAILURE(status)) {
|
if (ACPI_FAILURE(status)) {
|
||||||
goto error_exit;
|
goto error_exit;
|
||||||
}
|
}
|
||||||
@ -170,9 +175,9 @@ acpi_status acpi_ns_initialize_devices(void)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Execute the "global" _INI method that may appear at the root. This
|
* Execute the "global" _INI method that may appear at the root.
|
||||||
* support is provided for Windows compatibility (Vista+) and is not
|
* This support is provided for Windows compatibility (Vista+) and
|
||||||
* part of the ACPI specification.
|
* is not part of the ACPI specification.
|
||||||
*/
|
*/
|
||||||
info.evaluate_info->prefix_node = acpi_gbl_root_node;
|
info.evaluate_info->prefix_node = acpi_gbl_root_node;
|
||||||
info.evaluate_info->relative_pathname = METHOD_NAME__INI;
|
info.evaluate_info->relative_pathname = METHOD_NAME__INI;
|
||||||
@ -183,13 +188,33 @@ acpi_status acpi_ns_initialize_devices(void)
|
|||||||
if (ACPI_SUCCESS(status)) {
|
if (ACPI_SUCCESS(status)) {
|
||||||
info.num_INI++;
|
info.num_INI++;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Run all _REG methods
|
||||||
|
*
|
||||||
|
* Note: Any objects accessed by the _REG methods will be automatically
|
||||||
|
* initialized, even if they contain executable AML (see the call to
|
||||||
|
* acpi_ns_initialize_objects below).
|
||||||
|
*/
|
||||||
|
if (!(flags & ACPI_NO_ADDRESS_SPACE_INIT)) {
|
||||||
|
ACPI_DEBUG_PRINT((ACPI_DB_EXEC,
|
||||||
|
"[Init] Executing _REG OpRegion methods\n"));
|
||||||
|
|
||||||
|
status = acpi_ev_initialize_op_regions();
|
||||||
|
if (ACPI_FAILURE(status)) {
|
||||||
|
goto error_exit;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!(flags & ACPI_NO_DEVICE_INIT)) {
|
||||||
|
|
||||||
/* Walk namespace to execute all _INIs on present devices */
|
/* Walk namespace to execute all _INIs on present devices */
|
||||||
|
|
||||||
status = acpi_ns_walk_namespace(ACPI_TYPE_ANY, ACPI_ROOT_OBJECT,
|
status = acpi_ns_walk_namespace(ACPI_TYPE_ANY, ACPI_ROOT_OBJECT,
|
||||||
ACPI_UINT32_MAX, FALSE,
|
ACPI_UINT32_MAX, FALSE,
|
||||||
acpi_ns_init_one_device, NULL, &info,
|
acpi_ns_init_one_device, NULL,
|
||||||
NULL);
|
&info, NULL);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Any _OSI requests should be completed by now. If the BIOS has
|
* Any _OSI requests should be completed by now. If the BIOS has
|
||||||
@ -208,7 +233,9 @@ acpi_status acpi_ns_initialize_devices(void)
|
|||||||
ACPI_DEBUG_PRINT_RAW((ACPI_DB_INIT,
|
ACPI_DEBUG_PRINT_RAW((ACPI_DB_INIT,
|
||||||
" Executed %u _INI methods requiring %u _STA executions "
|
" Executed %u _INI methods requiring %u _STA executions "
|
||||||
"(examined %u objects)\n",
|
"(examined %u objects)\n",
|
||||||
info.num_INI, info.num_STA, info.device_count));
|
info.num_INI, info.num_STA,
|
||||||
|
info.device_count));
|
||||||
|
}
|
||||||
|
|
||||||
return_ACPI_STATUS(status);
|
return_ACPI_STATUS(status);
|
||||||
|
|
||||||
|
@ -301,33 +301,14 @@ acpi_status __init acpi_initialize_objects(u32 flags)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* Run all _REG methods
|
|
||||||
*
|
|
||||||
* Note: Any objects accessed by the _REG methods will be automatically
|
|
||||||
* initialized, even if they contain executable AML (see the call to
|
|
||||||
* acpi_ns_initialize_objects below).
|
|
||||||
*/
|
|
||||||
acpi_gbl_reg_methods_enabled = TRUE;
|
acpi_gbl_reg_methods_enabled = TRUE;
|
||||||
if (!(flags & ACPI_NO_ADDRESS_SPACE_INIT)) {
|
|
||||||
ACPI_DEBUG_PRINT((ACPI_DB_EXEC,
|
|
||||||
"[Init] Executing _REG OpRegion methods\n"));
|
|
||||||
|
|
||||||
status = acpi_ev_initialize_op_regions();
|
|
||||||
if (ACPI_FAILURE(status)) {
|
|
||||||
return_ACPI_STATUS(status);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Initialize all device objects in the namespace. This runs the device
|
* Initialize all device/region objects in the namespace. This runs
|
||||||
* _STA and _INI methods.
|
* the device _STA and _INI methods and region _REG methods.
|
||||||
*/
|
*/
|
||||||
if (!(flags & ACPI_NO_DEVICE_INIT)) {
|
if (!(flags & (ACPI_NO_DEVICE_INIT | ACPI_NO_ADDRESS_SPACE_INIT))) {
|
||||||
ACPI_DEBUG_PRINT((ACPI_DB_EXEC,
|
status = acpi_ns_initialize_devices(flags);
|
||||||
"[Init] Initializing ACPI Devices\n"));
|
|
||||||
|
|
||||||
status = acpi_ns_initialize_devices();
|
|
||||||
if (ACPI_FAILURE(status)) {
|
if (ACPI_FAILURE(status)) {
|
||||||
return_ACPI_STATUS(status);
|
return_ACPI_STATUS(status);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user