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

Merge tag 'acpi-4.18-rc1-2' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm

Pull additional ACPI updates from Rafael Wysocki:
"These update the ACPICA code in the kernel to upstream revision
20180531 including one important AML parser fix and updates related to
the IORT table, make the kernel recognize the "Windows 2017.2" _OSI
string and update the customized methods documentation.

Specifics:

- Update the ACPICA code in the kernel to upstream revision 20180531
including:
* AML parser fix to continue loading tables after detecting an AML
error (Erik Schmauss).
* AML parser debug option to dump parse trees (Bob Moore).
* Debugger updates (Bob Moore).
* Initial bits of Unload () operator deprecation (Bob Moore).
* Updates related to the IORT table (Robin Murphy).

- Make Linux respond to the "Windows 2017.2" _OSI string which
allows native Thunderbolt enumeration to be used on Dell systems
and was unsafe before recent changes in the PCI subsystem (Mario
Limonciello)

- Update the ACPI method customization feature documentation (Erik
Schmauss)"

* tag 'acpi-4.18-rc1-2' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm:
ACPICA: Recognize the _OSI string "Windows 2017.2"
ACPICA: Update version to 20180531
ACPICA: Interpreter: Begin deprecation of Unload operator
ACPICA: AML parser: attempt to continue loading table after error
ACPICA: Debugger: Reduce verbosity for module-level code errors.
ACPICA: AML Parser: Add debug option to dump parse trees
ACPICA: Debugger: Add count of namespace nodes after namespace dump
ACPICA: IORT: Add PMCG node supprt
ACPICA: IORT: Update for revision D
ACPI / Documentation: update ACPI customize method feature docs

+191 -25
+5 -5
Documentation/acpi/method-customizing.txt
··· 16 16 rebuild/reboot is not needed and test result can be got in minutes. 17 17 18 18 Note: Only ACPI METHOD can be overridden, any other object types like 19 - "Device", "OperationRegion", are not recognized. 19 + "Device", "OperationRegion", are not recognized. Methods 20 + declared inside scope operators are also not supported. 20 21 Note: The same ACPI control method can be overridden for many times, 21 22 and it's always the latest one that used by Linux/kernel. 22 23 Note: To get the ACPI debug object output (Store (AAAA, Debug)), ··· 33 32 34 33 DefinitionBlock ("", "SSDT", 1, "", "", 0x20080715) 35 34 { 36 - External (ACON) 37 - 38 35 Method (\_SB_.AC._PSR, 0, NotSerialized) 39 36 { 40 37 Store ("In AC _PSR", Debug) ··· 41 42 } 42 43 Note that the full pathname of the method in ACPI namespace 43 44 should be used. 44 - And remember to use "External" to declare external objects. 45 45 e) assemble the file to generate the AML code of the method. 46 - e.g. "iasl psr.asl" (psr.aml is generated as a result) 46 + e.g. "iasl -vw 6084 psr.asl" (psr.aml is generated as a result) 47 + If parameter "-vw 6084" is not supported by your iASL compiler, 48 + please try a newer version. 47 49 f) mount debugfs by "mount -t debugfs none /sys/kernel/debug" 48 50 g) override the old method via the debugfs by running 49 51 "cat /tmp/psr.aml > /sys/kernel/debug/acpi/custom_method"
+1
drivers/acpi/acpica/dbnames.c
··· 322 322 acpi_os_printf("Could Not get pathname for object %p\n", 323 323 obj_handle); 324 324 } else { 325 + info.count = 0; 325 326 info.owner_id = ACPI_OWNER_ID_MAX; 326 327 info.debug_level = ACPI_UINT32_MAX; 327 328 info.display_type = ACPI_DISPLAY_SUMMARY | ACPI_DISPLAY_SHORT;
+22 -1
drivers/acpi/acpica/dbobject.c
··· 35 35 acpi_db_dump_method_info(acpi_status status, struct acpi_walk_state *walk_state) 36 36 { 37 37 struct acpi_thread_state *thread; 38 + struct acpi_namespace_node *node; 39 + 40 + node = walk_state->method_node; 41 + 42 + /* There are no locals or arguments for the module-level code case */ 43 + 44 + if (node == acpi_gbl_root_node) { 45 + return; 46 + } 38 47 39 48 /* Ignore control codes, they are not errors */ 40 49 ··· 393 384 struct acpi_namespace_node *node; 394 385 u8 display_locals = FALSE; 395 386 396 - obj_desc = walk_state->method_desc; 397 387 node = walk_state->method_node; 388 + obj_desc = walk_state->method_desc; 389 + 390 + /* There are no locals for the module-level code case */ 391 + 392 + if (node == acpi_gbl_root_node) { 393 + return; 394 + } 398 395 399 396 if (!node) { 400 397 acpi_os_printf ··· 466 451 467 452 node = walk_state->method_node; 468 453 obj_desc = walk_state->method_desc; 454 + 455 + /* There are no arguments for the module-level code case */ 456 + 457 + if (node == acpi_gbl_root_node) { 458 + return; 459 + } 469 460 470 461 if (!node) { 471 462 acpi_os_printf
+9 -3
drivers/acpi/acpica/dsdebug.c
··· 162 162 op->common.next = NULL; 163 163 164 164 #ifdef ACPI_DISASSEMBLER 165 - acpi_os_printf("Failed at "); 166 - acpi_dm_disassemble(next_walk_state, op, 167 - ACPI_UINT32_MAX); 165 + if (walk_state->method_node != 166 + acpi_gbl_root_node) { 167 + 168 + /* More verbose if not module-level code */ 169 + 170 + acpi_os_printf("Failed at "); 171 + acpi_dm_disassemble(next_walk_state, op, 172 + ACPI_UINT32_MAX); 173 + } 168 174 #endif 169 175 op->common.next = next; 170 176 }
+11
drivers/acpi/acpica/exconfig.c
··· 490 490 ACPI_WARNING((AE_INFO, "Received request to unload an ACPI table")); 491 491 492 492 /* 493 + * May 2018: Unload is no longer supported for the following reasons: 494 + * 1) A correct implementation on some hosts may not be possible. 495 + * 2) Other ACPI implementations do not correctly/fully support it. 496 + * 3) It requires host device driver support which does not exist. 497 + * (To properly support namespace unload out from underneath.) 498 + * 4) This AML operator has never been seen in the field. 499 + */ 500 + ACPI_EXCEPTION((AE_INFO, AE_NOT_IMPLEMENTED, 501 + "AML Unload operator is not supported")); 502 + 503 + /* 493 504 * Validate the handle 494 505 * Although the handle is partially validated in acpi_ex_reconfiguration() 495 506 * when it calls acpi_ex_resolve_operands(), the handle is more completely
+3
drivers/acpi/acpica/nsdump.c
··· 170 170 } 171 171 172 172 type = this_node->type; 173 + info->count++; 173 174 174 175 /* Check if the owner matches */ 175 176 ··· 640 639 return; 641 640 } 642 641 642 + info.count = 0; 643 643 info.debug_level = ACPI_LV_TABLES; 644 644 info.owner_id = owner_id; 645 645 info.display_type = display_type; ··· 651 649 acpi_ns_dump_one_object, NULL, 652 650 (void *)&info, NULL); 653 651 652 + acpi_os_printf("\nNamespace node count: %u\n\n", info.count); 654 653 (void)acpi_ut_release_mutex(ACPI_MTX_NAMESPACE); 655 654 } 656 655
+49
drivers/acpi/acpica/psloop.c
··· 515 515 if (ACPI_FAILURE(status)) { 516 516 return_ACPI_STATUS(status); 517 517 } 518 + if (walk_state->opcode == AML_SCOPE_OP) { 519 + /* 520 + * If the scope op fails to parse, skip the body of the 521 + * scope op because the parse failure indicates that the 522 + * device may not exist. 523 + */ 524 + walk_state->parser_state.aml = 525 + walk_state->aml + 1; 526 + walk_state->parser_state.aml = 527 + acpi_ps_get_next_package_end 528 + (&walk_state->parser_state); 529 + walk_state->aml = 530 + walk_state->parser_state.aml; 531 + ACPI_ERROR((AE_INFO, 532 + "Skipping Scope block")); 533 + } 518 534 519 535 continue; 520 536 } ··· 573 557 if (ACPI_FAILURE(status)) { 574 558 return_ACPI_STATUS(status); 575 559 } 560 + if ((walk_state->control_state) && 561 + ((walk_state->control_state->control. 562 + opcode == AML_IF_OP) 563 + || (walk_state->control_state->control. 564 + opcode == AML_WHILE_OP))) { 565 + /* 566 + * If the if/while op fails to parse, we will skip parsing 567 + * the body of the op. 568 + */ 569 + parser_state->aml = 570 + walk_state->control_state->control. 571 + aml_predicate_start + 1; 572 + parser_state->aml = 573 + acpi_ps_get_next_package_end 574 + (parser_state); 575 + walk_state->aml = parser_state->aml; 576 576 577 + ACPI_ERROR((AE_INFO, 578 + "Skipping While/If block")); 579 + if (*walk_state->aml == AML_ELSE_OP) { 580 + ACPI_ERROR((AE_INFO, 581 + "Skipping Else block")); 582 + walk_state->parser_state.aml = 583 + walk_state->aml + 1; 584 + walk_state->parser_state.aml = 585 + acpi_ps_get_next_package_end 586 + (parser_state); 587 + walk_state->aml = 588 + parser_state->aml; 589 + } 590 + ACPI_FREE(acpi_ut_pop_generic_state 591 + (&walk_state->control_state)); 592 + } 593 + op = NULL; 577 594 continue; 578 595 } 579 596 }
+30
drivers/acpi/acpica/psobject.c
··· 12 12 #include "acparser.h" 13 13 #include "amlcode.h" 14 14 #include "acconvert.h" 15 + #include "acnamesp.h" 15 16 16 17 #define _COMPONENT ACPI_PARSER 17 18 ACPI_MODULE_NAME("psobject") ··· 550 549 551 550 do { 552 551 if (*op) { 552 + /* 553 + * These Opcodes need to be removed from the namespace because they 554 + * get created even if these opcodes cannot be created due to 555 + * errors. 556 + */ 557 + if (((*op)->common.aml_opcode == AML_REGION_OP) 558 + || ((*op)->common.aml_opcode == 559 + AML_DATA_REGION_OP)) { 560 + acpi_ns_delete_children((*op)->common. 561 + node); 562 + acpi_ns_remove_node((*op)->common.node); 563 + (*op)->common.node = NULL; 564 + acpi_ps_delete_parse_tree(*op); 565 + } 566 + 553 567 status2 = 554 568 acpi_ps_complete_this_op(walk_state, *op); 555 569 if (ACPI_FAILURE(status2)) { ··· 590 574 #endif 591 575 walk_state->prev_op = NULL; 592 576 walk_state->prev_arg_types = walk_state->arg_types; 577 + 578 + if (walk_state->parse_flags & ACPI_PARSE_MODULE_LEVEL) { 579 + /* 580 + * There was something that went wrong while executing code at the 581 + * module-level. We need to skip parsing whatever caused the 582 + * error and keep going. One runtime error during the table load 583 + * should not cause the entire table to not be loaded. This is 584 + * because there could be correct AML beyond the parts that caused 585 + * the runtime error. 586 + */ 587 + ACPI_ERROR((AE_INFO, 588 + "Ignore error and continue table load")); 589 + return_ACPI_STATUS(AE_OK); 590 + } 593 591 return_ACPI_STATUS(status); 594 592 } 595 593
+31 -3
drivers/acpi/acpica/pswalk.c
··· 25 25 * DESCRIPTION: Delete a portion of or an entire parse tree. 26 26 * 27 27 ******************************************************************************/ 28 + #include "amlcode.h" 28 29 void acpi_ps_delete_parse_tree(union acpi_parse_object *subtree_root) 29 30 { 30 31 union acpi_parse_object *op = subtree_root; 31 32 union acpi_parse_object *next = NULL; 32 33 union acpi_parse_object *parent = NULL; 34 + u32 level = 0; 33 35 34 36 ACPI_FUNCTION_TRACE_PTR(ps_delete_parse_tree, subtree_root); 37 + 38 + ACPI_DEBUG_PRINT((ACPI_DB_PARSE_TREES, " root %p\n", subtree_root)); 35 39 36 40 /* Visit all nodes in the subtree */ 37 41 38 42 while (op) { 39 - 40 - /* Check if we are not ascending */ 41 - 42 43 if (op != parent) { 44 + 45 + /* This is the descending case */ 46 + 47 + if (ACPI_IS_DEBUG_ENABLED 48 + (ACPI_LV_PARSE_TREES, _COMPONENT)) { 49 + 50 + /* This debug option will print the entire parse tree */ 51 + 52 + acpi_os_printf(" %*.s%s %p", (level * 4), 53 + " ", 54 + acpi_ps_get_opcode_name(op-> 55 + common. 56 + aml_opcode), 57 + op); 58 + 59 + if (op->named.aml_opcode == AML_INT_NAMEPATH_OP) { 60 + acpi_os_printf(" %4.4s", 61 + op->common.value.string); 62 + } 63 + if (op->named.aml_opcode == AML_STRING_OP) { 64 + acpi_os_printf(" %s", 65 + op->common.value.string); 66 + } 67 + acpi_os_printf("\n"); 68 + } 43 69 44 70 /* Look for an argument or child of the current op */ 45 71 ··· 75 49 /* Still going downward in tree (Op is not completed yet) */ 76 50 77 51 op = next; 52 + level++; 78 53 continue; 79 54 } 80 55 } ··· 96 69 if (next) { 97 70 op = next; 98 71 } else { 72 + level--; 99 73 op = parent; 100 74 } 101 75 }
+5 -5
drivers/acpi/acpica/uterror.c
··· 182 182 switch (lookup_status) { 183 183 case AE_ALREADY_EXISTS: 184 184 185 - acpi_os_printf(ACPI_MSG_BIOS_ERROR); 185 + acpi_os_printf("\n" ACPI_MSG_BIOS_ERROR); 186 186 message = "Failure creating"; 187 187 break; 188 188 189 189 case AE_NOT_FOUND: 190 190 191 - acpi_os_printf(ACPI_MSG_BIOS_ERROR); 192 - message = "Failure looking up"; 191 + acpi_os_printf("\n" ACPI_MSG_BIOS_ERROR); 192 + message = "Could not resolve"; 193 193 break; 194 194 195 195 default: 196 196 197 - acpi_os_printf(ACPI_MSG_ERROR); 198 - message = "Failure looking up"; 197 + acpi_os_printf("\n" ACPI_MSG_ERROR); 198 + message = "Failure resolving"; 199 199 break; 200 200 } 201 201
+1
drivers/acpi/acpica/utosi.c
··· 69 69 {"Windows 2015", NULL, 0, ACPI_OSI_WIN_10}, /* Windows 10 - Added 03/2015 */ 70 70 {"Windows 2016", NULL, 0, ACPI_OSI_WIN_10_RS1}, /* Windows 10 version 1607 - Added 12/2017 */ 71 71 {"Windows 2017", NULL, 0, ACPI_OSI_WIN_10_RS2}, /* Windows 10 version 1703 - Added 12/2017 */ 72 + {"Windows 2017.2", NULL, 0, ACPI_OSI_WIN_10_RS3}, /* Windows 10 version 1709 - Added 02/2018 */ 72 73 73 74 /* Feature Group Strings */ 74 75
+3 -1
include/acpi/acoutput.h
··· 80 80 #define ACPI_LV_ALLOCATIONS 0x00100000 81 81 #define ACPI_LV_FUNCTIONS 0x00200000 82 82 #define ACPI_LV_OPTIMIZATIONS 0x00400000 83 - #define ACPI_LV_VERBOSITY2 0x00700000 | ACPI_LV_VERBOSITY1 83 + #define ACPI_LV_PARSE_TREES 0x00800000 84 + #define ACPI_LV_VERBOSITY2 0x00F00000 | ACPI_LV_VERBOSITY1 84 85 #define ACPI_LV_ALL ACPI_LV_VERBOSITY2 85 86 86 87 /* Trace verbosity level 3 [Threading, I/O, and Interrupts] */ ··· 132 131 #define ACPI_DB_TABLES ACPI_DEBUG_LEVEL (ACPI_LV_TABLES) 133 132 #define ACPI_DB_FUNCTIONS ACPI_DEBUG_LEVEL (ACPI_LV_FUNCTIONS) 134 133 #define ACPI_DB_OPTIMIZATIONS ACPI_DEBUG_LEVEL (ACPI_LV_OPTIMIZATIONS) 134 + #define ACPI_DB_PARSE_TREES ACPI_DEBUG_LEVEL (ACPI_LV_PARSE_TREES) 135 135 #define ACPI_DB_VALUES ACPI_DEBUG_LEVEL (ACPI_LV_VALUES) 136 136 #define ACPI_DB_OBJECTS ACPI_DEBUG_LEVEL (ACPI_LV_OBJECTS) 137 137 #define ACPI_DB_ALLOCATIONS ACPI_DEBUG_LEVEL (ACPI_LV_ALLOCATIONS)
+1 -1
include/acpi/acpixf.h
··· 12 12 13 13 /* Current ACPICA subsystem version in YYYYMMDD format */ 14 14 15 - #define ACPI_CA_VERSION 0x20180508 15 + #define ACPI_CA_VERSION 0x20180531 16 16 17 17 #include <acpi/acconfig.h> 18 18 #include <acpi/actypes.h>
+19 -6
include/acpi/actbl2.h
··· 67 67 * IORT - IO Remapping Table 68 68 * 69 69 * Conforms to "IO Remapping Table System Software on ARM Platforms", 70 - * Document number: ARM DEN 0049C, May 2017 70 + * Document number: ARM DEN 0049D, March 2018 71 71 * 72 72 ******************************************************************************/ 73 73 ··· 98 98 ACPI_IORT_NODE_NAMED_COMPONENT = 0x01, 99 99 ACPI_IORT_NODE_PCI_ROOT_COMPLEX = 0x02, 100 100 ACPI_IORT_NODE_SMMU = 0x03, 101 - ACPI_IORT_NODE_SMMU_V3 = 0x04 101 + ACPI_IORT_NODE_SMMU_V3 = 0x04, 102 + ACPI_IORT_NODE_PMCG = 0x05 102 103 }; 103 104 104 105 struct acpi_iort_id_mapping { ··· 153 152 char device_name[1]; /* Path of namespace object */ 154 153 }; 155 154 155 + /* Masks for Flags field above */ 156 + 157 + #define ACPI_IORT_NC_STALL_SUPPORTED (1) 158 + #define ACPI_IORT_NC_PASID_BITS (31<<1) 159 + 156 160 struct acpi_iort_root_complex { 157 161 u64 memory_properties; /* Memory access properties */ 158 162 u32 ats_attribute; 159 163 u32 pci_segment_number; 164 + u8 memory_address_limit; /* Memory address size limit */ 165 + u8 reserved[3]; /* Reserved, must be zero */ 160 166 }; 161 167 162 168 /* Values for ats_attribute field above */ ··· 217 209 u32 pri_gsiv; 218 210 u32 gerr_gsiv; 219 211 u32 sync_gsiv; 220 - u8 pxm; 221 - u8 reserved1; 222 - u16 reserved2; 212 + u32 pxm; 223 213 u32 id_mapping_index; 224 214 }; 225 215 ··· 230 224 /* Masks for Flags field above */ 231 225 232 226 #define ACPI_IORT_SMMU_V3_COHACC_OVERRIDE (1) 233 - #define ACPI_IORT_SMMU_V3_HTTU_OVERRIDE (1<<1) 227 + #define ACPI_IORT_SMMU_V3_HTTU_OVERRIDE (3<<1) 234 228 #define ACPI_IORT_SMMU_V3_PXM_VALID (1<<3) 229 + 230 + struct acpi_iort_pmcg { 231 + u64 page0_base_address; 232 + u32 overflow_gsiv; 233 + u32 node_reference; 234 + u64 page1_base_address; 235 + }; 235 236 236 237 /******************************************************************************* 237 238 *
+1
include/acpi/actypes.h
··· 1272 1272 #define ACPI_OSI_WIN_10 0x0D 1273 1273 #define ACPI_OSI_WIN_10_RS1 0x0E 1274 1274 #define ACPI_OSI_WIN_10_RS2 0x0F 1275 + #define ACPI_OSI_WIN_10_RS3 0x10 1275 1276 1276 1277 /* Definitions of getopt */ 1277 1278