Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 201214
b: refs/heads/master
c: 0e1cf38
h: refs/heads/master
v: v3
  • Loading branch information
Len Brown committed Jul 25, 2010
1 parent 1dd432e commit 6f66ac8
Show file tree
Hide file tree
Showing 8 changed files with 41 additions and 14 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: 72ad5d77fb981963edae15eee8196c80238f5ed0
refs/heads/master: 0e1cf38889110a7188999388614aef17a84d9d25
9 changes: 9 additions & 0 deletions trunk/arch/x86/kernel/acpi/cstate.c
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,15 @@ int acpi_processor_ffh_cstate_probe(unsigned int cpu,
percpu_entry->states[cx->index].eax = cx->address;
percpu_entry->states[cx->index].ecx = MWAIT_ECX_INTERRUPT_BREAK;
}

/*
* For _CST FFH on Intel, if GAS.access_size bit 1 is cleared,
* then we should skip checking BM_STS for this C-state.
* ref: "Intel Processor Vendor-Specific ACPI Interface Specification"
*/
if ((c->x86_vendor == X86_VENDOR_INTEL) && !(reg->access_size & 0x2))
cx->bm_sts_skip = 1;

return retval;
}
EXPORT_SYMBOL_GPL(acpi_processor_ffh_cstate_probe);
Expand Down
19 changes: 11 additions & 8 deletions trunk/drivers/acpi/acpica/evxfevnt.c
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ acpi_ev_get_gpe_device(struct acpi_gpe_xrupt_info *gpe_xrupt_info,
acpi_status acpi_enable(void)
{
acpi_status status;
int retry;

ACPI_FUNCTION_TRACE(acpi_enable);

Expand Down Expand Up @@ -98,16 +99,18 @@ acpi_status acpi_enable(void)

/* Sanity check that transition succeeded */

if (acpi_hw_get_mode() != ACPI_SYS_MODE_ACPI) {
ACPI_ERROR((AE_INFO,
"Hardware did not enter ACPI mode"));
return_ACPI_STATUS(AE_NO_HARDWARE_RESPONSE);
for (retry = 0; retry < 30000; ++retry) {
if (acpi_hw_get_mode() == ACPI_SYS_MODE_ACPI) {
if (retry != 0)
ACPI_WARNING((AE_INFO,
"Platform took > %d00 usec to enter ACPI mode", retry));
return_ACPI_STATUS(AE_OK);
}
acpi_os_stall(100); /* 100 usec */
}

ACPI_DEBUG_PRINT((ACPI_DB_INIT,
"Transition to ACPI mode successful\n"));

return_ACPI_STATUS(AE_OK);
ACPI_ERROR((AE_INFO, "Hardware did not enter ACPI mode"));
return_ACPI_STATUS(AE_NO_HARDWARE_RESPONSE);
}

ACPI_EXPORT_SYMBOL(acpi_enable)
Expand Down
8 changes: 7 additions & 1 deletion trunk/drivers/acpi/battery.c
Original file line number Diff line number Diff line change
Expand Up @@ -868,9 +868,15 @@ static void acpi_battery_remove_fs(struct acpi_device *device)
static void acpi_battery_notify(struct acpi_device *device, u32 event)
{
struct acpi_battery *battery = acpi_driver_data(device);
#ifdef CONFIG_ACPI_SYSFS_POWER
struct device *old;
#endif

if (!battery)
return;
#ifdef CONFIG_ACPI_SYSFS_POWER
old = battery->bat.dev;
#endif
acpi_battery_update(battery);
acpi_bus_generate_proc_event(device, event,
acpi_battery_present(battery));
Expand All @@ -879,7 +885,7 @@ static void acpi_battery_notify(struct acpi_device *device, u32 event)
acpi_battery_present(battery));
#ifdef CONFIG_ACPI_SYSFS_POWER
/* acpi_battery_update could remove power_supply object */
if (battery->bat.dev)
if (old && battery->bat.dev)
power_supply_changed(&battery->bat);
#endif
}
Expand Down
2 changes: 1 addition & 1 deletion trunk/drivers/acpi/blacklist.c
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ static struct dmi_system_id acpi_osi_dmi_table[] __initdata = {
.ident = "Sony VGN-SR290J",
.matches = {
DMI_MATCH(DMI_SYS_VENDOR, "Sony Corporation"),
DMI_MATCH(DMI_PRODUCT_NAME, "Sony VGN-SR290J"),
DMI_MATCH(DMI_PRODUCT_NAME, "VGN-SR290J"),
},
},
{
Expand Down
2 changes: 1 addition & 1 deletion trunk/drivers/acpi/processor_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ static bool processor_physically_present(acpi_handle handle)
type = (acpi_type == ACPI_TYPE_DEVICE) ? 1 : 0;
cpuid = acpi_get_cpuid(handle, type, acpi_id);

if (cpuid == -1)
if ((cpuid == -1) && (num_possible_cpus() > 1))
return false;

return true;
Expand Down
10 changes: 9 additions & 1 deletion trunk/drivers/acpi/processor_idle.c
Original file line number Diff line number Diff line change
Expand Up @@ -76,14 +76,19 @@ static unsigned int max_cstate __read_mostly = ACPI_PROCESSOR_MAX_POWER;
module_param(max_cstate, uint, 0000);
static unsigned int nocst __read_mostly;
module_param(nocst, uint, 0000);
static int bm_check_disable __read_mostly;
module_param(bm_check_disable, uint, 0000);

static unsigned int latency_factor __read_mostly = 2;
module_param(latency_factor, uint, 0644);

#ifdef CONFIG_ACPI_PROCFS
static u64 us_to_pm_timer_ticks(s64 t)
{
return div64_u64(t * PM_TIMER_FREQUENCY, 1000000);
}
#endif

/*
* IBM ThinkPad R40e crashes mysteriously when going into C2 or C3.
* For now disable this. Probably a bug somewhere else.
Expand Down Expand Up @@ -763,6 +768,9 @@ static int acpi_idle_bm_check(void)
{
u32 bm_status = 0;

if (bm_check_disable)
return 0;

acpi_read_bit_register(ACPI_BITREG_BUS_MASTER_STATUS, &bm_status);
if (bm_status)
acpi_write_bit_register(ACPI_BITREG_BUS_MASTER_STATUS, 1);
Expand Down Expand Up @@ -947,7 +955,7 @@ static int acpi_idle_enter_bm(struct cpuidle_device *dev,
if (acpi_idle_suspend)
return(acpi_idle_enter_c1(dev, state));

if (acpi_idle_bm_check()) {
if (!cx->bm_sts_skip && acpi_idle_bm_check()) {
if (dev->safe_state) {
dev->last_state = dev->safe_state;
return dev->safe_state->enter(dev, dev->safe_state);
Expand Down
3 changes: 2 additions & 1 deletion trunk/include/acpi/processor.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ struct acpi_power_register {
u8 space_id;
u8 bit_width;
u8 bit_offset;
u8 reserved;
u8 access_size;
u64 address;
} __attribute__ ((packed));

Expand All @@ -63,6 +63,7 @@ struct acpi_processor_cx {
u32 power;
u32 usage;
u64 time;
u8 bm_sts_skip;
char desc[ACPI_CX_DESC_LEN];
};

Expand Down

0 comments on commit 6f66ac8

Please sign in to comment.