@ -28,34 +28,6 @@
# include "internal.h"
# include "sleep.h"
u8 wake_sleep_flags = ACPI_NO_OPTIONAL_METHODS ;
static unsigned int gts , bfs ;
static int set_param_wake_flag ( const char * val , struct kernel_param * kp )
{
int ret = param_set_int ( val , kp ) ;
if ( ret )
return ret ;
if ( kp - > arg = = ( const char * ) & gts ) {
if ( gts )
wake_sleep_flags | = ACPI_EXECUTE_GTS ;
else
wake_sleep_flags & = ~ ACPI_EXECUTE_GTS ;
}
if ( kp - > arg = = ( const char * ) & bfs ) {
if ( bfs )
wake_sleep_flags | = ACPI_EXECUTE_BFS ;
else
wake_sleep_flags & = ~ ACPI_EXECUTE_BFS ;
}
return ret ;
}
module_param_call ( gts , set_param_wake_flag , param_get_int , & gts , 0644 ) ;
module_param_call ( bfs , set_param_wake_flag , param_get_int , & bfs , 0644 ) ;
MODULE_PARM_DESC ( gts , " Enable evaluation of _GTS on suspend. " ) ;
MODULE_PARM_DESC ( bfs , " Enable evaluation of _BFS on resume " . ) ;
static u8 sleep_states [ ACPI_S_STATE_COUNT ] ;
static bool pwr_btn_event_pending ;
@ -305,7 +277,7 @@ static int acpi_suspend_enter(suspend_state_t pm_state)
switch ( acpi_state ) {
case ACPI_STATE_S1 :
barrier ( ) ;
status = acpi_enter_sleep_state ( acpi_state , wake_sleep_flags ) ;
status = acpi_enter_sleep_state ( acpi_state ) ;
break ;
case ACPI_STATE_S3 :
@ -319,8 +291,8 @@ static int acpi_suspend_enter(suspend_state_t pm_state)
/* This violates the spec but is required for bug compatibility. */
acpi_write_bit_register ( ACPI_BITREG_SCI_ENABLE , 1 ) ;
/* Reprogram control registers and execute _BFS */
acpi_leave_sleep_state_prep ( acpi_state , wake_sleep_flags ) ;
/* Reprogram control registers */
acpi_leave_sleep_state_prep ( acpi_state ) ;
/* ACPI 3.0 specs (P62) says that it's the responsibility
* of the OSPM to clear the status bit [ implying that the
@ -603,9 +575,9 @@ static int acpi_hibernation_enter(void)
ACPI_FLUSH_CPU_CACHE ( ) ;
/* This shouldn't return. If it returns, we have a problem */
status = acpi_enter_sleep_state ( ACPI_STATE_S4 , wake_sleep_flags ) ;
/* Reprogram control registers and execute _BFS */
acpi_leave_sleep_state_prep ( ACPI_STATE_S4 , wake_sleep_flags ) ;
status = acpi_enter_sleep_state ( ACPI_STATE_S4 ) ;
/* Reprogram control registers */
acpi_leave_sleep_state_prep ( ACPI_STATE_S4 ) ;
return ACPI_SUCCESS ( status ) ? 0 : - EFAULT ;
}
@ -617,8 +589,8 @@ static void acpi_hibernation_leave(void)
* enable it here .
*/
acpi_enable ( ) ;
/* Reprogram control registers and execute _BFS */
acpi_leave_sleep_state_prep ( ACPI_STATE_S4 , wake_sleep_flags ) ;
/* Reprogram control registers */
acpi_leave_sleep_state_prep ( ACPI_STATE_S4 ) ;
/* Check the hardware signature */
if ( facs & & s4_hardware_signature ! = facs - > hardware_signature ) {
printk ( KERN_EMERG " ACPI: Hardware changed while hibernated, "
@ -876,33 +848,7 @@ static void acpi_power_off(void)
/* acpi_sleep_prepare(ACPI_STATE_S5) should have already been called */
printk ( KERN_DEBUG " %s called \n " , __func__ ) ;
local_irq_disable ( ) ;
acpi_enter_sleep_state ( ACPI_STATE_S5 , wake_sleep_flags ) ;
}
/*
* ACPI 2.0 created the optional _GTS and _BFS ,
* but industry adoption has been neither rapid nor broad .
*
* Linux gets into trouble when it executes poorly validated
* paths through the BIOS , so disable _GTS and _BFS by default ,
* but do speak up and offer the option to enable them .
*/
static void __init acpi_gts_bfs_check ( void )
{
acpi_handle dummy ;
if ( ACPI_SUCCESS ( acpi_get_handle ( ACPI_ROOT_OBJECT , METHOD_PATHNAME__GTS , & dummy ) ) )
{
printk ( KERN_NOTICE PREFIX " BIOS offers _GTS \n " ) ;
printk ( KERN_NOTICE PREFIX " If \" acpi.gts=1 \" improves suspend, "
" please notify linux-acpi@vger.kernel.org \n " ) ;
}
if ( ACPI_SUCCESS ( acpi_get_handle ( ACPI_ROOT_OBJECT , METHOD_PATHNAME__BFS , & dummy ) ) )
{
printk ( KERN_NOTICE PREFIX " BIOS offers _BFS \n " ) ;
printk ( KERN_NOTICE PREFIX " If \" acpi.bfs=1 \" improves resume, "
" please notify linux-acpi@vger.kernel.org \n " ) ;
}
acpi_enter_sleep_state ( ACPI_STATE_S5 ) ;
}
int __init acpi_sleep_init ( void )
@ -963,6 +909,5 @@ int __init acpi_sleep_init(void)
* object can also be evaluated when the system enters S5 .
*/
register_reboot_notifier ( & tts_notifier ) ;
acpi_gts_bfs_check ( ) ;
return 0 ;
}