mirror of
https://gitee.com/bianbu-linux/linux-6.6
synced 2025-04-24 14:07:52 -04:00
Merge branches 'acpica' and 'acpi-tables'
* acpica: ACPICA: Update version to 20200430 ACPICA: Fix required parameters for _NIG and _NIH ACPICA: Dispatcher: add status checks ACPICA: Disassembler: ignore AE_ALREADY_EXISTS status when parsing create operators ACPICA: Move acpi_gbl_next_cmd_num definition to acglobal.h ACPICA: Make acpi_protocol_lengths static * acpi-tables: ACPI: sleep: Put the FACS table after using it ACPI: scan: Put SPCR and STAO table after using it ACPI: EC: Put the ACPI table after using it ACPI: APEI: Put the HEST table for error path ACPI: APEI: Put the error record serialization table for error path ACPI: APEI: Put the error injection table for error path and module exit ACPI: APEI: Put the boot error record table after parsing ACPI: watchdog: Put the watchdog action table after parsing ACPI: LPIT: Put the low power idle table after using it
This commit is contained in:
commit
48c604151a
15 changed files with 68 additions and 35 deletions
|
@ -151,10 +151,11 @@ void acpi_init_lpit(void)
|
||||||
struct acpi_table_lpit *lpit;
|
struct acpi_table_lpit *lpit;
|
||||||
|
|
||||||
status = acpi_get_table(ACPI_SIG_LPIT, 0, (struct acpi_table_header **)&lpit);
|
status = acpi_get_table(ACPI_SIG_LPIT, 0, (struct acpi_table_header **)&lpit);
|
||||||
|
|
||||||
if (ACPI_FAILURE(status))
|
if (ACPI_FAILURE(status))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
lpit_process((u64)lpit + sizeof(*lpit),
|
lpit_process((u64)lpit + sizeof(*lpit),
|
||||||
(u64)lpit + lpit->header.length);
|
(u64)lpit + lpit->header.length);
|
||||||
|
|
||||||
|
acpi_put_table((struct acpi_table_header *)lpit);
|
||||||
}
|
}
|
||||||
|
|
|
@ -73,6 +73,7 @@ static const struct acpi_table_wdat *acpi_watchdog_get_wdat(void)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (acpi_watchdog_uses_rtc(wdat)) {
|
if (acpi_watchdog_uses_rtc(wdat)) {
|
||||||
|
acpi_put_table((struct acpi_table_header *)wdat);
|
||||||
pr_info("Skipping WDAT on this system because it uses RTC SRAM\n");
|
pr_info("Skipping WDAT on this system because it uses RTC SRAM\n");
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
@ -117,12 +118,12 @@ void __init acpi_watchdog_init(void)
|
||||||
|
|
||||||
/* Watchdog disabled by BIOS */
|
/* Watchdog disabled by BIOS */
|
||||||
if (!(wdat->flags & ACPI_WDAT_ENABLED))
|
if (!(wdat->flags & ACPI_WDAT_ENABLED))
|
||||||
return;
|
goto fail_put_wdat;
|
||||||
|
|
||||||
/* Skip legacy PCI WDT devices */
|
/* Skip legacy PCI WDT devices */
|
||||||
if (wdat->pci_segment != 0xff || wdat->pci_bus != 0xff ||
|
if (wdat->pci_segment != 0xff || wdat->pci_bus != 0xff ||
|
||||||
wdat->pci_device != 0xff || wdat->pci_function != 0xff)
|
wdat->pci_device != 0xff || wdat->pci_function != 0xff)
|
||||||
return;
|
goto fail_put_wdat;
|
||||||
|
|
||||||
INIT_LIST_HEAD(&resource_list);
|
INIT_LIST_HEAD(&resource_list);
|
||||||
|
|
||||||
|
@ -188,4 +189,6 @@ void __init acpi_watchdog_init(void)
|
||||||
|
|
||||||
fail_free_resource_list:
|
fail_free_resource_list:
|
||||||
resource_list_free(&resource_list);
|
resource_list_free(&resource_list);
|
||||||
|
fail_put_wdat:
|
||||||
|
acpi_put_table((struct acpi_table_header *)wdat);
|
||||||
}
|
}
|
||||||
|
|
|
@ -290,6 +290,7 @@ ACPI_GLOBAL(struct acpi_external_file *, acpi_gbl_external_file_list);
|
||||||
#ifdef ACPI_DEBUGGER
|
#ifdef ACPI_DEBUGGER
|
||||||
ACPI_INIT_GLOBAL(u8, acpi_gbl_abort_method, FALSE);
|
ACPI_INIT_GLOBAL(u8, acpi_gbl_abort_method, FALSE);
|
||||||
ACPI_INIT_GLOBAL(acpi_thread_id, acpi_gbl_db_thread_id, ACPI_INVALID_THREAD_ID);
|
ACPI_INIT_GLOBAL(acpi_thread_id, acpi_gbl_db_thread_id, ACPI_INVALID_THREAD_ID);
|
||||||
|
ACPI_INIT_GLOBAL(u32, acpi_gbl_next_cmd_num, 1);
|
||||||
|
|
||||||
ACPI_GLOBAL(u8, acpi_gbl_db_opt_no_ini_methods);
|
ACPI_GLOBAL(u8, acpi_gbl_db_opt_no_ini_methods);
|
||||||
ACPI_GLOBAL(u8, acpi_gbl_db_opt_no_region_support);
|
ACPI_GLOBAL(u8, acpi_gbl_db_opt_no_region_support);
|
||||||
|
|
|
@ -640,10 +640,10 @@ const union acpi_predefined_info acpi_gbl_predefined_methods[] = {
|
||||||
{{"_NIC", METHOD_0ARGS, /* ACPI 6.3 */
|
{{"_NIC", METHOD_0ARGS, /* ACPI 6.3 */
|
||||||
METHOD_RETURNS(ACPI_RTYPE_BUFFER)}},
|
METHOD_RETURNS(ACPI_RTYPE_BUFFER)}},
|
||||||
|
|
||||||
{{"_NIG", METHOD_1ARGS(ACPI_TYPE_BUFFER), /* ACPI 6.3 */
|
{{"_NIG", METHOD_0ARGS, /* ACPI 6.3 */
|
||||||
METHOD_RETURNS(ACPI_RTYPE_BUFFER)}},
|
METHOD_RETURNS(ACPI_RTYPE_BUFFER)}},
|
||||||
|
|
||||||
{{"_NIH", METHOD_0ARGS, /* ACPI 6.3 */
|
{{"_NIH", METHOD_1ARGS(ACPI_TYPE_BUFFER), /* ACPI 6.3 */
|
||||||
METHOD_RETURNS(ACPI_RTYPE_BUFFER)}},
|
METHOD_RETURNS(ACPI_RTYPE_BUFFER)}},
|
||||||
|
|
||||||
{{"_NTT", METHOD_0ARGS,
|
{{"_NTT", METHOD_0ARGS,
|
||||||
|
|
|
@ -27,7 +27,6 @@ static HISTORY_INFO acpi_gbl_history_buffer[HISTORY_SIZE];
|
||||||
static u16 acpi_gbl_lo_history = 0;
|
static u16 acpi_gbl_lo_history = 0;
|
||||||
static u16 acpi_gbl_num_history = 0;
|
static u16 acpi_gbl_num_history = 0;
|
||||||
static u16 acpi_gbl_next_history_index = 0;
|
static u16 acpi_gbl_next_history_index = 0;
|
||||||
u32 acpi_gbl_next_cmd_num = 1;
|
|
||||||
|
|
||||||
/*******************************************************************************
|
/*******************************************************************************
|
||||||
*
|
*
|
||||||
|
|
|
@ -177,7 +177,10 @@ acpi_ds_create_buffer_field(union acpi_parse_object *op,
|
||||||
arg->common.value.string, ACPI_TYPE_ANY,
|
arg->common.value.string, ACPI_TYPE_ANY,
|
||||||
ACPI_IMODE_LOAD_PASS1, flags,
|
ACPI_IMODE_LOAD_PASS1, flags,
|
||||||
walk_state, &node);
|
walk_state, &node);
|
||||||
if (ACPI_FAILURE(status)) {
|
if ((walk_state->parse_flags & ACPI_PARSE_DISASSEMBLE)
|
||||||
|
&& status == AE_ALREADY_EXISTS) {
|
||||||
|
status = AE_OK;
|
||||||
|
} else if (ACPI_FAILURE(status)) {
|
||||||
ACPI_ERROR_NAMESPACE(walk_state->scope_info,
|
ACPI_ERROR_NAMESPACE(walk_state->scope_info,
|
||||||
arg->common.value.string, status);
|
arg->common.value.string, status);
|
||||||
return_ACPI_STATUS(status);
|
return_ACPI_STATUS(status);
|
||||||
|
@ -514,13 +517,20 @@ acpi_ds_create_field(union acpi_parse_object *op,
|
||||||
info.region_node = region_node;
|
info.region_node = region_node;
|
||||||
|
|
||||||
status = acpi_ds_get_field_names(&info, walk_state, arg->common.next);
|
status = acpi_ds_get_field_names(&info, walk_state, arg->common.next);
|
||||||
if (info.region_node->object->region.space_id ==
|
if (ACPI_FAILURE(status)) {
|
||||||
ACPI_ADR_SPACE_PLATFORM_COMM
|
return_ACPI_STATUS(status);
|
||||||
&& !(region_node->object->field.internal_pcc_buffer =
|
|
||||||
ACPI_ALLOCATE_ZEROED(info.region_node->object->region.
|
|
||||||
length))) {
|
|
||||||
return_ACPI_STATUS(AE_NO_MEMORY);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (info.region_node->object->region.space_id ==
|
||||||
|
ACPI_ADR_SPACE_PLATFORM_COMM) {
|
||||||
|
region_node->object->field.internal_pcc_buffer =
|
||||||
|
ACPI_ALLOCATE_ZEROED(info.region_node->object->region.
|
||||||
|
length);
|
||||||
|
if (!region_node->object->field.internal_pcc_buffer) {
|
||||||
|
return_ACPI_STATUS(AE_NO_MEMORY);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return_ACPI_STATUS(status);
|
return_ACPI_STATUS(status);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -22,7 +22,7 @@ ACPI_MODULE_NAME("exfield")
|
||||||
*/
|
*/
|
||||||
#define ACPI_INVALID_PROTOCOL_ID 0x80
|
#define ACPI_INVALID_PROTOCOL_ID 0x80
|
||||||
#define ACPI_MAX_PROTOCOL_ID 0x0F
|
#define ACPI_MAX_PROTOCOL_ID 0x0F
|
||||||
const u8 acpi_protocol_lengths[] = {
|
static const u8 acpi_protocol_lengths[] = {
|
||||||
ACPI_INVALID_PROTOCOL_ID, /* 0 - reserved */
|
ACPI_INVALID_PROTOCOL_ID, /* 0 - reserved */
|
||||||
ACPI_INVALID_PROTOCOL_ID, /* 1 - reserved */
|
ACPI_INVALID_PROTOCOL_ID, /* 1 - reserved */
|
||||||
0x00, /* 2 - ATTRIB_QUICK */
|
0x00, /* 2 - ATTRIB_QUICK */
|
||||||
|
|
|
@ -119,7 +119,7 @@ static int __init bert_init(void)
|
||||||
rc = bert_check_table(bert_tab);
|
rc = bert_check_table(bert_tab);
|
||||||
if (rc) {
|
if (rc) {
|
||||||
pr_err(FW_BUG "table invalid.\n");
|
pr_err(FW_BUG "table invalid.\n");
|
||||||
return rc;
|
goto out_put_bert_tab;
|
||||||
}
|
}
|
||||||
|
|
||||||
region_len = bert_tab->region_length;
|
region_len = bert_tab->region_length;
|
||||||
|
@ -127,7 +127,7 @@ static int __init bert_init(void)
|
||||||
rc = apei_resources_add(&bert_resources, bert_tab->address,
|
rc = apei_resources_add(&bert_resources, bert_tab->address,
|
||||||
region_len, true);
|
region_len, true);
|
||||||
if (rc)
|
if (rc)
|
||||||
return rc;
|
goto out_put_bert_tab;
|
||||||
rc = apei_resources_request(&bert_resources, "APEI BERT");
|
rc = apei_resources_request(&bert_resources, "APEI BERT");
|
||||||
if (rc)
|
if (rc)
|
||||||
goto out_fini;
|
goto out_fini;
|
||||||
|
@ -142,6 +142,8 @@ static int __init bert_init(void)
|
||||||
apei_resources_release(&bert_resources);
|
apei_resources_release(&bert_resources);
|
||||||
out_fini:
|
out_fini:
|
||||||
apei_resources_fini(&bert_resources);
|
apei_resources_fini(&bert_resources);
|
||||||
|
out_put_bert_tab:
|
||||||
|
acpi_put_table((struct acpi_table_header *)bert_tab);
|
||||||
|
|
||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
|
|
|
@ -692,7 +692,7 @@ static int __init einj_init(void)
|
||||||
rc = einj_check_table(einj_tab);
|
rc = einj_check_table(einj_tab);
|
||||||
if (rc) {
|
if (rc) {
|
||||||
pr_warn(FW_BUG "Invalid EINJ table.\n");
|
pr_warn(FW_BUG "Invalid EINJ table.\n");
|
||||||
return -EINVAL;
|
goto err_put_table;
|
||||||
}
|
}
|
||||||
|
|
||||||
rc = -ENOMEM;
|
rc = -ENOMEM;
|
||||||
|
@ -760,6 +760,8 @@ err_release:
|
||||||
err_fini:
|
err_fini:
|
||||||
apei_resources_fini(&einj_resources);
|
apei_resources_fini(&einj_resources);
|
||||||
debugfs_remove_recursive(einj_debug_dir);
|
debugfs_remove_recursive(einj_debug_dir);
|
||||||
|
err_put_table:
|
||||||
|
acpi_put_table((struct acpi_table_header *)einj_tab);
|
||||||
|
|
||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
|
@ -780,6 +782,7 @@ static void __exit einj_exit(void)
|
||||||
apei_resources_release(&einj_resources);
|
apei_resources_release(&einj_resources);
|
||||||
apei_resources_fini(&einj_resources);
|
apei_resources_fini(&einj_resources);
|
||||||
debugfs_remove_recursive(einj_debug_dir);
|
debugfs_remove_recursive(einj_debug_dir);
|
||||||
|
acpi_put_table((struct acpi_table_header *)einj_tab);
|
||||||
}
|
}
|
||||||
|
|
||||||
module_init(einj_init);
|
module_init(einj_init);
|
||||||
|
|
|
@ -1122,7 +1122,7 @@ static int __init erst_init(void)
|
||||||
rc = erst_check_table(erst_tab);
|
rc = erst_check_table(erst_tab);
|
||||||
if (rc) {
|
if (rc) {
|
||||||
pr_err(FW_BUG "ERST table is invalid.\n");
|
pr_err(FW_BUG "ERST table is invalid.\n");
|
||||||
goto err;
|
goto err_put_erst_tab;
|
||||||
}
|
}
|
||||||
|
|
||||||
apei_resources_init(&erst_resources);
|
apei_resources_init(&erst_resources);
|
||||||
|
@ -1196,6 +1196,8 @@ err_release:
|
||||||
apei_resources_release(&erst_resources);
|
apei_resources_release(&erst_resources);
|
||||||
err_fini:
|
err_fini:
|
||||||
apei_resources_fini(&erst_resources);
|
apei_resources_fini(&erst_resources);
|
||||||
|
err_put_erst_tab:
|
||||||
|
acpi_put_table((struct acpi_table_header *)erst_tab);
|
||||||
err:
|
err:
|
||||||
erst_disable = 1;
|
erst_disable = 1;
|
||||||
return rc;
|
return rc;
|
||||||
|
|
|
@ -243,8 +243,8 @@ void __init acpi_hest_init(void)
|
||||||
} else if (ACPI_FAILURE(status)) {
|
} else if (ACPI_FAILURE(status)) {
|
||||||
const char *msg = acpi_format_exception(status);
|
const char *msg = acpi_format_exception(status);
|
||||||
pr_err(HEST_PFX "Failed to get table, %s\n", msg);
|
pr_err(HEST_PFX "Failed to get table, %s\n", msg);
|
||||||
rc = -EINVAL;
|
hest_disable = HEST_DISABLED;
|
||||||
goto err;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
rc = apei_hest_parse(hest_parse_cmc, NULL);
|
rc = apei_hest_parse(hest_parse_cmc, NULL);
|
||||||
|
@ -266,4 +266,5 @@ void __init acpi_hest_init(void)
|
||||||
return;
|
return;
|
||||||
err:
|
err:
|
||||||
hest_disable = HEST_DISABLED;
|
hest_disable = HEST_DISABLED;
|
||||||
|
acpi_put_table((struct acpi_table_header *)hest_tab);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1783,13 +1783,14 @@ static void __init acpi_ec_ecdt_start(void)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
status = acpi_get_handle(NULL, ecdt_ptr->id, &handle);
|
status = acpi_get_handle(NULL, ecdt_ptr->id, &handle);
|
||||||
if (ACPI_FAILURE(status))
|
if (ACPI_SUCCESS(status)) {
|
||||||
return;
|
boot_ec->handle = handle;
|
||||||
|
|
||||||
boot_ec->handle = handle;
|
/* Add a special ACPI device object to represent the boot EC. */
|
||||||
|
acpi_bus_register_early_device(ACPI_BUS_TYPE_ECDT_EC);
|
||||||
|
}
|
||||||
|
|
||||||
/* Add a special ACPI device object to represent the boot EC. */
|
acpi_put_table((struct acpi_table_header *)ecdt_ptr);
|
||||||
acpi_bus_register_early_device(ACPI_BUS_TYPE_ECDT_EC);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -1891,12 +1892,12 @@ void __init acpi_ec_ecdt_probe(void)
|
||||||
* Asus X50GL:
|
* Asus X50GL:
|
||||||
* https://bugzilla.kernel.org/show_bug.cgi?id=11880
|
* https://bugzilla.kernel.org/show_bug.cgi?id=11880
|
||||||
*/
|
*/
|
||||||
return;
|
goto out;
|
||||||
}
|
}
|
||||||
|
|
||||||
ec = acpi_ec_alloc();
|
ec = acpi_ec_alloc();
|
||||||
if (!ec)
|
if (!ec)
|
||||||
return;
|
goto out;
|
||||||
|
|
||||||
if (EC_FLAGS_CORRECT_ECDT) {
|
if (EC_FLAGS_CORRECT_ECDT) {
|
||||||
ec->command_addr = ecdt_ptr->data.address;
|
ec->command_addr = ecdt_ptr->data.address;
|
||||||
|
@ -1922,13 +1923,16 @@ void __init acpi_ec_ecdt_probe(void)
|
||||||
ret = acpi_ec_setup(ec, NULL);
|
ret = acpi_ec_setup(ec, NULL);
|
||||||
if (ret) {
|
if (ret) {
|
||||||
acpi_ec_free(ec);
|
acpi_ec_free(ec);
|
||||||
return;
|
goto out;
|
||||||
}
|
}
|
||||||
|
|
||||||
boot_ec = ec;
|
boot_ec = ec;
|
||||||
boot_ec_is_ecdt = true;
|
boot_ec_is_ecdt = true;
|
||||||
|
|
||||||
pr_info("Boot ECDT EC used to handle transactions\n");
|
pr_info("Boot ECDT EC used to handle transactions\n");
|
||||||
|
|
||||||
|
out:
|
||||||
|
acpi_put_table((struct acpi_table_header *)ecdt_ptr);
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef CONFIG_PM_SLEEP
|
#ifdef CONFIG_PM_SLEEP
|
||||||
|
|
|
@ -2157,10 +2157,13 @@ static void __init acpi_get_spcr_uart_addr(void)
|
||||||
|
|
||||||
status = acpi_get_table(ACPI_SIG_SPCR, 0,
|
status = acpi_get_table(ACPI_SIG_SPCR, 0,
|
||||||
(struct acpi_table_header **)&spcr_ptr);
|
(struct acpi_table_header **)&spcr_ptr);
|
||||||
if (ACPI_SUCCESS(status))
|
if (ACPI_FAILURE(status)) {
|
||||||
spcr_uart_addr = spcr_ptr->serial_port.address;
|
pr_warn(PREFIX "STAO table present, but SPCR is missing\n");
|
||||||
else
|
return;
|
||||||
printk(KERN_WARNING PREFIX "STAO table present, but SPCR is missing\n");
|
}
|
||||||
|
|
||||||
|
spcr_uart_addr = spcr_ptr->serial_port.address;
|
||||||
|
acpi_put_table((struct acpi_table_header *)spcr_ptr);
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool acpi_scan_initialized;
|
static bool acpi_scan_initialized;
|
||||||
|
@ -2196,10 +2199,12 @@ int __init acpi_scan_init(void)
|
||||||
(struct acpi_table_header **)&stao_ptr);
|
(struct acpi_table_header **)&stao_ptr);
|
||||||
if (ACPI_SUCCESS(status)) {
|
if (ACPI_SUCCESS(status)) {
|
||||||
if (stao_ptr->header.length > sizeof(struct acpi_table_stao))
|
if (stao_ptr->header.length > sizeof(struct acpi_table_stao))
|
||||||
printk(KERN_INFO PREFIX "STAO Name List not yet supported.");
|
pr_info(PREFIX "STAO Name List not yet supported.\n");
|
||||||
|
|
||||||
if (stao_ptr->ignore_uart)
|
if (stao_ptr->ignore_uart)
|
||||||
acpi_get_spcr_uart_addr();
|
acpi_get_spcr_uart_addr();
|
||||||
|
|
||||||
|
acpi_put_table((struct acpi_table_header *)stao_ptr);
|
||||||
}
|
}
|
||||||
|
|
||||||
acpi_gpe_apply_masked_gpes();
|
acpi_gpe_apply_masked_gpes();
|
||||||
|
|
|
@ -1280,8 +1280,10 @@ static void acpi_sleep_hibernate_setup(void)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
acpi_get_table(ACPI_SIG_FACS, 1, (struct acpi_table_header **)&facs);
|
acpi_get_table(ACPI_SIG_FACS, 1, (struct acpi_table_header **)&facs);
|
||||||
if (facs)
|
if (facs) {
|
||||||
s4_hardware_signature = facs->hardware_signature;
|
s4_hardware_signature = facs->hardware_signature;
|
||||||
|
acpi_put_table((struct acpi_table_header *)facs);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
#else /* !CONFIG_HIBERNATION */
|
#else /* !CONFIG_HIBERNATION */
|
||||||
static inline void acpi_sleep_hibernate_setup(void) {}
|
static inline void acpi_sleep_hibernate_setup(void) {}
|
||||||
|
|
|
@ -12,7 +12,7 @@
|
||||||
|
|
||||||
/* Current ACPICA subsystem version in YYYYMMDD format */
|
/* Current ACPICA subsystem version in YYYYMMDD format */
|
||||||
|
|
||||||
#define ACPI_CA_VERSION 0x20200326
|
#define ACPI_CA_VERSION 0x20200430
|
||||||
|
|
||||||
#include <acpi/acconfig.h>
|
#include <acpi/acconfig.h>
|
||||||
#include <acpi/actypes.h>
|
#include <acpi/actypes.h>
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue