Commit edbe77ba authored by Len Brown's avatar Len Brown

Merge branch 'misc-2.6.35' into release

parents 64a4222f 0dc698b9
...@@ -43,6 +43,10 @@ static DEFINE_MUTEX(isolated_cpus_lock); ...@@ -43,6 +43,10 @@ static DEFINE_MUTEX(isolated_cpus_lock);
#define CPUID5_ECX_EXTENSIONS_SUPPORTED (0x1) #define CPUID5_ECX_EXTENSIONS_SUPPORTED (0x1)
#define CPUID5_ECX_INTERRUPT_BREAK (0x2) #define CPUID5_ECX_INTERRUPT_BREAK (0x2)
static unsigned long power_saving_mwait_eax; static unsigned long power_saving_mwait_eax;
static unsigned char tsc_detected_unstable;
static unsigned char tsc_marked_unstable;
static void power_saving_mwait_init(void) static void power_saving_mwait_init(void)
{ {
unsigned int eax, ebx, ecx, edx; unsigned int eax, ebx, ecx, edx;
...@@ -87,8 +91,8 @@ static void power_saving_mwait_init(void) ...@@ -87,8 +91,8 @@ static void power_saving_mwait_init(void)
/*FALL THROUGH*/ /*FALL THROUGH*/
default: default:
/* TSC could halt in idle, so notify users */ /* TSC could halt in idle */
mark_tsc_unstable("TSC halts in idle"); tsc_detected_unstable = 1;
} }
#endif #endif
} }
...@@ -178,6 +182,11 @@ static int power_saving_thread(void *data) ...@@ -178,6 +182,11 @@ static int power_saving_thread(void *data)
expire_time = jiffies + HZ * (100 - idle_pct) / 100; expire_time = jiffies + HZ * (100 - idle_pct) / 100;
while (!need_resched()) { while (!need_resched()) {
if (tsc_detected_unstable && !tsc_marked_unstable) {
/* TSC could halt in idle, so notify users */
mark_tsc_unstable("TSC halts in idle");
tsc_marked_unstable = 1;
}
local_irq_disable(); local_irq_disable();
cpu = smp_processor_id(); cpu = smp_processor_id();
clockevents_notify(CLOCK_EVT_NOTIFY_BROADCAST_ENTER, clockevents_notify(CLOCK_EVT_NOTIFY_BROADCAST_ENTER,
......
...@@ -1027,10 +1027,9 @@ int __init acpi_ec_ecdt_probe(void) ...@@ -1027,10 +1027,9 @@ int __init acpi_ec_ecdt_probe(void)
/* Don't trust ECDT, which comes from ASUSTek */ /* Don't trust ECDT, which comes from ASUSTek */
if (!EC_FLAGS_VALIDATE_ECDT) if (!EC_FLAGS_VALIDATE_ECDT)
goto install; goto install;
saved_ec = kmalloc(sizeof(struct acpi_ec), GFP_KERNEL); saved_ec = kmemdup(boot_ec, sizeof(struct acpi_ec), GFP_KERNEL);
if (!saved_ec) if (!saved_ec)
return -ENOMEM; return -ENOMEM;
memcpy(saved_ec, boot_ec, sizeof(struct acpi_ec));
/* fall through */ /* fall through */
} }
......
...@@ -727,18 +727,8 @@ static int acpi_processor_power_seq_show(struct seq_file *seq, void *offset) ...@@ -727,18 +727,8 @@ static int acpi_processor_power_seq_show(struct seq_file *seq, void *offset)
break; break;
} }
if (pr->power.states[i].promotion.state)
seq_printf(seq, "promotion[C%zd] ",
(pr->power.states[i].promotion.state -
pr->power.states));
else
seq_puts(seq, "promotion[--] "); seq_puts(seq, "promotion[--] ");
if (pr->power.states[i].demotion.state)
seq_printf(seq, "demotion[C%zd] ",
(pr->power.states[i].demotion.state -
pr->power.states));
else
seq_puts(seq, "demotion[--] "); seq_puts(seq, "demotion[--] ");
seq_printf(seq, "latency[%03d] usage[%08d] duration[%020llu]\n", seq_printf(seq, "latency[%03d] usage[%08d] duration[%020llu]\n",
...@@ -869,6 +859,7 @@ static int acpi_idle_enter_simple(struct cpuidle_device *dev, ...@@ -869,6 +859,7 @@ static int acpi_idle_enter_simple(struct cpuidle_device *dev,
struct acpi_processor *pr; struct acpi_processor *pr;
struct acpi_processor_cx *cx = cpuidle_get_statedata(state); struct acpi_processor_cx *cx = cpuidle_get_statedata(state);
ktime_t kt1, kt2; ktime_t kt1, kt2;
s64 idle_time_ns;
s64 idle_time; s64 idle_time;
s64 sleep_ticks = 0; s64 sleep_ticks = 0;
...@@ -910,12 +901,14 @@ static int acpi_idle_enter_simple(struct cpuidle_device *dev, ...@@ -910,12 +901,14 @@ static int acpi_idle_enter_simple(struct cpuidle_device *dev,
sched_clock_idle_sleep_event(); sched_clock_idle_sleep_event();
acpi_idle_do_entry(cx); acpi_idle_do_entry(cx);
kt2 = ktime_get_real(); kt2 = ktime_get_real();
idle_time = ktime_to_us(ktime_sub(kt2, kt1)); idle_time_ns = ktime_to_ns(ktime_sub(kt2, kt1));
idle_time = idle_time_ns;
do_div(idle_time, NSEC_PER_USEC);
sleep_ticks = us_to_pm_timer_ticks(idle_time); sleep_ticks = us_to_pm_timer_ticks(idle_time);
/* Tell the scheduler how much we idled: */ /* Tell the scheduler how much we idled: */
sched_clock_idle_wakeup_event(sleep_ticks*PM_TIMER_TICK_NS); sched_clock_idle_wakeup_event(idle_time_ns);
local_irq_enable(); local_irq_enable();
current_thread_info()->status |= TS_POLLING; current_thread_info()->status |= TS_POLLING;
...@@ -943,6 +936,7 @@ static int acpi_idle_enter_bm(struct cpuidle_device *dev, ...@@ -943,6 +936,7 @@ static int acpi_idle_enter_bm(struct cpuidle_device *dev,
struct acpi_processor *pr; struct acpi_processor *pr;
struct acpi_processor_cx *cx = cpuidle_get_statedata(state); struct acpi_processor_cx *cx = cpuidle_get_statedata(state);
ktime_t kt1, kt2; ktime_t kt1, kt2;
s64 idle_time_ns;
s64 idle_time; s64 idle_time;
s64 sleep_ticks = 0; s64 sleep_ticks = 0;
...@@ -1025,11 +1019,13 @@ static int acpi_idle_enter_bm(struct cpuidle_device *dev, ...@@ -1025,11 +1019,13 @@ static int acpi_idle_enter_bm(struct cpuidle_device *dev,
spin_unlock(&c3_lock); spin_unlock(&c3_lock);
} }
kt2 = ktime_get_real(); kt2 = ktime_get_real();
idle_time = ktime_to_us(ktime_sub(kt2, kt1)); idle_time_ns = ktime_to_us(ktime_sub(kt2, kt1));
idle_time = idle_time_ns;
do_div(idle_time, NSEC_PER_USEC);
sleep_ticks = us_to_pm_timer_ticks(idle_time); sleep_ticks = us_to_pm_timer_ticks(idle_time);
/* Tell the scheduler how much we idled: */ /* Tell the scheduler how much we idled: */
sched_clock_idle_wakeup_event(sleep_ticks*PM_TIMER_TICK_NS); sched_clock_idle_wakeup_event(idle_time_ns);
local_irq_enable(); local_irq_enable();
current_thread_info()->status |= TS_POLLING; current_thread_info()->status |= TS_POLLING;
......
extern u8 sleep_states[]; extern u8 sleep_states[];
extern int acpi_suspend (u32 state); extern int acpi_suspend(u32 state);
extern void acpi_enable_wakeup_device_prep(u8 sleep_state); extern void acpi_enable_wakeup_device_prep(u8 sleep_state);
extern void acpi_enable_wakeup_device(u8 sleep_state); extern void acpi_enable_wakeup_device(u8 sleep_state);
......
...@@ -1003,11 +1003,11 @@ static void acpi_video_device_find_cap(struct acpi_video_device *device) ...@@ -1003,11 +1003,11 @@ static void acpi_video_device_find_cap(struct acpi_video_device *device)
result = acpi_video_init_brightness(device); result = acpi_video_init_brightness(device);
if (result) if (result)
return; return;
name = kzalloc(MAX_NAME_LEN, GFP_KERNEL); name = kasprintf(GFP_KERNEL, "acpi_video%d", count);
if (!name) if (!name)
return; return;
count++;
sprintf(name, "acpi_video%d", count++);
memset(&props, 0, sizeof(struct backlight_properties)); memset(&props, 0, sizeof(struct backlight_properties));
props.max_brightness = device->brightness->count - 3; props.max_brightness = device->brightness->count - 3;
device->backlight = backlight_device_register(name, NULL, device, device->backlight = backlight_device_register(name, NULL, device,
...@@ -1063,10 +1063,10 @@ static void acpi_video_device_find_cap(struct acpi_video_device *device) ...@@ -1063,10 +1063,10 @@ static void acpi_video_device_find_cap(struct acpi_video_device *device)
if (device->cap._DCS && device->cap._DSS) { if (device->cap._DCS && device->cap._DSS) {
static int count; static int count;
char *name; char *name;
name = kzalloc(MAX_NAME_LEN, GFP_KERNEL); name = kasprintf(GFP_KERNEL, "acpi_video%d", count);
if (!name) if (!name)
return; return;
sprintf(name, "acpi_video%d", count++); count++;
device->output_dev = video_output_register(name, device->output_dev = video_output_register(name,
NULL, device, &acpi_output_properties); NULL, device, &acpi_output_properties);
kfree(name); kfree(name);
......
...@@ -52,17 +52,6 @@ struct acpi_power_register { ...@@ -52,17 +52,6 @@ struct acpi_power_register {
u64 address; u64 address;
} __attribute__ ((packed)); } __attribute__ ((packed));
struct acpi_processor_cx_policy {
u32 count;
struct acpi_processor_cx *state;
struct {
u32 time;
u32 ticks;
u32 count;
u32 bm;
} threshold;
};
struct acpi_processor_cx { struct acpi_processor_cx {
u8 valid; u8 valid;
u8 type; u8 type;
...@@ -74,8 +63,6 @@ struct acpi_processor_cx { ...@@ -74,8 +63,6 @@ struct acpi_processor_cx {
u32 power; u32 power;
u32 usage; u32 usage;
u64 time; u64 time;
struct acpi_processor_cx_policy promotion;
struct acpi_processor_cx_policy demotion;
char desc[ACPI_CX_DESC_LEN]; char desc[ACPI_CX_DESC_LEN];
}; };
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment