Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 85566
b: refs/heads/master
c: 4fcb2fc
h: refs/heads/master
v: v3
  • Loading branch information
Venkatesh Pallipadi authored and Len Brown committed Feb 14, 2008
1 parent 7700c50 commit b35bf35
Show file tree
Hide file tree
Showing 10 changed files with 44 additions and 66 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: 46c1fbdb7191bf07979d7cd5f08d1a86458181a2
refs/heads/master: 4fcb2fcd4d0678b8ae103d257dcb28074cbfc7fa
2 changes: 2 additions & 0 deletions trunk/arch/x86/kernel/acpi/cstate.c
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,8 @@ 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);
Expand Down
64 changes: 8 additions & 56 deletions trunk/drivers/acpi/blacklist.c
Original file line number Diff line number Diff line change
Expand Up @@ -186,12 +186,6 @@ static int __init dmi_unknown_osi_linux(const struct dmi_system_id *d)
acpi_dmi_osi_linux(-1, d); /* unknown */
return 0;
}
static int __init dmi_disable_osi_vista(const struct dmi_system_id *d)
{
printk(KERN_NOTICE PREFIX "DMI detected: %s\n", d->ident);
acpi_osi_setup("!Windows 2006");
return 0;
}

/*
* Most BIOS that invoke OSI(Linux) do nothing with it.
Expand Down Expand Up @@ -234,10 +228,10 @@ static struct dmi_system_id acpi_osi_dmi_table[] __initdata = {
* DMI_MATCH(DMI_PRODUCT_NAME, "TravelMate 5520"),
* DMI_MATCH(DMI_PRODUCT_NAME, "TravelMate 6460"),
* DMI_MATCH(DMI_PRODUCT_NAME, "TravelMate 7510"),
* DMI_MATCH(DMI_PRODUCT_NAME, "Extensa 5220"),
*
* _OSI(Linux) is a NOP:
* DMI_MATCH(DMI_PRODUCT_NAME, "Aspire 5315"),
* DMI_MATCH(DMI_PRODUCT_NAME, "Extensa 5220"),
*/
{
.callback = dmi_disable_osi_linux,
Expand Down Expand Up @@ -333,20 +327,12 @@ static struct dmi_system_id acpi_osi_dmi_table[] __initdata = {
},
{ /* OSI(Linux) effect unknown */
.callback = dmi_unknown_osi_linux,
.ident = "Dell OptiPlex GX620",
.ident = "Dell OP GX620",
.matches = {
DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
DMI_MATCH(DMI_PRODUCT_NAME, "OptiPlex GX620"),
},
},
{ /* OSI(Linux) causes some USB initialization to not run */
.callback = dmi_unknown_osi_linux,
.ident = "Dell OptiPlex 755",
.matches = {
DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
DMI_MATCH(DMI_PRODUCT_NAME, "OptiPlex 755"),
},
},
{ /* OSI(Linux) effect unknown */
.callback = dmi_unknown_osi_linux,
.ident = "Dell PE 1900",
Expand All @@ -356,14 +342,6 @@ static struct dmi_system_id acpi_osi_dmi_table[] __initdata = {
},
},
{ /* OSI(Linux) is a NOP */
.callback = dmi_unknown_osi_linux,
.ident = "Dell PE 1950",
.matches = {
DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
DMI_MATCH(DMI_PRODUCT_NAME, "PowerEdge 1950"),
},
},
{ /* OSI(Linux) is a NOP */
.callback = dmi_disable_osi_linux,
.ident = "Dell PE R200",
.matches = {
Expand All @@ -379,22 +357,6 @@ static struct dmi_system_id acpi_osi_dmi_table[] __initdata = {
DMI_MATCH(DMI_PRODUCT_NAME, "Precision WorkStation 390"),
},
},
{ /* OSI(Linux) touches USB */
.callback = dmi_unknown_osi_linux,
.ident = "Dell PR 390",
.matches = {
DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
DMI_MATCH(DMI_PRODUCT_NAME, "Precision WorkStation 690"),
},
},
{ /* OSI(Linux) unknown - ASL looks benign, but may effect dock/SMM */
.callback = dmi_unknown_osi_linux,
.ident = "Dell PR M4300",
.matches = {
DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
DMI_MATCH(DMI_PRODUCT_NAME, "Precision M4300"),
},
},
{ /* OSI(Linux) is a NOP */
.callback = dmi_disable_osi_linux,
.ident = "Dell Vostro 1000",
Expand Down Expand Up @@ -428,10 +390,10 @@ static struct dmi_system_id acpi_osi_dmi_table[] __initdata = {
* DMI_MATCH(DMI_PRODUCT_NAME, "AMILO Pi 1536"),
* DMI_MATCH(DMI_PRODUCT_NAME, "AMILO Pi 1556"),
* DMI_MATCH(DMI_PRODUCT_NAME, "AMILO Xi 1546"),
* DMI_MATCH(DMI_PRODUCT_NAME, "ESPRIMO Mobile V5505"),
* _OSI(Linux) unknown effect:
* DMI_MATCH(DMI_PRODUCT_NAME, "Amilo M1425"),
* DMI_MATCH(DMI_PRODUCT_NAME, "Amilo Si 1520"),
* DMI_MATCH(DMI_PRODUCT_NAME, "ESPRIMO Mobile V5505"),
*/
{
.callback = dmi_disable_osi_linux,
Expand All @@ -440,14 +402,6 @@ static struct dmi_system_id acpi_osi_dmi_table[] __initdata = {
DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU SIEMENS"),
},
},
{
.callback = dmi_disable_osi_vista,
.ident = "Fujitsu Siemens",
.matches = {
DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU SIEMENS"),
DMI_MATCH(DMI_PRODUCT_NAME, "ESPRIMO Mobile V5505"),
},
},
/*
* Disable OSI(Linux) warnings on all "Hewlett-Packard"
*
Expand Down Expand Up @@ -489,11 +443,10 @@ static struct dmi_system_id acpi_osi_dmi_table[] __initdata = {
* _OSI(Linux) helps sound
* DMI_MATCH(DMI_PRODUCT_VERSION, "ThinkPad R61"),
* DMI_MATCH(DMI_PRODUCT_VERSION, "ThinkPad T61"),
* _OSI(Linux) has Linux specific hooks
* DMI_MATCH(DMI_PRODUCT_VERSION, "ThinkPad X61"),
* _OSI(Linux) is a NOP:
* DMI_MATCH(DMI_PRODUCT_VERSION, "3000 N100"),
* DMI_MATCH(DMI_PRODUCT_VERSION, "LENOVO3000 V100"),
* _OSI(Linux) effect unknown
* DMI_MATCH(DMI_PRODUCT_VERSION, "ThinkPad X61"),
*/
{
.callback = dmi_enable_osi_linux,
Expand All @@ -512,15 +465,15 @@ static struct dmi_system_id acpi_osi_dmi_table[] __initdata = {
},
},
{
.callback = dmi_enable_osi_linux,
.callback = dmi_unknown_osi_linux,
.ident = "Lenovo ThinkPad X61",
.matches = {
DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"),
DMI_MATCH(DMI_PRODUCT_VERSION, "ThinkPad X61"),
},
},
{
.callback = dmi_disable_osi_linux,
.callback = dmi_unknown_osi_linux,
.ident = "Lenovo 3000 V100",
.matches = {
DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"),
Expand Down Expand Up @@ -590,9 +543,8 @@ static struct dmi_system_id acpi_osi_dmi_table[] __initdata = {
* Disable OSI(Linux) warnings on all "Sony Corporation"
*
* _OSI(Linux) is a NOP:
* DMI_MATCH(DMI_PRODUCT_NAME, "VGN-NR11S_S"),
* DMI_MATCH(DMI_PRODUCT_NAME, "VGN-SZ38GP_C"),
* DMI_MATCH(DMI_PRODUCT_NAME, "VGN-SZ650N"),
* DMI_MATCH(DMI_PRODUCT_NAME, "VGN-SZ38GP_C"),
* DMI_MATCH(DMI_PRODUCT_NAME, "VGN-TZ21MN_N"),
* _OSI(Linux) unknown effect:
* DMI_MATCH(DMI_PRODUCT_NAME, "VGN-FZ11M"),
Expand Down
2 changes: 1 addition & 1 deletion trunk/drivers/acpi/osl.c
Original file line number Diff line number Diff line change
Expand Up @@ -1109,7 +1109,7 @@ void __init acpi_dmi_osi_linux(int enable, const struct dmi_system_id *d)
* string starting with '!' disables that string
* otherwise string is added to list, augmenting built-in strings
*/
int __init acpi_osi_setup(char *str)
static int __init acpi_osi_setup(char *str)
{
if (str == NULL || *str == '\0') {
printk(KERN_INFO PREFIX "_OSI method disabled\n");
Expand Down
11 changes: 11 additions & 0 deletions trunk/drivers/acpi/processor_idle.c
Original file line number Diff line number Diff line change
Expand Up @@ -945,11 +945,16 @@ 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;
Expand Down Expand Up @@ -1643,6 +1648,11 @@ 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];
Expand All @@ -1659,6 +1669,7 @@ 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;
Expand Down
3 changes: 2 additions & 1 deletion trunk/drivers/cpuidle/cpuidle.c
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,8 @@ static void poll_idle_init(struct cpuidle_device *dev)

cpuidle_set_statedata(state, NULL);

snprintf(state->name, CPUIDLE_NAME_LEN, "C0 (poll idle)");
snprintf(state->name, CPUIDLE_NAME_LEN, "C0");
snprintf(state->desc, CPUIDLE_DESC_LEN, "CPUIDLE CORE POLL IDLE");
state->exit_latency = 0;
state->target_residency = 0;
state->power_usage = -1;
Expand Down
14 changes: 11 additions & 3 deletions trunk/drivers/cpuidle/sysfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -218,23 +218,31 @@ static ssize_t show_state_##_name(struct cpuidle_state *state, char *buf) \
return sprintf(buf, "%u\n", state->_name);\
}

static ssize_t show_state_name(struct cpuidle_state *state, char *buf)
{
return sprintf(buf, "%s\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, "<null>\n");\
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);
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,
Expand Down
9 changes: 6 additions & 3 deletions trunk/include/acpi/processor.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,11 @@
#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_CSTATE_SYSTEMIO 0
#define ACPI_CSTATE_FFH 1
#define ACPI_CSTATE_HALT 2

#define ACPI_CX_DESC_LEN 32

/* Power Management */

Expand Down Expand Up @@ -74,6 +76,7 @@ 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 {
Expand Down
1 change: 0 additions & 1 deletion trunk/include/linux/acpi.h
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,6 @@ extern bool wmi_has_guid(const char *guid);
extern int acpi_blacklisted(void);
#ifdef CONFIG_DMI
extern void acpi_dmi_osi_linux(int enable, const struct dmi_system_id *d);
extern int acpi_osi_setup(char *str);
#endif

#ifdef CONFIG_ACPI_NUMA
Expand Down
2 changes: 2 additions & 0 deletions trunk/include/linux/cpuidle.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@

#define CPUIDLE_STATE_MAX 8
#define CPUIDLE_NAME_LEN 16
#define CPUIDLE_DESC_LEN 32

struct cpuidle_device;

Expand All @@ -29,6 +30,7 @@ struct cpuidle_device;

struct cpuidle_state {
char name[CPUIDLE_NAME_LEN];
char desc[CPUIDLE_DESC_LEN];
void *driver_data;

unsigned int flags;
Expand Down

0 comments on commit b35bf35

Please sign in to comment.