diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2014-06-12 16:14:19 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2014-06-12 16:14:19 -0400 |
commit | 19c1940feab777bb037c665a09f495d08a6c4e6c (patch) | |
tree | 68d4de31f30c9d69a1f1ea080b8a69ce61e1ead5 /drivers/base | |
parent | 7c574cf6aeb75920ba4d3af937bb1b3c42785ac4 (diff) | |
parent | d715a226b0b3dae48865d05e8c36175a8f75a809 (diff) |
Merge tag 'pm+acpi-3.16-rc1-2' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm
Pull more ACPI and power management updates from Rafael Wysocki:
"These are fixups on top of the previous PM+ACPI pull request,
regression fixes (ACPI hotplug, cpufreq ppc-corenet), other bug fixes
(ACPI reset, cpufreq), new PM trace points for system suspend
profiling and a copyright notice update.
Specifics:
- I didn't remember correctly that the Hans de Goede's ACPI video
patches actually didn't flip the video.use_native_backlight
default, although we had discussed that and decided to do that.
Since I said we would do that in the previous PM+ACPI pull request,
make that change for real now.
- ACPI bus check notifications for PCI host bridges don't cause the
bus below the host bridge to be checked for changes as they should
because of a mistake in the ACPI-based PCI hotplug (ACPIPHP)
subsystem that forgets to add hotplug contexts to PCI host bridge
ACPI device objects. Create hotplug contexts for PCI host bridges
too as appropriate.
- Revert recent cpufreq commit related to the big.LITTLE cpufreq
driver that breaks arm64 builds.
- Fix for a regression in the ppc-corenet cpufreq driver introduced
during the 3.15 cycle and causing the driver to use the remainder
from do_div instead of the quotient. From Ed Swarthout.
- Resets triggered by panic activate a BUG_ON() in vmalloc.c on
systems where the ACPI reset register is located in memory address
space. Fix from Randy Wright.
- Fix for a problem with cpufreq governors that decisions made by
them may be suboptimal due to the fact that deferrable timers are
used by them for CPU load sampling. From Srivatsa S Bhat.
- Fix for a problem with the Tegra cpufreq driver where the CPU
frequency is temporarily switched to a "stable" level that is
different from both the initial and target frequencies during
transitions which causes udelay() to expire earlier than it should
sometimes. From Viresh Kumar.
- New trace points and rework of some existing trace points for
system suspend/resume profiling from Todd Brandt.
- Assorted cpufreq fixes and cleanups from Stratos Karafotis and
Viresh Kumar.
- Copyright notice update for suspend-and-cpuhotplug.txt from
Srivatsa S Bhat"
* tag 'pm+acpi-3.16-rc1-2' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm:
ACPI / hotplug / PCI: Add hotplug contexts to PCI host bridges
PM / sleep: trace events for device PM callbacks
cpufreq: cpufreq-cpu0: remove dependency on THERMAL and REGULATOR
cpufreq: tegra: update comment for clarity
cpufreq: intel_pstate: Remove duplicate CPU ID check
cpufreq: Mark CPU0 driver with CPUFREQ_NEED_INITIAL_FREQ_CHECK flag
PM / Documentation: Update copyright in suspend-and-cpuhotplug.txt
cpufreq: governor: remove copy_prev_load from 'struct cpu_dbs_common_info'
cpufreq: governor: Be friendly towards latency-sensitive bursty workloads
PM / sleep: trace events for suspend/resume
cpufreq: ppc-corenet-cpu-freq: do_div use quotient
Revert "cpufreq: Enable big.LITTLE cpufreq driver on arm64"
cpufreq: Tegra: implement intermediate frequency callbacks
cpufreq: add support for intermediate (stable) frequencies
ACPI / video: Change the default for video.use_native_backlight to 1
ACPI: Fix bug when ACPI reset register is implemented in system memory
Diffstat (limited to 'drivers/base')
-rw-r--r-- | drivers/base/power/main.c | 30 | ||||
-rw-r--r-- | drivers/base/syscore.c | 5 |
2 files changed, 31 insertions, 4 deletions
diff --git a/drivers/base/power/main.c b/drivers/base/power/main.c index 343ffad59377..bf412961a934 100644 --- a/drivers/base/power/main.c +++ b/drivers/base/power/main.c | |||
@@ -214,9 +214,6 @@ static void initcall_debug_report(struct device *dev, ktime_t calltime, | |||
214 | pr_info("call %s+ returned %d after %Ld usecs\n", dev_name(dev), | 214 | pr_info("call %s+ returned %d after %Ld usecs\n", dev_name(dev), |
215 | error, (unsigned long long)nsecs >> 10); | 215 | error, (unsigned long long)nsecs >> 10); |
216 | } | 216 | } |
217 | |||
218 | trace_device_pm_report_time(dev, info, nsecs, pm_verb(state.event), | ||
219 | error); | ||
220 | } | 217 | } |
221 | 218 | ||
222 | /** | 219 | /** |
@@ -387,7 +384,9 @@ static int dpm_run_callback(pm_callback_t cb, struct device *dev, | |||
387 | calltime = initcall_debug_start(dev); | 384 | calltime = initcall_debug_start(dev); |
388 | 385 | ||
389 | pm_dev_dbg(dev, state, info); | 386 | pm_dev_dbg(dev, state, info); |
387 | trace_device_pm_callback_start(dev, info, state.event); | ||
390 | error = cb(dev); | 388 | error = cb(dev); |
389 | trace_device_pm_callback_end(dev, error); | ||
391 | suspend_report_result(cb, error); | 390 | suspend_report_result(cb, error); |
392 | 391 | ||
393 | initcall_debug_report(dev, calltime, error, state, info); | 392 | initcall_debug_report(dev, calltime, error, state, info); |
@@ -545,6 +544,7 @@ static void dpm_resume_noirq(pm_message_t state) | |||
545 | struct device *dev; | 544 | struct device *dev; |
546 | ktime_t starttime = ktime_get(); | 545 | ktime_t starttime = ktime_get(); |
547 | 546 | ||
547 | trace_suspend_resume(TPS("dpm_resume_noirq"), state.event, true); | ||
548 | mutex_lock(&dpm_list_mtx); | 548 | mutex_lock(&dpm_list_mtx); |
549 | pm_transition = state; | 549 | pm_transition = state; |
550 | 550 | ||
@@ -587,6 +587,7 @@ static void dpm_resume_noirq(pm_message_t state) | |||
587 | dpm_show_time(starttime, state, "noirq"); | 587 | dpm_show_time(starttime, state, "noirq"); |
588 | resume_device_irqs(); | 588 | resume_device_irqs(); |
589 | cpuidle_resume(); | 589 | cpuidle_resume(); |
590 | trace_suspend_resume(TPS("dpm_resume_noirq"), state.event, false); | ||
590 | } | 591 | } |
591 | 592 | ||
592 | /** | 593 | /** |
@@ -664,6 +665,7 @@ static void dpm_resume_early(pm_message_t state) | |||
664 | struct device *dev; | 665 | struct device *dev; |
665 | ktime_t starttime = ktime_get(); | 666 | ktime_t starttime = ktime_get(); |
666 | 667 | ||
668 | trace_suspend_resume(TPS("dpm_resume_early"), state.event, true); | ||
667 | mutex_lock(&dpm_list_mtx); | 669 | mutex_lock(&dpm_list_mtx); |
668 | pm_transition = state; | 670 | pm_transition = state; |
669 | 671 | ||
@@ -703,6 +705,7 @@ static void dpm_resume_early(pm_message_t state) | |||
703 | mutex_unlock(&dpm_list_mtx); | 705 | mutex_unlock(&dpm_list_mtx); |
704 | async_synchronize_full(); | 706 | async_synchronize_full(); |
705 | dpm_show_time(starttime, state, "early"); | 707 | dpm_show_time(starttime, state, "early"); |
708 | trace_suspend_resume(TPS("dpm_resume_early"), state.event, false); | ||
706 | } | 709 | } |
707 | 710 | ||
708 | /** | 711 | /** |
@@ -834,6 +837,7 @@ void dpm_resume(pm_message_t state) | |||
834 | struct device *dev; | 837 | struct device *dev; |
835 | ktime_t starttime = ktime_get(); | 838 | ktime_t starttime = ktime_get(); |
836 | 839 | ||
840 | trace_suspend_resume(TPS("dpm_resume"), state.event, true); | ||
837 | might_sleep(); | 841 | might_sleep(); |
838 | 842 | ||
839 | mutex_lock(&dpm_list_mtx); | 843 | mutex_lock(&dpm_list_mtx); |
@@ -875,6 +879,7 @@ void dpm_resume(pm_message_t state) | |||
875 | dpm_show_time(starttime, state, NULL); | 879 | dpm_show_time(starttime, state, NULL); |
876 | 880 | ||
877 | cpufreq_resume(); | 881 | cpufreq_resume(); |
882 | trace_suspend_resume(TPS("dpm_resume"), state.event, false); | ||
878 | } | 883 | } |
879 | 884 | ||
880 | /** | 885 | /** |
@@ -913,7 +918,9 @@ static void device_complete(struct device *dev, pm_message_t state) | |||
913 | 918 | ||
914 | if (callback) { | 919 | if (callback) { |
915 | pm_dev_dbg(dev, state, info); | 920 | pm_dev_dbg(dev, state, info); |
921 | trace_device_pm_callback_start(dev, info, state.event); | ||
916 | callback(dev); | 922 | callback(dev); |
923 | trace_device_pm_callback_end(dev, 0); | ||
917 | } | 924 | } |
918 | 925 | ||
919 | device_unlock(dev); | 926 | device_unlock(dev); |
@@ -932,6 +939,7 @@ void dpm_complete(pm_message_t state) | |||
932 | { | 939 | { |
933 | struct list_head list; | 940 | struct list_head list; |
934 | 941 | ||
942 | trace_suspend_resume(TPS("dpm_complete"), state.event, true); | ||
935 | might_sleep(); | 943 | might_sleep(); |
936 | 944 | ||
937 | INIT_LIST_HEAD(&list); | 945 | INIT_LIST_HEAD(&list); |
@@ -951,6 +959,7 @@ void dpm_complete(pm_message_t state) | |||
951 | } | 959 | } |
952 | list_splice(&list, &dpm_list); | 960 | list_splice(&list, &dpm_list); |
953 | mutex_unlock(&dpm_list_mtx); | 961 | mutex_unlock(&dpm_list_mtx); |
962 | trace_suspend_resume(TPS("dpm_complete"), state.event, false); | ||
954 | } | 963 | } |
955 | 964 | ||
956 | /** | 965 | /** |
@@ -1086,6 +1095,7 @@ static int dpm_suspend_noirq(pm_message_t state) | |||
1086 | ktime_t starttime = ktime_get(); | 1095 | ktime_t starttime = ktime_get(); |
1087 | int error = 0; | 1096 | int error = 0; |
1088 | 1097 | ||
1098 | trace_suspend_resume(TPS("dpm_suspend_noirq"), state.event, true); | ||
1089 | cpuidle_pause(); | 1099 | cpuidle_pause(); |
1090 | suspend_device_irqs(); | 1100 | suspend_device_irqs(); |
1091 | mutex_lock(&dpm_list_mtx); | 1101 | mutex_lock(&dpm_list_mtx); |
@@ -1126,6 +1136,7 @@ static int dpm_suspend_noirq(pm_message_t state) | |||
1126 | } else { | 1136 | } else { |
1127 | dpm_show_time(starttime, state, "noirq"); | 1137 | dpm_show_time(starttime, state, "noirq"); |
1128 | } | 1138 | } |
1139 | trace_suspend_resume(TPS("dpm_suspend_noirq"), state.event, false); | ||
1129 | return error; | 1140 | return error; |
1130 | } | 1141 | } |
1131 | 1142 | ||
@@ -1222,6 +1233,7 @@ static int dpm_suspend_late(pm_message_t state) | |||
1222 | ktime_t starttime = ktime_get(); | 1233 | ktime_t starttime = ktime_get(); |
1223 | int error = 0; | 1234 | int error = 0; |
1224 | 1235 | ||
1236 | trace_suspend_resume(TPS("dpm_suspend_late"), state.event, true); | ||
1225 | mutex_lock(&dpm_list_mtx); | 1237 | mutex_lock(&dpm_list_mtx); |
1226 | pm_transition = state; | 1238 | pm_transition = state; |
1227 | async_error = 0; | 1239 | async_error = 0; |
@@ -1257,6 +1269,7 @@ static int dpm_suspend_late(pm_message_t state) | |||
1257 | } else { | 1269 | } else { |
1258 | dpm_show_time(starttime, state, "late"); | 1270 | dpm_show_time(starttime, state, "late"); |
1259 | } | 1271 | } |
1272 | trace_suspend_resume(TPS("dpm_suspend_late"), state.event, false); | ||
1260 | return error; | 1273 | return error; |
1261 | } | 1274 | } |
1262 | 1275 | ||
@@ -1295,7 +1308,9 @@ static int legacy_suspend(struct device *dev, pm_message_t state, | |||
1295 | 1308 | ||
1296 | calltime = initcall_debug_start(dev); | 1309 | calltime = initcall_debug_start(dev); |
1297 | 1310 | ||
1311 | trace_device_pm_callback_start(dev, info, state.event); | ||
1298 | error = cb(dev, state); | 1312 | error = cb(dev, state); |
1313 | trace_device_pm_callback_end(dev, error); | ||
1299 | suspend_report_result(cb, error); | 1314 | suspend_report_result(cb, error); |
1300 | 1315 | ||
1301 | initcall_debug_report(dev, calltime, error, state, info); | 1316 | initcall_debug_report(dev, calltime, error, state, info); |
@@ -1461,6 +1476,7 @@ int dpm_suspend(pm_message_t state) | |||
1461 | ktime_t starttime = ktime_get(); | 1476 | ktime_t starttime = ktime_get(); |
1462 | int error = 0; | 1477 | int error = 0; |
1463 | 1478 | ||
1479 | trace_suspend_resume(TPS("dpm_suspend"), state.event, true); | ||
1464 | might_sleep(); | 1480 | might_sleep(); |
1465 | 1481 | ||
1466 | cpufreq_suspend(); | 1482 | cpufreq_suspend(); |
@@ -1498,6 +1514,7 @@ int dpm_suspend(pm_message_t state) | |||
1498 | dpm_save_failed_step(SUSPEND_SUSPEND); | 1514 | dpm_save_failed_step(SUSPEND_SUSPEND); |
1499 | } else | 1515 | } else |
1500 | dpm_show_time(starttime, state, NULL); | 1516 | dpm_show_time(starttime, state, NULL); |
1517 | trace_suspend_resume(TPS("dpm_suspend"), state.event, false); | ||
1501 | return error; | 1518 | return error; |
1502 | } | 1519 | } |
1503 | 1520 | ||
@@ -1549,8 +1566,11 @@ static int device_prepare(struct device *dev, pm_message_t state) | |||
1549 | callback = dev->driver->pm->prepare; | 1566 | callback = dev->driver->pm->prepare; |
1550 | } | 1567 | } |
1551 | 1568 | ||
1552 | if (callback) | 1569 | if (callback) { |
1570 | trace_device_pm_callback_start(dev, info, state.event); | ||
1553 | ret = callback(dev); | 1571 | ret = callback(dev); |
1572 | trace_device_pm_callback_end(dev, ret); | ||
1573 | } | ||
1554 | 1574 | ||
1555 | device_unlock(dev); | 1575 | device_unlock(dev); |
1556 | 1576 | ||
@@ -1582,6 +1602,7 @@ int dpm_prepare(pm_message_t state) | |||
1582 | { | 1602 | { |
1583 | int error = 0; | 1603 | int error = 0; |
1584 | 1604 | ||
1605 | trace_suspend_resume(TPS("dpm_prepare"), state.event, true); | ||
1585 | might_sleep(); | 1606 | might_sleep(); |
1586 | 1607 | ||
1587 | mutex_lock(&dpm_list_mtx); | 1608 | mutex_lock(&dpm_list_mtx); |
@@ -1612,6 +1633,7 @@ int dpm_prepare(pm_message_t state) | |||
1612 | put_device(dev); | 1633 | put_device(dev); |
1613 | } | 1634 | } |
1614 | mutex_unlock(&dpm_list_mtx); | 1635 | mutex_unlock(&dpm_list_mtx); |
1636 | trace_suspend_resume(TPS("dpm_prepare"), state.event, false); | ||
1615 | return error; | 1637 | return error; |
1616 | } | 1638 | } |
1617 | 1639 | ||
diff --git a/drivers/base/syscore.c b/drivers/base/syscore.c index e8d11b6630ee..dbb8350ea8dc 100644 --- a/drivers/base/syscore.c +++ b/drivers/base/syscore.c | |||
@@ -10,6 +10,7 @@ | |||
10 | #include <linux/mutex.h> | 10 | #include <linux/mutex.h> |
11 | #include <linux/module.h> | 11 | #include <linux/module.h> |
12 | #include <linux/interrupt.h> | 12 | #include <linux/interrupt.h> |
13 | #include <trace/events/power.h> | ||
13 | 14 | ||
14 | static LIST_HEAD(syscore_ops_list); | 15 | static LIST_HEAD(syscore_ops_list); |
15 | static DEFINE_MUTEX(syscore_ops_lock); | 16 | static DEFINE_MUTEX(syscore_ops_lock); |
@@ -49,6 +50,7 @@ int syscore_suspend(void) | |||
49 | struct syscore_ops *ops; | 50 | struct syscore_ops *ops; |
50 | int ret = 0; | 51 | int ret = 0; |
51 | 52 | ||
53 | trace_suspend_resume(TPS("syscore_suspend"), 0, true); | ||
52 | pr_debug("Checking wakeup interrupts\n"); | 54 | pr_debug("Checking wakeup interrupts\n"); |
53 | 55 | ||
54 | /* Return error code if there are any wakeup interrupts pending. */ | 56 | /* Return error code if there are any wakeup interrupts pending. */ |
@@ -70,6 +72,7 @@ int syscore_suspend(void) | |||
70 | "Interrupts enabled after %pF\n", ops->suspend); | 72 | "Interrupts enabled after %pF\n", ops->suspend); |
71 | } | 73 | } |
72 | 74 | ||
75 | trace_suspend_resume(TPS("syscore_suspend"), 0, false); | ||
73 | return 0; | 76 | return 0; |
74 | 77 | ||
75 | err_out: | 78 | err_out: |
@@ -92,6 +95,7 @@ void syscore_resume(void) | |||
92 | { | 95 | { |
93 | struct syscore_ops *ops; | 96 | struct syscore_ops *ops; |
94 | 97 | ||
98 | trace_suspend_resume(TPS("syscore_resume"), 0, true); | ||
95 | WARN_ONCE(!irqs_disabled(), | 99 | WARN_ONCE(!irqs_disabled(), |
96 | "Interrupts enabled before system core resume.\n"); | 100 | "Interrupts enabled before system core resume.\n"); |
97 | 101 | ||
@@ -103,6 +107,7 @@ void syscore_resume(void) | |||
103 | WARN_ONCE(!irqs_disabled(), | 107 | WARN_ONCE(!irqs_disabled(), |
104 | "Interrupts enabled after %pF\n", ops->resume); | 108 | "Interrupts enabled after %pF\n", ops->resume); |
105 | } | 109 | } |
110 | trace_suspend_resume(TPS("syscore_resume"), 0, false); | ||
106 | } | 111 | } |
107 | EXPORT_SYMBOL_GPL(syscore_resume); | 112 | EXPORT_SYMBOL_GPL(syscore_resume); |
108 | #endif /* CONFIG_PM_SLEEP */ | 113 | #endif /* CONFIG_PM_SLEEP */ |