Skip to content

Commit

Permalink
Merge branch 'release' of git://git.kernel.org/pub/scm/linux/kernel/g…
Browse files Browse the repository at this point in the history
…it/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
  • Loading branch information
torvalds committed Aug 3, 2012
2 parents d42d1da + 9d0b01a commit d8579fd
Show file tree
Hide file tree
Showing 18 changed files with 73 additions and 146 deletions.
5 changes: 3 additions & 2 deletions arch/ia64/kernel/acpi.c
Original file line number Diff line number Diff line change
Expand Up @@ -497,7 +497,7 @@ acpi_numa_processor_affinity_init(struct acpi_srat_cpu_affinity *pa)
srat_num_cpus++;
}

void __init
int __init
acpi_numa_memory_affinity_init(struct acpi_srat_mem_affinity *ma)
{
unsigned long paddr, size;
Expand All @@ -512,7 +512,7 @@ acpi_numa_memory_affinity_init(struct acpi_srat_mem_affinity *ma)

/* Ignore disabled entries */
if (!(ma->flags & ACPI_SRAT_MEM_ENABLED))
return;
return -1;

/* record this node in proximity bitmap */
pxm_bit_set(pxm);
Expand All @@ -531,6 +531,7 @@ acpi_numa_memory_affinity_init(struct acpi_srat_mem_affinity *ma)
p->size = size;
p->nid = pxm;
num_node_memblks++;
return 0;
}

void __init acpi_numa_arch_fixup(void)
Expand Down
4 changes: 0 additions & 4 deletions arch/x86/kernel/acpi/sleep.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
*
Expand Down
2 changes: 0 additions & 2 deletions arch/x86/kernel/acpi/sleep.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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);
Expand Down
4 changes: 3 additions & 1 deletion arch/x86/kernel/acpi/wakeup_32.S
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 3 additions & 1 deletion arch/x86/kernel/acpi/wakeup_64.S
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
15 changes: 8 additions & 7 deletions arch/x86/mm/srat.c
Original file line number Diff line number Diff line change
Expand Up @@ -142,23 +142,23 @@ static inline int save_add_info(void) {return 0;}
#endif

/* 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)
{
u64 start, end;
int node, pxm;

if (srat_disabled())
return;
return -1;
if (ma->header.length != sizeof(struct acpi_srat_mem_affinity)) {
bad_srat();
return;
return -1;
}
if ((ma->flags & ACPI_SRAT_MEM_ENABLED) == 0)
return;
return -1;

if ((ma->flags & ACPI_SRAT_MEM_HOT_PLUGGABLE) && !save_add_info())
return;
return -1;
start = ma->base_address;
end = start + ma->length;
pxm = ma->proximity_domain;
Expand All @@ -168,19 +168,20 @@ acpi_numa_memory_affinity_init(struct acpi_srat_mem_affinity *ma)
if (node < 0) {
printk(KERN_ERR "SRAT: Too many proximity domains.\n");
bad_srat();
return;
return -1;
}

if (numa_add_memblk(node, start, end) < 0) {
bad_srat();
return;
return -1;
}

node_set(node, numa_nodes_parsed);

printk(KERN_INFO "SRAT: Node %u PXM %u [mem %#010Lx-%#010Lx]\n",
node, pxm,
(unsigned long long) start, (unsigned long long) end - 1);
return 0;
}

void __init acpi_numa_arch_fixup(void) {}
Expand Down
12 changes: 6 additions & 6 deletions drivers/acpi/acpica/achware.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
19 changes: 3 additions & 16 deletions drivers/acpi/acpica/hwesleep.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
*
Expand All @@ -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;
Expand All @@ -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();
Expand Down Expand Up @@ -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
*
Expand All @@ -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;
Expand All @@ -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);
}

Expand All @@ -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);

Expand Down
20 changes: 3 additions & 17 deletions drivers/acpi/acpica/hwsleep.c
Original file line number Diff line number Diff line change
Expand Up @@ -56,15 +56,14 @@ 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
*
* DESCRIPTION: Enter a system sleep state via the legacy FADT PM registers
* 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;
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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
*
Expand All @@ -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;
Expand Down Expand Up @@ -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);
}

Expand All @@ -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
*
Expand All @@ -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;

Expand Down
22 changes: 10 additions & 12 deletions drivers/acpi/acpica/hwxfsleep.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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 =
Expand All @@ -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);
Expand All @@ -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 */
Expand Down Expand Up @@ -349,15 +349,14 @@ 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
*
* DESCRIPTION: Enter a system sleep state (see ACPI 2.0 spec p 231)
* 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;

Expand All @@ -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);
}

Expand All @@ -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);
}
Expand All @@ -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);
}

Expand Down
Loading

0 comments on commit d8579fd

Please sign in to comment.