tangled
alpha
login
or
join now
tjh.dev
/
kernel
1
fork
atom
Linux kernel mirror (for testing)
git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel
os
linux
1
fork
atom
overview
issues
pulls
pipelines
Pull c-states into release branch
Len Brown
20 years ago
f1b2ad5d
a51a69c0
+17
-19
2 changed files
expand all
collapse all
unified
split
drivers
acpi
processor_idle.c
include
acpi
processor.h
+16
-19
drivers/acpi/processor_idle.c
reviewed
···
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
6
-
* Copyright (C) 2004 Dominik Brodowski <linux@brodo.de>
6
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
267
-
if (diff > 32)
268
268
-
diff = 32;
267
267
+
if (diff > 31)
268
268
+
diff = 31;
269
269
270
270
-
while (diff) {
271
271
-
/* if we didn't get called, assume there was busmaster activity */
272
272
-
diff--;
273
273
-
if (diff)
274
274
-
pr->power.bm_activity |= 0x1;
275
275
-
pr->power.bm_activity <<= 1;
276
276
-
}
270
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
281
-
pr->power.bm_activity++;
275
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
287
-
pr->power.bm_activity++;
293
293
+
pr->power.bm_activity |= 0x1;
288
294
}
289
295
290
296
pr->power.bm_check_timestamp = jiffies;
291
297
292
298
/*
293
293
-
* Apply bus mastering demotion policy. Automatically demote
299
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
296
-
* funciton) but should upon the next.
302
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
304
-
if (pr->power.bm_activity & cx->demotion.threshold.bm) {
310
310
+
if ((pr->power.bm_activity & 0x1) &&
311
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
322
-
323
323
-
cx->usage++;
324
327
325
328
/*
326
329
* Sleep:
···
428
435
local_irq_enable();
429
436
return;
430
437
}
438
438
+
cx->usage++;
439
439
+
if ((cx->type != ACPI_STATE_C1) && (sleep_ticks > 0))
440
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
1057
-
seq_printf(seq, "latency[%03d] usage[%08d]\n",
1061
1061
+
seq_printf(seq, "latency[%03d] usage[%08d] duration[%020llu]\n",
1058
1062
pr->power.states[i].latency,
1059
1059
-
pr->power.states[i].usage);
1063
1063
+
pr->power.states[i].usage,
1064
1064
+
pr->power.states[i].time);
1060
1065
}
1061
1066
1062
1067
end:
+1
include/acpi/processor.h
reviewed
···
62
62
u32 latency_ticks;
63
63
u32 power;
64
64
u32 usage;
65
65
+
u64 time;
65
66
struct acpi_processor_cx_policy promotion;
66
67
struct acpi_processor_cx_policy demotion;
67
68
};