Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Merge tag 'acpi-4.17-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm

Pull ACPI fix from Rafael Wysocki:
"Fix an ACPICA regression introduced in this cycle and related to the
handling of package objects loaded by the Load and loadTable AML
operators that are not initialized properly after recent changes (Bob
Moore)"

* tag 'acpi-4.17-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm:
ACPICA: Add deferred package support for the Load and loadTable operators

+74 -20
+4
drivers/acpi/acpica/acnamesp.h
··· 56 56 57 57 acpi_status acpi_ns_initialize_devices(u32 flags); 58 58 59 + acpi_status 60 + acpi_ns_init_one_package(acpi_handle obj_handle, 61 + u32 level, void *context, void **return_value); 62 + 59 63 /* 60 64 * nsload - Namespace loading 61 65 */
+14
drivers/acpi/acpica/exconfig.c
··· 174 174 return_ACPI_STATUS(status); 175 175 } 176 176 177 + /* Complete the initialization/resolution of package objects */ 178 + 179 + status = acpi_ns_walk_namespace(ACPI_TYPE_PACKAGE, ACPI_ROOT_OBJECT, 180 + ACPI_UINT32_MAX, 0, 181 + acpi_ns_init_one_package, NULL, NULL, 182 + NULL); 183 + 177 184 /* Parameter Data (optional) */ 178 185 179 186 if (parameter_node) { ··· 436 429 437 430 return_ACPI_STATUS(status); 438 431 } 432 + 433 + /* Complete the initialization/resolution of package objects */ 434 + 435 + status = acpi_ns_walk_namespace(ACPI_TYPE_PACKAGE, ACPI_ROOT_OBJECT, 436 + ACPI_UINT32_MAX, 0, 437 + acpi_ns_init_one_package, NULL, NULL, 438 + NULL); 439 439 440 440 /* Store the ddb_handle into the Target operand */ 441 441
+56 -20
drivers/acpi/acpica/nsinit.c
··· 242 242 243 243 /******************************************************************************* 244 244 * 245 + * FUNCTION: acpi_ns_init_one_package 246 + * 247 + * PARAMETERS: obj_handle - Node 248 + * level - Current nesting level 249 + * context - Not used 250 + * return_value - Not used 251 + * 252 + * RETURN: Status 253 + * 254 + * DESCRIPTION: Callback from acpi_walk_namespace. Invoked for every package 255 + * within the namespace. Used during dynamic load of an SSDT. 256 + * 257 + ******************************************************************************/ 258 + 259 + acpi_status 260 + acpi_ns_init_one_package(acpi_handle obj_handle, 261 + u32 level, void *context, void **return_value) 262 + { 263 + acpi_status status; 264 + union acpi_operand_object *obj_desc; 265 + struct acpi_namespace_node *node = 266 + (struct acpi_namespace_node *)obj_handle; 267 + 268 + obj_desc = acpi_ns_get_attached_object(node); 269 + if (!obj_desc) { 270 + return (AE_OK); 271 + } 272 + 273 + /* Exit if package is already initialized */ 274 + 275 + if (obj_desc->package.flags & AOPOBJ_DATA_VALID) { 276 + return (AE_OK); 277 + } 278 + 279 + status = acpi_ds_get_package_arguments(obj_desc); 280 + if (ACPI_FAILURE(status)) { 281 + return (AE_OK); 282 + } 283 + 284 + status = 285 + acpi_ut_walk_package_tree(obj_desc, NULL, 286 + acpi_ds_init_package_element, NULL); 287 + if (ACPI_FAILURE(status)) { 288 + return (AE_OK); 289 + } 290 + 291 + obj_desc->package.flags |= AOPOBJ_DATA_VALID; 292 + return (AE_OK); 293 + } 294 + 295 + /******************************************************************************* 296 + * 245 297 * FUNCTION: acpi_ns_init_one_object 246 298 * 247 299 * PARAMETERS: obj_handle - Node ··· 412 360 413 361 case ACPI_TYPE_PACKAGE: 414 362 363 + /* Complete the initialization/resolution of the package object */ 364 + 415 365 info->package_init++; 416 - status = acpi_ds_get_package_arguments(obj_desc); 417 - if (ACPI_FAILURE(status)) { 418 - break; 419 - } 420 - 421 - ACPI_DEBUG_PRINT_RAW((ACPI_DB_PARSE, 422 - "%s: Completing resolution of Package elements\n", 423 - ACPI_GET_FUNCTION_NAME)); 424 - 425 - /* 426 - * Resolve all named references in package objects (and all 427 - * sub-packages). This action has been deferred until the entire 428 - * namespace has been loaded, in order to support external and 429 - * forward references from individual package elements (05/2017). 430 - */ 431 - status = acpi_ut_walk_package_tree(obj_desc, NULL, 432 - acpi_ds_init_package_element, 433 - NULL); 434 - 435 - obj_desc->package.flags |= AOPOBJ_DATA_VALID; 366 + status = 367 + acpi_ns_init_one_package(obj_handle, level, NULL, NULL); 436 368 break; 437 369 438 370 default: