diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2016-06-10 11:15:37 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2016-06-10 11:15:37 -0400 |
commit | f758bbd470723b306a01bc3655ef77f888aa3c99 (patch) | |
tree | a15a81efcff1b560214cb6c3036e4c8945b51400 | |
parent | 524a3f2ca284831262fcf5e4ca145ef32f4b282d (diff) | |
parent | bd6ac2abc9937eb7613aa194195fd98fe9312b38 (diff) |
Merge tag 'acpi-4.7-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm
Pull ACPI fix from Rafael Wysocki:
"A recently introduced boot regression related to the ACPI EC
initialization is addressed by restoring the previous behavior (Lv
Zheng)"
* tag 'acpi-4.7-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm:
ACPI / EC: Fix a boot EC regresion by restoring boot EC support for the DSDT EC
-rw-r--r-- | drivers/acpi/bus.c | 2 | ||||
-rw-r--r-- | drivers/acpi/ec.c | 29 | ||||
-rw-r--r-- | drivers/acpi/internal.h | 2 |
3 files changed, 24 insertions, 9 deletions
diff --git a/drivers/acpi/bus.c b/drivers/acpi/bus.c index 31e8da648fff..262ca31b86d9 100644 --- a/drivers/acpi/bus.c +++ b/drivers/acpi/bus.c | |||
@@ -1051,7 +1051,7 @@ static int __init acpi_bus_init(void) | |||
1051 | * Maybe EC region is required at bus_scan/acpi_get_devices. So it | 1051 | * Maybe EC region is required at bus_scan/acpi_get_devices. So it |
1052 | * is necessary to enable it as early as possible. | 1052 | * is necessary to enable it as early as possible. |
1053 | */ | 1053 | */ |
1054 | acpi_boot_ec_enable(); | 1054 | acpi_ec_dsdt_probe(); |
1055 | 1055 | ||
1056 | printk(KERN_INFO PREFIX "Interpreter enabled\n"); | 1056 | printk(KERN_INFO PREFIX "Interpreter enabled\n"); |
1057 | 1057 | ||
diff --git a/drivers/acpi/ec.c b/drivers/acpi/ec.c index 0e70181f150c..73c76d646064 100644 --- a/drivers/acpi/ec.c +++ b/drivers/acpi/ec.c | |||
@@ -1446,10 +1446,30 @@ ec_parse_io_ports(struct acpi_resource *resource, void *context) | |||
1446 | return AE_OK; | 1446 | return AE_OK; |
1447 | } | 1447 | } |
1448 | 1448 | ||
1449 | int __init acpi_boot_ec_enable(void) | 1449 | static const struct acpi_device_id ec_device_ids[] = { |
1450 | {"PNP0C09", 0}, | ||
1451 | {"", 0}, | ||
1452 | }; | ||
1453 | |||
1454 | int __init acpi_ec_dsdt_probe(void) | ||
1450 | { | 1455 | { |
1451 | if (!boot_ec) | 1456 | acpi_status status; |
1457 | |||
1458 | if (boot_ec) | ||
1452 | return 0; | 1459 | return 0; |
1460 | |||
1461 | /* | ||
1462 | * Finding EC from DSDT if there is no ECDT EC available. When this | ||
1463 | * function is invoked, ACPI tables have been fully loaded, we can | ||
1464 | * walk namespace now. | ||
1465 | */ | ||
1466 | boot_ec = make_acpi_ec(); | ||
1467 | if (!boot_ec) | ||
1468 | return -ENOMEM; | ||
1469 | status = acpi_get_devices(ec_device_ids[0].id, | ||
1470 | ec_parse_device, boot_ec, NULL); | ||
1471 | if (ACPI_FAILURE(status) || !boot_ec->handle) | ||
1472 | return -ENODEV; | ||
1453 | if (!ec_install_handlers(boot_ec)) { | 1473 | if (!ec_install_handlers(boot_ec)) { |
1454 | first_ec = boot_ec; | 1474 | first_ec = boot_ec; |
1455 | return 0; | 1475 | return 0; |
@@ -1457,11 +1477,6 @@ int __init acpi_boot_ec_enable(void) | |||
1457 | return -EFAULT; | 1477 | return -EFAULT; |
1458 | } | 1478 | } |
1459 | 1479 | ||
1460 | static const struct acpi_device_id ec_device_ids[] = { | ||
1461 | {"PNP0C09", 0}, | ||
1462 | {"", 0}, | ||
1463 | }; | ||
1464 | |||
1465 | #if 0 | 1480 | #if 0 |
1466 | /* | 1481 | /* |
1467 | * Some EC firmware variations refuses to respond QR_EC when SCI_EVT is not | 1482 | * Some EC firmware variations refuses to respond QR_EC when SCI_EVT is not |
diff --git a/drivers/acpi/internal.h b/drivers/acpi/internal.h index 9bb0773d39bf..27cc7feabfe4 100644 --- a/drivers/acpi/internal.h +++ b/drivers/acpi/internal.h | |||
@@ -181,7 +181,7 @@ typedef int (*acpi_ec_query_func) (void *data); | |||
181 | 181 | ||
182 | int acpi_ec_init(void); | 182 | int acpi_ec_init(void); |
183 | int acpi_ec_ecdt_probe(void); | 183 | int acpi_ec_ecdt_probe(void); |
184 | int acpi_boot_ec_enable(void); | 184 | int acpi_ec_dsdt_probe(void); |
185 | void acpi_ec_block_transactions(void); | 185 | void acpi_ec_block_transactions(void); |
186 | void acpi_ec_unblock_transactions(void); | 186 | void acpi_ec_unblock_transactions(void); |
187 | void acpi_ec_unblock_transactions_early(void); | 187 | void acpi_ec_unblock_transactions_early(void); |