ACPI: remove _GTS/_BFS support
Subsystems (4)
Len Brown
reviewercover ACPI: remove _GTS/_BFS support
Here's a pair of patches to remove _GTS/_BFS support -- something that we've wanted to do for a while.
Justification is in the commit log of 2/2.
Let me know if you se any troubles with the pair.
thanks,
Len Brown, Intel Open Source Technology Center
Len Brown
reviewerPATCH 1/2 ACPI/x86: revert 'x86, acpi: Call acpi_enter_sleep_state via an asmlinkage C function from assembler'
From: Len Brown <[email protected]>
cd74257b974d6d26442c97891c4d05772748b177 patched up GTS/BFS -- a feature we want to remove. So revert it (by hand, due to conflict in sleep.h) to prepare for GTS/BFS removal.
--- arch/x86/kernel/acpi/sleep.c | 4 ---- arch/x86/kernel/acpi/sleep.h | 2 -- arch/x86/kernel/acpi/wakeup_32.S | 4 +++- arch/x86/kernel/acpi/wakeup_64.S | 4 +++- 4 files changed, 6 insertions(+), 8 deletions(-)
arch/x86/kernel/acpi/sleep.c +0 -4
@@ -25,10 +25,6 @@ unsigned long acpi_realmode_flags;static char temp_stack[4096 ];#endif -asmlinkage void acpi_enter_s3(void) -{ -acpi_enter_sleep_state (3 , wake_sleep_flags); -}/** * acpi_suspend_lowlevel - save kernel state *
arch/x86/kernel/acpi/sleep.h +0 -2
@@ -2,7 +2,6 @@* Variables and functions used by the code in sleep.c */ -#include <linux/linkage.h> #include <asm/realmode.h> extern unsigned long saved_video_mode;
@@ -11,7 +10,6 @@ extern long saved_magic;extern int wakeup_pmode_return;extern u8 wake_sleep_flags; -extern asmlinkage void acpi_enter_s3(void);extern unsigned long acpi_copy_wakeup_routine (unsigned long );extern void wakeup_long64 (void );
arch/x86/kernel/acpi/wakeup_32.S +3 -1
@@ -74,7 +74,9 @@ restore_registers: ENTRY(do_suspend_lowlevel) call save_processor_state call save_registers - call acpi_enter_s3 + pushl $3 + call acpi_enter_sleep_state + addl $4, %esp # In case of S3 failure, we'll emerge here. Jump # to ret_point to recover
arch/x86/kernel/acpi/wakeup_64.S +3 -1
@@ -71,7 +71,9 @@ ENTRY(do_suspend_lowlevel) movq %rsi, saved_rsi addq $8, %rsp - call acpi_enter_s3 + movl $3, %edi + xorl %eax, %eax + call acpi_enter_sleep_state /* in case something went wrong, restore the machine status and go on */ jmp resume_point
Signature · 1 line
1.7.12.rc0
Len Brown
reviewerPATCH 2/2 ACPI: delete _GTS/_BFS support
In reply to Len BrownFrom: Len Brown <[email protected]>
_GTS and _BFS were added to the suspend/resume flow in the ACPI 2.0 specification.
Linux dutifully implemented _GTS and _BFS. We discovered that it was rarely seen in systems in the field. Further, some of those systems had AML so bogus that it could never work -- proof that no other operating system supports _GTS and _BFS. So we made _GTS and _BFS optional via modparam, and disabled them by default.
But we've had to complicate some code to keep
this support in the kernel, as these methods are defined to be evaluated very close to sleep entry and exit. Indeed, no other AML is ever evaluated with interrupts off.
We have submitted a proposal for _GTS and _BFS to be officially removed from the ACPI specification on the next revision. Here we remove it from Linux.
--- drivers/acpi/acpica/achware.h | 12 +++---- drivers/acpi/acpica/hwesleep.c | 19 ++--------- drivers/acpi/acpica/hwsleep.c | 20 ++--------- drivers/acpi/acpica/hwxfsleep.c | 22 ++++++------- drivers/acpi/sleep.c | 73 +++++------------------------------------ include/acpi/acpixf.h | 4 +-- include/acpi/actypes.h | 2 +- 7 files changed, 34 insertions(+), 118 deletions(-)
drivers/acpi/acpica/achware.h +6 -6
@@ -83,22 +83,22 @@ acpi_status acpi_hw_clear_acpi_status(void);/* * hwsleep - sleep/wake support (Legacy sleep registers) */ -acpi_status acpi_hw_legacy_sleep (u8 sleep_state,u8 flags); +acpi_status acpi_hw_legacy_sleep (u8 sleep_state); -acpi_status acpi_hw_legacy_wake_prep (u8 sleep_state,u8 flags); +acpi_status acpi_hw_legacy_wake_prep (u8 sleep_state); -acpi_status acpi_hw_legacy_wake (u8 sleep_state,u8 flags); +acpi_status acpi_hw_legacy_wake (u8 sleep_state);/* * hwesleep - sleep/wake support (Extended FADT-V5 sleep registers) */ void acpi_hw_execute_sleep_method (char *method_name,u32 integer_argument); -acpi_status acpi_hw_extended_sleep (u8 sleep_state,u8 flags); +acpi_status acpi_hw_extended_sleep (u8 sleep_state); -acpi_status acpi_hw_extended_wake_prep (u8 sleep_state,u8 flags); +acpi_status acpi_hw_extended_wake_prep (u8 sleep_state); -acpi_status acpi_hw_extended_wake (u8 sleep_state,u8 flags); +acpi_status acpi_hw_extended_wake (u8 sleep_state);/* * hwvalid - Port I/O with validation
drivers/acpi/acpica/hwesleep.c +3 -16
@@ -90,7 +90,6 @@ void acpi_hw_execute_sleep_method(char *method_pathname, u32 integer_argument)* FUNCTION: acpi_hw_extended_sleep * * PARAMETERS: sleep_state - Which sleep state to enter -* flags - ACPI_EXECUTE_GTS to run optional method * * RETURN: Status *
@@ -100,7 +99,7 @@ void acpi_hw_execute_sleep_method(char *method_pathname, u32 integer_argument)* ******************************************************************************/ -acpi_status acpi_hw_extended_sleep (u8 sleep_state,u8 flags) +acpi_status acpi_hw_extended_sleep (u8 sleep_state) {acpi_status status;u8 sleep_type_value;
@@ -125,12 +124,6 @@ acpi_status acpi_hw_extended_sleep(u8 sleep_state, u8 flags) acpi_gbl_system_awake_and_running = FALSE; -/* Optionally execute _GTS (Going To Sleep) */ - -if (flags &ACPI_EXECUTE_GTS ) { -acpi_hw_execute_sleep_method (METHOD_PATHNAME__GTS , sleep_state); - } -/* Flush caches, as per ACPI specification */ ACPI_FLUSH_CPU_CACHE ();
@@ -172,7 +165,6 @@ acpi_status acpi_hw_extended_sleep(u8 sleep_state, u8 flags)* FUNCTION: acpi_hw_extended_wake_prep * * PARAMETERS: sleep_state - Which sleep state we just exited -* flags - ACPI_EXECUTE_BFS to run optional method * * RETURN: Status *
@@ -181,7 +173,7 @@ acpi_status acpi_hw_extended_sleep(u8 sleep_state, u8 flags)* ******************************************************************************/ -acpi_status acpi_hw_extended_wake_prep (u8 sleep_state,u8 flags) +acpi_status acpi_hw_extended_wake_prep (u8 sleep_state) {acpi_status status;u8 sleep_type_value;
@@ -200,11 +192,6 @@ acpi_status acpi_hw_extended_wake_prep(u8 sleep_state, u8 flags) &acpi_gbl_FADT.sleep_control); } -/* Optionally execute _BFS (Back From Sleep) */ - -if (flags &ACPI_EXECUTE_BFS ) { -acpi_hw_execute_sleep_method (METHOD_PATHNAME__BFS , sleep_state); - }return_ACPI_STATUS (AE_OK ); }
@@ -222,7 +209,7 @@ acpi_status acpi_hw_extended_wake_prep(u8 sleep_state, u8 flags)* ******************************************************************************/ -acpi_status acpi_hw_extended_wake (u8 sleep_state,u8 flags) +acpi_status acpi_hw_extended_wake (u8 sleep_state) {ACPI_FUNCTION_TRACE (hw_extended_wake);
drivers/acpi/acpica/hwsleep.c +3 -17
@@ -56,7 +56,6 @@ ACPI_MODULE_NAME("hwsleep")* FUNCTION: acpi_hw_legacy_sleep * * PARAMETERS: sleep_state - Which sleep state to enter -* flags - ACPI_EXECUTE_GTS to run optional method * * RETURN: Status *
@@ -64,7 +63,7 @@ ACPI_MODULE_NAME("hwsleep")* THIS FUNCTION MUST BE CALLED WITH INTERRUPTS DISABLED * ******************************************************************************/ -acpi_status acpi_hw_legacy_sleep (u8 sleep_state,u8 flags) +acpi_status acpi_hw_legacy_sleep (u8 sleep_state) {struct acpi_bit_register_info *sleep_type_reg_info;struct acpi_bit_register_info *sleep_enable_reg_info;
@@ -110,12 +109,6 @@ acpi_status acpi_hw_legacy_sleep(u8 sleep_state, u8 flags)return_ACPI_STATUS (status); } -/* Optionally execute _GTS (Going To Sleep) */ - -if (flags &ACPI_EXECUTE_GTS ) { -acpi_hw_execute_sleep_method (METHOD_PATHNAME__GTS , sleep_state); - } -/* Get current value of PM1A control */ status = acpi_hw_register_read(ACPI_REGISTER_PM1_CONTROL,
@@ -214,7 +207,6 @@ acpi_status acpi_hw_legacy_sleep(u8 sleep_state, u8 flags)* FUNCTION: acpi_hw_legacy_wake_prep * * PARAMETERS: sleep_state - Which sleep state we just exited -* flags - ACPI_EXECUTE_BFS to run optional method * * RETURN: Status *
@@ -224,7 +216,7 @@ acpi_status acpi_hw_legacy_sleep(u8 sleep_state, u8 flags)* ******************************************************************************/ -acpi_status acpi_hw_legacy_wake_prep (u8 sleep_state,u8 flags) +acpi_status acpi_hw_legacy_wake_prep (u8 sleep_state) {acpi_status status;struct acpi_bit_register_info *sleep_type_reg_info;
@@ -275,11 +267,6 @@ acpi_status acpi_hw_legacy_wake_prep(u8 sleep_state, u8 flags) } } -/* Optionally execute _BFS (Back From Sleep) */ - -if (flags &ACPI_EXECUTE_BFS ) { -acpi_hw_execute_sleep_method (METHOD_PATHNAME__BFS , sleep_state); - }return_ACPI_STATUS (status); }
@@ -288,7 +275,6 @@ acpi_status acpi_hw_legacy_wake_prep(u8 sleep_state, u8 flags)* FUNCTION: acpi_hw_legacy_wake * * PARAMETERS: sleep_state - Which sleep state we just exited -* flags - Reserved, set to zero * * RETURN: Status *
@@ -297,7 +283,7 @@ acpi_status acpi_hw_legacy_wake_prep(u8 sleep_state, u8 flags)* ******************************************************************************/ -acpi_status acpi_hw_legacy_wake (u8 sleep_state,u8 flags) +acpi_status acpi_hw_legacy_wake (u8 sleep_state) {acpi_status status;
drivers/acpi/acpica/hwxfsleep.c +10 -12
@@ -50,7 +50,7 @@ ACPI_MODULE_NAME("hwxfsleep")/* Local prototypes */ static acpi_status -acpi_hw_sleep_dispatch (u8 sleep_state,u8 flags,u32 function_id); +acpi_hw_sleep_dispatch (u8 sleep_state,u32 function_id);/* * Dispatch table used to efficiently branch to the various sleep
@@ -235,7 +235,7 @@ ACPI_EXPORT_SYMBOL(acpi_enter_sleep_state_s4bios)* ******************************************************************************/ static acpi_status -acpi_hw_sleep_dispatch (u8 sleep_state,u8 flags,u32 function_id) +acpi_hw_sleep_dispatch (u8 sleep_state,u32 function_id) {acpi_status status; struct acpi_sleep_functions *sleep_functions =
@@ -248,11 +248,11 @@ acpi_hw_sleep_dispatch(u8 sleep_state, u8 flags, u32 function_id)* use the extended sleep registers */ if (acpi_gbl_reduced_hardware || acpi_gbl_FADT.sleep_control.address) { - status = sleep_functions->extended_function (sleep_state, flags); + status = sleep_functions->extended_function (sleep_state); }else {/* Legacy sleep */ - status = sleep_functions->legacy_function (sleep_state, flags); + status = sleep_functions->legacy_function (sleep_state); }return (status);
@@ -262,7 +262,7 @@ acpi_hw_sleep_dispatch(u8 sleep_state, u8 flags, u32 function_id)* For the case where reduced-hardware-only code is being generated, * we know that only the extended sleep registers are available */ - status = sleep_functions->extended_function (sleep_state, flags); + status = sleep_functions->extended_function (sleep_state);return (status);#endif /* !ACPI_REDUCED_HARDWARE */
@@ -349,7 +349,6 @@ ACPI_EXPORT_SYMBOL(acpi_enter_sleep_state_prep)* FUNCTION: acpi_enter_sleep_state * * PARAMETERS: sleep_state - Which sleep state to enter -* flags - ACPI_EXECUTE_GTS to run optional method * * RETURN: Status *
@@ -357,7 +356,7 @@ ACPI_EXPORT_SYMBOL(acpi_enter_sleep_state_prep)* THIS FUNCTION MUST BE CALLED WITH INTERRUPTS DISABLED * ******************************************************************************/ -acpi_status asmlinkage acpi_enter_sleep_state(u8 sleep_state, u8 flags) +acpi_status asmlinkage acpi_enter_sleep_state(u8 sleep_state) {acpi_status status;
@@ -371,7 +370,7 @@ acpi_status asmlinkage acpi_enter_sleep_state(u8 sleep_state, u8 flags) } status = -acpi_hw_sleep_dispatch (sleep_state, flags,ACPI_SLEEP_FUNCTION_ID ); +acpi_hw_sleep_dispatch (sleep_state,ACPI_SLEEP_FUNCTION_ID );return_ACPI_STATUS (status); }
@@ -391,14 +390,14 @@ ACPI_EXPORT_SYMBOL(acpi_enter_sleep_state)* Called with interrupts DISABLED. * ******************************************************************************/ -acpi_status acpi_leave_sleep_state_prep (u8 sleep_state,u8 flags) +acpi_status acpi_leave_sleep_state_prep (u8 sleep_state) {acpi_status status;ACPI_FUNCTION_TRACE (acpi_leave_sleep_state_prep); status = -acpi_hw_sleep_dispatch (sleep_state, flags, +acpi_hw_sleep_dispatch (sleep_state,ACPI_WAKE_PREP_FUNCTION_ID );return_ACPI_STATUS (status); }
@@ -423,8 +422,7 @@ acpi_status acpi_leave_sleep_state(u8 sleep_state)ACPI_FUNCTION_TRACE (acpi_leave_sleep_state); - - status =acpi_hw_sleep_dispatch (sleep_state,0 ,ACPI_WAKE_FUNCTION_ID ); + status =acpi_hw_sleep_dispatch (sleep_state,ACPI_WAKE_FUNCTION_ID );return_ACPI_STATUS (status); }
drivers/acpi/sleep.c +9 -64
114 lines not on this page · raw message
include/acpi/acpixf.h +2 -2
@@ -491,11 +491,11 @@ acpi_get_sleep_type_data(u8 sleep_state, u8 * slp_typ_a, u8 * slp_typ_b);acpi_status acpi_enter_sleep_state_prep (u8 sleep_state); -acpi_status asmlinkage acpi_enter_sleep_state(u8 sleep_state, u8 flags); +acpi_status asmlinkage acpi_enter_sleep_state(u8 sleep_state); ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status asmlinkage acpi_enter_sleep_state_s4bios(void)) -acpi_status acpi_leave_sleep_state_prep(u8 sleep_state, u8 flags); +acpi_status acpi_leave_sleep_state_prep(u8 sleep_state);acpi_status acpi_leave_sleep_state (u8 sleep_state);
include/acpi/actypes.h +1 -1
@@ -803,7 +803,7 @@ typedef u8 acpi_adr_space_type;/* Sleep function dispatch */ -typedef acpi_status (*ACPI_SLEEP_FUNCTION ) (u8 sleep_state,u8 flags); +typedef acpi_status (*ACPI_SLEEP_FUNCTION ) (u8 sleep_state);struct acpi_sleep_functions {ACPI_SLEEP_FUNCTION legacy_function;
Signature · 1 line
1.7.12.rc0
Quoted 5 lines · Len Brown
Here's a pair of patches to remove _GTS/_BFS support -- something that we've wanted to do for a while.
Justification is in the commit log of 2/2.
Let me know if you se any troubles with the pair.
Thanks,
Ingo
Quoted 2 lines · Len Brown
Here's a pair of patches to remove _GTS/_BFS support -- something that we've wanted to do for a while.
Yeey! Acked-by on both patches please.
Quoted 11 lines
Justification is in the commit log of 2/2.
Let me know if you se any troubles with the pair.thanks,
Len Brown, Intel Open Source Technology Center--
To unsubscribe from this list: send the line "unsubscribe linux-acpi" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html