diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2017-08-24 17:56:20 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2017-08-24 17:56:20 -0400 |
commit | 4898b99c261efe32348fce28302c01c7b1e1e343 (patch) | |
tree | 89dd2e102ee3d77687fb73d689adee55c05c4e29 | |
parent | f7bbf0754b52b7f99deb0c8834f771e2b50157d6 (diff) | |
parent | d5d6c1ddb93a7225915cd7e89f35944878d667f9 (diff) |
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
-rw-r--r-- | drivers/acpi/acpica/nsxfeval.c | 10 | ||||
-rw-r--r-- | drivers/acpi/ec.c | 17 | ||||
-rw-r--r-- | drivers/acpi/internal.h | 1 | ||||
-rw-r--r-- | drivers/acpi/property.c | 2 | ||||
-rw-r--r-- | drivers/acpi/scan.c | 1 |
5 files changed, 15 insertions, 16 deletions
diff --git a/drivers/acpi/acpica/nsxfeval.c b/drivers/acpi/acpica/nsxfeval.c index 538c61677c10..783f4c838aee 100644 --- a/drivers/acpi/acpica/nsxfeval.c +++ b/drivers/acpi/acpica/nsxfeval.c | |||
@@ -100,9 +100,13 @@ acpi_evaluate_object_typed(acpi_handle handle, | |||
100 | free_buffer_on_error = TRUE; | 100 | free_buffer_on_error = TRUE; |
101 | } | 101 | } |
102 | 102 | ||
103 | status = acpi_get_handle(handle, pathname, &target_handle); | 103 | if (pathname) { |
104 | if (ACPI_FAILURE(status)) { | 104 | status = acpi_get_handle(handle, pathname, &target_handle); |
105 | return_ACPI_STATUS(status); | 105 | if (ACPI_FAILURE(status)) { |
106 | return_ACPI_STATUS(status); | ||
107 | } | ||
108 | } else { | ||
109 | target_handle = handle; | ||
106 | } | 110 | } |
107 | 111 | ||
108 | full_pathname = acpi_ns_get_external_pathname(target_handle); | 112 | full_pathname = acpi_ns_get_external_pathname(target_handle); |
diff --git a/drivers/acpi/ec.c b/drivers/acpi/ec.c index 62068a5e814f..ae3d6d152633 100644 --- a/drivers/acpi/ec.c +++ b/drivers/acpi/ec.c | |||
@@ -1741,7 +1741,7 @@ error: | |||
1741 | * functioning ECDT EC first in order to handle the events. | 1741 | * functioning ECDT EC first in order to handle the events. |
1742 | * https://bugzilla.kernel.org/show_bug.cgi?id=115021 | 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 | acpi_handle handle; | 1746 | acpi_handle handle; |
1747 | 1747 | ||
@@ -2003,20 +2003,17 @@ static inline void acpi_ec_query_exit(void) | |||
2003 | int __init acpi_ec_init(void) | 2003 | int __init acpi_ec_init(void) |
2004 | { | 2004 | { |
2005 | int result; | 2005 | int result; |
2006 | int ecdt_fail, dsdt_fail; | ||
2006 | 2007 | ||
2007 | /* register workqueue for _Qxx evaluations */ | 2008 | /* register workqueue for _Qxx evaluations */ |
2008 | result = acpi_ec_query_init(); | 2009 | result = acpi_ec_query_init(); |
2009 | if (result) | 2010 | if (result) |
2010 | goto err_exit; | 2011 | return result; |
2011 | /* Now register the driver for the EC */ | ||
2012 | result = acpi_bus_register_driver(&acpi_ec_driver); | ||
2013 | if (result) | ||
2014 | goto err_exit; | ||
2015 | 2012 | ||
2016 | err_exit: | 2013 | /* Drivers must be started after acpi_ec_query_init() */ |
2017 | if (result) | 2014 | ecdt_fail = acpi_ec_ecdt_start(); |
2018 | acpi_ec_query_exit(); | 2015 | dsdt_fail = acpi_bus_register_driver(&acpi_ec_driver); |
2019 | return result; | 2016 | return ecdt_fail && dsdt_fail ? -ENODEV : 0; |
2020 | } | 2017 | } |
2021 | 2018 | ||
2022 | /* EC driver currently not unloadable */ | 2019 | /* EC driver currently not unloadable */ |
diff --git a/drivers/acpi/internal.h b/drivers/acpi/internal.h index 58dd7ab3c653..3f5af4d7a739 100644 --- a/drivers/acpi/internal.h +++ b/drivers/acpi/internal.h | |||
@@ -185,7 +185,6 @@ typedef int (*acpi_ec_query_func) (void *data); | |||
185 | int acpi_ec_init(void); | 185 | int acpi_ec_init(void); |
186 | int acpi_ec_ecdt_probe(void); | 186 | int acpi_ec_ecdt_probe(void); |
187 | int acpi_ec_dsdt_probe(void); | 187 | int acpi_ec_dsdt_probe(void); |
188 | int acpi_ec_ecdt_start(void); | ||
189 | void acpi_ec_block_transactions(void); | 188 | void acpi_ec_block_transactions(void); |
190 | void acpi_ec_unblock_transactions(void); | 189 | void acpi_ec_unblock_transactions(void); |
191 | int acpi_ec_add_query_handler(struct acpi_ec *ec, u8 query_bit, | 190 | int acpi_ec_add_query_handler(struct acpi_ec *ec, u8 query_bit, |
diff --git a/drivers/acpi/property.c b/drivers/acpi/property.c index 917c789f953d..476a52c60cf3 100644 --- a/drivers/acpi/property.c +++ b/drivers/acpi/property.c | |||
@@ -1047,7 +1047,7 @@ static struct fwnode_handle *acpi_graph_get_child_prop_value( | |||
1047 | fwnode_for_each_child_node(fwnode, child) { | 1047 | fwnode_for_each_child_node(fwnode, child) { |
1048 | u32 nr; | 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 | continue; | 1051 | continue; |
1052 | 1052 | ||
1053 | if (val == nr) | 1053 | if (val == nr) |
diff --git a/drivers/acpi/scan.c b/drivers/acpi/scan.c index 33897298f03e..70fd5502c284 100644 --- a/drivers/acpi/scan.c +++ b/drivers/acpi/scan.c | |||
@@ -2084,7 +2084,6 @@ int __init acpi_scan_init(void) | |||
2084 | 2084 | ||
2085 | acpi_gpe_apply_masked_gpes(); | 2085 | acpi_gpe_apply_masked_gpes(); |
2086 | acpi_update_all_gpes(); | 2086 | acpi_update_all_gpes(); |
2087 | acpi_ec_ecdt_start(); | ||
2088 | 2087 | ||
2089 | acpi_scan_initialized = true; | 2088 | acpi_scan_initialized = true; |
2090 | 2089 | ||