Merge branch 'release' of git://git.kernel.org/pub/scm/linux/kernel/git/lenb/linux
Pull ACPI and power management fixes from Len Brown: "A 3.3 sleep regression fixed, numa bugfix, plus some minor cleanups" * 'release' of git://git.kernel.org/pub/scm/linux/kernel/git/lenb/linux: ACPI processor: Fix tick_broadcast_mask online/offline regression ACPI: Only count valid srat memory structures ACPI: Untangle a return statement for better readability ACPI / PCI: Do not try to acquire _OSC control if that is hopeless ACPI: delete _GTS/_BFS support ACPI/x86: revert 'x86, acpi: Call acpi_enter_sleep_state via an asmlinkage C function from assembler' ACPI: replace strlen("string") with sizeof("string") -1 ACPI / PM: Fix build warning in sleep.c for CONFIG_ACPI_SLEEP unset
This commit is contained in:
commit
d8579fd834
@ -497,7 +497,7 @@ acpi_numa_processor_affinity_init(struct acpi_srat_cpu_affinity *pa)
|
|||||||
srat_num_cpus++;
|
srat_num_cpus++;
|
||||||
}
|
}
|
||||||
|
|
||||||
void __init
|
int __init
|
||||||
acpi_numa_memory_affinity_init(struct acpi_srat_mem_affinity *ma)
|
acpi_numa_memory_affinity_init(struct acpi_srat_mem_affinity *ma)
|
||||||
{
|
{
|
||||||
unsigned long paddr, size;
|
unsigned long paddr, size;
|
||||||
@ -512,7 +512,7 @@ acpi_numa_memory_affinity_init(struct acpi_srat_mem_affinity *ma)
|
|||||||
|
|
||||||
/* Ignore disabled entries */
|
/* Ignore disabled entries */
|
||||||
if (!(ma->flags & ACPI_SRAT_MEM_ENABLED))
|
if (!(ma->flags & ACPI_SRAT_MEM_ENABLED))
|
||||||
return;
|
return -1;
|
||||||
|
|
||||||
/* record this node in proximity bitmap */
|
/* record this node in proximity bitmap */
|
||||||
pxm_bit_set(pxm);
|
pxm_bit_set(pxm);
|
||||||
@ -531,6 +531,7 @@ acpi_numa_memory_affinity_init(struct acpi_srat_mem_affinity *ma)
|
|||||||
p->size = size;
|
p->size = size;
|
||||||
p->nid = pxm;
|
p->nid = pxm;
|
||||||
num_node_memblks++;
|
num_node_memblks++;
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void __init acpi_numa_arch_fixup(void)
|
void __init acpi_numa_arch_fixup(void)
|
||||||
|
@ -25,10 +25,6 @@ unsigned long acpi_realmode_flags;
|
|||||||
static char temp_stack[4096];
|
static char temp_stack[4096];
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
asmlinkage void acpi_enter_s3(void)
|
|
||||||
{
|
|
||||||
acpi_enter_sleep_state(3, wake_sleep_flags);
|
|
||||||
}
|
|
||||||
/**
|
/**
|
||||||
* acpi_suspend_lowlevel - save kernel state
|
* acpi_suspend_lowlevel - save kernel state
|
||||||
*
|
*
|
||||||
|
@ -2,7 +2,6 @@
|
|||||||
* Variables and functions used by the code in sleep.c
|
* Variables and functions used by the code in sleep.c
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <linux/linkage.h>
|
|
||||||
#include <asm/realmode.h>
|
#include <asm/realmode.h>
|
||||||
|
|
||||||
extern unsigned long saved_video_mode;
|
extern unsigned long saved_video_mode;
|
||||||
@ -11,7 +10,6 @@ extern long saved_magic;
|
|||||||
extern int wakeup_pmode_return;
|
extern int wakeup_pmode_return;
|
||||||
|
|
||||||
extern u8 wake_sleep_flags;
|
extern u8 wake_sleep_flags;
|
||||||
extern asmlinkage void acpi_enter_s3(void);
|
|
||||||
|
|
||||||
extern unsigned long acpi_copy_wakeup_routine(unsigned long);
|
extern unsigned long acpi_copy_wakeup_routine(unsigned long);
|
||||||
extern void wakeup_long64(void);
|
extern void wakeup_long64(void);
|
||||||
|
@ -74,7 +74,9 @@ restore_registers:
|
|||||||
ENTRY(do_suspend_lowlevel)
|
ENTRY(do_suspend_lowlevel)
|
||||||
call save_processor_state
|
call save_processor_state
|
||||||
call save_registers
|
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
|
# In case of S3 failure, we'll emerge here. Jump
|
||||||
# to ret_point to recover
|
# to ret_point to recover
|
||||||
|
@ -71,7 +71,9 @@ ENTRY(do_suspend_lowlevel)
|
|||||||
movq %rsi, saved_rsi
|
movq %rsi, saved_rsi
|
||||||
|
|
||||||
addq $8, %rsp
|
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 */
|
/* in case something went wrong, restore the machine status and go on */
|
||||||
jmp resume_point
|
jmp resume_point
|
||||||
|
|
||||||
|
@ -142,23 +142,23 @@ static inline int save_add_info(void) {return 0;}
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Callback for parsing of the Proximity Domain <-> Memory Area mappings */
|
/* Callback for parsing of the Proximity Domain <-> Memory Area mappings */
|
||||||
void __init
|
int __init
|
||||||
acpi_numa_memory_affinity_init(struct acpi_srat_mem_affinity *ma)
|
acpi_numa_memory_affinity_init(struct acpi_srat_mem_affinity *ma)
|
||||||
{
|
{
|
||||||
u64 start, end;
|
u64 start, end;
|
||||||
int node, pxm;
|
int node, pxm;
|
||||||
|
|
||||||
if (srat_disabled())
|
if (srat_disabled())
|
||||||
return;
|
return -1;
|
||||||
if (ma->header.length != sizeof(struct acpi_srat_mem_affinity)) {
|
if (ma->header.length != sizeof(struct acpi_srat_mem_affinity)) {
|
||||||
bad_srat();
|
bad_srat();
|
||||||
return;
|
return -1;
|
||||||
}
|
}
|
||||||
if ((ma->flags & ACPI_SRAT_MEM_ENABLED) == 0)
|
if ((ma->flags & ACPI_SRAT_MEM_ENABLED) == 0)
|
||||||
return;
|
return -1;
|
||||||
|
|
||||||
if ((ma->flags & ACPI_SRAT_MEM_HOT_PLUGGABLE) && !save_add_info())
|
if ((ma->flags & ACPI_SRAT_MEM_HOT_PLUGGABLE) && !save_add_info())
|
||||||
return;
|
return -1;
|
||||||
start = ma->base_address;
|
start = ma->base_address;
|
||||||
end = start + ma->length;
|
end = start + ma->length;
|
||||||
pxm = ma->proximity_domain;
|
pxm = ma->proximity_domain;
|
||||||
@ -168,12 +168,12 @@ acpi_numa_memory_affinity_init(struct acpi_srat_mem_affinity *ma)
|
|||||||
if (node < 0) {
|
if (node < 0) {
|
||||||
printk(KERN_ERR "SRAT: Too many proximity domains.\n");
|
printk(KERN_ERR "SRAT: Too many proximity domains.\n");
|
||||||
bad_srat();
|
bad_srat();
|
||||||
return;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (numa_add_memblk(node, start, end) < 0) {
|
if (numa_add_memblk(node, start, end) < 0) {
|
||||||
bad_srat();
|
bad_srat();
|
||||||
return;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
node_set(node, numa_nodes_parsed);
|
node_set(node, numa_nodes_parsed);
|
||||||
@ -181,6 +181,7 @@ acpi_numa_memory_affinity_init(struct acpi_srat_mem_affinity *ma)
|
|||||||
printk(KERN_INFO "SRAT: Node %u PXM %u [mem %#010Lx-%#010Lx]\n",
|
printk(KERN_INFO "SRAT: Node %u PXM %u [mem %#010Lx-%#010Lx]\n",
|
||||||
node, pxm,
|
node, pxm,
|
||||||
(unsigned long long) start, (unsigned long long) end - 1);
|
(unsigned long long) start, (unsigned long long) end - 1);
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void __init acpi_numa_arch_fixup(void) {}
|
void __init acpi_numa_arch_fixup(void) {}
|
||||||
|
@ -83,22 +83,22 @@ acpi_status acpi_hw_clear_acpi_status(void);
|
|||||||
/*
|
/*
|
||||||
* hwsleep - sleep/wake support (Legacy sleep registers)
|
* 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)
|
* hwesleep - sleep/wake support (Extended FADT-V5 sleep registers)
|
||||||
*/
|
*/
|
||||||
void acpi_hw_execute_sleep_method(char *method_name, u32 integer_argument);
|
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
|
* hwvalid - Port I/O with validation
|
||||||
|
@ -90,7 +90,6 @@ void acpi_hw_execute_sleep_method(char *method_pathname, u32 integer_argument)
|
|||||||
* FUNCTION: acpi_hw_extended_sleep
|
* FUNCTION: acpi_hw_extended_sleep
|
||||||
*
|
*
|
||||||
* PARAMETERS: sleep_state - Which sleep state to enter
|
* PARAMETERS: sleep_state - Which sleep state to enter
|
||||||
* flags - ACPI_EXECUTE_GTS to run optional method
|
|
||||||
*
|
*
|
||||||
* RETURN: Status
|
* 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;
|
acpi_status status;
|
||||||
u8 sleep_type_value;
|
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;
|
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 */
|
/* Flush caches, as per ACPI specification */
|
||||||
|
|
||||||
ACPI_FLUSH_CPU_CACHE();
|
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
|
* FUNCTION: acpi_hw_extended_wake_prep
|
||||||
*
|
*
|
||||||
* PARAMETERS: sleep_state - Which sleep state we just exited
|
* PARAMETERS: sleep_state - Which sleep state we just exited
|
||||||
* flags - ACPI_EXECUTE_BFS to run optional method
|
|
||||||
*
|
*
|
||||||
* RETURN: Status
|
* 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;
|
acpi_status status;
|
||||||
u8 sleep_type_value;
|
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);
|
&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);
|
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);
|
ACPI_FUNCTION_TRACE(hw_extended_wake);
|
||||||
|
|
||||||
|
@ -56,7 +56,6 @@ ACPI_MODULE_NAME("hwsleep")
|
|||||||
* FUNCTION: acpi_hw_legacy_sleep
|
* FUNCTION: acpi_hw_legacy_sleep
|
||||||
*
|
*
|
||||||
* PARAMETERS: sleep_state - Which sleep state to enter
|
* PARAMETERS: sleep_state - Which sleep state to enter
|
||||||
* flags - ACPI_EXECUTE_GTS to run optional method
|
|
||||||
*
|
*
|
||||||
* RETURN: Status
|
* RETURN: Status
|
||||||
*
|
*
|
||||||
@ -64,7 +63,7 @@ ACPI_MODULE_NAME("hwsleep")
|
|||||||
* THIS FUNCTION MUST BE CALLED WITH INTERRUPTS DISABLED
|
* 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_type_reg_info;
|
||||||
struct acpi_bit_register_info *sleep_enable_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);
|
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 */
|
/* Get current value of PM1A control */
|
||||||
|
|
||||||
status = acpi_hw_register_read(ACPI_REGISTER_PM1_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
|
* FUNCTION: acpi_hw_legacy_wake_prep
|
||||||
*
|
*
|
||||||
* PARAMETERS: sleep_state - Which sleep state we just exited
|
* PARAMETERS: sleep_state - Which sleep state we just exited
|
||||||
* flags - ACPI_EXECUTE_BFS to run optional method
|
|
||||||
*
|
*
|
||||||
* RETURN: Status
|
* 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;
|
acpi_status status;
|
||||||
struct acpi_bit_register_info *sleep_type_reg_info;
|
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);
|
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
|
* FUNCTION: acpi_hw_legacy_wake
|
||||||
*
|
*
|
||||||
* PARAMETERS: sleep_state - Which sleep state we just exited
|
* PARAMETERS: sleep_state - Which sleep state we just exited
|
||||||
* flags - Reserved, set to zero
|
|
||||||
*
|
*
|
||||||
* RETURN: Status
|
* 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;
|
acpi_status status;
|
||||||
|
|
||||||
|
@ -50,7 +50,7 @@ ACPI_MODULE_NAME("hwxfsleep")
|
|||||||
|
|
||||||
/* Local prototypes */
|
/* Local prototypes */
|
||||||
static acpi_status
|
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
|
* 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
|
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;
|
acpi_status status;
|
||||||
struct acpi_sleep_functions *sleep_functions =
|
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
|
* use the extended sleep registers
|
||||||
*/
|
*/
|
||||||
if (acpi_gbl_reduced_hardware || acpi_gbl_FADT.sleep_control.address) {
|
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 {
|
} else {
|
||||||
/* Legacy sleep */
|
/* Legacy sleep */
|
||||||
|
|
||||||
status = sleep_functions->legacy_function(sleep_state, flags);
|
status = sleep_functions->legacy_function(sleep_state);
|
||||||
}
|
}
|
||||||
|
|
||||||
return (status);
|
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,
|
* For the case where reduced-hardware-only code is being generated,
|
||||||
* we know that only the extended sleep registers are available
|
* 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);
|
return (status);
|
||||||
|
|
||||||
#endif /* !ACPI_REDUCED_HARDWARE */
|
#endif /* !ACPI_REDUCED_HARDWARE */
|
||||||
@ -349,7 +349,6 @@ ACPI_EXPORT_SYMBOL(acpi_enter_sleep_state_prep)
|
|||||||
* FUNCTION: acpi_enter_sleep_state
|
* FUNCTION: acpi_enter_sleep_state
|
||||||
*
|
*
|
||||||
* PARAMETERS: sleep_state - Which sleep state to enter
|
* PARAMETERS: sleep_state - Which sleep state to enter
|
||||||
* flags - ACPI_EXECUTE_GTS to run optional method
|
|
||||||
*
|
*
|
||||||
* RETURN: Status
|
* RETURN: Status
|
||||||
*
|
*
|
||||||
@ -357,7 +356,7 @@ ACPI_EXPORT_SYMBOL(acpi_enter_sleep_state_prep)
|
|||||||
* THIS FUNCTION MUST BE CALLED WITH INTERRUPTS DISABLED
|
* 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;
|
acpi_status status;
|
||||||
|
|
||||||
@ -371,7 +370,7 @@ acpi_status asmlinkage acpi_enter_sleep_state(u8 sleep_state, u8 flags)
|
|||||||
}
|
}
|
||||||
|
|
||||||
status =
|
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);
|
return_ACPI_STATUS(status);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -391,14 +390,14 @@ ACPI_EXPORT_SYMBOL(acpi_enter_sleep_state)
|
|||||||
* Called with interrupts DISABLED.
|
* 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_status status;
|
||||||
|
|
||||||
ACPI_FUNCTION_TRACE(acpi_leave_sleep_state_prep);
|
ACPI_FUNCTION_TRACE(acpi_leave_sleep_state_prep);
|
||||||
|
|
||||||
status =
|
status =
|
||||||
acpi_hw_sleep_dispatch(sleep_state, flags,
|
acpi_hw_sleep_dispatch(sleep_state,
|
||||||
ACPI_WAKE_PREP_FUNCTION_ID);
|
ACPI_WAKE_PREP_FUNCTION_ID);
|
||||||
return_ACPI_STATUS(status);
|
return_ACPI_STATUS(status);
|
||||||
}
|
}
|
||||||
@ -423,8 +422,7 @@ acpi_status acpi_leave_sleep_state(u8 sleep_state)
|
|||||||
|
|
||||||
ACPI_FUNCTION_TRACE(acpi_leave_sleep_state);
|
ACPI_FUNCTION_TRACE(acpi_leave_sleep_state);
|
||||||
|
|
||||||
|
status = acpi_hw_sleep_dispatch(sleep_state, ACPI_WAKE_FUNCTION_ID);
|
||||||
status = acpi_hw_sleep_dispatch(sleep_state, 0, ACPI_WAKE_FUNCTION_ID);
|
|
||||||
return_ACPI_STATUS(status);
|
return_ACPI_STATUS(status);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -237,6 +237,8 @@ acpi_parse_processor_affinity(struct acpi_subtable_header *header,
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static int __initdata parsed_numa_memblks;
|
||||||
|
|
||||||
static int __init
|
static int __init
|
||||||
acpi_parse_memory_affinity(struct acpi_subtable_header * header,
|
acpi_parse_memory_affinity(struct acpi_subtable_header * header,
|
||||||
const unsigned long end)
|
const unsigned long end)
|
||||||
@ -250,8 +252,8 @@ acpi_parse_memory_affinity(struct acpi_subtable_header * header,
|
|||||||
acpi_table_print_srat_entry(header);
|
acpi_table_print_srat_entry(header);
|
||||||
|
|
||||||
/* let architecture-dependent part to do it */
|
/* let architecture-dependent part to do it */
|
||||||
acpi_numa_memory_affinity_init(memory_affinity);
|
if (!acpi_numa_memory_affinity_init(memory_affinity))
|
||||||
|
parsed_numa_memblks++;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -304,8 +306,10 @@ int __init acpi_numa_init(void)
|
|||||||
|
|
||||||
acpi_numa_arch_fixup();
|
acpi_numa_arch_fixup();
|
||||||
|
|
||||||
if (cnt <= 0)
|
if (cnt < 0)
|
||||||
return cnt ?: -ENOENT;
|
return cnt;
|
||||||
|
else if (!parsed_numa_memblks)
|
||||||
|
return -ENOENT;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -573,8 +573,15 @@ static int __devinit acpi_pci_root_add(struct acpi_device *device)
|
|||||||
OSC_CLOCK_PWR_CAPABILITY_SUPPORT;
|
OSC_CLOCK_PWR_CAPABILITY_SUPPORT;
|
||||||
if (pci_msi_enabled())
|
if (pci_msi_enabled())
|
||||||
flags |= OSC_MSI_SUPPORT;
|
flags |= OSC_MSI_SUPPORT;
|
||||||
if (flags != base_flags)
|
if (flags != base_flags) {
|
||||||
acpi_pci_osc_support(root, flags);
|
status = acpi_pci_osc_support(root, flags);
|
||||||
|
if (ACPI_FAILURE(status)) {
|
||||||
|
dev_info(root->bus->bridge, "ACPI _OSC support "
|
||||||
|
"notification failed, disabling PCIe ASPM\n");
|
||||||
|
pcie_no_aspm();
|
||||||
|
flags = base_flags;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (!pcie_ports_disabled
|
if (!pcie_ports_disabled
|
||||||
&& (flags & ACPI_PCIE_REQ_SUPPORT) == ACPI_PCIE_REQ_SUPPORT) {
|
&& (flags & ACPI_PCIE_REQ_SUPPORT) == ACPI_PCIE_REQ_SUPPORT) {
|
||||||
|
@ -437,7 +437,7 @@ static int acpi_cpu_soft_notify(struct notifier_block *nfb,
|
|||||||
/* Normal CPU soft online event */
|
/* Normal CPU soft online event */
|
||||||
} else {
|
} else {
|
||||||
acpi_processor_ppc_has_changed(pr, 0);
|
acpi_processor_ppc_has_changed(pr, 0);
|
||||||
acpi_processor_cst_has_changed(pr);
|
acpi_processor_hotplug(pr);
|
||||||
acpi_processor_reevaluate_tstate(pr, action);
|
acpi_processor_reevaluate_tstate(pr, action);
|
||||||
acpi_processor_tstate_has_changed(pr);
|
acpi_processor_tstate_has_changed(pr);
|
||||||
}
|
}
|
||||||
|
@ -28,36 +28,7 @@
|
|||||||
#include "internal.h"
|
#include "internal.h"
|
||||||
#include "sleep.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 *)>s) {
|
|
||||||
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, >s, 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 u8 sleep_states[ACPI_S_STATE_COUNT];
|
||||||
static bool pwr_btn_event_pending;
|
|
||||||
|
|
||||||
static void acpi_sleep_tts_switch(u32 acpi_state)
|
static void acpi_sleep_tts_switch(u32 acpi_state)
|
||||||
{
|
{
|
||||||
@ -110,6 +81,7 @@ static int acpi_sleep_prepare(u32 acpi_state)
|
|||||||
|
|
||||||
#ifdef CONFIG_ACPI_SLEEP
|
#ifdef CONFIG_ACPI_SLEEP
|
||||||
static u32 acpi_target_sleep_state = ACPI_STATE_S0;
|
static u32 acpi_target_sleep_state = ACPI_STATE_S0;
|
||||||
|
static bool pwr_btn_event_pending;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* The ACPI specification wants us to save NVS memory regions during hibernation
|
* The ACPI specification wants us to save NVS memory regions during hibernation
|
||||||
@ -305,7 +277,7 @@ static int acpi_suspend_enter(suspend_state_t pm_state)
|
|||||||
switch (acpi_state) {
|
switch (acpi_state) {
|
||||||
case ACPI_STATE_S1:
|
case ACPI_STATE_S1:
|
||||||
barrier();
|
barrier();
|
||||||
status = acpi_enter_sleep_state(acpi_state, wake_sleep_flags);
|
status = acpi_enter_sleep_state(acpi_state);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case ACPI_STATE_S3:
|
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. */
|
/* This violates the spec but is required for bug compatibility. */
|
||||||
acpi_write_bit_register(ACPI_BITREG_SCI_ENABLE, 1);
|
acpi_write_bit_register(ACPI_BITREG_SCI_ENABLE, 1);
|
||||||
|
|
||||||
/* Reprogram control registers and execute _BFS */
|
/* Reprogram control registers */
|
||||||
acpi_leave_sleep_state_prep(acpi_state, wake_sleep_flags);
|
acpi_leave_sleep_state_prep(acpi_state);
|
||||||
|
|
||||||
/* ACPI 3.0 specs (P62) says that it's the responsibility
|
/* ACPI 3.0 specs (P62) says that it's the responsibility
|
||||||
* of the OSPM to clear the status bit [ implying that the
|
* 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();
|
ACPI_FLUSH_CPU_CACHE();
|
||||||
|
|
||||||
/* This shouldn't return. If it returns, we have a problem */
|
/* This shouldn't return. If it returns, we have a problem */
|
||||||
status = acpi_enter_sleep_state(ACPI_STATE_S4, wake_sleep_flags);
|
status = acpi_enter_sleep_state(ACPI_STATE_S4);
|
||||||
/* Reprogram control registers and execute _BFS */
|
/* Reprogram control registers */
|
||||||
acpi_leave_sleep_state_prep(ACPI_STATE_S4, wake_sleep_flags);
|
acpi_leave_sleep_state_prep(ACPI_STATE_S4);
|
||||||
|
|
||||||
return ACPI_SUCCESS(status) ? 0 : -EFAULT;
|
return ACPI_SUCCESS(status) ? 0 : -EFAULT;
|
||||||
}
|
}
|
||||||
@ -617,8 +589,8 @@ static void acpi_hibernation_leave(void)
|
|||||||
* enable it here.
|
* enable it here.
|
||||||
*/
|
*/
|
||||||
acpi_enable();
|
acpi_enable();
|
||||||
/* Reprogram control registers and execute _BFS */
|
/* Reprogram control registers */
|
||||||
acpi_leave_sleep_state_prep(ACPI_STATE_S4, wake_sleep_flags);
|
acpi_leave_sleep_state_prep(ACPI_STATE_S4);
|
||||||
/* Check the hardware signature */
|
/* Check the hardware signature */
|
||||||
if (facs && s4_hardware_signature != facs->hardware_signature) {
|
if (facs && s4_hardware_signature != facs->hardware_signature) {
|
||||||
printk(KERN_EMERG "ACPI: Hardware changed while hibernated, "
|
printk(KERN_EMERG "ACPI: Hardware changed while hibernated, "
|
||||||
@ -892,33 +864,7 @@ static void acpi_power_off(void)
|
|||||||
/* acpi_sleep_prepare(ACPI_STATE_S5) should have already been called */
|
/* acpi_sleep_prepare(ACPI_STATE_S5) should have already been called */
|
||||||
printk(KERN_DEBUG "%s called\n", __func__);
|
printk(KERN_DEBUG "%s called\n", __func__);
|
||||||
local_irq_disable();
|
local_irq_disable();
|
||||||
acpi_enter_sleep_state(ACPI_STATE_S5, wake_sleep_flags);
|
acpi_enter_sleep_state(ACPI_STATE_S5);
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
|
||||||
* 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");
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
int __init acpi_sleep_init(void)
|
int __init acpi_sleep_init(void)
|
||||||
@ -979,6 +925,5 @@ int __init acpi_sleep_init(void)
|
|||||||
* object can also be evaluated when the system enters S5.
|
* object can also be evaluated when the system enters S5.
|
||||||
*/
|
*/
|
||||||
register_reboot_notifier(&tts_notifier);
|
register_reboot_notifier(&tts_notifier);
|
||||||
acpi_gts_bfs_check();
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -173,7 +173,7 @@ static int param_set_trace_state(const char *val, struct kernel_param *kp)
|
|||||||
{
|
{
|
||||||
int result = 0;
|
int result = 0;
|
||||||
|
|
||||||
if (!strncmp(val, "enable", strlen("enable"))) {
|
if (!strncmp(val, "enable", sizeof("enable") - 1)) {
|
||||||
result = acpi_debug_trace(trace_method_name, trace_debug_level,
|
result = acpi_debug_trace(trace_method_name, trace_debug_level,
|
||||||
trace_debug_layer, 0);
|
trace_debug_layer, 0);
|
||||||
if (result)
|
if (result)
|
||||||
@ -181,7 +181,7 @@ static int param_set_trace_state(const char *val, struct kernel_param *kp)
|
|||||||
goto exit;
|
goto exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!strncmp(val, "disable", strlen("disable"))) {
|
if (!strncmp(val, "disable", sizeof("disable") - 1)) {
|
||||||
int name = 0;
|
int name = 0;
|
||||||
result = acpi_debug_trace((char *)&name, trace_debug_level,
|
result = acpi_debug_trace((char *)&name, trace_debug_level,
|
||||||
trace_debug_layer, 0);
|
trace_debug_layer, 0);
|
||||||
|
@ -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 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_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);
|
acpi_status acpi_leave_sleep_state(u8 sleep_state);
|
||||||
|
|
||||||
|
@ -803,7 +803,7 @@ typedef u8 acpi_adr_space_type;
|
|||||||
|
|
||||||
/* Sleep function dispatch */
|
/* 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 {
|
struct acpi_sleep_functions {
|
||||||
ACPI_SLEEP_FUNCTION legacy_function;
|
ACPI_SLEEP_FUNCTION legacy_function;
|
||||||
|
@ -96,7 +96,7 @@ void acpi_table_print_madt_entry (struct acpi_subtable_header *madt);
|
|||||||
void acpi_numa_slit_init (struct acpi_table_slit *slit);
|
void acpi_numa_slit_init (struct acpi_table_slit *slit);
|
||||||
void acpi_numa_processor_affinity_init (struct acpi_srat_cpu_affinity *pa);
|
void acpi_numa_processor_affinity_init (struct acpi_srat_cpu_affinity *pa);
|
||||||
void acpi_numa_x2apic_affinity_init(struct acpi_srat_x2apic_cpu_affinity *pa);
|
void acpi_numa_x2apic_affinity_init(struct acpi_srat_x2apic_cpu_affinity *pa);
|
||||||
void acpi_numa_memory_affinity_init (struct acpi_srat_mem_affinity *ma);
|
int acpi_numa_memory_affinity_init (struct acpi_srat_mem_affinity *ma);
|
||||||
void acpi_numa_arch_fixup(void);
|
void acpi_numa_arch_fixup(void);
|
||||||
|
|
||||||
#ifdef CONFIG_ACPI_HOTPLUG_CPU
|
#ifdef CONFIG_ACPI_HOTPLUG_CPU
|
||||||
|
Loading…
x
Reference in New Issue
Block a user