diff options
author | Len Brown <len.brown@intel.com> | 2006-06-29 15:58:09 -0400 |
---|---|---|
committer | Len Brown <len.brown@intel.com> | 2006-06-29 15:58:09 -0400 |
commit | f1b2ad5d2a8e1791d806ef244164d19c3d5c8b83 (patch) | |
tree | 87ee4837f11718ed9ce68c282c8d01f61086debe /drivers/acpi/processor_idle.c | |
parent | a51a69c0ed955f4fa6f64b4377378c744f9b737b (diff) | |
parent | c4a001b1ea32e09f7556178249b8885418858b5c (diff) |
Pull c-states into release branch
Diffstat (limited to 'drivers/acpi/processor_idle.c')
-rw-r--r-- | drivers/acpi/processor_idle.c | 35 |
1 files changed, 16 insertions, 19 deletions
diff --git a/drivers/acpi/processor_idle.c b/drivers/acpi/processor_idle.c index 2278b21b5eb8..e439eb77d283 100644 --- a/drivers/acpi/processor_idle.c +++ b/drivers/acpi/processor_idle.c | |||
@@ -3,7 +3,7 @@ | |||
3 | * | 3 | * |
4 | * Copyright (C) 2001, 2002 Andy Grover <andrew.grover@intel.com> | 4 | * Copyright (C) 2001, 2002 Andy Grover <andrew.grover@intel.com> |
5 | * Copyright (C) 2001, 2002 Paul Diefenbaugh <paul.s.diefenbaugh@intel.com> | 5 | * Copyright (C) 2001, 2002 Paul Diefenbaugh <paul.s.diefenbaugh@intel.com> |
6 | * Copyright (C) 2004 Dominik Brodowski <linux@brodo.de> | 6 | * Copyright (C) 2004, 2005 Dominik Brodowski <linux@brodo.de> |
7 | * Copyright (C) 2004 Anil S Keshavamurthy <anil.s.keshavamurthy@intel.com> | 7 | * Copyright (C) 2004 Anil S Keshavamurthy <anil.s.keshavamurthy@intel.com> |
8 | * - Added processor hotplug support | 8 | * - Added processor hotplug support |
9 | * Copyright (C) 2005 Venkatesh Pallipadi <venkatesh.pallipadi@intel.com> | 9 | * Copyright (C) 2005 Venkatesh Pallipadi <venkatesh.pallipadi@intel.com> |
@@ -264,21 +264,15 @@ static void acpi_processor_idle(void) | |||
264 | u32 bm_status = 0; | 264 | u32 bm_status = 0; |
265 | unsigned long diff = jiffies - pr->power.bm_check_timestamp; | 265 | unsigned long diff = jiffies - pr->power.bm_check_timestamp; |
266 | 266 | ||
267 | if (diff > 32) | 267 | if (diff > 31) |
268 | diff = 32; | 268 | diff = 31; |
269 | 269 | ||
270 | while (diff) { | 270 | pr->power.bm_activity <<= diff; |
271 | /* if we didn't get called, assume there was busmaster activity */ | ||
272 | diff--; | ||
273 | if (diff) | ||
274 | pr->power.bm_activity |= 0x1; | ||
275 | pr->power.bm_activity <<= 1; | ||
276 | } | ||
277 | 271 | ||
278 | acpi_get_register(ACPI_BITREG_BUS_MASTER_STATUS, | 272 | acpi_get_register(ACPI_BITREG_BUS_MASTER_STATUS, |
279 | &bm_status, ACPI_MTX_DO_NOT_LOCK); | 273 | &bm_status, ACPI_MTX_DO_NOT_LOCK); |
280 | if (bm_status) { | 274 | if (bm_status) { |
281 | pr->power.bm_activity++; | 275 | pr->power.bm_activity |= 0x1; |
282 | acpi_set_register(ACPI_BITREG_BUS_MASTER_STATUS, | 276 | acpi_set_register(ACPI_BITREG_BUS_MASTER_STATUS, |
283 | 1, ACPI_MTX_DO_NOT_LOCK); | 277 | 1, ACPI_MTX_DO_NOT_LOCK); |
284 | } | 278 | } |
@@ -290,16 +284,16 @@ static void acpi_processor_idle(void) | |||
290 | else if (errata.piix4.bmisx) { | 284 | else if (errata.piix4.bmisx) { |
291 | if ((inb_p(errata.piix4.bmisx + 0x02) & 0x01) | 285 | if ((inb_p(errata.piix4.bmisx + 0x02) & 0x01) |
292 | || (inb_p(errata.piix4.bmisx + 0x0A) & 0x01)) | 286 | || (inb_p(errata.piix4.bmisx + 0x0A) & 0x01)) |
293 | pr->power.bm_activity++; | 287 | pr->power.bm_activity |= 0x1; |
294 | } | 288 | } |
295 | 289 | ||
296 | pr->power.bm_check_timestamp = jiffies; | 290 | pr->power.bm_check_timestamp = jiffies; |
297 | 291 | ||
298 | /* | 292 | /* |
299 | * Apply bus mastering demotion policy. Automatically demote | 293 | * If bus mastering is or was active this jiffy, demote |
300 | * to avoid a faulty transition. Note that the processor | 294 | * to avoid a faulty transition. Note that the processor |
301 | * won't enter a low-power state during this call (to this | 295 | * won't enter a low-power state during this call (to this |
302 | * funciton) but should upon the next. | 296 | * function) but should upon the next. |
303 | * | 297 | * |
304 | * TBD: A better policy might be to fallback to the demotion | 298 | * TBD: A better policy might be to fallback to the demotion |
305 | * state (use it for this quantum only) istead of | 299 | * state (use it for this quantum only) istead of |
@@ -307,7 +301,8 @@ static void acpi_processor_idle(void) | |||
307 | * qualification. This may, however, introduce DMA | 301 | * qualification. This may, however, introduce DMA |
308 | * issues (e.g. floppy DMA transfer overrun/underrun). | 302 | * issues (e.g. floppy DMA transfer overrun/underrun). |
309 | */ | 303 | */ |
310 | if (pr->power.bm_activity & cx->demotion.threshold.bm) { | 304 | if ((pr->power.bm_activity & 0x1) && |
305 | cx->demotion.threshold.bm) { | ||
311 | local_irq_enable(); | 306 | local_irq_enable(); |
312 | next_state = cx->demotion.state; | 307 | next_state = cx->demotion.state; |
313 | goto end; | 308 | goto end; |
@@ -325,8 +320,6 @@ static void acpi_processor_idle(void) | |||
325 | cx = &pr->power.states[ACPI_STATE_C1]; | 320 | cx = &pr->power.states[ACPI_STATE_C1]; |
326 | #endif | 321 | #endif |
327 | 322 | ||
328 | cx->usage++; | ||
329 | |||
330 | /* | 323 | /* |
331 | * Sleep: | 324 | * Sleep: |
332 | * ------ | 325 | * ------ |
@@ -435,6 +428,9 @@ static void acpi_processor_idle(void) | |||
435 | local_irq_enable(); | 428 | local_irq_enable(); |
436 | return; | 429 | return; |
437 | } | 430 | } |
431 | cx->usage++; | ||
432 | if ((cx->type != ACPI_STATE_C1) && (sleep_ticks > 0)) | ||
433 | cx->time += sleep_ticks; | ||
438 | 434 | ||
439 | next_state = pr->power.state; | 435 | next_state = pr->power.state; |
440 | 436 | ||
@@ -1058,9 +1054,10 @@ static int acpi_processor_power_seq_show(struct seq_file *seq, void *offset) | |||
1058 | else | 1054 | else |
1059 | seq_puts(seq, "demotion[--] "); | 1055 | seq_puts(seq, "demotion[--] "); |
1060 | 1056 | ||
1061 | seq_printf(seq, "latency[%03d] usage[%08d]\n", | 1057 | seq_printf(seq, "latency[%03d] usage[%08d] duration[%020llu]\n", |
1062 | pr->power.states[i].latency, | 1058 | pr->power.states[i].latency, |
1063 | pr->power.states[i].usage); | 1059 | pr->power.states[i].usage, |
1060 | pr->power.states[i].time); | ||
1064 | } | 1061 | } |
1065 | 1062 | ||
1066 | end: | 1063 | end: |