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 57 acpi_status acpi_ns_initialize_devices(u32 flags); 58 59 /* 60 * nsload - Namespace loading 61 */
··· 56 57 acpi_status acpi_ns_initialize_devices(u32 flags); 58 59 + acpi_status 60 + acpi_ns_init_one_package(acpi_handle obj_handle, 61 + u32 level, void *context, void **return_value); 62 + 63 /* 64 * nsload - Namespace loading 65 */
+14
drivers/acpi/acpica/exconfig.c
··· 174 return_ACPI_STATUS(status); 175 } 176 177 /* Parameter Data (optional) */ 178 179 if (parameter_node) { ··· 436 437 return_ACPI_STATUS(status); 438 } 439 440 /* Store the ddb_handle into the Target operand */ 441
··· 174 return_ACPI_STATUS(status); 175 } 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 + 184 /* Parameter Data (optional) */ 185 186 if (parameter_node) { ··· 429 430 return_ACPI_STATUS(status); 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 440 /* Store the ddb_handle into the Target operand */ 441
+56 -20
drivers/acpi/acpica/nsinit.c
··· 242 243 /******************************************************************************* 244 * 245 * FUNCTION: acpi_ns_init_one_object 246 * 247 * PARAMETERS: obj_handle - Node ··· 412 413 case ACPI_TYPE_PACKAGE: 414 415 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; 436 break; 437 438 default:
··· 242 243 /******************************************************************************* 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 + * 297 * FUNCTION: acpi_ns_init_one_object 298 * 299 * PARAMETERS: obj_handle - Node ··· 360 361 case ACPI_TYPE_PACKAGE: 362 363 + /* Complete the initialization/resolution of the package object */ 364 + 365 info->package_init++; 366 + status = 367 + acpi_ns_init_one_package(obj_handle, level, NULL, NULL); 368 break; 369 370 default: