lkml.org 
[lkml]   [2014]   [Feb]   [28]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 2/2] timer: Make sure TIMER_FLAG_MASK bits are free in allocated base
Date
Currently we are using two lowest bit of base for internal purpose and so they
both should be zero in the allocated address. The code was doing the right thing
before this patch came in:

commit c5f66e99b7cb091e3d51ae8e8156892e8feb7fa3
Author: Tejun Heo <tj@kernel.org>
Date: Wed Aug 8 11:10:28 2012 -0700

timer: Implement TIMER_IRQSAFE

Tejun probably forgot to update this piece of code which checks if the lowest
'n' bits are zero or not and so wasn't updated according to the new flag. Lets
use TIMER_FLAG_MASK in the calculations here, so that this code wouldn't require
a change later on with another flag in.

Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
---
kernel/timer.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/kernel/timer.c b/kernel/timer.c
index e8e7839..d52a8ff 100644
--- a/kernel/timer.c
+++ b/kernel/timer.c
@@ -1548,9 +1548,8 @@ static int init_timers_cpu(int cpu)
if (!base)
return -ENOMEM;

- /* Make sure that tvec_base is 2 byte aligned */
- if (tbase_get_deferrable(base)) {
- WARN_ON(1);
+ /* Make sure tvec_base has TIMER_FLAG_MASK bits free */
+ if (WARN_ON(base != tbase_get_base(base))) {
kfree(base);
return -ENOMEM;
}
--
1.7.12.rc2.18.g61b472e


\
 
 \ /
  Last update: 2014-02-28 10:21    [W:0.090 / U:1.176 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site