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-fe79a9ba11962a603fb6af68fcb476e64031e46c@git.kernel.org>
Date:	Fri, 7 Feb 2014 06:40:39 -0800
From:	tip-bot for Soren Brinkmann <tipbot@...or.com>
To:	linux-tip-commits@...r.kernel.org
Cc:	linux-kernel@...r.kernel.org, soren.brinkmann@...inx.com,
	hpa@...or.com, mingo@...nel.org, tglx@...utronix.de,
	michal.simek@...inx.com, daniel.lezcano@...aro.org
Subject: [tip:timers/core] clockevents:
  Adjust timer interval when frequency changes

Commit-ID:  fe79a9ba11962a603fb6af68fcb476e64031e46c
Gitweb:     http://git.kernel.org/tip/fe79a9ba11962a603fb6af68fcb476e64031e46c
Author:     Soren Brinkmann <soren.brinkmann@...inx.com>
AuthorDate: Mon, 3 Feb 2014 14:34:32 -0800
Committer:  Thomas Gleixner <tglx@...utronix.de>
CommitDate: Fri, 7 Feb 2014 15:34:29 +0100

clockevents: Adjust timer interval when frequency changes

clockevent devices in periodic mode are not updated when the frequency
of the device changes. Issue a dev->set_mode() callback which forces
the device to reevaluate the timer settings.

Signed-off-by: Soren Brinkmann <soren.brinkmann@...inx.com>
Cc: linux-arm-kernel@...ts.infradead.org
Cc: Daniel Lezcano <daniel.lezcano@...aro.org>
Cc: Michal Simek <michal.simek@...inx.com>
Link: http://lkml.kernel.org/r/1391466877-28908-3-git-send-email-soren.brinkmann@xilinx.com
Signed-off-by: Thomas Gleixner <tglx@...utronix.de>
---
 kernel/time/clockevents.c | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/kernel/time/clockevents.c b/kernel/time/clockevents.c
index 641d910..f85e5fd 100644
--- a/kernel/time/clockevents.c
+++ b/kernel/time/clockevents.c
@@ -443,10 +443,13 @@ int __clockevents_update_freq(struct clock_event_device *dev, u32 freq)
 {
 	clockevents_config(dev, freq);
 
-	if (dev->mode != CLOCK_EVT_MODE_ONESHOT)
-		return 0;
+	if (dev->mode == CLOCK_EVT_MODE_ONESHOT)
+		return clockevents_program_event(dev, dev->next_event, false);
+
+	if (dev->mode == CLOCK_EVT_MODE_PERIODIC)
+		dev->set_mode(CLOCK_EVT_MODE_PERIODIC, dev);
 
-	return clockevents_program_event(dev, dev->next_event, false);
+	return 0;
 }
 
 /**
--
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