View | Details | Raw Unified | Return to bug 3549 | Differences between
and this patch

Collapse All | Expand All

(-)a/drivers/acpi/osl.c (+9 lines)
Lines 1078-1080 Link Here
1078
1078
1079
__setup("acpi_leave_gpes_disabled", acpi_leave_gpes_disabled_setup);
1079
__setup("acpi_leave_gpes_disabled", acpi_leave_gpes_disabled_setup);
1080
1080
1081
/*
1082
 * acpi_cstate_limit is defined in the base kernel so modules can
1083
 * change it w/o depending on the state of the processor module.
1084
 */
1085
unsigned int acpi_cstate_limit = ACPI_C_STATES_MAX;
1086
1087
1088
EXPORT_SYMBOL(acpi_cstate_limit);
1089
(-)a/drivers/acpi/processor.c (-1 / +10 lines)
Lines 459-466 Link Here
459
	 * Track the number of longs (time asleep is greater than threshold)
459
	 * Track the number of longs (time asleep is greater than threshold)
460
	 * and promote when the count threshold is reached.  Note that bus
460
	 * and promote when the count threshold is reached.  Note that bus
461
	 * mastering activity may prevent promotions.
461
	 * mastering activity may prevent promotions.
462
	 * Do not promote above acpi_cstate_limit.
462
	 */
463
	 */
463
	if (cx->promotion.state) {
464
	if (cx->promotion.state && (cx->promotion.state <= acpi_cstate_limit)) {
464
		if (sleep_ticks > cx->promotion.threshold.ticks) {
465
		if (sleep_ticks > cx->promotion.threshold.ticks) {
465
			cx->promotion.count++;
466
			cx->promotion.count++;
466
 			cx->demotion.count = 0;
467
 			cx->demotion.count = 0;
Lines 498-503 Link Here
498
499
499
end:
500
end:
500
	/*
501
	/*
502
	 * Demote if current state exceeds acpi_cstate_limit
503
	 */
504
	if (pr->power.state > acpi_cstate_limit) {
505
		next_state = acpi_cstate_limit;
506
	}
507
508
	/*
501
	 * New Cx State?
509
	 * New Cx State?
502
	 * -------------
510
	 * -------------
503
	 * If we're going to start using a new Cx state we must clean up
511
	 * If we're going to start using a new Cx state we must clean up
Lines 2441-2445 Link Here
2441
2449
2442
module_init(acpi_processor_init);
2450
module_init(acpi_processor_init);
2443
module_exit(acpi_processor_exit);
2451
module_exit(acpi_processor_exit);
2452
module_param_named(acpi_cstate_limit, acpi_cstate_limit, uint, 0);
2444
2453
2445
EXPORT_SYMBOL(acpi_processor_set_thermal_limit);
2454
EXPORT_SYMBOL(acpi_processor_set_thermal_limit);
(-)a/include/linux/acpi.h (+26 lines)
Lines 471-474 Link Here
471
471
472
#endif /*!CONFIG_ACPI_INTERPRETER*/
472
#endif /*!CONFIG_ACPI_INTERPRETER*/
473
473
474
#define	ACPI_CSTATE_LIMIT_DEFINED	/* for driver builds */
475
#ifdef	CONFIG_ACPI
476
477
/*
478
 * Set highest legal C-state
479
 * 0: C0 okay, but not C1
480
 * 1: C1 okay, but not C2
481
 * 2: C2 okay, but not C3 etc.
482
 */
483
484
extern unsigned int acpi_cstate_limit;
485
486
static inline unsigned int acpi_get_cstate_limit(void)
487
{
488
	return acpi_cstate_limit;
489
}
490
static inline void acpi_set_cstate_limit(unsigned int new_limit)
491
{
492
	acpi_cstate_limit = new_limit;
493
	return;
494
}
495
#else
496
static inline unsigned int acpi_get_cstate_limit(void) { return 0; }
497
static inline void acpi_set_cstate_limit(unsigned int new_limit) { return; }
498
#endif
499
474
#endif /*_LINUX_ACPI_H*/
500
#endif /*_LINUX_ACPI_H*/

Return to bug 3549