Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 311503
b: refs/heads/master
c: 75cc523
h: refs/heads/master
i:
  311501: e26e1a8
  311499: ed1dbe6
  311495: 1d6cce2
  311487: e315e1e
v: v3
  • Loading branch information
Deepthi Dharwar authored and Rafael J. Wysocki committed Jun 27, 2012
1 parent ffc85df commit 035e1b3
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 3 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: 1f758b23177d588a71b96ad02990e715949bb82f
refs/heads/master: 75cc52358799bd6001e7d1a47847f997f5ae99f0
32 changes: 30 additions & 2 deletions trunk/drivers/acpi/processor_idle.c
Original file line number Diff line number Diff line change
Expand Up @@ -224,6 +224,7 @@ static void lapic_timer_state_broadcast(struct acpi_processor *pr,
/*
* Suspend / resume control
*/
static int acpi_idle_suspend;
static u32 saved_bm_rld;

static void acpi_idle_bm_rld_save(void)
Expand All @@ -242,13 +243,21 @@ static void acpi_idle_bm_rld_restore(void)

int acpi_processor_suspend(struct acpi_device * device, pm_message_t state)
{
if (acpi_idle_suspend == 1)
return 0;

acpi_idle_bm_rld_save();
acpi_idle_suspend = 1;
return 0;
}

int acpi_processor_resume(struct acpi_device * device)
{
if (acpi_idle_suspend == 0)
return 0;

acpi_idle_bm_rld_restore();
acpi_idle_suspend = 0;
return 0;
}

Expand Down Expand Up @@ -754,6 +763,12 @@ static int acpi_idle_enter_c1(struct cpuidle_device *dev,

local_irq_disable();

if (acpi_idle_suspend) {
local_irq_enable();
cpu_relax();
return -EBUSY;
}

lapic_timer_state_broadcast(pr, cx, 1);
kt1 = ktime_get_real();
acpi_idle_do_entry(cx);
Expand Down Expand Up @@ -823,6 +838,12 @@ static int acpi_idle_enter_simple(struct cpuidle_device *dev,

local_irq_disable();

if (acpi_idle_suspend) {
local_irq_enable();
cpu_relax();
return -EBUSY;
}

if (cx->entry_method != ACPI_CSTATE_FFH) {
current_thread_info()->status &= ~TS_POLLING;
/*
Expand Down Expand Up @@ -907,14 +928,21 @@ static int acpi_idle_enter_bm(struct cpuidle_device *dev,
drv, drv->safe_state_index);
} else {
local_irq_disable();
acpi_safe_halt();
if (!acpi_idle_suspend)
acpi_safe_halt();
local_irq_enable();
return -EINVAL;
return -EBUSY;
}
}

local_irq_disable();

if (acpi_idle_suspend) {
local_irq_enable();
cpu_relax();
return -EBUSY;
}

if (cx->entry_method != ACPI_CSTATE_FFH) {
current_thread_info()->status &= ~TS_POLLING;
/*
Expand Down

0 comments on commit 035e1b3

Please sign in to comment.