From af5c0c29fec2ed646943f0f1e90e3faa88570350 Mon Sep 17 00:00:00 2001 From: Venkatesh Pallipadi Date: Mon, 11 Feb 2008 15:20:27 -0800 Subject: [PATCH] --- yaml --- r: 85568 b: refs/heads/master c: b077fbada161479d9a32a7730d2822d5e737b306 h: refs/heads/master v: v3 --- [refs] | 2 +- trunk/Documentation/00-INDEX | 2 - trunk/Documentation/cpuidle/core.txt | 23 ------- trunk/Documentation/cpuidle/driver.txt | 31 ---------- trunk/Documentation/cpuidle/governor.txt | 29 --------- trunk/Documentation/cpuidle/sysfs.txt | 79 ------------------------ trunk/arch/x86/kernel/acpi/cstate.c | 2 - trunk/drivers/acpi/processor_idle.c | 19 +++--- trunk/drivers/cpuidle/cpuidle.c | 3 +- trunk/drivers/cpuidle/sysfs.c | 14 +---- trunk/include/acpi/processor.h | 9 +-- trunk/include/linux/cpuidle.h | 2 - 12 files changed, 16 insertions(+), 199 deletions(-) delete mode 100644 trunk/Documentation/cpuidle/core.txt delete mode 100644 trunk/Documentation/cpuidle/driver.txt delete mode 100644 trunk/Documentation/cpuidle/governor.txt delete mode 100644 trunk/Documentation/cpuidle/sysfs.txt diff --git a/[refs] b/[refs] index a482e024aa27..80c20b132a19 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: fe8e288a63f2f3c51c288500282d0eb5cd26a534 +refs/heads/master: b077fbada161479d9a32a7730d2822d5e737b306 diff --git a/trunk/Documentation/00-INDEX b/trunk/Documentation/00-INDEX index 30b327a116ea..8d556707bb68 100644 --- a/trunk/Documentation/00-INDEX +++ b/trunk/Documentation/00-INDEX @@ -109,8 +109,6 @@ cpu-hotplug.txt - document describing CPU hotplug support in the Linux kernel. cpu-load.txt - document describing how CPU load statistics are collected. -cpuidle/ - - info on CPU_IDLE, CPU idle state management subsystem. cpusets.txt - documents the cpusets feature; assign CPUs and Mem to a set of tasks. cputopology.txt diff --git a/trunk/Documentation/cpuidle/core.txt b/trunk/Documentation/cpuidle/core.txt deleted file mode 100644 index 63ecc5dc9d8a..000000000000 --- a/trunk/Documentation/cpuidle/core.txt +++ /dev/null @@ -1,23 +0,0 @@ - - Supporting multiple CPU idle levels in kernel - - cpuidle - -General Information: - -Various CPUs today support multiple idle levels that are differentiated -by varying exit latencies and power consumption during idle. -cpuidle is a generic in-kernel infrastructure that separates -idle policy (governor) from idle mechanism (driver) and provides a -standardized infrastructure to support independent development of -governors and drivers. - -cpuidle resides under drivers/cpuidle. - -Boot options: -"cpuidle_sysfs_switch" -enables current_governor interface in /sys/devices/system/cpu/cpuidle/, -which can be used to switch governors at run time. This boot option -is meant for developer testing only. In normal usage, kernel picks the -best governor based on governor ratings. -SEE ALSO: sysfs.txt in this directory. diff --git a/trunk/Documentation/cpuidle/driver.txt b/trunk/Documentation/cpuidle/driver.txt deleted file mode 100644 index 7a9e09ece931..000000000000 --- a/trunk/Documentation/cpuidle/driver.txt +++ /dev/null @@ -1,31 +0,0 @@ - - - Supporting multiple CPU idle levels in kernel - - cpuidle drivers - - - - -cpuidle driver hooks into the cpuidle infrastructure and handles the -architecture/platform dependent part of CPU idle states. Driver -provides the platform idle state detection capability and also -has mechanisms in place to support actual entry-exit into CPU idle states. - -cpuidle driver initializes the cpuidle_device structure for each CPU device -and registers with cpuidle using cpuidle_register_device. - -It can also support the dynamic changes (like battery <-> AC), by using -cpuidle_pause_and_lock, cpuidle_disable_device and cpuidle_enable_device, -cpuidle_resume_and_unlock. - -Interfaces: -extern int cpuidle_register_driver(struct cpuidle_driver *drv); -extern void cpuidle_unregister_driver(struct cpuidle_driver *drv); -extern int cpuidle_register_device(struct cpuidle_device *dev); -extern void cpuidle_unregister_device(struct cpuidle_device *dev); - -extern void cpuidle_pause_and_lock(void); -extern void cpuidle_resume_and_unlock(void); -extern int cpuidle_enable_device(struct cpuidle_device *dev); -extern void cpuidle_disable_device(struct cpuidle_device *dev); diff --git a/trunk/Documentation/cpuidle/governor.txt b/trunk/Documentation/cpuidle/governor.txt deleted file mode 100644 index 12c6bd50c9f6..000000000000 --- a/trunk/Documentation/cpuidle/governor.txt +++ /dev/null @@ -1,29 +0,0 @@ - - - - Supporting multiple CPU idle levels in kernel - - cpuidle governors - - - - -cpuidle governor is policy routine that decides what idle state to enter at -any given time. cpuidle core uses different callbacks to the governor. - -* enable() to enable governor for a particular device -* disable() to disable governor for a particular device -* select() to select an idle state to enter -* reflect() called after returning from the idle state, which can be used - by the governor for some record keeping. - -More than one governor can be registered at the same time and -users can switch between drivers using /sysfs interface (when enabled). -More than one governor part is supported for developers to easily experiment -with different governors. By default, most optimal governor based on your -kernel configuration and platform will be selected by cpuidle. - -Interfaces: -extern int cpuidle_register_governor(struct cpuidle_governor *gov); -extern void cpuidle_unregister_governor(struct cpuidle_governor *gov); -struct cpuidle_governor diff --git a/trunk/Documentation/cpuidle/sysfs.txt b/trunk/Documentation/cpuidle/sysfs.txt deleted file mode 100644 index 50d7b1642759..000000000000 --- a/trunk/Documentation/cpuidle/sysfs.txt +++ /dev/null @@ -1,79 +0,0 @@ - - - Supporting multiple CPU idle levels in kernel - - cpuidle sysfs - -System global cpuidle related information and tunables are under -/sys/devices/system/cpu/cpuidle - -The current interfaces in this directory has self-explanatory names: -* current_driver -* current_governor_ro - -With cpuidle_sysfs_switch boot option (meant for developer testing) -following objects are visible instead. -* current_driver -* available_governors -* current_governor -In this case users can switch the governor at run time by writing -to current_governor. - - -Per logical CPU specific cpuidle information are under -/sys/devices/system/cpu/cpuX/cpuidle -for each online cpu X - --------------------------------------------------------------------------------- -# ls -lR /sys/devices/system/cpu/cpu0/cpuidle/ -/sys/devices/system/cpu/cpu0/cpuidle/: -total 0 -drwxr-xr-x 2 root root 0 Feb 8 10:42 state0 -drwxr-xr-x 2 root root 0 Feb 8 10:42 state1 -drwxr-xr-x 2 root root 0 Feb 8 10:42 state2 -drwxr-xr-x 2 root root 0 Feb 8 10:42 state3 - -/sys/devices/system/cpu/cpu0/cpuidle/state0: -total 0 --r--r--r-- 1 root root 4096 Feb 8 10:42 desc --r--r--r-- 1 root root 4096 Feb 8 10:42 latency --r--r--r-- 1 root root 4096 Feb 8 10:42 name --r--r--r-- 1 root root 4096 Feb 8 10:42 power --r--r--r-- 1 root root 4096 Feb 8 10:42 time --r--r--r-- 1 root root 4096 Feb 8 10:42 usage - -/sys/devices/system/cpu/cpu0/cpuidle/state1: -total 0 --r--r--r-- 1 root root 4096 Feb 8 10:42 desc --r--r--r-- 1 root root 4096 Feb 8 10:42 latency --r--r--r-- 1 root root 4096 Feb 8 10:42 name --r--r--r-- 1 root root 4096 Feb 8 10:42 power --r--r--r-- 1 root root 4096 Feb 8 10:42 time --r--r--r-- 1 root root 4096 Feb 8 10:42 usage - -/sys/devices/system/cpu/cpu0/cpuidle/state2: -total 0 --r--r--r-- 1 root root 4096 Feb 8 10:42 desc --r--r--r-- 1 root root 4096 Feb 8 10:42 latency --r--r--r-- 1 root root 4096 Feb 8 10:42 name --r--r--r-- 1 root root 4096 Feb 8 10:42 power --r--r--r-- 1 root root 4096 Feb 8 10:42 time --r--r--r-- 1 root root 4096 Feb 8 10:42 usage - -/sys/devices/system/cpu/cpu0/cpuidle/state3: -total 0 --r--r--r-- 1 root root 4096 Feb 8 10:42 desc --r--r--r-- 1 root root 4096 Feb 8 10:42 latency --r--r--r-- 1 root root 4096 Feb 8 10:42 name --r--r--r-- 1 root root 4096 Feb 8 10:42 power --r--r--r-- 1 root root 4096 Feb 8 10:42 time --r--r--r-- 1 root root 4096 Feb 8 10:42 usage --------------------------------------------------------------------------------- - - -* desc : Small description about the idle state (string) -* latency : Latency to exit out of this idle state (in microseconds) -* name : Name of the idle state (string) -* power : Power consumed while in this idle state (in milliwatts) -* time : Total time spent in this idle state (in microseconds) -* usage : Number of times this state was entered (count) diff --git a/trunk/arch/x86/kernel/acpi/cstate.c b/trunk/arch/x86/kernel/acpi/cstate.c index 8ca3557a6d59..10b67170b133 100644 --- a/trunk/arch/x86/kernel/acpi/cstate.c +++ b/trunk/arch/x86/kernel/acpi/cstate.c @@ -126,8 +126,6 @@ int acpi_processor_ffh_cstate_probe(unsigned int cpu, printk(KERN_DEBUG "Monitor-Mwait will be used to enter C-%d " "state\n", cx->type); } - snprintf(cx->desc, ACPI_CX_DESC_LEN, "ACPI FFH INTEL MWAIT 0x%x", - cx->address); out: set_cpus_allowed(current, saved_mask); diff --git a/trunk/drivers/acpi/processor_idle.c b/trunk/drivers/acpi/processor_idle.c index baa389b908e2..1f022b0846d4 100644 --- a/trunk/drivers/acpi/processor_idle.c +++ b/trunk/drivers/acpi/processor_idle.c @@ -945,16 +945,11 @@ static int acpi_processor_get_power_info_cst(struct acpi_processor *pr) * Otherwise, ignore this info and continue. */ cx.entry_method = ACPI_CSTATE_HALT; - snprintf(cx.desc, ACPI_CX_DESC_LEN, "ACPI HLT"); } else { continue; } - } else { - snprintf(cx.desc, ACPI_CX_DESC_LEN, "ACPI IOPORT 0x%x", - cx.address); } - obj = &(element->package.elements[2]); if (obj->type != ACPI_TYPE_INTEGER) continue; @@ -1425,6 +1420,14 @@ static int acpi_idle_enter_c1(struct cpuidle_device *dev, return 0; local_irq_disable(); + + /* Do not access any ACPI IO ports in suspend path */ + if (acpi_idle_suspend) { + acpi_safe_halt(); + local_irq_enable(); + return 0; + } + if (pr->flags.bm_check) acpi_idle_update_bm_rld(pr, cx); @@ -1648,11 +1651,6 @@ static int acpi_processor_setup_cpuidle(struct acpi_processor *pr) return -EINVAL; } - for (i = 0; i < CPUIDLE_STATE_MAX; i++) { - dev->states[i].name[0] = '\0'; - dev->states[i].desc[0] = '\0'; - } - for (i = 1; i < ACPI_PROCESSOR_MAX_POWER && i <= max_cstate; i++) { cx = &pr->power.states[i]; state = &dev->states[count]; @@ -1669,7 +1667,6 @@ static int acpi_processor_setup_cpuidle(struct acpi_processor *pr) cpuidle_set_statedata(state, cx); snprintf(state->name, CPUIDLE_NAME_LEN, "C%d", i); - strncpy(state->desc, cx->desc, CPUIDLE_DESC_LEN); state->exit_latency = cx->latency; state->target_residency = cx->latency * latency_factor; state->power_usage = cx->power; diff --git a/trunk/drivers/cpuidle/cpuidle.c b/trunk/drivers/cpuidle/cpuidle.c index d73663a52324..60f71e6345e3 100644 --- a/trunk/drivers/cpuidle/cpuidle.c +++ b/trunk/drivers/cpuidle/cpuidle.c @@ -219,8 +219,7 @@ static void poll_idle_init(struct cpuidle_device *dev) cpuidle_set_statedata(state, NULL); - snprintf(state->name, CPUIDLE_NAME_LEN, "C0"); - snprintf(state->desc, CPUIDLE_DESC_LEN, "CPUIDLE CORE POLL IDLE"); + snprintf(state->name, CPUIDLE_NAME_LEN, "C0 (poll idle)"); state->exit_latency = 0; state->target_residency = 0; state->power_usage = -1; diff --git a/trunk/drivers/cpuidle/sysfs.c b/trunk/drivers/cpuidle/sysfs.c index 69102ca05685..088ea74edd34 100644 --- a/trunk/drivers/cpuidle/sysfs.c +++ b/trunk/drivers/cpuidle/sysfs.c @@ -218,23 +218,16 @@ static ssize_t show_state_##_name(struct cpuidle_state *state, char *buf) \ return sprintf(buf, "%u\n", state->_name);\ } -#define define_show_state_str_function(_name) \ -static ssize_t show_state_##_name(struct cpuidle_state *state, char *buf) \ -{ \ - if (state->_name[0] == '\0')\ - return sprintf(buf, "\n");\ - return sprintf(buf, "%s\n", state->_name);\ +static ssize_t show_state_name(struct cpuidle_state *state, char *buf) +{ + return sprintf(buf, "%s\n", state->name); } define_show_state_function(exit_latency) define_show_state_function(power_usage) define_show_state_function(usage) define_show_state_function(time) -define_show_state_str_function(name) -define_show_state_str_function(desc) - define_one_state_ro(name, show_state_name); -define_one_state_ro(desc, show_state_desc); define_one_state_ro(latency, show_state_exit_latency); define_one_state_ro(power, show_state_power_usage); define_one_state_ro(usage, show_state_usage); @@ -242,7 +235,6 @@ define_one_state_ro(time, show_state_time); static struct attribute *cpuidle_state_default_attrs[] = { &attr_name.attr, - &attr_desc.attr, &attr_latency.attr, &attr_power.attr, &attr_usage.attr, diff --git a/trunk/include/acpi/processor.h b/trunk/include/acpi/processor.h index 06480bcabfdc..cdc8004cfd12 100644 --- a/trunk/include/acpi/processor.h +++ b/trunk/include/acpi/processor.h @@ -32,11 +32,9 @@ #define DOMAIN_COORD_TYPE_SW_ANY 0xfd #define DOMAIN_COORD_TYPE_HW_ALL 0xfe -#define ACPI_CSTATE_SYSTEMIO 0 -#define ACPI_CSTATE_FFH 1 -#define ACPI_CSTATE_HALT 2 - -#define ACPI_CX_DESC_LEN 32 +#define ACPI_CSTATE_SYSTEMIO (0) +#define ACPI_CSTATE_FFH (1) +#define ACPI_CSTATE_HALT (2) /* Power Management */ @@ -76,7 +74,6 @@ struct acpi_processor_cx { u64 time; struct acpi_processor_cx_policy promotion; struct acpi_processor_cx_policy demotion; - char desc[ACPI_CX_DESC_LEN]; }; struct acpi_processor_power { diff --git a/trunk/include/linux/cpuidle.h b/trunk/include/linux/cpuidle.h index 6b72a4584086..385d45b616db 100644 --- a/trunk/include/linux/cpuidle.h +++ b/trunk/include/linux/cpuidle.h @@ -19,7 +19,6 @@ #define CPUIDLE_STATE_MAX 8 #define CPUIDLE_NAME_LEN 16 -#define CPUIDLE_DESC_LEN 32 struct cpuidle_device; @@ -30,7 +29,6 @@ struct cpuidle_device; struct cpuidle_state { char name[CPUIDLE_NAME_LEN]; - char desc[CPUIDLE_DESC_LEN]; void *driver_data; unsigned int flags;