Skip to content

Commit

Permalink
Merge branch 'misc-2.6.35' into release
Browse files Browse the repository at this point in the history
  • Loading branch information
lenb committed May 28, 2010
2 parents 64a4222 + 0dc698b commit edbe77b
Show file tree
Hide file tree
Showing 6 changed files with 30 additions and 39 deletions.
13 changes: 11 additions & 2 deletions drivers/acpi/acpi_pad.c
Expand Up @@ -43,6 +43,10 @@ static DEFINE_MUTEX(isolated_cpus_lock);
#define CPUID5_ECX_EXTENSIONS_SUPPORTED (0x1)
#define CPUID5_ECX_INTERRUPT_BREAK (0x2)
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)
{
unsigned int eax, ebx, ecx, edx;
Expand Down Expand Up @@ -87,8 +91,8 @@ static void power_saving_mwait_init(void)

/*FALL THROUGH*/
default:
/* TSC could halt in idle, so notify users */
mark_tsc_unstable("TSC halts in idle");
/* TSC could halt in idle */
tsc_detected_unstable = 1;
}
#endif
}
Expand Down Expand Up @@ -178,6 +182,11 @@ static int power_saving_thread(void *data)
expire_time = jiffies + HZ * (100 - idle_pct) / 100;

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();
cpu = smp_processor_id();
clockevents_notify(CLOCK_EVT_NOTIFY_BROADCAST_ENTER,
Expand Down
3 changes: 1 addition & 2 deletions drivers/acpi/ec.c
Expand Up @@ -1027,10 +1027,9 @@ int __init acpi_ec_ecdt_probe(void)
/* Don't trust ECDT, which comes from ASUSTek */
if (!EC_FLAGS_VALIDATE_ECDT)
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)
return -ENOMEM;
memcpy(saved_ec, boot_ec, sizeof(struct acpi_ec));
/* fall through */
}

Expand Down
30 changes: 13 additions & 17 deletions drivers/acpi/processor_idle.c
Expand Up @@ -727,19 +727,9 @@ static int acpi_processor_power_seq_show(struct seq_file *seq, void *offset)
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[--] ");

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, "promotion[--] ");

seq_puts(seq, "demotion[--] ");

seq_printf(seq, "latency[%03d] usage[%08d] duration[%020llu]\n",
pr->power.states[i].latency,
Expand Down Expand Up @@ -869,6 +859,7 @@ static int acpi_idle_enter_simple(struct cpuidle_device *dev,
struct acpi_processor *pr;
struct acpi_processor_cx *cx = cpuidle_get_statedata(state);
ktime_t kt1, kt2;
s64 idle_time_ns;
s64 idle_time;
s64 sleep_ticks = 0;

Expand Down Expand Up @@ -910,12 +901,14 @@ static int acpi_idle_enter_simple(struct cpuidle_device *dev,
sched_clock_idle_sleep_event();
acpi_idle_do_entry(cx);
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);

/* 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();
current_thread_info()->status |= TS_POLLING;
Expand Down Expand Up @@ -943,6 +936,7 @@ static int acpi_idle_enter_bm(struct cpuidle_device *dev,
struct acpi_processor *pr;
struct acpi_processor_cx *cx = cpuidle_get_statedata(state);
ktime_t kt1, kt2;
s64 idle_time_ns;
s64 idle_time;
s64 sleep_ticks = 0;

Expand Down Expand Up @@ -1025,11 +1019,13 @@ static int acpi_idle_enter_bm(struct cpuidle_device *dev,
spin_unlock(&c3_lock);
}
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);
/* 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();
current_thread_info()->status |= TS_POLLING;
Expand Down
2 changes: 1 addition & 1 deletion drivers/acpi/sleep.h
@@ -1,6 +1,6 @@

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(u8 sleep_state);
Expand Down
8 changes: 4 additions & 4 deletions drivers/acpi/video.c
Expand Up @@ -1003,11 +1003,11 @@ static void acpi_video_device_find_cap(struct acpi_video_device *device)
result = acpi_video_init_brightness(device);
if (result)
return;
name = kzalloc(MAX_NAME_LEN, GFP_KERNEL);
name = kasprintf(GFP_KERNEL, "acpi_video%d", count);
if (!name)
return;
count++;

sprintf(name, "acpi_video%d", count++);
memset(&props, 0, sizeof(struct backlight_properties));
props.max_brightness = device->brightness->count - 3;
device->backlight = backlight_device_register(name, NULL, device,
Expand Down Expand Up @@ -1063,10 +1063,10 @@ static void acpi_video_device_find_cap(struct acpi_video_device *device)
if (device->cap._DCS && device->cap._DSS) {
static int count;
char *name;
name = kzalloc(MAX_NAME_LEN, GFP_KERNEL);
name = kasprintf(GFP_KERNEL, "acpi_video%d", count);
if (!name)
return;
sprintf(name, "acpi_video%d", count++);
count++;
device->output_dev = video_output_register(name,
NULL, device, &acpi_output_properties);
kfree(name);
Expand Down
13 changes: 0 additions & 13 deletions include/acpi/processor.h
Expand Up @@ -52,17 +52,6 @@ struct acpi_power_register {
u64 address;
} __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 {
u8 valid;
u8 type;
Expand All @@ -74,8 +63,6 @@ struct acpi_processor_cx {
u32 power;
u32 usage;
u64 time;
struct acpi_processor_cx_policy promotion;
struct acpi_processor_cx_policy demotion;
char desc[ACPI_CX_DESC_LEN];
};

Expand Down

0 comments on commit edbe77b

Please sign in to comment.