diff options
-rw-r--r-- | Documentation/feature-removal-schedule.txt | 9 | ||||
-rw-r--r-- | drivers/acpi/ec.c | 22 | ||||
-rw-r--r-- | drivers/acpi/internal.h | 5 | ||||
-rw-r--r-- | drivers/acpi/processor_idle.c | 17 | ||||
-rw-r--r-- | drivers/acpi/sleep.c | 57 |
5 files changed, 55 insertions, 55 deletions
diff --git a/Documentation/feature-removal-schedule.txt b/Documentation/feature-removal-schedule.txt index 672be0109d02..c268783bc4e7 100644 --- a/Documentation/feature-removal-schedule.txt +++ b/Documentation/feature-removal-schedule.txt | |||
@@ -578,15 +578,6 @@ Who: Avi Kivity <avi@redhat.com> | |||
578 | 578 | ||
579 | ---------------------------- | 579 | ---------------------------- |
580 | 580 | ||
581 | What: "acpi=ht" boot option | ||
582 | When: 2.6.35 | ||
583 | Why: Useful in 2003, implementation is a hack. | ||
584 | Generally invoked by accident today. | ||
585 | Seen as doing more harm than good. | ||
586 | Who: Len Brown <len.brown@intel.com> | ||
587 | |||
588 | ---------------------------- | ||
589 | |||
590 | What: iwlwifi 50XX module parameters | 581 | What: iwlwifi 50XX module parameters |
591 | When: 2.6.40 | 582 | When: 2.6.40 |
592 | Why: The "..50" modules parameters were used to configure 5000 series and | 583 | Why: The "..50" modules parameters were used to configure 5000 series and |
diff --git a/drivers/acpi/ec.c b/drivers/acpi/ec.c index e61d4f8e62a5..5f2027d782e8 100644 --- a/drivers/acpi/ec.c +++ b/drivers/acpi/ec.c | |||
@@ -79,7 +79,7 @@ enum { | |||
79 | EC_FLAGS_GPE_STORM, /* GPE storm detected */ | 79 | EC_FLAGS_GPE_STORM, /* GPE storm detected */ |
80 | EC_FLAGS_HANDLERS_INSTALLED, /* Handlers for GPE and | 80 | EC_FLAGS_HANDLERS_INSTALLED, /* Handlers for GPE and |
81 | * OpReg are installed */ | 81 | * OpReg are installed */ |
82 | EC_FLAGS_FROZEN, /* Transactions are suspended */ | 82 | EC_FLAGS_BLOCKED, /* Transactions are blocked */ |
83 | }; | 83 | }; |
84 | 84 | ||
85 | /* If we find an EC via the ECDT, we need to keep a ptr to its context */ | 85 | /* If we find an EC via the ECDT, we need to keep a ptr to its context */ |
@@ -293,7 +293,7 @@ static int acpi_ec_transaction(struct acpi_ec *ec, struct transaction *t) | |||
293 | if (t->rdata) | 293 | if (t->rdata) |
294 | memset(t->rdata, 0, t->rlen); | 294 | memset(t->rdata, 0, t->rlen); |
295 | mutex_lock(&ec->lock); | 295 | mutex_lock(&ec->lock); |
296 | if (test_bit(EC_FLAGS_FROZEN, &ec->flags)) { | 296 | if (test_bit(EC_FLAGS_BLOCKED, &ec->flags)) { |
297 | status = -EINVAL; | 297 | status = -EINVAL; |
298 | goto unlock; | 298 | goto unlock; |
299 | } | 299 | } |
@@ -459,7 +459,7 @@ int ec_transaction(u8 command, | |||
459 | 459 | ||
460 | EXPORT_SYMBOL(ec_transaction); | 460 | EXPORT_SYMBOL(ec_transaction); |
461 | 461 | ||
462 | void acpi_ec_suspend_transactions(void) | 462 | void acpi_ec_block_transactions(void) |
463 | { | 463 | { |
464 | struct acpi_ec *ec = first_ec; | 464 | struct acpi_ec *ec = first_ec; |
465 | 465 | ||
@@ -468,11 +468,11 @@ void acpi_ec_suspend_transactions(void) | |||
468 | 468 | ||
469 | mutex_lock(&ec->lock); | 469 | mutex_lock(&ec->lock); |
470 | /* Prevent transactions from being carried out */ | 470 | /* Prevent transactions from being carried out */ |
471 | set_bit(EC_FLAGS_FROZEN, &ec->flags); | 471 | set_bit(EC_FLAGS_BLOCKED, &ec->flags); |
472 | mutex_unlock(&ec->lock); | 472 | mutex_unlock(&ec->lock); |
473 | } | 473 | } |
474 | 474 | ||
475 | void acpi_ec_resume_transactions(void) | 475 | void acpi_ec_unblock_transactions(void) |
476 | { | 476 | { |
477 | struct acpi_ec *ec = first_ec; | 477 | struct acpi_ec *ec = first_ec; |
478 | 478 | ||
@@ -481,10 +481,20 @@ void acpi_ec_resume_transactions(void) | |||
481 | 481 | ||
482 | mutex_lock(&ec->lock); | 482 | mutex_lock(&ec->lock); |
483 | /* Allow transactions to be carried out again */ | 483 | /* Allow transactions to be carried out again */ |
484 | clear_bit(EC_FLAGS_FROZEN, &ec->flags); | 484 | clear_bit(EC_FLAGS_BLOCKED, &ec->flags); |
485 | mutex_unlock(&ec->lock); | 485 | mutex_unlock(&ec->lock); |
486 | } | 486 | } |
487 | 487 | ||
488 | void acpi_ec_unblock_transactions_early(void) | ||
489 | { | ||
490 | /* | ||
491 | * Allow transactions to happen again (this function is called from | ||
492 | * atomic context during wakeup, so we don't need to acquire the mutex). | ||
493 | */ | ||
494 | if (first_ec) | ||
495 | clear_bit(EC_FLAGS_BLOCKED, &first_ec->flags); | ||
496 | } | ||
497 | |||
488 | static int acpi_ec_query_unlocked(struct acpi_ec *ec, u8 * data) | 498 | static int acpi_ec_query_unlocked(struct acpi_ec *ec, u8 * data) |
489 | { | 499 | { |
490 | int result; | 500 | int result; |
diff --git a/drivers/acpi/internal.h b/drivers/acpi/internal.h index e28411367239..f8f190ec066e 100644 --- a/drivers/acpi/internal.h +++ b/drivers/acpi/internal.h | |||
@@ -49,8 +49,9 @@ void acpi_early_processor_set_pdc(void); | |||
49 | int acpi_ec_init(void); | 49 | int acpi_ec_init(void); |
50 | int acpi_ec_ecdt_probe(void); | 50 | int acpi_ec_ecdt_probe(void); |
51 | int acpi_boot_ec_enable(void); | 51 | int acpi_boot_ec_enable(void); |
52 | void acpi_ec_suspend_transactions(void); | 52 | void acpi_ec_block_transactions(void); |
53 | void acpi_ec_resume_transactions(void); | 53 | void acpi_ec_unblock_transactions(void); |
54 | void acpi_ec_unblock_transactions_early(void); | ||
54 | 55 | ||
55 | /*-------------------------------------------------------------------------- | 56 | /*-------------------------------------------------------------------------- |
56 | Suspend/Resume | 57 | Suspend/Resume |
diff --git a/drivers/acpi/processor_idle.c b/drivers/acpi/processor_idle.c index 2e8c27d48f2b..b1b385692f46 100644 --- a/drivers/acpi/processor_idle.c +++ b/drivers/acpi/processor_idle.c | |||
@@ -80,7 +80,7 @@ module_param(nocst, uint, 0000); | |||
80 | static unsigned int latency_factor __read_mostly = 2; | 80 | static unsigned int latency_factor __read_mostly = 2; |
81 | module_param(latency_factor, uint, 0644); | 81 | module_param(latency_factor, uint, 0644); |
82 | 82 | ||
83 | static s64 us_to_pm_timer_ticks(s64 t) | 83 | static u64 us_to_pm_timer_ticks(s64 t) |
84 | { | 84 | { |
85 | return div64_u64(t * PM_TIMER_FREQUENCY, 1000000); | 85 | return div64_u64(t * PM_TIMER_FREQUENCY, 1000000); |
86 | } | 86 | } |
@@ -731,10 +731,10 @@ static int acpi_processor_power_seq_show(struct seq_file *seq, void *offset) | |||
731 | 731 | ||
732 | seq_puts(seq, "demotion[--] "); | 732 | seq_puts(seq, "demotion[--] "); |
733 | 733 | ||
734 | seq_printf(seq, "latency[%03d] usage[%08d] duration[%020llu]\n", | 734 | seq_printf(seq, "latency[%03d] usage[%08d] duration[%020Lu]\n", |
735 | pr->power.states[i].latency, | 735 | pr->power.states[i].latency, |
736 | pr->power.states[i].usage, | 736 | pr->power.states[i].usage, |
737 | (unsigned long long)pr->power.states[i].time); | 737 | us_to_pm_timer_ticks(pr->power.states[i].time)); |
738 | } | 738 | } |
739 | 739 | ||
740 | end: | 740 | end: |
@@ -861,7 +861,6 @@ static int acpi_idle_enter_simple(struct cpuidle_device *dev, | |||
861 | ktime_t kt1, kt2; | 861 | ktime_t kt1, kt2; |
862 | s64 idle_time_ns; | 862 | s64 idle_time_ns; |
863 | s64 idle_time; | 863 | s64 idle_time; |
864 | s64 sleep_ticks = 0; | ||
865 | 864 | ||
866 | pr = __get_cpu_var(processors); | 865 | pr = __get_cpu_var(processors); |
867 | 866 | ||
@@ -906,8 +905,6 @@ static int acpi_idle_enter_simple(struct cpuidle_device *dev, | |||
906 | idle_time = idle_time_ns; | 905 | idle_time = idle_time_ns; |
907 | do_div(idle_time, NSEC_PER_USEC); | 906 | do_div(idle_time, NSEC_PER_USEC); |
908 | 907 | ||
909 | sleep_ticks = us_to_pm_timer_ticks(idle_time); | ||
910 | |||
911 | /* Tell the scheduler how much we idled: */ | 908 | /* Tell the scheduler how much we idled: */ |
912 | sched_clock_idle_wakeup_event(idle_time_ns); | 909 | sched_clock_idle_wakeup_event(idle_time_ns); |
913 | 910 | ||
@@ -918,7 +915,7 @@ static int acpi_idle_enter_simple(struct cpuidle_device *dev, | |||
918 | cx->usage++; | 915 | cx->usage++; |
919 | 916 | ||
920 | lapic_timer_state_broadcast(pr, cx, 0); | 917 | lapic_timer_state_broadcast(pr, cx, 0); |
921 | cx->time += sleep_ticks; | 918 | cx->time += idle_time; |
922 | return idle_time; | 919 | return idle_time; |
923 | } | 920 | } |
924 | 921 | ||
@@ -940,7 +937,6 @@ static int acpi_idle_enter_bm(struct cpuidle_device *dev, | |||
940 | ktime_t kt1, kt2; | 937 | ktime_t kt1, kt2; |
941 | s64 idle_time_ns; | 938 | s64 idle_time_ns; |
942 | s64 idle_time; | 939 | s64 idle_time; |
943 | s64 sleep_ticks = 0; | ||
944 | 940 | ||
945 | 941 | ||
946 | pr = __get_cpu_var(processors); | 942 | pr = __get_cpu_var(processors); |
@@ -1022,11 +1018,10 @@ static int acpi_idle_enter_bm(struct cpuidle_device *dev, | |||
1022 | spin_unlock(&c3_lock); | 1018 | spin_unlock(&c3_lock); |
1023 | } | 1019 | } |
1024 | kt2 = ktime_get_real(); | 1020 | kt2 = ktime_get_real(); |
1025 | idle_time_ns = ktime_to_us(ktime_sub(kt2, kt1)); | 1021 | idle_time_ns = ktime_to_ns(ktime_sub(kt2, kt1)); |
1026 | idle_time = idle_time_ns; | 1022 | idle_time = idle_time_ns; |
1027 | do_div(idle_time, NSEC_PER_USEC); | 1023 | do_div(idle_time, NSEC_PER_USEC); |
1028 | 1024 | ||
1029 | sleep_ticks = us_to_pm_timer_ticks(idle_time); | ||
1030 | /* Tell the scheduler how much we idled: */ | 1025 | /* Tell the scheduler how much we idled: */ |
1031 | sched_clock_idle_wakeup_event(idle_time_ns); | 1026 | sched_clock_idle_wakeup_event(idle_time_ns); |
1032 | 1027 | ||
@@ -1037,7 +1032,7 @@ static int acpi_idle_enter_bm(struct cpuidle_device *dev, | |||
1037 | cx->usage++; | 1032 | cx->usage++; |
1038 | 1033 | ||
1039 | lapic_timer_state_broadcast(pr, cx, 0); | 1034 | lapic_timer_state_broadcast(pr, cx, 0); |
1040 | cx->time += sleep_ticks; | 1035 | cx->time += idle_time; |
1041 | return idle_time; | 1036 | return idle_time; |
1042 | } | 1037 | } |
1043 | 1038 | ||
diff --git a/drivers/acpi/sleep.c b/drivers/acpi/sleep.c index 4ab2275b4461..3fb4bdea7e06 100644 --- a/drivers/acpi/sleep.c +++ b/drivers/acpi/sleep.c | |||
@@ -94,11 +94,13 @@ void __init acpi_old_suspend_ordering(void) | |||
94 | } | 94 | } |
95 | 95 | ||
96 | /** | 96 | /** |
97 | * acpi_pm_disable_gpes - Disable the GPEs. | 97 | * acpi_pm_freeze - Disable the GPEs and suspend EC transactions. |
98 | */ | 98 | */ |
99 | static int acpi_pm_disable_gpes(void) | 99 | static int acpi_pm_freeze(void) |
100 | { | 100 | { |
101 | acpi_disable_all_gpes(); | 101 | acpi_disable_all_gpes(); |
102 | acpi_os_wait_events_complete(NULL); | ||
103 | acpi_ec_block_transactions(); | ||
102 | return 0; | 104 | return 0; |
103 | } | 105 | } |
104 | 106 | ||
@@ -126,7 +128,8 @@ static int acpi_pm_prepare(void) | |||
126 | int error = __acpi_pm_prepare(); | 128 | int error = __acpi_pm_prepare(); |
127 | 129 | ||
128 | if (!error) | 130 | if (!error) |
129 | acpi_disable_all_gpes(); | 131 | acpi_pm_freeze(); |
132 | |||
130 | return error; | 133 | return error; |
131 | } | 134 | } |
132 | 135 | ||
@@ -256,6 +259,8 @@ static int acpi_suspend_enter(suspend_state_t pm_state) | |||
256 | * acpi_leave_sleep_state will reenable specific GPEs later | 259 | * acpi_leave_sleep_state will reenable specific GPEs later |
257 | */ | 260 | */ |
258 | acpi_disable_all_gpes(); | 261 | acpi_disable_all_gpes(); |
262 | /* Allow EC transactions to happen. */ | ||
263 | acpi_ec_unblock_transactions_early(); | ||
259 | 264 | ||
260 | local_irq_restore(flags); | 265 | local_irq_restore(flags); |
261 | printk(KERN_DEBUG "Back to C!\n"); | 266 | printk(KERN_DEBUG "Back to C!\n"); |
@@ -267,6 +272,12 @@ static int acpi_suspend_enter(suspend_state_t pm_state) | |||
267 | return ACPI_SUCCESS(status) ? 0 : -EFAULT; | 272 | return ACPI_SUCCESS(status) ? 0 : -EFAULT; |
268 | } | 273 | } |
269 | 274 | ||
275 | static void acpi_suspend_finish(void) | ||
276 | { | ||
277 | acpi_ec_unblock_transactions(); | ||
278 | acpi_pm_finish(); | ||
279 | } | ||
280 | |||
270 | static int acpi_suspend_state_valid(suspend_state_t pm_state) | 281 | static int acpi_suspend_state_valid(suspend_state_t pm_state) |
271 | { | 282 | { |
272 | u32 acpi_state; | 283 | u32 acpi_state; |
@@ -288,7 +299,7 @@ static struct platform_suspend_ops acpi_suspend_ops = { | |||
288 | .begin = acpi_suspend_begin, | 299 | .begin = acpi_suspend_begin, |
289 | .prepare_late = acpi_pm_prepare, | 300 | .prepare_late = acpi_pm_prepare, |
290 | .enter = acpi_suspend_enter, | 301 | .enter = acpi_suspend_enter, |
291 | .wake = acpi_pm_finish, | 302 | .wake = acpi_suspend_finish, |
292 | .end = acpi_pm_end, | 303 | .end = acpi_pm_end, |
293 | }; | 304 | }; |
294 | 305 | ||
@@ -314,9 +325,9 @@ static int acpi_suspend_begin_old(suspend_state_t pm_state) | |||
314 | static struct platform_suspend_ops acpi_suspend_ops_old = { | 325 | static struct platform_suspend_ops acpi_suspend_ops_old = { |
315 | .valid = acpi_suspend_state_valid, | 326 | .valid = acpi_suspend_state_valid, |
316 | .begin = acpi_suspend_begin_old, | 327 | .begin = acpi_suspend_begin_old, |
317 | .prepare_late = acpi_pm_disable_gpes, | 328 | .prepare_late = acpi_pm_freeze, |
318 | .enter = acpi_suspend_enter, | 329 | .enter = acpi_suspend_enter, |
319 | .wake = acpi_pm_finish, | 330 | .wake = acpi_suspend_finish, |
320 | .end = acpi_pm_end, | 331 | .end = acpi_pm_end, |
321 | .recover = acpi_pm_finish, | 332 | .recover = acpi_pm_finish, |
322 | }; | 333 | }; |
@@ -433,6 +444,7 @@ static int acpi_hibernation_enter(void) | |||
433 | static void acpi_hibernation_finish(void) | 444 | static void acpi_hibernation_finish(void) |
434 | { | 445 | { |
435 | hibernate_nvs_free(); | 446 | hibernate_nvs_free(); |
447 | acpi_ec_unblock_transactions(); | ||
436 | acpi_pm_finish(); | 448 | acpi_pm_finish(); |
437 | } | 449 | } |
438 | 450 | ||
@@ -453,19 +465,13 @@ static void acpi_hibernation_leave(void) | |||
453 | } | 465 | } |
454 | /* Restore the NVS memory area */ | 466 | /* Restore the NVS memory area */ |
455 | hibernate_nvs_restore(); | 467 | hibernate_nvs_restore(); |
468 | /* Allow EC transactions to happen. */ | ||
469 | acpi_ec_unblock_transactions_early(); | ||
456 | } | 470 | } |
457 | 471 | ||
458 | static int acpi_pm_pre_restore(void) | 472 | static void acpi_pm_thaw(void) |
459 | { | ||
460 | acpi_disable_all_gpes(); | ||
461 | acpi_os_wait_events_complete(NULL); | ||
462 | acpi_ec_suspend_transactions(); | ||
463 | return 0; | ||
464 | } | ||
465 | |||
466 | static void acpi_pm_restore_cleanup(void) | ||
467 | { | 473 | { |
468 | acpi_ec_resume_transactions(); | 474 | acpi_ec_unblock_transactions(); |
469 | acpi_enable_all_runtime_gpes(); | 475 | acpi_enable_all_runtime_gpes(); |
470 | } | 476 | } |
471 | 477 | ||
@@ -477,8 +483,8 @@ static struct platform_hibernation_ops acpi_hibernation_ops = { | |||
477 | .prepare = acpi_pm_prepare, | 483 | .prepare = acpi_pm_prepare, |
478 | .enter = acpi_hibernation_enter, | 484 | .enter = acpi_hibernation_enter, |
479 | .leave = acpi_hibernation_leave, | 485 | .leave = acpi_hibernation_leave, |
480 | .pre_restore = acpi_pm_pre_restore, | 486 | .pre_restore = acpi_pm_freeze, |
481 | .restore_cleanup = acpi_pm_restore_cleanup, | 487 | .restore_cleanup = acpi_pm_thaw, |
482 | }; | 488 | }; |
483 | 489 | ||
484 | /** | 490 | /** |
@@ -510,12 +516,9 @@ static int acpi_hibernation_begin_old(void) | |||
510 | 516 | ||
511 | static int acpi_hibernation_pre_snapshot_old(void) | 517 | static int acpi_hibernation_pre_snapshot_old(void) |
512 | { | 518 | { |
513 | int error = acpi_pm_disable_gpes(); | 519 | acpi_pm_freeze(); |
514 | 520 | hibernate_nvs_save(); | |
515 | if (!error) | 521 | return 0; |
516 | hibernate_nvs_save(); | ||
517 | |||
518 | return error; | ||
519 | } | 522 | } |
520 | 523 | ||
521 | /* | 524 | /* |
@@ -527,11 +530,11 @@ static struct platform_hibernation_ops acpi_hibernation_ops_old = { | |||
527 | .end = acpi_pm_end, | 530 | .end = acpi_pm_end, |
528 | .pre_snapshot = acpi_hibernation_pre_snapshot_old, | 531 | .pre_snapshot = acpi_hibernation_pre_snapshot_old, |
529 | .finish = acpi_hibernation_finish, | 532 | .finish = acpi_hibernation_finish, |
530 | .prepare = acpi_pm_disable_gpes, | 533 | .prepare = acpi_pm_freeze, |
531 | .enter = acpi_hibernation_enter, | 534 | .enter = acpi_hibernation_enter, |
532 | .leave = acpi_hibernation_leave, | 535 | .leave = acpi_hibernation_leave, |
533 | .pre_restore = acpi_pm_pre_restore, | 536 | .pre_restore = acpi_pm_freeze, |
534 | .restore_cleanup = acpi_pm_restore_cleanup, | 537 | .restore_cleanup = acpi_pm_thaw, |
535 | .recover = acpi_pm_finish, | 538 | .recover = acpi_pm_finish, |
536 | }; | 539 | }; |
537 | #endif /* CONFIG_HIBERNATION */ | 540 | #endif /* CONFIG_HIBERNATION */ |