Skip to content

Commit 48c6041

Browse files
committed
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
3 parents 6e6c252 + 2d2feb6 + 9572223 commit 48c6041

File tree

15 files changed

+67
-34
lines changed

15 files changed

+67
-34
lines changed

drivers/acpi/acpi_lpit.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,10 +151,11 @@ void acpi_init_lpit(void)
151151
struct acpi_table_lpit *lpit;
152152

153153
status = acpi_get_table(ACPI_SIG_LPIT, 0, (struct acpi_table_header **)&lpit);
154-
155154
if (ACPI_FAILURE(status))
156155
return;
157156

158157
lpit_process((u64)lpit + sizeof(*lpit),
159158
(u64)lpit + lpit->header.length);
159+
160+
acpi_put_table((struct acpi_table_header *)lpit);
160161
}

drivers/acpi/acpi_watchdog.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ static const struct acpi_table_wdat *acpi_watchdog_get_wdat(void)
7373
}
7474

7575
if (acpi_watchdog_uses_rtc(wdat)) {
76+
acpi_put_table((struct acpi_table_header *)wdat);
7677
pr_info("Skipping WDAT on this system because it uses RTC SRAM\n");
7778
return NULL;
7879
}
@@ -117,12 +118,12 @@ void __init acpi_watchdog_init(void)
117118

118119
/* Watchdog disabled by BIOS */
119120
if (!(wdat->flags & ACPI_WDAT_ENABLED))
120-
return;
121+
goto fail_put_wdat;
121122

122123
/* Skip legacy PCI WDT devices */
123124
if (wdat->pci_segment != 0xff || wdat->pci_bus != 0xff ||
124125
wdat->pci_device != 0xff || wdat->pci_function != 0xff)
125-
return;
126+
goto fail_put_wdat;
126127

127128
INIT_LIST_HEAD(&resource_list);
128129

@@ -188,4 +189,6 @@ void __init acpi_watchdog_init(void)
188189

189190
fail_free_resource_list:
190191
resource_list_free(&resource_list);
192+
fail_put_wdat:
193+
acpi_put_table((struct acpi_table_header *)wdat);
191194
}

drivers/acpi/acpica/acglobal.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -290,6 +290,7 @@ ACPI_GLOBAL(struct acpi_external_file *, acpi_gbl_external_file_list);
290290
#ifdef ACPI_DEBUGGER
291291
ACPI_INIT_GLOBAL(u8, acpi_gbl_abort_method, FALSE);
292292
ACPI_INIT_GLOBAL(acpi_thread_id, acpi_gbl_db_thread_id, ACPI_INVALID_THREAD_ID);
293+
ACPI_INIT_GLOBAL(u32, acpi_gbl_next_cmd_num, 1);
293294

294295
ACPI_GLOBAL(u8, acpi_gbl_db_opt_no_ini_methods);
295296
ACPI_GLOBAL(u8, acpi_gbl_db_opt_no_region_support);

drivers/acpi/acpica/acpredef.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -640,10 +640,10 @@ const union acpi_predefined_info acpi_gbl_predefined_methods[] = {
640640
{{"_NIC", METHOD_0ARGS, /* ACPI 6.3 */
641641
METHOD_RETURNS(ACPI_RTYPE_BUFFER)}},
642642

643-
{{"_NIG", METHOD_1ARGS(ACPI_TYPE_BUFFER), /* ACPI 6.3 */
643+
{{"_NIG", METHOD_0ARGS, /* ACPI 6.3 */
644644
METHOD_RETURNS(ACPI_RTYPE_BUFFER)}},
645645

646-
{{"_NIH", METHOD_0ARGS, /* ACPI 6.3 */
646+
{{"_NIH", METHOD_1ARGS(ACPI_TYPE_BUFFER), /* ACPI 6.3 */
647647
METHOD_RETURNS(ACPI_RTYPE_BUFFER)}},
648648

649649
{{"_NTT", METHOD_0ARGS,

drivers/acpi/acpica/dbhistry.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ static HISTORY_INFO acpi_gbl_history_buffer[HISTORY_SIZE];
2727
static u16 acpi_gbl_lo_history = 0;
2828
static u16 acpi_gbl_num_history = 0;
2929
static u16 acpi_gbl_next_history_index = 0;
30-
u32 acpi_gbl_next_cmd_num = 1;
3130

3231
/*******************************************************************************
3332
*

drivers/acpi/acpica/dsfield.c

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,10 @@ acpi_ds_create_buffer_field(union acpi_parse_object *op,
177177
arg->common.value.string, ACPI_TYPE_ANY,
178178
ACPI_IMODE_LOAD_PASS1, flags,
179179
walk_state, &node);
180-
if (ACPI_FAILURE(status)) {
180+
if ((walk_state->parse_flags & ACPI_PARSE_DISASSEMBLE)
181+
&& status == AE_ALREADY_EXISTS) {
182+
status = AE_OK;
183+
} else if (ACPI_FAILURE(status)) {
181184
ACPI_ERROR_NAMESPACE(walk_state->scope_info,
182185
arg->common.value.string, status);
183186
return_ACPI_STATUS(status);
@@ -514,13 +517,20 @@ acpi_ds_create_field(union acpi_parse_object *op,
514517
info.region_node = region_node;
515518

516519
status = acpi_ds_get_field_names(&info, walk_state, arg->common.next);
520+
if (ACPI_FAILURE(status)) {
521+
return_ACPI_STATUS(status);
522+
}
523+
517524
if (info.region_node->object->region.space_id ==
518-
ACPI_ADR_SPACE_PLATFORM_COMM
519-
&& !(region_node->object->field.internal_pcc_buffer =
520-
ACPI_ALLOCATE_ZEROED(info.region_node->object->region.
521-
length))) {
522-
return_ACPI_STATUS(AE_NO_MEMORY);
525+
ACPI_ADR_SPACE_PLATFORM_COMM) {
526+
region_node->object->field.internal_pcc_buffer =
527+
ACPI_ALLOCATE_ZEROED(info.region_node->object->region.
528+
length);
529+
if (!region_node->object->field.internal_pcc_buffer) {
530+
return_ACPI_STATUS(AE_NO_MEMORY);
531+
}
523532
}
533+
524534
return_ACPI_STATUS(status);
525535
}
526536

drivers/acpi/acpica/exfield.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ ACPI_MODULE_NAME("exfield")
2222
*/
2323
#define ACPI_INVALID_PROTOCOL_ID 0x80
2424
#define ACPI_MAX_PROTOCOL_ID 0x0F
25-
const u8 acpi_protocol_lengths[] = {
25+
static const u8 acpi_protocol_lengths[] = {
2626
ACPI_INVALID_PROTOCOL_ID, /* 0 - reserved */
2727
ACPI_INVALID_PROTOCOL_ID, /* 1 - reserved */
2828
0x00, /* 2 - ATTRIB_QUICK */

drivers/acpi/apei/bert.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -119,15 +119,15 @@ static int __init bert_init(void)
119119
rc = bert_check_table(bert_tab);
120120
if (rc) {
121121
pr_err(FW_BUG "table invalid.\n");
122-
return rc;
122+
goto out_put_bert_tab;
123123
}
124124

125125
region_len = bert_tab->region_length;
126126
apei_resources_init(&bert_resources);
127127
rc = apei_resources_add(&bert_resources, bert_tab->address,
128128
region_len, true);
129129
if (rc)
130-
return rc;
130+
goto out_put_bert_tab;
131131
rc = apei_resources_request(&bert_resources, "APEI BERT");
132132
if (rc)
133133
goto out_fini;
@@ -142,6 +142,8 @@ static int __init bert_init(void)
142142
apei_resources_release(&bert_resources);
143143
out_fini:
144144
apei_resources_fini(&bert_resources);
145+
out_put_bert_tab:
146+
acpi_put_table((struct acpi_table_header *)bert_tab);
145147

146148
return rc;
147149
}

drivers/acpi/apei/einj.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -692,7 +692,7 @@ static int __init einj_init(void)
692692
rc = einj_check_table(einj_tab);
693693
if (rc) {
694694
pr_warn(FW_BUG "Invalid EINJ table.\n");
695-
return -EINVAL;
695+
goto err_put_table;
696696
}
697697

698698
rc = -ENOMEM;
@@ -760,6 +760,8 @@ static int __init einj_init(void)
760760
err_fini:
761761
apei_resources_fini(&einj_resources);
762762
debugfs_remove_recursive(einj_debug_dir);
763+
err_put_table:
764+
acpi_put_table((struct acpi_table_header *)einj_tab);
763765

764766
return rc;
765767
}
@@ -780,6 +782,7 @@ static void __exit einj_exit(void)
780782
apei_resources_release(&einj_resources);
781783
apei_resources_fini(&einj_resources);
782784
debugfs_remove_recursive(einj_debug_dir);
785+
acpi_put_table((struct acpi_table_header *)einj_tab);
783786
}
784787

785788
module_init(einj_init);

drivers/acpi/apei/erst.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1122,7 +1122,7 @@ static int __init erst_init(void)
11221122
rc = erst_check_table(erst_tab);
11231123
if (rc) {
11241124
pr_err(FW_BUG "ERST table is invalid.\n");
1125-
goto err;
1125+
goto err_put_erst_tab;
11261126
}
11271127

11281128
apei_resources_init(&erst_resources);
@@ -1196,6 +1196,8 @@ static int __init erst_init(void)
11961196
apei_resources_release(&erst_resources);
11971197
err_fini:
11981198
apei_resources_fini(&erst_resources);
1199+
err_put_erst_tab:
1200+
acpi_put_table((struct acpi_table_header *)erst_tab);
11991201
err:
12001202
erst_disable = 1;
12011203
return rc;

0 commit comments

Comments
 (0)