[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1372916056-24301-3-git-send-email-alex.shi@intel.com>
Date: Thu, 4 Jul 2013 13:34:15 +0800
From: Alex Shi <alex.shi@...el.com>
To: tglx@...utronix.de, hpa@...ux.intel.com, tim.c.chen@...ux.intel.com
Cc: linux-kernel@...r.kernel.org, andi.kleen@...el.com,
a.p.zijlstra@...llo.nl, mingo@...e.hu
Subject: [PATCH 2/3] clockesource: set override clocksource
Shrink the mutex region. And save a clocksource_select action if set
clocksource is same as current clocksource.
Signed-off-by: Alex Shi <alex.shi@...el.com>
---
kernel/time/clocksource.c | 12 +++++++-----
1 file changed, 7 insertions(+), 5 deletions(-)
diff --git a/kernel/time/clocksource.c b/kernel/time/clocksource.c
index 021c159..9d6c333 100644
--- a/kernel/time/clocksource.c
+++ b/kernel/time/clocksource.c
@@ -885,13 +885,15 @@ static ssize_t sysfs_override_clocksource(struct device *dev,
{
size_t ret;
- mutex_lock(&clocksource_mutex);
-
ret = sysfs_get_uname(buf, override_name, count);
- if (ret >= 0)
- clocksource_select();
+ if (ret >= 0) {
+ if (!strcmp(curr_clocksource->name, override_name))
+ return ret;
- mutex_unlock(&clocksource_mutex);
+ mutex_lock(&clocksource_mutex);
+ clocksource_select();
+ mutex_unlock(&clocksource_mutex);
+ }
return ret;
}
--
1.7.12
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists