summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorSumit Singh <sumsingh.com>2014-04-21 13:59:04 +0530
committerRiham Haidar <rhaidar@nvidia.com>2014-06-13 11:54:23 -0700
commit46355d511314f7448b6894967339154697129d86 (patch)
tree54bdab02d214f38469530add13e48a403e2a044e /include
parentddc6607ba07751e5a70bb08585d8e92494998783 (diff)
hrtimer: enhance power efficiency
Defining relaxed version of hrtimer_callback_running(), which will be used to improve power efficiency through the use of macro cpu_relaxed_read_long. Bug 1440421 Change-Id: Ie42d7ae9628a817d52f4636781e11b607327c2c5 Signed-off-by: Sumit Singh <sumsingh@nvidia.com> Reviewed-on: http://git-master/r/398789 (cherry picked from commit 0d9f5fc1d39d7d1809519b5d11bf7ac72287b7c6) Reviewed-on: http://git-master/r/422255 Reviewed-by: Automatic_Commit_Validation_User GVS: Gerrit_Virtual_Submit Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com>
Diffstat (limited to 'include')
-rw-r--r--include/linux/hrtimer.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/include/linux/hrtimer.h b/include/linux/hrtimer.h
index d19a5c2d2270..4d674c334faa 100644
--- a/include/linux/hrtimer.h
+++ b/include/linux/hrtimer.h
@@ -5,6 +5,7 @@
*
* Copyright(C) 2005, Thomas Gleixner <tglx@linutronix.de>
* Copyright(C) 2005, Red Hat, Inc., Ingo Molnar
+ * Copyright (C) 2014, NVIDIA CORPORATION. All rights reserved.
*
* data type definitions, declarations, prototypes
*
@@ -23,6 +24,7 @@
#include <linux/percpu.h>
#include <linux/timer.h>
#include <linux/timerqueue.h>
+#include <asm/relaxed.h>
struct hrtimer_clock_base;
struct hrtimer_cpu_base;
@@ -418,6 +420,11 @@ static inline int hrtimer_callback_running(struct hrtimer *timer)
return timer->state & HRTIMER_STATE_CALLBACK;
}
+static inline int hrtimer_callback_running_relaxed(struct hrtimer *timer)
+{
+ return cpu_relaxed_read_long(&timer->state) & HRTIMER_STATE_CALLBACK;
+}
+
/* Forward a hrtimer so it expires after now: */
extern u64
hrtimer_forward(struct hrtimer *timer, ktime_t now, ktime_t interval);