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-c7121843685de2bf7f3afd3ae1d6a146010bf1fc@git.kernel.org>
Date:	Fri, 31 Jul 2009 12:16:22 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:  c7121843685de2bf7f3afd3ae1d6a146010bf1fc
Gitweb:     http://git.kernel.org/tip/c7121843685de2bf7f3afd3ae1d6a146010bf1fc
Author:     Magnus Damm <magnus.damm@...il.com>
AuthorDate: Tue, 28 Jul 2009 14:09:55 -0700
Committer:  Ingo Molnar <mingo@...e.hu>
CommitDate: Fri, 31 Jul 2009 14:12:36 +0200

clocksource: Save mult_orig in clocksource_disable()

To fix the common case where ->enable() does not set up
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 |   14 +++++++++++++-
 1 files changed, 13 insertions(+), 1 deletions(-)

diff --git a/include/linux/clocksource.h b/include/linux/clocksource.h
index c56457c..1219be4 100644
--- a/include/linux/clocksource.h
+++ b/include/linux/clocksource.h
@@ -293,7 +293,12 @@ 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 +314,13 @@ 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