aboutsummaryrefslogtreecommitdiff
path: root/drivers/base
diff options
context:
space:
mode:
authorAlex Shi <alex.shi@linaro.org>2015-04-17 10:35:53 +0800
committerAlex Shi <alex.shi@linaro.org>2015-04-17 10:35:53 +0800
commit87449e82dffbc547b20ea133bf2d8fc767096e56 (patch)
treede7993e5788ebc807dd17afe21812613c79b9087 /drivers/base
parent877c2196bf43e410b8b1a66c7bbf7d5cb98a9f41 (diff)
parent401b999aa32ba52f4f074bafc3220fc25fb99ef2 (diff)
Merge branch 'linaro-android-3.14-lsk' of git://android.git.linaro.org/kernel/linaro-android into linux-linaro-lsk-v3.14-android
Diffstat (limited to 'drivers/base')
-rw-r--r--drivers/base/cpu.c2
-rw-r--r--drivers/base/power/wakeup.c22
2 files changed, 20 insertions, 4 deletions
diff --git a/drivers/base/cpu.c b/drivers/base/cpu.c
index 335e9efc7872..8a38bf8c792f 100644
--- a/drivers/base/cpu.c
+++ b/drivers/base/cpu.c
@@ -346,7 +346,7 @@ int register_cpu(struct cpu *cpu, int num)
cpu->dev.offline_disabled = !cpu->hotpluggable;
cpu->dev.offline = !cpu_online(num);
cpu->dev.of_node = of_get_cpu_node(num, NULL);
-#ifdef CONFIG_ARCH_HAS_CPU_AUTOPROBE
+#ifdef CONFIG_HAVE_CPU_AUTOPROBE
cpu->dev.bus->uevent = cpu_uevent;
#endif
cpu->dev.groups = common_cpu_attr_groups;
diff --git a/drivers/base/power/wakeup.c b/drivers/base/power/wakeup.c
index 066d15837e15..303e8616d6bc 100644
--- a/drivers/base/power/wakeup.c
+++ b/drivers/base/power/wakeup.c
@@ -14,6 +14,7 @@
#include <linux/suspend.h>
#include <linux/seq_file.h>
#include <linux/debugfs.h>
+#include <linux/types.h>
#include <trace/events/power.h>
#include "power.h"
@@ -661,16 +662,31 @@ EXPORT_SYMBOL_GPL(pm_wakeup_event);
void pm_get_active_wakeup_sources(char *pending_wakeup_source, size_t max)
{
- struct wakeup_source *ws;
+ struct wakeup_source *ws, *last_active_ws = NULL;
int len = 0;
+ bool active = false;
+
rcu_read_lock();
- len += snprintf(pending_wakeup_source, max, "Pending Wakeup Sources: ");
list_for_each_entry_rcu(ws, &wakeup_sources, entry) {
if (ws->active) {
- len += snprintf(pending_wakeup_source + len, max,
+ if (!active)
+ len += scnprintf(pending_wakeup_source, max,
+ "Pending Wakeup Sources: ");
+ len += scnprintf(pending_wakeup_source + len, max - len,
"%s ", ws->name);
+ active = true;
+ } else if (!active &&
+ (!last_active_ws ||
+ ktime_to_ns(ws->last_time) >
+ ktime_to_ns(last_active_ws->last_time))) {
+ last_active_ws = ws;
}
}
+ if (!active && last_active_ws) {
+ scnprintf(pending_wakeup_source, max,
+ "Last active Wakeup Source: %s",
+ last_active_ws->name);
+ }
rcu_read_unlock();
}
EXPORT_SYMBOL_GPL(pm_get_active_wakeup_sources);