lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <tip-a52c77102626951144165c53a6b54f1e812360d5@git.kernel.org>
Date:	Thu, 30 Jul 2009 19:57:36 GMT
From:	tip-bot for Magnus Damm <magnus.damm@...il.com>
To:	linux-tip-commits@...r.kernel.org
Cc:	linux-kernel@...r.kernel.org, hpa@...or.com, mingo@...hat.com,
	damm@...l.co.jp, tglx@...utronix.de, magnus.damm@...il.com
Subject: [tip:timers/urgent] clocksource: save mult_orig in clocksource_disable()

Commit-ID:  a52c77102626951144165c53a6b54f1e812360d5
Gitweb:     http://git.kernel.org/tip/a52c77102626951144165c53a6b54f1e812360d5
Author:     Magnus Damm <magnus.damm@...il.com>
AuthorDate: Tue, 28 Jul 2009 14:09:55 -0700
Committer:  Thomas Gleixner <tglx@...utronix.de>
CommitDate: Thu, 30 Jul 2009 21:55:47 +0200

clocksource: save mult_orig in clocksource_disable()

Save clocksource mult_orig in clocksource_disable().

To fix the common case where ->enable() does not setup
mult, make sure mult_orig is saved in mult on disable.

Also add comments to explain why we do this.

Signed-off-by: Magnus Damm <damm@...l.co.jp>
Cc: johnstul@...ibm.com
Cc: lethal@...ux-sh.org
Cc: akpm@...ux-foundation.org
LKML-Reference: <20090618152432.10136.9932.sendpatchset@....opensource.se>
Signed-off-by: Thomas Gleixner <tglx@...utronix.de>


---
 include/linux/clocksource.h |   12 +++++++++++-
 1 files changed, 11 insertions(+), 1 deletions(-)

diff --git a/include/linux/clocksource.h b/include/linux/clocksource.h
index c56457c..aff9f01 100644
--- a/include/linux/clocksource.h
+++ b/include/linux/clocksource.h
@@ -293,7 +293,11 @@ static inline int clocksource_enable(struct clocksource *cs)
 	if (cs->enable)
 		ret = cs->enable(cs);
 
-	/* save mult_orig on enable */
+	/* The frequency may have changed while the clocksource
+	 * was disabled. If so the code in ->enable() must update
+	 * the mult value to reflect the new frequency. Make sure
+	 * mult_orig follows this change.
+	 */
 	cs->mult_orig = cs->mult;
 
 	return ret;
@@ -309,6 +313,12 @@ static inline int clocksource_enable(struct clocksource *cs)
  */
 static inline void clocksource_disable(struct clocksource *cs)
 {
+	/* Save mult_orig in mult so clocksource_enable() can
+	 * restore the value regardless if ->enable() updates
+	 * the value of mult or not.
+	 */
+	cs->mult = cs->mult_orig;
+
 	if (cs->disable)
 		cs->disable(cs);
 }
--
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

Powered by Openwall GNU/*/Linux Powered by OpenVZ