Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 62907
b: refs/heads/master
c: 8c8eb78
h: refs/heads/master
i:
  62905: 1ca733d
  62903: 6b88887
v: v3
  • Loading branch information
Thomas Renninger authored and Len Brown committed Jul 23, 2007
1 parent 22542e6 commit 0f3eee2
Show file tree
Hide file tree
Showing 36 changed files with 197 additions and 352 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: cb3e0c107bebc6cf3e7158f7aa54c32017c7d4c4
refs/heads/master: 8c8eb78f673c07b60f31751e1e47ac367c60c6b7
2 changes: 1 addition & 1 deletion trunk/arch/i386/kernel/acpi/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ obj-$(CONFIG_ACPI) += boot.o
ifneq ($(CONFIG_PCI),)
obj-$(CONFIG_X86_IO_APIC) += earlyquirk.o
endif
obj-$(CONFIG_ACPI) += sleep.o wakeup.o
obj-$(CONFIG_ACPI_SLEEP) += sleep.o wakeup.o

ifneq ($(CONFIG_ACPI_PROCESSOR),)
obj-y += cstate.o processor.o
Expand Down
2 changes: 1 addition & 1 deletion trunk/arch/i386/kernel/setup.c
Original file line number Diff line number Diff line change
Expand Up @@ -422,7 +422,7 @@ void __init setup_bootmem_allocator(void)
*/
reserve_bootmem(PAGE_SIZE, PAGE_SIZE);
#endif
#ifdef CONFIG_ACPI
#ifdef CONFIG_ACPI_SLEEP
/*
* Reserve low memory region for sleep support.
*/
Expand Down
2 changes: 1 addition & 1 deletion trunk/arch/i386/mm/init.c
Original file line number Diff line number Diff line change
Expand Up @@ -432,7 +432,7 @@ static void __init pagetable_init (void)
paravirt_pagetable_setup_done(pgd_base);
}

#if defined(CONFIG_SOFTWARE_SUSPEND) || defined(CONFIG_ACPI)
#if defined(CONFIG_SOFTWARE_SUSPEND) || defined(CONFIG_ACPI_SLEEP)
/*
* Swap suspend & friends need this for resume because things like the intel-agp
* driver might have split up a kernel 4MB mapping.
Expand Down
19 changes: 0 additions & 19 deletions trunk/arch/ia64/kernel/acpi.c
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,6 @@ EXPORT_SYMBOL(pm_power_off);
unsigned int acpi_cpei_override;
unsigned int acpi_cpei_phys_cpuid;

unsigned long acpi_wakeup_address = 0;

const char __init *
acpi_get_sysname(void)
{
Expand Down Expand Up @@ -988,21 +986,4 @@ int acpi_unregister_ioapic(acpi_handle handle, u32 gsi_base)

EXPORT_SYMBOL(acpi_unregister_ioapic);

/*
* acpi_save_state_mem() - save kernel state
*
* TBD when when IA64 starts to support suspend...
*/
int acpi_save_state_mem(void) { return 0; }

/*
* acpi_restore_state()
*/
void acpi_restore_state_mem(void) {}

/*
* do_suspend_lowlevel()
*/
void do_suspend_lowlevel(void) {}

#endif /* CONFIG_ACPI */
2 changes: 1 addition & 1 deletion trunk/arch/x86_64/kernel/acpi/Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
obj-y := boot.o
boot-y := ../../../i386/kernel/acpi/boot.o
obj-y += sleep.o wakeup.o
obj-$(CONFIG_ACPI_SLEEP) += sleep.o wakeup.o

ifneq ($(CONFIG_ACPI_PROCESSOR),)
obj-y += processor.o
Expand Down
4 changes: 4 additions & 0 deletions trunk/arch/x86_64/kernel/acpi/sleep.c
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,8 @@
Low-Level Sleep Support
-------------------------------------------------------------------------- */

#ifdef CONFIG_ACPI_SLEEP

/* address in low memory of the wakeup routine. */
unsigned long acpi_wakeup_address = 0;
unsigned long acpi_realmode_flags;
Expand Down Expand Up @@ -115,6 +117,8 @@ static int __init acpi_sleep_setup(char *str)

__setup("acpi_sleep=", acpi_sleep_setup);

#endif /*CONFIG_ACPI_SLEEP */

void acpi_pci_link_exit(void)
{
}
2 changes: 1 addition & 1 deletion trunk/arch/x86_64/kernel/head.S
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ ident_complete:
addq %rbp, trampoline_level4_pgt + 0(%rip)
addq %rbp, trampoline_level4_pgt + (511*8)(%rip)
#endif
#ifdef CONFIG_ACPI
#ifdef CONFIG_ACPI_SLEEP
addq %rbp, wakeup_level4_pgt + 0(%rip)
addq %rbp, wakeup_level4_pgt + (511*8)(%rip)
#endif
Expand Down
2 changes: 1 addition & 1 deletion trunk/arch/x86_64/kernel/setup.c
Original file line number Diff line number Diff line change
Expand Up @@ -333,7 +333,7 @@ void __init setup_arch(char **cmdline_p)
reserve_bootmem_generic(SMP_TRAMPOLINE_BASE, 2*PAGE_SIZE);
#endif

#ifdef CONFIG_ACPI
#ifdef CONFIG_ACPI_SLEEP
/*
* Reserve low memory region for sleep support.
*/
Expand Down
64 changes: 43 additions & 21 deletions trunk/drivers/acpi/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,6 @@ menuconfig ACPI
depends on PCI
depends on PM
select PNP
# for sleep
select HOTPLUG_CPU if X86 && SMP
select SUSPEND_SMP if X86 && SMP
default y
---help---
Advanced Configuration and Power Interface (ACPI) support for
Expand Down Expand Up @@ -45,26 +42,51 @@ menuconfig ACPI

if ACPI

config ACPI_SLEEP
bool "Sleep States"
depends on X86 && (!SMP || SUSPEND_SMP)
default y
---help---
This option adds support for ACPI suspend states.

With this option, you will be able to put the system "to sleep".
Sleep states are low power states for the system and devices. All
of the system operating state is saved to either memory or disk
(depending on the state), to allow the system to resume operation
quickly at your request.

Although this option sounds really nifty, barely any of the device
drivers have been converted to the new driver model and hence few
have proper power management support.

This option is not recommended for anyone except those doing driver
power management development.

config ACPI_SLEEP_PROC_FS
bool
depends on ACPI_SLEEP && PROC_FS
default y

config ACPI_SLEEP_PROC_SLEEP
bool "/proc/acpi/sleep (deprecated)"
depends on ACPI_SLEEP_PROC_FS
default n
---help---
Create /proc/acpi/sleep
Deprecated by /sys/power/state

config ACPI_PROCFS
bool "Deprecated /proc/acpi files"
depends on PROC_FS
bool "Procfs interface (deprecated)"
default y
---help---
For backwards compatibility, this option allows
depricated /proc/acpi/ files to exist, even when
they have been replaced by functions in /sys.
The deprecated files (and their replacements) include:

/proc/acpi/sleep (/sys/power/state)
/proc/acpi/info (/sys/modules/acpi/parameters/acpica_version)
/proc/acpi/dsdt (/sys/firmware/acpi/tables/DSDT)
/proc/acpi/fadt (/sys/firmware/acpi/tables/FACP)
/proc/acpi/debug_layer (/sys/module/acpi/parameters/debug_layer)
/proc/acpi/debug_level (/sys/module/acpi/parameters/debug_level)

This option has no effect on /proc/acpi/ files
and functions which do not yet exist in /sys.

Say N to delete /proc/acpi/ files that have moved to /sys/
The Procfs interface for ACPI is made optional for backward compatibility.
As the same functions are duplicated in the sysfs interface
and this proc interface will be removed some time later,
it's marked as deprecated.
( /proc/acpi/debug_layer && debug_level are deprecated by
/sys/module/acpi/parameters/debug_layer && debug_level.
/proc/acpi/info is deprecated by
/sys/module/acpi/parameters/acpica_version )

config ACPI_AC
tristate "AC Adapter"
Expand Down
2 changes: 1 addition & 1 deletion trunk/drivers/acpi/events/evrgnini.c
Original file line number Diff line number Diff line change
Expand Up @@ -378,7 +378,7 @@ static u8 acpi_ev_match_pci_root_bridge(char *id)
static u8 acpi_ev_is_pci_root_bridge(struct acpi_namespace_node *node)
{
acpi_status status;
struct acpi_device_id hid;
struct acpica_device_id hid;
struct acpi_compatible_id_list *cid;
acpi_native_uint i;

Expand Down
2 changes: 1 addition & 1 deletion trunk/drivers/acpi/namespace/nsxfeval.c
Original file line number Diff line number Diff line change
Expand Up @@ -440,7 +440,7 @@ acpi_ns_get_device_callback(acpi_handle obj_handle,
acpi_status status;
struct acpi_namespace_node *node;
u32 flags;
struct acpi_device_id hid;
struct acpica_device_id hid;
struct acpi_compatible_id_list *cid;
acpi_native_uint i;

Expand Down
59 changes: 18 additions & 41 deletions trunk/drivers/acpi/processor_throttling.c
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,6 @@ ACPI_MODULE_NAME("processor_throttling");
static int acpi_processor_get_throttling(struct acpi_processor *pr);
int acpi_processor_set_throttling(struct acpi_processor *pr, int state);

/*
* _TPC - Throttling Present Capabilities
*/
static int acpi_processor_get_platform_limit(struct acpi_processor *pr)
{
acpi_status status = 0;
Expand All @@ -58,10 +55,8 @@ static int acpi_processor_get_platform_limit(struct acpi_processor *pr)
if (!pr)
return -EINVAL;
status = acpi_evaluate_integer(pr->handle, "_TPC", NULL, &tpc);
if (ACPI_FAILURE(status)) {
if (status != AE_NOT_FOUND) {
ACPI_EXCEPTION((AE_INFO, status, "Evaluating _TPC"));
}
if (ACPI_FAILURE(status) && status != AE_NOT_FOUND) {
ACPI_EXCEPTION((AE_INFO, status, "Evaluating _TPC"));
return -ENODEV;
}
pr->throttling_platform_limit = (int)tpc;
Expand All @@ -73,9 +68,9 @@ int acpi_processor_tstate_has_changed(struct acpi_processor *pr)
return acpi_processor_get_platform_limit(pr);
}

/*
* _PTC - Processor Throttling Control (and status) register location
*/
/* --------------------------------------------------------------------------
_PTC, _TSS, _TSD support
-------------------------------------------------------------------------- */
static int acpi_processor_get_throttling_control(struct acpi_processor *pr)
{
int result = 0;
Expand All @@ -86,9 +81,7 @@ static int acpi_processor_get_throttling_control(struct acpi_processor *pr)

status = acpi_evaluate_object(pr->handle, "_PTC", NULL, &buffer);
if (ACPI_FAILURE(status)) {
if (status != AE_NOT_FOUND) {
ACPI_EXCEPTION((AE_INFO, status, "Evaluating _PTC"));
}
ACPI_EXCEPTION((AE_INFO, status, "Evaluating _PTC"));
return -ENODEV;
}

Expand Down Expand Up @@ -139,10 +132,6 @@ static int acpi_processor_get_throttling_control(struct acpi_processor *pr)

return result;
}

/*
* _TSS - Throttling Supported States
*/
static int acpi_processor_get_throttling_states(struct acpi_processor *pr)
{
int result = 0;
Expand All @@ -155,9 +144,7 @@ static int acpi_processor_get_throttling_states(struct acpi_processor *pr)

status = acpi_evaluate_object(pr->handle, "_TSS", NULL, &buffer);
if (ACPI_FAILURE(status)) {
if (status != AE_NOT_FOUND) {
ACPI_EXCEPTION((AE_INFO, status, "Evaluating _TSS"));
}
ACPI_EXCEPTION((AE_INFO, status, "Evaluating _TSS"));
return -ENODEV;
}

Expand Down Expand Up @@ -214,10 +201,6 @@ static int acpi_processor_get_throttling_states(struct acpi_processor *pr)

return result;
}

/*
* _TSD - T-State Dependencies
*/
static int acpi_processor_get_tsd(struct acpi_processor *pr)
{
int result = 0;
Expand All @@ -230,9 +213,6 @@ static int acpi_processor_get_tsd(struct acpi_processor *pr)

status = acpi_evaluate_object(pr->handle, "_TSD", NULL, &buffer);
if (ACPI_FAILURE(status)) {
if (status != AE_NOT_FOUND) {
ACPI_EXCEPTION((AE_INFO, status, "Evaluating _TSD"));
}
return -ENODEV;
}

Expand Down Expand Up @@ -545,6 +525,9 @@ int acpi_processor_get_throttling_info(struct acpi_processor *pr)
int result = 0;
int step = 0;
int i = 0;
int no_ptc = 0;
int no_tss = 0;
int no_tsd = 0;

ACPI_DEBUG_PRINT((ACPI_DB_INFO,
"pblk_address[0x%08x] duty_offset[%d] duty_width[%d]\n",
Expand All @@ -555,14 +538,12 @@ int acpi_processor_get_throttling_info(struct acpi_processor *pr)
if (!pr)
return -EINVAL;

/*
* Evaluate _PTC, _TSS and _TPC
* They must all be present or none of them can be used.
*/
if (acpi_processor_get_throttling_control(pr) ||
acpi_processor_get_throttling_states(pr) ||
acpi_processor_get_platform_limit(pr))
{
/* TBD: Support ACPI 2.0 objects */
no_ptc = acpi_processor_get_throttling_control(pr);
no_tss = acpi_processor_get_throttling_states(pr);
no_tsd = acpi_processor_get_tsd(pr);

if (no_ptc || no_tss) {
pr->throttling.acpi_processor_get_throttling =
&acpi_processor_get_throttling_fadt;
pr->throttling.acpi_processor_set_throttling =
Expand All @@ -574,8 +555,6 @@ int acpi_processor_get_throttling_info(struct acpi_processor *pr)
&acpi_processor_set_throttling_ptc;
}

acpi_processor_get_tsd(pr);

if (!pr->throttling.address) {
ACPI_DEBUG_PRINT((ACPI_DB_INFO, "No throttling register\n"));
return 0;
Expand Down Expand Up @@ -679,20 +658,18 @@ static int acpi_processor_throttling_seq_show(struct seq_file *seq,
pr->throttling.state_count - 1);

seq_puts(seq, "states:\n");
if (pr->throttling.acpi_processor_get_throttling ==
acpi_processor_get_throttling_fadt) {
if (acpi_processor_get_throttling == acpi_processor_get_throttling_fadt)
for (i = 0; i < pr->throttling.state_count; i++)
seq_printf(seq, " %cT%d: %02d%%\n",
(i == pr->throttling.state ? '*' : ' '), i,
(pr->throttling.states[i].performance ? pr->
throttling.states[i].performance / 10 : 0));
} else {
else
for (i = 0; i < pr->throttling.state_count; i++)
seq_printf(seq, " %cT%d: %02d%%\n",
(i == pr->throttling.state ? '*' : ' '), i,
(int)pr->throttling.states_tss[i].
freqpercentage);
}

end:
return 0;
Expand Down
4 changes: 2 additions & 2 deletions trunk/drivers/acpi/sleep/Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
obj-y := poweroff.o wakeup.o
obj-y += main.o
obj-$(CONFIG_X86) += proc.o
obj-$(CONFIG_ACPI_SLEEP) += main.o
obj-$(CONFIG_ACPI_SLEEP_PROC_FS) += proc.o

EXTRA_CFLAGS += $(ACPI_CFLAGS)
Loading

0 comments on commit 0f3eee2

Please sign in to comment.