diff options
| author | Sumit Singh <sumsingh.com> | 2014-04-21 13:59:04 +0530 |
|---|---|---|
| committer | Moyster <oysterized@gmail.com> | 2016-09-10 12:07:10 +0200 |
| commit | c1c7b649b4bc072415cca262c96a0d1181572fd5 (patch) | |
| tree | a02fb1bf7965646ba891492a09cdb31224665ffc /include | |
| parent | 7654fa770bf7a3755ce349fbf3552cf026c35af3 (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>
Signed-off-by: franciscofranco <franciscofranco.1990@gmail.com>
Diffstat (limited to 'include')
| -rw-r--r-- | include/linux/hrtimer.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/include/linux/hrtimer.h b/include/linux/hrtimer.h index d19a5c2d2..4d674c334 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); |
