From 1f57e6a2c4ae3840449ea1c2708cea43aa15f3ec Mon Sep 17 00:00:00 2001 From: Erik Kaneda Date: Fri, 14 Feb 2020 10:47:55 -0800 Subject: ACPICA: ASL-ASL+ converter: remove function parameters from cv_init_file_tree() ACPICA commit 3ba6fa55a4a32d8b6fc28f9f285506ea0e359296 These parameters can be computed inside of the function from the Table parameter. Link: https://github.com/acpica/acpica/commit/3ba6fa55 Signed-off-by: Erik Kaneda Signed-off-by: Bob Moore Signed-off-by: Rafael J. Wysocki --- drivers/acpi/acpica/acconvert.h | 4 +--- drivers/acpi/acpica/acmacros.h | 4 ++-- 2 files changed, 3 insertions(+), 5 deletions(-) (limited to 'drivers/acpi') diff --git a/drivers/acpi/acpica/acconvert.h b/drivers/acpi/acpica/acconvert.h index ede4b9cc9e85..9eca93656116 100644 --- a/drivers/acpi/acpica/acconvert.h +++ b/drivers/acpi/acpica/acconvert.h @@ -65,9 +65,7 @@ void cg_write_aml_comment(union acpi_parse_object *op); /* * cvparser */ -void -cv_init_file_tree(struct acpi_table_header *table, - u8 *aml_start, u32 aml_length); +void cv_init_file_tree(struct acpi_table_header *table); void cv_clear_op_comments(union acpi_parse_object *op); diff --git a/drivers/acpi/acpica/acmacros.h b/drivers/acpi/acpica/acmacros.h index 2269e10bc21b..87d06c963a60 100644 --- a/drivers/acpi/acpica/acmacros.h +++ b/drivers/acpi/acpica/acmacros.h @@ -477,7 +477,7 @@ #define ASL_CV_PRINT_ONE_COMMENT(a,b,c,d) cv_print_one_comment_type (a,b,c,d); #define ASL_CV_PRINT_ONE_COMMENT_LIST(a,b) cv_print_one_comment_list (a,b); #define ASL_CV_FILE_HAS_SWITCHED(a) cv_file_has_switched(a) -#define ASL_CV_INIT_FILETREE(a,b,c) cv_init_file_tree(a,b,c); +#define ASL_CV_INIT_FILETREE(a) cv_init_file_tree(a); #else @@ -492,7 +492,7 @@ #define ASL_CV_PRINT_ONE_COMMENT(a,b,c,d) #define ASL_CV_PRINT_ONE_COMMENT_LIST(a,b) #define ASL_CV_FILE_HAS_SWITCHED(a) 0 -#define ASL_CV_INIT_FILETREE(a,b,c) +#define ASL_CV_INIT_FILETREE(a) #endif -- cgit v1.2.3 From 9e43f5d544e40d64686a38372d41d8100401d28c Mon Sep 17 00:00:00 2001 From: Erik Kaneda Date: Fri, 14 Feb 2020 10:47:56 -0800 Subject: ACPICA: ASL-ASL+ converter: make root file a parameter for cv_init_file_tree ACPICA commit 5d160cc86cca440eac7055f981e48bc14d4eb9f7 This decouples cv_init_file_tree from acpi_gbl_output_file and allows it to be called independently of acpi_os_redirect_output() Link: https://github.com/acpica/acpica/commit/5d160cc8 Signed-off-by: Erik Kaneda Signed-off-by: Bob Moore Signed-off-by: Rafael J. Wysocki --- drivers/acpi/acpica/acconvert.h | 2 +- drivers/acpi/acpica/acmacros.h | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'drivers/acpi') diff --git a/drivers/acpi/acpica/acconvert.h b/drivers/acpi/acpica/acconvert.h index 9eca93656116..cf85d66da6e7 100644 --- a/drivers/acpi/acpica/acconvert.h +++ b/drivers/acpi/acpica/acconvert.h @@ -65,7 +65,7 @@ void cg_write_aml_comment(union acpi_parse_object *op); /* * cvparser */ -void cv_init_file_tree(struct acpi_table_header *table); +void cv_init_file_tree(struct acpi_table_header *table, FILE * root_file); void cv_clear_op_comments(union acpi_parse_object *op); diff --git a/drivers/acpi/acpica/acmacros.h b/drivers/acpi/acpica/acmacros.h index 87d06c963a60..168904ba3086 100644 --- a/drivers/acpi/acpica/acmacros.h +++ b/drivers/acpi/acpica/acmacros.h @@ -477,7 +477,7 @@ #define ASL_CV_PRINT_ONE_COMMENT(a,b,c,d) cv_print_one_comment_type (a,b,c,d); #define ASL_CV_PRINT_ONE_COMMENT_LIST(a,b) cv_print_one_comment_list (a,b); #define ASL_CV_FILE_HAS_SWITCHED(a) cv_file_has_switched(a) -#define ASL_CV_INIT_FILETREE(a) cv_init_file_tree(a); +#define ASL_CV_INIT_FILETREE(a,b) cv_init_file_tree(a,b); #else @@ -492,7 +492,7 @@ #define ASL_CV_PRINT_ONE_COMMENT(a,b,c,d) #define ASL_CV_PRINT_ONE_COMMENT_LIST(a,b) #define ASL_CV_FILE_HAS_SWITCHED(a) 0 -#define ASL_CV_INIT_FILETREE(a) +#define ASL_CV_INIT_FILETREE(a,b) #endif -- cgit v1.2.3 From 4444b178529300a173b927bbef3e65d328fc15be Mon Sep 17 00:00:00 2001 From: Bob Moore Date: Fri, 14 Feb 2020 10:47:57 -0800 Subject: ACPICA: Fix a comment "enable" fixed events -> "disable" all fixed events. ACPICA commit af4462c6f41ebc9bf63b5370818c5fd96524e7a9 Link: https://github.com/acpica/acpica/commit/af4462c6 Signed-off-by: Bob Moore Signed-off-by: Erik Kaneda Signed-off-by: Rafael J. Wysocki --- drivers/acpi/acpica/evevent.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers/acpi') diff --git a/drivers/acpi/acpica/evevent.c b/drivers/acpi/acpica/evevent.c index 8c83d8c620dc..89391938193d 100644 --- a/drivers/acpi/acpica/evevent.c +++ b/drivers/acpi/acpica/evevent.c @@ -130,7 +130,7 @@ static acpi_status acpi_ev_fixed_event_initialize(void) /* * Initialize the structure that keeps track of fixed event handlers and - * enable the fixed events. + * disable all of the fixed events. */ for (i = 0; i < ACPI_NUM_FIXED_EVENTS; i++) { acpi_gbl_fixed_event_handlers[i].handler = NULL; -- cgit v1.2.3 From a1dc35b840e9e7a91663a288ecb4912b9e4a1406 Mon Sep 17 00:00:00 2001 From: Anchal Agarwal Date: Fri, 14 Feb 2020 10:47:58 -0800 Subject: ACPICA: Enable sleep button on ACPI legacy wake ACPICA commit 9383f5b01091e432c05f802a57edc20d329eec1f Hibernation (S4) is triggered in a guest when it recieves a sleep trigger from the hypervisor. When the guest resumes from this power state, it does not see the sleep_enabled bit. In otherwords, the sleep button is not enabled on waking from an S4 state. This causes subsequent invocation of sleep state to fail in the guest. Fix this problem by enabling the sleep button in ACPI legacy wake. Signed-off-by: Anchal Agarwal Reviewed-by: Balbir Singh Reviewed-by: Frank van der Linden [ ek: changelog] Link: https://github.com/acpica/acpica/commit/9383f5b0 Signed-off-by: Erik Kaneda Signed-off-by: Anchal Agarwal Signed-off-by: Bob Moore Signed-off-by: Rafael J. Wysocki --- drivers/acpi/acpica/hwsleep.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'drivers/acpi') diff --git a/drivers/acpi/acpica/hwsleep.c b/drivers/acpi/acpica/hwsleep.c index 243a25add28f..317ae870336b 100644 --- a/drivers/acpi/acpica/hwsleep.c +++ b/drivers/acpi/acpica/hwsleep.c @@ -300,6 +300,18 @@ acpi_status acpi_hw_legacy_wake(u8 sleep_state) [ACPI_EVENT_POWER_BUTTON]. status_register_id, ACPI_CLEAR_STATUS); + /* Enable sleep button */ + + (void) + acpi_write_bit_register(acpi_gbl_fixed_event_info + [ACPI_EVENT_SLEEP_BUTTON]. + enable_register_id, ACPI_ENABLE_EVENT); + + (void) + acpi_write_bit_register(acpi_gbl_fixed_event_info + [ACPI_EVENT_SLEEP_BUTTON]. + status_register_id, ACPI_CLEAR_STATUS); + acpi_hw_execute_sleep_method(METHOD_PATHNAME__SST, ACPI_SST_WORKING); return_ACPI_STATUS(status); } -- cgit v1.2.3 From 464fa2bd52c190d0b7bde7c2c1e0f0af7a6c33d4 Mon Sep 17 00:00:00 2001 From: Bob Moore Date: Fri, 14 Feb 2020 10:47:59 -0800 Subject: ACPICA: Table Manager: Update comments in a function header Update acpi_get_table_header to remove text stating that the caller must unmap any returned memory. ACPICA commit 4f3a235cf0044b2d91958b1f99b4ca824c63f948 Link: https://github.com/acpica/acpica/commit/4f3a235c Signed-off-by: Bob Moore Signed-off-by: Erik Kaneda Signed-off-by: Rafael J. Wysocki --- drivers/acpi/acpica/tbxface.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'drivers/acpi') diff --git a/drivers/acpi/acpica/tbxface.c b/drivers/acpi/acpica/tbxface.c index f8403d480318..7490429ddbf6 100644 --- a/drivers/acpi/acpica/tbxface.c +++ b/drivers/acpi/acpica/tbxface.c @@ -202,14 +202,14 @@ ACPI_EXPORT_SYMBOL_INIT(acpi_reallocate_root_table) * * PARAMETERS: signature - ACPI signature of needed table * instance - Which instance (for SSDTs) - * out_table_header - The pointer to the table header to fill + * out_table_header - The pointer to the where the table header + * is returned * - * RETURN: Status and pointer to mapped table header + * RETURN: Status and a copy of the table header * - * DESCRIPTION: Finds an ACPI table header. - * - * NOTE: Caller is responsible in unmapping the header with - * acpi_os_unmap_memory + * DESCRIPTION: Finds and returns an ACPI table header. Caller provides the + * memory where a copy of the header is to be returned + * (fixed length). * ******************************************************************************/ acpi_status -- cgit v1.2.3 From 45bbbbe2d5bcfe72754da275298f5de9120a4c31 Mon Sep 17 00:00:00 2001 From: Sven Barth Date: Fri, 14 Feb 2020 10:48:00 -0800 Subject: ACPICA: cast the result of the pointer difference to u32 Altnatively we could declare aml_length as acpi_size, but then one would need to cast at the assignment for method_obj->method.aml_length ACPICA commit 72805936603fcf84e98f1b89bf99b5101af27fb8 Link: https://github.com/acpica/acpica/commit/72805936 Signed-off-by: Sven Barth Signed-off-by: Bob Moore Signed-off-by: Erik Kaneda Signed-off-by: Rafael J. Wysocki --- drivers/acpi/acpica/nsxfname.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers/acpi') diff --git a/drivers/acpi/acpica/nsxfname.c b/drivers/acpi/acpica/nsxfname.c index 984129dcaa0c..0e6aba81605b 100644 --- a/drivers/acpi/acpica/nsxfname.c +++ b/drivers/acpi/acpica/nsxfname.c @@ -516,7 +516,7 @@ acpi_status acpi_install_method(u8 *buffer) method_flags = *parser_state.aml++; aml_start = parser_state.aml; - aml_length = ACPI_PTR_DIFF(parser_state.pkg_end, aml_start); + aml_length = (u32)ACPI_PTR_DIFF(parser_state.pkg_end, aml_start); /* * Allocate resources up-front. We don't want to have to delete a new -- cgit v1.2.3 From 8dbb75ce331749ff178b73386763e31224b5e047 Mon Sep 17 00:00:00 2001 From: Sven Barth Date: Fri, 14 Feb 2020 10:48:01 -0800 Subject: ACPICA: cast length arguement to acpi_ns_build_normalized_path() as u32 ACPICA commit d216e4c8d886d7fb82697948c4fee8a5777a1a5a Link: https://github.com/acpica/acpica/commit/d216e4c8 Signed-off-by: Sven Barth Signed-off-by: Bob Moore Signed-off-by: Erik Kaneda Signed-off-by: Rafael J. Wysocki --- drivers/acpi/acpica/nsnames.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'drivers/acpi') diff --git a/drivers/acpi/acpica/nsnames.c b/drivers/acpi/acpica/nsnames.c index 370bbc867745..832b79c4b008 100644 --- a/drivers/acpi/acpica/nsnames.c +++ b/drivers/acpi/acpica/nsnames.c @@ -164,7 +164,7 @@ acpi_ns_handle_to_pathname(acpi_handle target_handle, /* Build the path in the caller buffer */ (void)acpi_ns_build_normalized_path(node, buffer->pointer, - required_size, no_trailing); + (u32)required_size, no_trailing); ACPI_DEBUG_PRINT((ACPI_DB_EXEC, "%s [%X]\n", (char *)buffer->pointer, (u32) required_size)); @@ -315,7 +315,7 @@ char *acpi_ns_get_normalized_pathname(struct acpi_namespace_node *node, /* Build the path in the allocated buffer */ - (void)acpi_ns_build_normalized_path(node, name_buffer, size, + (void)acpi_ns_build_normalized_path(node, name_buffer, (u32)size, no_trailing); ACPI_DEBUG_PRINT_RAW((ACPI_DB_NAMES, "%s: Path \"%s\"\n", -- cgit v1.2.3 From a34991fdf421170ee634c73b5fe0785817dcb11e Mon Sep 17 00:00:00 2001 From: Sven Barth Date: Fri, 14 Feb 2020 10:48:02 -0800 Subject: ACPICA: use acpi_size instead of u32 for prefix_path_length strlen() returns a size_t, so use acpi_size instead of u32 for prefix_path_length. ACPICA commit 0f64c317e769a63679442404421da1d5bd61068a Link: https://github.com/acpica/acpica/commit/0f64c317 Signed-off-by: Sven Barth Signed-off-by: Bob Moore Signed-off-by: Erik Kaneda Signed-off-by: Rafael J. Wysocki --- drivers/acpi/acpica/nsnames.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers/acpi') diff --git a/drivers/acpi/acpica/nsnames.c b/drivers/acpi/acpica/nsnames.c index 832b79c4b008..d4d26147610e 100644 --- a/drivers/acpi/acpica/nsnames.c +++ b/drivers/acpi/acpica/nsnames.c @@ -346,7 +346,7 @@ char *acpi_ns_build_prefixed_pathname(union acpi_generic_state *prefix_scope, char *full_path = NULL; char *external_path = NULL; char *prefix_path = NULL; - u32 prefix_path_length = 0; + acpi_size prefix_path_length = 0; /* If there is a prefix, get the pathname to it */ -- cgit v1.2.3 From 54a2a15a56648998ac6ca103f33fe5cdb672ae7a Mon Sep 17 00:00:00 2001 From: Bob Moore Date: Fri, 14 Feb 2020 10:48:03 -0800 Subject: ACPICA: Fix a couple of typos Squashed ACPICA commit e93a53d4d312a83a3ec72aa9cfb12d781b4fefca and df52c574572344cd9095b66a0f580d51249deb2a Submitted by: ehaouas@noos.fr Link: https://github.com/acpica/acpica/commit/e93a53d4 Signed-off-by: Bob Moore Signed-off-by: Erik Kaneda Signed-off-by: Rafael J. Wysocki --- drivers/acpi/acpica/utobject.c | 2 +- include/acpi/actbl1.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'drivers/acpi') diff --git a/drivers/acpi/acpica/utobject.c b/drivers/acpi/acpica/utobject.c index 3e60bdac2200..bbec04c291d2 100644 --- a/drivers/acpi/acpica/utobject.c +++ b/drivers/acpi/acpica/utobject.c @@ -44,7 +44,7 @@ acpi_ut_get_element_length(u8 object_type, * * NOTE: We always allocate the worst-case object descriptor because * these objects are cached, and we want them to be - * one-size-satisifies-any-request. This in itself may not be + * one-size-satisfies-any-request. This in itself may not be * the most memory efficient, but the efficiency of the object * cache should more than make up for this! * diff --git a/include/acpi/actbl1.h b/include/acpi/actbl1.h index 02d06b79e1cd..43549547ed3e 100644 --- a/include/acpi/actbl1.h +++ b/include/acpi/actbl1.h @@ -862,7 +862,7 @@ enum acpi_erst_instructions { /* Command status return values */ enum acpi_erst_command_status { - ACPI_ERST_SUCESS = 0, + ACPI_ERST_SUCCESS = 0, ACPI_ERST_NO_SPACE = 1, ACPI_ERST_NOT_AVAILABLE = 2, ACPI_ERST_FAILURE = 3, -- cgit v1.2.3