History

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

Pull ACPI updates from Rafael Wysocki: "These update the ACPICA code in the kernel to upstream revision 20190703, fix up the handling of GPEs in ACPICA, allow some more ACPI code to be built on ARM64 platforms, allow BGRT to be overridden, fix minor issues and clean up assorted pieces of ACPI code. Specifics: - Update the ACPICA code in the kernel to upstream revision 20190703 including: - Initial/default namespace creation simplification (Bob Moore). - Object initialization sequence update (Bob Moore). - Removal of legacy module-level (dead) code (Erik Schmauss). - Table load object initialization update (Erik Schmauss, Nikolaus Voss). - Fix GPE enabling issue in ACPICA causing premature wakeups from suspend-to-idle to occur (Rafael Wysocki). - Allow ACPI AC and battery drivers to be built on non-X86 (Ard Biesheuvel). - Fix address space handler removal in the ACPI PMIC driver for Intel platforms (Andy Shevchenko). - Allow BGRT to be overridden via initrd or configfs (Andrea Oliveri). - Fix object resolution on table loads via configfs (Nikolaus Voss). - Clean up assorted pieces of ACPI code and tools (Colin Ian King, Liguang Zhang, Masahiro Yamada). - Fix documentation build warning, convert the extcon document to ReST and add it to the ACPI documentation (Mauro Carvalho Chehab, Qian Cai)" * tag 'acpi-5.3-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm: ACPI / APEI: Remove needless __ghes_check_estatus() calls ACPICA: Update version to 20190703 ACPICA: Update table load object initialization ACPICA: Update for object initialization sequence ACPICA: remove legacy module-level code due to deprecation ACPICA: Namespace: simplify creation of the initial/default namespace ACPI / PMIC: intel: Drop double removal of address space handler ACPI: APD: remove redundant assignment to pointer clk docs: extcon: convert it to ReST and move to ACPI dir ACPI: Make AC and battery drivers available on !X86 ACPICA: Clear status of GPEs on first direct enable ACPI: configfs: Resolve objects on host-directed table loads ACPI: tables: Allow BGRT to be overridden ACPI: OSL: Make a W=1 kernel-doc warning go away ACPI: tools: Exclude tools/* from .gitignore patterns

Linus Torvalds committed 7 years ago

Commit 4b470452 parents cf2d213 64372c031 files · +131 −337Browse files

Unified · Split

31 files
  1. Documentation/firmware-guide/acpi/extcon-intel-int3496.rst +10 −4
  2. Documentation/firmware-guide/acpi/index.rst +1 −0
  3. MAINTAINERS +3 −3
  4. drivers/acpi/Kconfig +0 −2
  5. drivers/acpi/acpi_apd.c +1 −1
  6. drivers/acpi/acpi_configfs.c +1 −5
  7. drivers/acpi/acpica/acevents.h +2 −1
  8. drivers/acpi/acpica/acglobal.h +0 −1
  9. drivers/acpi/acpica/acnamesp.h +0 −2
  10. drivers/acpi/acpica/dsinit.c +1 −1
  11. drivers/acpi/acpica/evgpe.c +7 −1
  12. drivers/acpi/acpica/evgpeblk.c +1 −1
  13. drivers/acpi/acpica/evxface.c +1 −1
  14. drivers/acpi/acpica/evxfgpe.c +1 −1
  15. drivers/acpi/acpica/exconfig.c +6 −10
  16. drivers/acpi/acpica/nsaccess.c +43 −11
  17. drivers/acpi/acpica/nseval.c +0 −190
  18. drivers/acpi/acpica/nsinit.c +19 −30
  19. drivers/acpi/acpica/nsload.c +0 −12
  20. drivers/acpi/acpica/nsutils.c +0 −12
  21. drivers/acpi/acpica/tbdata.c +0 −13
  22. drivers/acpi/acpica/tbxfload.c +7 −0
  23. drivers/acpi/acpica/utinit.c +0 −1
  24. drivers/acpi/acpica/utxfinit.c +6 −12
  25. drivers/acpi/apei/ghes.c +1 −1
  26. drivers/acpi/osl.c +2 −2
  27. drivers/acpi/pmic/intel_pmic.c +0 −2
  28. drivers/acpi/tables.c +11 −10
  29. include/acpi/acpi_io.h +2 −2
  30. include/acpi/acpixf.h +1 −1
  31. tools/power/acpi/.gitignore +4 −4
Documentation/firmware-guide/acpi/extcon-intel-int3496.rstrenamed from Documentation/extcon/intel-int3496.txt+10−4
@@ -1,5 +1,6 @@
1+=====================================================
12 Intel INT3496 ACPI device extcon driver documentation
2−-----------------------------------------------------
3+=====================================================
34
45 The Intel INT3496 ACPI device extcon driver is a driver for ACPI
56 devices with an acpi-id of INT3496, such as found for example on
@@ -13,15 +14,20 @@ between an USB host and an USB peripheral controller. · 7 unmodified lines
1314 The ACPI devices exposes this functionality by returning an array with up
1415 to 3 gpio descriptors from its ACPI _CRS (Current Resource Settings) call:
1516
16−Index 0: The input gpio for the id-pin, this is always present and valid
17−Index 1: The output gpio for enabling Vbus output from the device to the otg
17+======= =====================================================================
18+Index 0 The input gpio for the id-pin, this is always present and valid
19+Index 1 The output gpio for enabling Vbus output from the device to the otg
1820 port, write 1 to enable the Vbus output (this gpio descriptor may
1921 be absent or invalid)
20−Index 2: The output gpio for muxing of the data pins between the USB host and
22+Index 2 The output gpio for muxing of the data pins between the USB host and
2123 the USB peripheral controller, write 1 to mux to the peripheral
2224 controller
25+======= =====================================================================
2326
2427 There is a mapping between indices and GPIO connection IDs as follows
28+
29+ ======= =======
2530 id index 0
2631 vbus index 1
2732 mux index 2
33+ ======= =======
Documentation/firmware-guide/acpi/index.rst+1−0
@@ -24,3 +24,4 @@ ACPI Support · 23 unmodified lines
2424 acpi-lid
2525 lpit
2626 video_extension
27+ extcon-intel-int3496
MAINTAINERS+3−3
@@ -321,7 +321,7 @@ F: drivers/pnp/pnpacpi/ · 320 unmodified lines
321321 F: include/linux/acpi.h
322322 F: include/linux/fwnode.h
323323 F: include/acpi/
324−F: Documentation/acpi/
324+F: Documentation/firmware-guide/acpi/
325325 F: Documentation/ABI/testing/sysfs-bus-acpi
326326 F: Documentation/ABI/testing/configfs-acpi
327327 F: drivers/pci/*acpi*
@@ -4893,7 +4893,7 @@ S: Maintained · 4565 unmodified lines
48934893 F: Documentation/
48944894 F: scripts/kernel-doc
48954895 X: Documentation/ABI/
4896−X: Documentation/acpi/
4896+X: Documentation/firmware-guide/acpi/
48974897 X: Documentation/devicetree/
48984898 X: Documentation/i2c/
48994899 X: Documentation/media/
@@ -6069,7 +6069,7 @@ S: Maintained · 1169 unmodified lines
60696069 F: drivers/extcon/
60706070 F: include/linux/extcon/
60716071 F: include/linux/extcon.h
6072−F: Documentation/extcon/
6072+F: Documentation/firmware-guide/acpi/extcon-intel-int3496.rst
60736073 F: Documentation/devicetree/bindings/extcon/
60746074
60756075 EXYNOS DP DRIVER
drivers/acpi/Kconfig+0−2
@@ -155,7 +155,6 @@ config ACPI_EC_DEBUGFS · 154 unmodified lines
155155
156156 config ACPI_AC
157157 tristate "AC Adapter"
158− depends on X86
159158 select POWER_SUPPLY
160159 default y
161160 help
@@ -168,7 +167,6 @@ config ACPI_AC · 6 unmodified lines
168167
169168 config ACPI_BATTERY
170169 tristate "Battery"
171− depends on X86
172170 select POWER_SUPPLY
173171 default y
174172 help
drivers/acpi/acpi_apd.c+1−1
@@ -57,7 +57,7 @@ struct apd_private_data { · 56 unmodified lines
5757 static int acpi_apd_setup(struct apd_private_data *pdata)
5858 {
5959 const struct apd_device_desc *dev_desc = pdata->dev_desc;
60− struct clk *clk = ERR_PTR(-ENODEV);
60+ struct clk *clk;
6161
6262 if (dev_desc->fixed_clk_rate) {
6363 clk = clk_register_fixed_rate(&pdata->adev->dev,
drivers/acpi/acpi_configfs.c+1−5
@@ -53,11 +53,7 @@ static ssize_t acpi_table_aml_write(struct config_item *cfg, · 52 unmodified lines
5353 if (!table->header)
5454 return -ENOMEM;
5555
56− ACPI_INFO(("Host-directed Dynamic ACPI Table Load:"));
57− ret = acpi_tb_install_and_load_table(
58− ACPI_PTR_TO_PHYSADDR(table->header),
59− ACPI_TABLE_ORIGIN_EXTERNAL_VIRTUAL, FALSE,
60− &table->index);
56+ ret = acpi_load_table(table->header);
6157 if (ret) {
6258 kfree(table->header);
6359 table->header = NULL;
drivers/acpi/acpica/acevents.h+2−1
@@ -69,7 +69,8 @@ acpi_status · 68 unmodified lines
6969 acpi_ev_mask_gpe(struct acpi_gpe_event_info *gpe_event_info, u8 is_masked);
7070
7171 acpi_status
72−acpi_ev_add_gpe_reference(struct acpi_gpe_event_info *gpe_event_info);
72+acpi_ev_add_gpe_reference(struct acpi_gpe_event_info *gpe_event_info,
73+ u8 clear_on_enable);
7374
7475 acpi_status
7576 acpi_ev_remove_gpe_reference(struct acpi_gpe_event_info *gpe_event_info);
drivers/acpi/acpica/acglobal.h+0−1
@@ -178,7 +178,6 @@ ACPI_GLOBAL(u8, acpi_gbl_verbose_leak_dump); · 177 unmodified lines
178178 ACPI_GLOBAL(struct acpi_namespace_node, acpi_gbl_root_node_struct);
179179 ACPI_GLOBAL(struct acpi_namespace_node *, acpi_gbl_root_node);
180180 ACPI_GLOBAL(struct acpi_namespace_node *, acpi_gbl_fadt_gpe_device);
181−ACPI_GLOBAL(union acpi_operand_object *, acpi_gbl_module_code_list);
182181
183182 extern const u8 acpi_gbl_ns_properties[ACPI_NUM_NS_TYPES];
184183 extern const struct acpi_predefined_names
drivers/acpi/acpica/acnamesp.h+0−2
@@ -207,8 +207,6 @@ acpi_ns_dump_object_paths(acpi_object_type type, · 206 unmodified lines
207207 */
208208 acpi_status acpi_ns_evaluate(struct acpi_evaluate_info *info);
209209
210−void acpi_ns_exec_module_code_list(void);
211−
212210 /*
213211 * nsarguments - Argument count/type checking for predefined/reserved names
214212 */
drivers/acpi/acpica/dsinit.c+1−1
@@ -202,7 +202,7 @@ acpi_ds_initialize_objects(u32 table_index, · 201 unmodified lines
202202
203203 if (ACPI_COMPARE_NAMESEG(table->signature, ACPI_SIG_DSDT)) {
204204 ACPI_DEBUG_PRINT_RAW((ACPI_DB_INIT,
205− "\nInitializing Namespace objects:\n"));
205+ "\nACPI table initialization:\n"));
206206 }
207207
208208 /* Summary of objects initialized */
drivers/acpi/acpica/evgpe.c+7−1
@@ -146,6 +146,7 @@ acpi_ev_mask_gpe(struct acpi_gpe_event_info *gpe_event_info, u8 is_masked) · 145 unmodified lines
146146 * FUNCTION: acpi_ev_add_gpe_reference
147147 *
148148 * PARAMETERS: gpe_event_info - Add a reference to this GPE
149+ * clear_on_enable - Clear GPE status before enabling it
149150 *
150151 * RETURN: Status
151152 *
@@ -155,7 +156,8 @@ acpi_ev_mask_gpe(struct acpi_gpe_event_info *gpe_event_info, u8 is_masked) · 3 unmodified lines
155156 ******************************************************************************/
156157
157158 acpi_status
158−acpi_ev_add_gpe_reference(struct acpi_gpe_event_info *gpe_event_info)
159+acpi_ev_add_gpe_reference(struct acpi_gpe_event_info *gpe_event_info,
160+ u8 clear_on_enable)
159161 {
160162 acpi_status status = AE_OK;
161163
@@ -170,6 +172,10 @@ acpi_ev_add_gpe_reference(struct acpi_gpe_event_info *gpe_event_info) · 8 unmodified lines
170172
171173 /* Enable on first reference */
172174
175+ if (clear_on_enable) {
176+ (void)acpi_hw_clear_gpe(gpe_event_info);
177+ }
178+
173179 status = acpi_ev_update_gpe_enable_mask(gpe_event_info);
174180 if (ACPI_SUCCESS(status)) {
175181 status = acpi_ev_enable_gpe(gpe_event_info);
drivers/acpi/acpica/evgpeblk.c+1−1
@@ -453,7 +453,7 @@ acpi_ev_initialize_gpe_block(struct acpi_gpe_xrupt_info *gpe_xrupt_info, · 452 unmodified lines
453453 continue;
454454 }
455455
456− status = acpi_ev_add_gpe_reference(gpe_event_info);
456+ status = acpi_ev_add_gpe_reference(gpe_event_info, FALSE);
457457 if (ACPI_FAILURE(status)) {
458458 ACPI_EXCEPTION((AE_INFO, status,
459459 "Could not enable GPE 0x%02X",
drivers/acpi/acpica/evxface.c+1−1
@@ -971,7 +971,7 @@ acpi_remove_gpe_handler(acpi_handle gpe_device, · 970 unmodified lines
971971 ACPI_GPE_DISPATCH_METHOD) ||
972972 (ACPI_GPE_DISPATCH_TYPE(handler->original_flags) ==
973973 ACPI_GPE_DISPATCH_NOTIFY)) && handler->originally_enabled) {
974− (void)acpi_ev_add_gpe_reference(gpe_event_info);
974+ (void)acpi_ev_add_gpe_reference(gpe_event_info, FALSE);
975975 if (ACPI_GPE_IS_POLLING_NEEDED(gpe_event_info)) {
976976
977977 /* Poll edge triggered GPEs to handle existing events */
drivers/acpi/acpica/evxfgpe.c+1−1
@@ -108,7 +108,7 @@ acpi_status acpi_enable_gpe(acpi_handle gpe_device, u32 gpe_number) · 107 unmodified lines
108108 if (gpe_event_info) {
109109 if (ACPI_GPE_DISPATCH_TYPE(gpe_event_info->flags) !=
110110 ACPI_GPE_DISPATCH_NONE) {
111− status = acpi_ev_add_gpe_reference(gpe_event_info);
111+ status = acpi_ev_add_gpe_reference(gpe_event_info, TRUE);
112112 if (ACPI_SUCCESS(status) &&
113113 ACPI_GPE_IS_POLLING_NEEDED(gpe_event_info)) {
114114
drivers/acpi/acpica/exconfig.c+6−10
@@ -174,12 +174,9 @@ acpi_ex_load_table_op(struct acpi_walk_state *walk_state, · 173 unmodified lines
174174 return_ACPI_STATUS(status);
175175 }
176176
177− /* Complete the initialization/resolution of package objects */
177+ /* Complete the initialization/resolution of new objects */
178178
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);
179+ acpi_ns_initialize_objects();
183180
184181 /* Parameter Data (optional) */
185182
@@ -437,12 +434,11 @@ acpi_ex_load_op(union acpi_operand_object *obj_desc, · 251 unmodified lines
437434 return_ACPI_STATUS(status);
438435 }
439436
440− /* Complete the initialization/resolution of package objects */
437+ /* Complete the initialization/resolution of new objects */
441438
442− status = acpi_ns_walk_namespace(ACPI_TYPE_PACKAGE, ACPI_ROOT_OBJECT,
443− ACPI_UINT32_MAX, 0,
444− acpi_ns_init_one_package, NULL, NULL,
445− NULL);
439+ acpi_ex_exit_interpreter();
440+ acpi_ns_initialize_objects();
441+ acpi_ex_enter_interpreter();
446442
447443 /* Store the ddb_handle into the Target operand */
448444
drivers/acpi/acpica/nsaccess.c+43−11
@@ -36,6 +36,7 @@ acpi_status acpi_ns_root_initialize(void) · 35 unmodified lines
3636 acpi_status status;
3737 const struct acpi_predefined_names *init_val = NULL;
3838 struct acpi_namespace_node *new_node;
39+ struct acpi_namespace_node *prev_node = NULL;
3940 union acpi_operand_object *obj_desc;
4041 acpi_string val = NULL;
4142
@@ -61,12 +62,28 @@ acpi_status acpi_ns_root_initialize(void) · 19 unmodified lines
6162 */
6263 acpi_gbl_root_node = &acpi_gbl_root_node_struct;
6364
64− /* Enter the pre-defined names in the name table */
65+ /* Enter the predefined names in the name table */
6566
6667 ACPI_DEBUG_PRINT((ACPI_DB_INFO,
6768 "Entering predefined entries into namespace\n"));
6869
70+ /*
71+ * Create the initial (default) namespace.
72+ * This namespace looks like something similar to this:
73+ *
74+ * ACPI Namespace (from Namespace Root):
75+ * 0 _GPE Scope 00203160 00
76+ * 0 _PR_ Scope 002031D0 00
77+ * 0 _SB_ Device 00203240 00 Notify Object: 0020ADD8
78+ * 0 _SI_ Scope 002032B0 00
79+ * 0 _TZ_ Device 00203320 00
80+ * 0 _REV Integer 00203390 00 = 0000000000000002
81+ * 0 _OS_ String 00203488 00 Len 14 "Microsoft Windows NT"
82+ * 0 _GL_ Mutex 00203580 00 Object 002035F0
83+ * 0 _OSI Method 00203678 00 Args 1 Len 0000 Aml 00000000
84+ */
6985 for (init_val = acpi_gbl_pre_defined_names; init_val->name; init_val++) {
86+ status = AE_OK;
7087
7188 /* _OSI is optional for now, will be permanent later */
7289
@@ -75,17 +92,32 @@ acpi_status acpi_ns_root_initialize(void) · 2 unmodified lines
7592 continue;
7693 }
7794
78− status =
79− acpi_ns_lookup(NULL, ACPI_CAST_PTR(char, init_val->name),
80− init_val->type, ACPI_IMODE_LOAD_PASS2,
81− ACPI_NS_NO_UPSEARCH, NULL, &new_node);
82− if (ACPI_FAILURE(status)) {
83− ACPI_EXCEPTION((AE_INFO, status,
84− "Could not create predefined name %s",
85− init_val->name));
86− continue;
95+ /*
96+ * Create, init, and link the new predefined name
97+ * Note: No need to use acpi_ns_lookup here because all the
98+ * predefined names are at the root level. It is much easier to
99+ * just create and link the new node(s) here.
100+ */
101+ new_node =
102+ ACPI_ALLOCATE_ZEROED(sizeof(struct acpi_namespace_node));
103+ if (!new_node) {
104+ status = AE_NO_MEMORY;
105+ goto unlock_and_exit;
87106 }
88107
108+ ACPI_COPY_NAMESEG(new_node->name.ascii, init_val->name);
109+ new_node->descriptor_type = ACPI_DESC_TYPE_NAMED;
110+ new_node->type = init_val->type;
111+
112+ if (!prev_node) {
113+ acpi_gbl_root_node_struct.child = new_node;
114+ } else {
115+ prev_node->peer = new_node;
116+ }
117+
118+ new_node->parent = &acpi_gbl_root_node_struct;
119+ prev_node = new_node;
120+
89121 /*
90122 * Name entered successfully. If entry in pre_defined_names[] specifies
91123 * an initial value, create the initial value.
@@ -131,7 +163,7 @@ acpi_status acpi_ns_root_initialize(void) · 39 unmodified lines
131163
132164 new_node->value = obj_desc->method.param_count;
133165 #else
134− /* Mark this as a very SPECIAL method */
166+ /* Mark this as a very SPECIAL method (_OSI) */
135167
136168 obj_desc->method.info_flags =
137169 ACPI_METHOD_INTERNAL_ONLY;
drivers/acpi/acpica/nseval.c+0−190
@@ -14,11 +14,6 @@ · 13 unmodified lines
1414 #define _COMPONENT ACPI_NAMESPACE
1515 ACPI_MODULE_NAME("nseval")
1616
17−/* Local prototypes */
18−static void
19−acpi_ns_exec_module_code(union acpi_operand_object *method_obj,
20− struct acpi_evaluate_info *info);
21−
2217 /*******************************************************************************
2318 *
2419 * FUNCTION: acpi_ns_evaluate
@@ -44,7 +39,6 @@ acpi_ns_exec_module_code(union acpi_operand_object *method_obj, · 19 unmodified lines
4439 * MUTEX: Locks interpreter
4540 *
4641 ******************************************************************************/
47−
4842 acpi_status acpi_ns_evaluate(struct acpi_evaluate_info *info)
4943 {
5044 acpi_status status;
@@ -310,187 +304,3 @@ cleanup: · 259 unmodified lines
310304 info->full_pathname = NULL;
311305 return_ACPI_STATUS(status);
312306 }
313−
314−/*******************************************************************************
315− *
316− * FUNCTION: acpi_ns_exec_module_code_list
317− *
318− * PARAMETERS: None
319− *
320− * RETURN: None. Exceptions during method execution are ignored, since
321− * we cannot abort a table load.
322− *
323− * DESCRIPTION: Execute all elements of the global module-level code list.
324− * Each element is executed as a single control method.
325− *
326− * NOTE: With this option enabled, each block of detected executable AML
327− * code that is outside of any control method is wrapped with a temporary
328− * control method object and placed on a global list. The methods on this
329− * list are executed below.
330− *
331− * This function executes the module-level code for all tables only after
332− * all of the tables have been loaded. It is a legacy option and is
333− * not compatible with other ACPI implementations. See acpi_ns_load_table.
334− *
335− * This function will be removed when the legacy option is removed.
336− *
337− ******************************************************************************/
338−
339−void acpi_ns_exec_module_code_list(void)
340−{
341− union acpi_operand_object *prev;
342− union acpi_operand_object *next;
343− struct acpi_evaluate_info *info;
344− u32 method_count = 0;
345−
346− ACPI_FUNCTION_TRACE(ns_exec_module_code_list);
347−
348− /* Exit now if the list is empty */
349−
350− next = acpi_gbl_module_code_list;
351− if (!next) {
352− ACPI_DEBUG_PRINT((ACPI_DB_INIT_NAMES,
353− "Legacy MLC block list is empty\n"));
354−
355− return_VOID;
356− }
357−
358− /* Allocate the evaluation information block */
359−
360− info = ACPI_ALLOCATE(sizeof(struct acpi_evaluate_info));
361− if (!info) {
362− return_VOID;
363− }
364−
365− /* Walk the list, executing each "method" */
366−
367− while (next) {
368− prev = next;
369− next = next->method.mutex;
370−
371− /* Clear the link field and execute the method */
372−
373− prev->method.mutex = NULL;
374− acpi_ns_exec_module_code(prev, info);
375− method_count++;
376−
377− /* Delete the (temporary) method object */
378−
379− acpi_ut_remove_reference(prev);
380− }
381−
382− ACPI_INFO(("Executed %u blocks of module-level executable AML code",
383− method_count));
384−
385− ACPI_FREE(info);
386− acpi_gbl_module_code_list = NULL;
387− return_VOID;
388−}
389−
390−/*******************************************************************************
391− *
392− * FUNCTION: acpi_ns_exec_module_code
393− *
394− * PARAMETERS: method_obj - Object container for the module-level code
395− * info - Info block for method evaluation
396− *
397− * RETURN: None. Exceptions during method execution are ignored, since
398− * we cannot abort a table load.
399− *
400− * DESCRIPTION: Execute a control method containing a block of module-level
401− * executable AML code. The control method is temporarily
402− * installed to the root node, then evaluated.
403− *
404− ******************************************************************************/
405−
406−static void
407−acpi_ns_exec_module_code(union acpi_operand_object *method_obj,
408− struct acpi_evaluate_info *info)
409−{
410− union acpi_operand_object *parent_obj;
411− struct acpi_namespace_node *parent_node;
412− acpi_object_type type;
413− acpi_status status;
414−
415− ACPI_FUNCTION_TRACE(ns_exec_module_code);
416−
417− /*
418− * Get the parent node. We cheat by using the next_object field
419− * of the method object descriptor.
420− */
421− parent_node =
422− ACPI_CAST_PTR(struct acpi_namespace_node,
423− method_obj->method.next_object);
424− type = acpi_ns_get_type(parent_node);
425−
426− /*
427− * Get the region handler and save it in the method object. We may need
428− * this if an operation region declaration causes a _REG method to be run.
429− *
430− * We can't do this in acpi_ps_link_module_code because
431− * acpi_gbl_root_node->Object is NULL at PASS1.
432− */
433− if ((type == ACPI_TYPE_DEVICE) && parent_node->object) {
434− method_obj->method.dispatch.handler =
435− parent_node->object->device.handler;
436− }
437−
438− /* Must clear next_object (acpi_ns_attach_object needs the field) */
439−
440− method_obj->method.next_object = NULL;
441−
442− /* Initialize the evaluation information block */
443−
444− memset(info, 0, sizeof(struct acpi_evaluate_info));
445− info->prefix_node = parent_node;
446−
447− /*
448− * Get the currently attached parent object. Add a reference,
449− * because the ref count will be decreased when the method object
450− * is installed to the parent node.
451− */
452− parent_obj = acpi_ns_get_attached_object(parent_node);
453− if (parent_obj) {
454− acpi_ut_add_reference(parent_obj);
455− }
456−
457− /* Install the method (module-level code) in the parent node */
458−
459− status =
460− acpi_ns_attach_object(parent_node, method_obj, ACPI_TYPE_METHOD);
461− if (ACPI_FAILURE(status)) {
462− goto exit;
463− }
464−
465− /* Execute the parent node as a control method */
466−
467− status = acpi_ns_evaluate(info);
468−
469− ACPI_DEBUG_PRINT((ACPI_DB_INIT_NAMES,
470− "Executed module-level code at %p\n",
471− method_obj->method.aml_start));
472−
473− /* Delete a possible implicit return value (in slack mode) */
474−
475− if (info->return_object) {
476− acpi_ut_remove_reference(info->return_object);
477− }
478−
479− /* Detach the temporary method object */
480−
481− acpi_ns_detach_object(parent_node);
482−
483− /* Restore the original parent object */
484−
485− if (parent_obj) {
486− status = acpi_ns_attach_object(parent_node, parent_obj, type);
487− } else {
488− parent_node->type = (u8)type;
489− }
490−
491−exit:
492− if (parent_obj) {
493− acpi_ut_remove_reference(parent_obj);
494− }
495− return_VOID;
496−}
drivers/acpi/acpica/nsinit.c+19−30
@@ -55,14 +55,19 @@ acpi_status acpi_ns_initialize_objects(void) · 54 unmodified lines
5555 ACPI_DEBUG_PRINT((ACPI_DB_DISPATCH,
5656 "**** Starting initialization of namespace objects ****\n"));
5757 ACPI_DEBUG_PRINT_RAW((ACPI_DB_INIT,
58− "Completing Region/Field/Buffer/Package initialization:\n"));
58+ "Final data object initialization: "));
5959
60− /* Set all init info to zero */
60+ /* Clear the info block */
6161
6262 memset(&info, 0, sizeof(struct acpi_init_walk_info));
6363
6464 /* Walk entire namespace from the supplied root */
6565
66+ /*
67+ * TBD: will become ACPI_TYPE_PACKAGE as this type object
68+ * is now the only one that supports deferred initialization
69+ * (forward references).
70+ */
6671 status = acpi_walk_namespace(ACPI_TYPE_ANY, ACPI_ROOT_OBJECT,
6772 ACPI_UINT32_MAX, acpi_ns_init_one_object,
6873 NULL, &info, NULL);
@@ -71,13 +76,8 @@ acpi_status acpi_ns_initialize_objects(void) · 2 unmodified lines
7176 }
7277
7378 ACPI_DEBUG_PRINT_RAW((ACPI_DB_INIT,
74− " Initialized %u/%u Regions %u/%u Fields %u/%u "
75− "Buffers %u/%u Packages (%u nodes)\n",
76− info.op_region_init, info.op_region_count,
77− info.field_init, info.field_count,
78− info.buffer_init, info.buffer_count,
79− info.package_init, info.package_count,
80− info.object_count));
79+ "Namespace contains %u (0x%X) objects\n",
80+ info.object_count, info.object_count));
8181
8282 ACPI_DEBUG_PRINT((ACPI_DB_DISPATCH,
8383 "%u Control Methods found\n%u Op Regions found\n",
@@ -382,34 +382,18 @@ acpi_ns_init_one_object(acpi_handle obj_handle, · 298 unmodified lines
382382 acpi_ex_enter_interpreter();
383383
384384 /*
385− * Each of these types can contain executable AML code within the
386− * declaration.
385+ * Only initialization of Package objects can be deferred, in order
386+ * to support forward references.
387387 */
388388 switch (type) {
389− case ACPI_TYPE_REGION:
390−
391− info->op_region_init++;
392− status = acpi_ds_get_region_arguments(obj_desc);
393− break;
394−
395− case ACPI_TYPE_BUFFER_FIELD:
396−
397− info->field_init++;
398− status = acpi_ds_get_buffer_field_arguments(obj_desc);
399− break;
400−
401389 case ACPI_TYPE_LOCAL_BANK_FIELD:
402390
391+ /* TBD: bank_fields do not require deferred init, remove this code */
392+
403393 info->field_init++;
404394 status = acpi_ds_get_bank_field_arguments(obj_desc);
405395 break;
406396
407− case ACPI_TYPE_BUFFER:
408−
409− info->buffer_init++;
410− status = acpi_ds_get_buffer_arguments(obj_desc);
411− break;
412−
413397 case ACPI_TYPE_PACKAGE:
414398
415399 /* Complete the initialization/resolution of the package object */
@@ -421,8 +405,13 @@ acpi_ns_init_one_object(acpi_handle obj_handle, · 5 unmodified lines
421405
422406 default:
423407
424− /* No other types can get here */
408+ /* No other types should get here */
425409
410+ status = AE_TYPE;
411+ ACPI_EXCEPTION((AE_INFO, status,
412+ "Opcode is not deferred [%4.4s] (%s)",
413+ acpi_ut_get_node_name(node),
414+ acpi_ut_get_type_name(type)));
426415 break;
427416 }
428417
drivers/acpi/acpica/nsload.c+0−12
@@ -109,18 +109,6 @@ unlock: · 108 unmodified lines
109109 ACPI_DEBUG_PRINT((ACPI_DB_INFO,
110110 "**** Completed Table Object Initialization\n"));
111111
112− /*
113− * This case handles the legacy option that groups all module-level
114− * code blocks together and defers execution until all of the tables
115− * are loaded. Execute all of these blocks at this time.
116− * Execute any module-level code that was detected during the table
117− * load phase.
118− *
119− * Note: this option is deprecated and will be eliminated in the
120− * future. Use of this option can cause problems with AML code that
121− * depends upon in-order immediate execution of module-level code.
122− */
123− acpi_ns_exec_module_code_list();
124112 return_ACPI_STATUS(status);
125113 }
126114
drivers/acpi/acpica/nsutils.c+0−12
@@ -560,21 +560,9 @@ struct acpi_namespace_node *acpi_ns_validate_handle(acpi_handle handle) · 559 unmodified lines
560560 void acpi_ns_terminate(void)
561561 {
562562 acpi_status status;
563− union acpi_operand_object *prev;
564− union acpi_operand_object *next;
565563
566564 ACPI_FUNCTION_TRACE(ns_terminate);
567565
568− /* Delete any module-level code blocks */
569−
570− next = acpi_gbl_module_code_list;
571− while (next) {
572− prev = next;
573− next = next->method.mutex;
574− prev->method.mutex = NULL; /* Clear the Mutex (cheated) field */
575− acpi_ut_remove_reference(prev);
576− }
577−
578566 /*
579567 * Free the entire namespace -- all nodes and all objects
580568 * attached to the nodes
drivers/acpi/acpica/tbdata.c+0−13
@@ -933,19 +933,6 @@ acpi_tb_load_table(u32 table_index, struct acpi_namespace_node *parent_node) · 932 unmodified lines
933933
934934 status = acpi_ns_load_table(table_index, parent_node);
935935
936− /*
937− * This case handles the legacy option that groups all module-level
938− * code blocks together and defers execution until all of the tables
939− * are loaded. Execute all of these blocks at this time.
940− * Execute any module-level code that was detected during the table
941− * load phase.
942− *
943− * Note: this option is deprecated and will be eliminated in the
944− * future. Use of this option can cause problems with AML code that
945− * depends upon in-order immediate execution of module-level code.
946− */
947− acpi_ns_exec_module_code_list();
948−
949936 /*
950937 * Update GPEs for any new _Lxx/_Exx methods. Ignore errors. The host is
951938 * responsible for discovering any new wake GPEs by running _PRW methods
drivers/acpi/acpica/tbxfload.c+7−0
@@ -297,6 +297,13 @@ acpi_status acpi_load_table(struct acpi_table_header *table) · 296 unmodified lines
297297 status = acpi_tb_install_and_load_table(ACPI_PTR_TO_PHYSADDR(table),
298298 ACPI_TABLE_ORIGIN_EXTERNAL_VIRTUAL,
299299 FALSE, &table_index);
300+ if (ACPI_SUCCESS(status)) {
301+
302+ /* Complete the initialization/resolution of new objects */
303+
304+ acpi_ns_initialize_objects();
305+ }
306+
300307 return_ACPI_STATUS(status);
301308 }
302309
drivers/acpi/acpica/utinit.c+0−1
@@ -180,7 +180,6 @@ acpi_status acpi_ut_init_globals(void) · 179 unmodified lines
180180
181181 /* Namespace */
182182
183− acpi_gbl_module_code_list = NULL;
184183 acpi_gbl_root_node = NULL;
185184 acpi_gbl_root_node_struct.name.integer = ACPI_ROOT_NAME;
186185 acpi_gbl_root_node_struct.descriptor_type = ACPI_DESC_TYPE_NAMED;
drivers/acpi/acpica/utxfinit.c+6−12
@@ -211,24 +211,17 @@ acpi_status ACPI_INIT_FUNCTION acpi_initialize_objects(u32 flags) · 210 unmodified lines
211211
212212 ACPI_FUNCTION_TRACE(acpi_initialize_objects);
213213
214+#ifdef ACPI_OBSOLETE_BEHAVIOR
214215 /*
215− * This case handles the legacy option that groups all module-level
216− * code blocks together and defers execution until all of the tables
217− * are loaded. Execute all of these blocks at this time.
218− * Execute any module-level code that was detected during the table
219− * load phase.
220− *
221− * Note: this option is deprecated and will be eliminated in the
222− * future. Use of this option can cause problems with AML code that
223− * depends upon in-order immediate execution of module-level code.
216+ * 05/2019: Removed, initialization now happens at both object
217+ * creation and table load time
224218 */
225− acpi_ns_exec_module_code_list();
226219
227220 /*
228221 * Initialize the objects that remain uninitialized. This
229222 * runs the executable AML that may be part of the
230− * declaration of these objects:
231− * operation_regions, buffer_fields, Buffers, and Packages.
223+ * declaration of these objects: operation_regions, buffer_fields,
224+ * bank_fields, Buffers, and Packages.
232225 */
233226 if (!(flags & ACPI_NO_OBJECT_INIT)) {
234227 status = acpi_ns_initialize_objects();
@@ -236,6 +229,7 @@ acpi_status ACPI_INIT_FUNCTION acpi_initialize_objects(u32 flags) · 1 unmodified line
236229 return_ACPI_STATUS(status);
237230 }
238231 }
232+#endif
239233
240234 /*
241235 * Initialize all device/region objects in the namespace. This runs
drivers/acpi/apei/ghes.c+1−1
@@ -345,7 +345,7 @@ static int __ghes_peek_estatus(struct ghes *ghes, · 344 unmodified lines
345345 return -ENOENT;
346346 }
347347
348− return __ghes_check_estatus(ghes, estatus);
348+ return 0;
349349 }
350350
351351 static int __ghes_read_estatus(struct acpi_hest_generic_status *estatus,
drivers/acpi/osl.c+2−2
@@ -301,8 +301,8 @@ static void acpi_unmap(acpi_physical_address pg_off, void __iomem *vaddr) · 300 unmodified lines
301301 * During early init (when acpi_permanent_mmap has not been set yet) this
302302 * routine simply calls __acpi_map_table() to get the job done.
303303 */
304−void __iomem *__ref
305−acpi_os_map_iomem(acpi_physical_address phys, acpi_size size)
304+void __iomem __ref
305+*acpi_os_map_iomem(acpi_physical_address phys, acpi_size size)
306306 {
307307 struct acpi_ioremap *map;
308308 void __iomem *virt;
drivers/acpi/pmic/intel_pmic.c+0−2
@@ -284,8 +284,6 @@ int intel_pmic_install_opregion_handler(struct device *dev, acpi_handle handle, · 283 unmodified lines
284284 intel_pmic_thermal_handler,
285285 NULL, opregion);
286286 if (ACPI_FAILURE(status)) {
287− acpi_remove_address_space_handler(handle, PMIC_POWER_OPREGION_ID,
288− intel_pmic_power_handler);
289287 ret = -ENODEV;
290288 goto out_remove_power_handler;
291289 }
drivers/acpi/tables.c+11−10
@@ -490,16 +490,17 @@ static u8 __init acpi_table_checksum(u8 *buffer, u32 length) · 489 unmodified lines
490490
491491 /* All but ACPI_SIG_RSDP and ACPI_SIG_FACS: */
492492 static const char * const table_sigs[] = {
493− ACPI_SIG_BERT, ACPI_SIG_CPEP, ACPI_SIG_ECDT, ACPI_SIG_EINJ,
494− ACPI_SIG_ERST, ACPI_SIG_HEST, ACPI_SIG_MADT, ACPI_SIG_MSCT,
495− ACPI_SIG_SBST, ACPI_SIG_SLIT, ACPI_SIG_SRAT, ACPI_SIG_ASF,
496− ACPI_SIG_BOOT, ACPI_SIG_DBGP, ACPI_SIG_DMAR, ACPI_SIG_HPET,
497− ACPI_SIG_IBFT, ACPI_SIG_IVRS, ACPI_SIG_MCFG, ACPI_SIG_MCHI,
498− ACPI_SIG_SLIC, ACPI_SIG_SPCR, ACPI_SIG_SPMI, ACPI_SIG_TCPA,
499− ACPI_SIG_UEFI, ACPI_SIG_WAET, ACPI_SIG_WDAT, ACPI_SIG_WDDT,
500− ACPI_SIG_WDRT, ACPI_SIG_DSDT, ACPI_SIG_FADT, ACPI_SIG_PSDT,
501− ACPI_SIG_RSDT, ACPI_SIG_XSDT, ACPI_SIG_SSDT, ACPI_SIG_IORT,
502− ACPI_SIG_NFIT, ACPI_SIG_HMAT, ACPI_SIG_PPTT, NULL };
493+ ACPI_SIG_BERT, ACPI_SIG_BGRT, ACPI_SIG_CPEP, ACPI_SIG_ECDT,
494+ ACPI_SIG_EINJ, ACPI_SIG_ERST, ACPI_SIG_HEST, ACPI_SIG_MADT,
495+ ACPI_SIG_MSCT, ACPI_SIG_SBST, ACPI_SIG_SLIT, ACPI_SIG_SRAT,
496+ ACPI_SIG_ASF, ACPI_SIG_BOOT, ACPI_SIG_DBGP, ACPI_SIG_DMAR,
497+ ACPI_SIG_HPET, ACPI_SIG_IBFT, ACPI_SIG_IVRS, ACPI_SIG_MCFG,
498+ ACPI_SIG_MCHI, ACPI_SIG_SLIC, ACPI_SIG_SPCR, ACPI_SIG_SPMI,
499+ ACPI_SIG_TCPA, ACPI_SIG_UEFI, ACPI_SIG_WAET, ACPI_SIG_WDAT,
500+ ACPI_SIG_WDDT, ACPI_SIG_WDRT, ACPI_SIG_DSDT, ACPI_SIG_FADT,
501+ ACPI_SIG_PSDT, ACPI_SIG_RSDT, ACPI_SIG_XSDT, ACPI_SIG_SSDT,
502+ ACPI_SIG_IORT, ACPI_SIG_NFIT, ACPI_SIG_HMAT, ACPI_SIG_PPTT,
503+ NULL };
503504
504505 #define ACPI_HEADER_SIZE sizeof(struct acpi_table_header)
505506
include/acpi/acpi_io.h+2−2
@@ -16,8 +16,8 @@ static inline void __iomem *acpi_os_ioremap(acpi_physical_address phys, · 15 unmodified lines
1616
1717 extern bool acpi_permanent_mmap;
1818
19−void __iomem *__ref
20−acpi_os_map_iomem(acpi_physical_address phys, acpi_size size);
19+void __iomem __ref
20+*acpi_os_map_iomem(acpi_physical_address phys, acpi_size size);
2121 void __ref acpi_os_unmap_iomem(void __iomem *virt, acpi_size size);
2222 void __iomem *acpi_os_get_iomem(acpi_physical_address phys, unsigned int size);
2323
include/acpi/acpixf.h+1−1
@@ -12,7 +12,7 @@ · 11 unmodified lines
1212
1313 /* Current ACPICA subsystem version in YYYYMMDD format */
1414
15−#define ACPI_CA_VERSION 0x20190509
15+#define ACPI_CA_VERSION 0x20190703
1616
1717 #include <acpi/acconfig.h>
1818 #include <acpi/actypes.h>
tools/power/acpi/.gitignore+4−4
@@ -1,4 +1,4 @@
1−acpidbg
2−acpidump
3−ec
4−include
1+/acpidbg
2+/acpidump
3+/ec
4+/include/

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t