Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Pull c-states into release branch

Len Brown f1b2ad5d a51a69c0

+17 -19
+16 -19
drivers/acpi/processor_idle.c
··· 3 3 * 4 4 * Copyright (C) 2001, 2002 Andy Grover <andrew.grover@intel.com> 5 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 7 * Copyright (C) 2004 Anil S Keshavamurthy <anil.s.keshavamurthy@intel.com> 8 8 * - Added processor hotplug support 9 9 * Copyright (C) 2005 Venkatesh Pallipadi <venkatesh.pallipadi@intel.com> ··· 264 264 u32 bm_status = 0; 265 265 unsigned long diff = jiffies - pr->power.bm_check_timestamp; 266 266 267 - if (diff > 32) 268 - diff = 32; 267 + if (diff > 31) 268 + diff = 31; 269 269 270 - while (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 - } 270 + pr->power.bm_activity <<= diff; 277 271 278 272 acpi_get_register(ACPI_BITREG_BUS_MASTER_STATUS, 279 273 &bm_status, ACPI_MTX_DO_NOT_LOCK); 280 274 if (bm_status) { 281 - pr->power.bm_activity++; 275 + pr->power.bm_activity |= 0x1; 282 276 acpi_set_register(ACPI_BITREG_BUS_MASTER_STATUS, 283 277 1, ACPI_MTX_DO_NOT_LOCK); 284 278 } ··· 284 290 else if (errata.piix4.bmisx) { 285 291 if ((inb_p(errata.piix4.bmisx + 0x02) & 0x01) 286 292 || (inb_p(errata.piix4.bmisx + 0x0A) & 0x01)) 287 - pr->power.bm_activity++; 293 + pr->power.bm_activity |= 0x1; 288 294 } 289 295 290 296 pr->power.bm_check_timestamp = jiffies; 291 297 292 298 /* 293 - * Apply bus mastering demotion policy. Automatically demote 299 + * If bus mastering is or was active this jiffy, demote 294 300 * to avoid a faulty transition. Note that the processor 295 301 * won't enter a low-power state during this call (to this 296 - * funciton) but should upon the next. 302 + * function) but should upon the next. 297 303 * 298 304 * TBD: A better policy might be to fallback to the demotion 299 305 * state (use it for this quantum only) istead of ··· 301 307 * qualification. This may, however, introduce DMA 302 308 * issues (e.g. floppy DMA transfer overrun/underrun). 303 309 */ 304 - if (pr->power.bm_activity & cx->demotion.threshold.bm) { 310 + if ((pr->power.bm_activity & 0x1) && 311 + cx->demotion.threshold.bm) { 305 312 local_irq_enable(); 306 313 next_state = cx->demotion.state; 307 314 goto end; ··· 319 324 !pr->flags.has_cst && !acpi_fadt.plvl2_up) 320 325 cx = &pr->power.states[ACPI_STATE_C1]; 321 326 #endif 322 - 323 - cx->usage++; 324 327 325 328 /* 326 329 * Sleep: ··· 428 435 local_irq_enable(); 429 436 return; 430 437 } 438 + cx->usage++; 439 + if ((cx->type != ACPI_STATE_C1) && (sleep_ticks > 0)) 440 + cx->time += sleep_ticks; 431 441 432 442 next_state = pr->power.state; 433 443 ··· 1054 1058 else 1055 1059 seq_puts(seq, "demotion[--] "); 1056 1060 1057 - seq_printf(seq, "latency[%03d] usage[%08d]\n", 1061 + seq_printf(seq, "latency[%03d] usage[%08d] duration[%020llu]\n", 1058 1062 pr->power.states[i].latency, 1059 - pr->power.states[i].usage); 1063 + pr->power.states[i].usage, 1064 + pr->power.states[i].time); 1060 1065 } 1061 1066 1062 1067 end:
+1
include/acpi/processor.h
··· 62 62 u32 latency_ticks; 63 63 u32 power; 64 64 u32 usage; 65 + u64 time; 65 66 struct acpi_processor_cx_policy promotion; 66 67 struct acpi_processor_cx_policy demotion; 67 68 };