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

Pull ACPI fixes from Rafael Wysocki:
"These fix two recent regressions (in ACPICA and in the ACPI EC driver)
and one bug in code introduced during the 4.12 cycle (ACPI device
properties library routine).

Specifics:

- Fix a regression in the ACPI EC driver causing a kernel to crash
during initialization on some systems due to a code ordering issue
exposed by a recent change (Lv Zheng).

- Fix a recent regression in ACPICA due to a change of the behavior
of a library function in a way that is not backwards compatible
with some existing callers of it (Rafael Wysocki).

- Fix a coding mistake in a library function related to the handling
of ACPI device properties introduced during the 4.12 cycle (Sakari
Ailus)"

* tag 'acpi-4.13-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm:
ACPI: device property: Fix node lookup in acpi_graph_get_child_prop_value()
ACPICA: Fix acpi_evaluate_object_typed()
ACPI: EC: Fix regression related to wrong ECDT initialization order

+15 -16
+7 -3
drivers/acpi/acpica/nsxfeval.c
··· 100 100 free_buffer_on_error = TRUE; 101 101 } 102 102 103 - status = acpi_get_handle(handle, pathname, &target_handle); 104 - if (ACPI_FAILURE(status)) { 105 - return_ACPI_STATUS(status); 103 + if (pathname) { 104 + status = acpi_get_handle(handle, pathname, &target_handle); 105 + if (ACPI_FAILURE(status)) { 106 + return_ACPI_STATUS(status); 107 + } 108 + } else { 109 + target_handle = handle; 106 110 } 107 111 108 112 full_pathname = acpi_ns_get_external_pathname(target_handle);
+7 -10
drivers/acpi/ec.c
··· 1741 1741 * functioning ECDT EC first in order to handle the events. 1742 1742 * https://bugzilla.kernel.org/show_bug.cgi?id=115021 1743 1743 */ 1744 - int __init acpi_ec_ecdt_start(void) 1744 + static int __init acpi_ec_ecdt_start(void) 1745 1745 { 1746 1746 acpi_handle handle; 1747 1747 ··· 2003 2003 int __init acpi_ec_init(void) 2004 2004 { 2005 2005 int result; 2006 + int ecdt_fail, dsdt_fail; 2006 2007 2007 2008 /* register workqueue for _Qxx evaluations */ 2008 2009 result = acpi_ec_query_init(); 2009 2010 if (result) 2010 - goto err_exit; 2011 - /* Now register the driver for the EC */ 2012 - result = acpi_bus_register_driver(&acpi_ec_driver); 2013 - if (result) 2014 - goto err_exit; 2011 + return result; 2015 2012 2016 - err_exit: 2017 - if (result) 2018 - acpi_ec_query_exit(); 2019 - return result; 2013 + /* Drivers must be started after acpi_ec_query_init() */ 2014 + ecdt_fail = acpi_ec_ecdt_start(); 2015 + dsdt_fail = acpi_bus_register_driver(&acpi_ec_driver); 2016 + return ecdt_fail && dsdt_fail ? -ENODEV : 0; 2020 2017 } 2021 2018 2022 2019 /* EC driver currently not unloadable */
-1
drivers/acpi/internal.h
··· 185 185 int acpi_ec_init(void); 186 186 int acpi_ec_ecdt_probe(void); 187 187 int acpi_ec_dsdt_probe(void); 188 - int acpi_ec_ecdt_start(void); 189 188 void acpi_ec_block_transactions(void); 190 189 void acpi_ec_unblock_transactions(void); 191 190 int acpi_ec_add_query_handler(struct acpi_ec *ec, u8 query_bit,
+1 -1
drivers/acpi/property.c
··· 1047 1047 fwnode_for_each_child_node(fwnode, child) { 1048 1048 u32 nr; 1049 1049 1050 - if (!fwnode_property_read_u32(fwnode, prop_name, &nr)) 1050 + if (fwnode_property_read_u32(child, prop_name, &nr)) 1051 1051 continue; 1052 1052 1053 1053 if (val == nr)
-1
drivers/acpi/scan.c
··· 2084 2084 2085 2085 acpi_gpe_apply_masked_gpes(); 2086 2086 acpi_update_all_gpes(); 2087 - acpi_ec_ecdt_start(); 2088 2087 2089 2088 acpi_scan_initialized = true; 2090 2089