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]
Date:   Tue, 24 Oct 2017 01:06:28 -0700
From:   Prasad Sodagudi <psodagud@...eaurora.org>
To:     tglx@...utronix.de, mingo@...nel.org, viresh.kumar@...aro.org
Cc:     linux-kernel@...r.kernel.org, psodagud@...eaurora.org
Subject: [PATCH] Clockevents:  Always call clockevents_program_event

Currently tick_program_event function is not calling
clockevents_program_event when  'expires == KTIME_MAX',
it is just updating clockevent state to CLOCK_EVT_STATE_ONESHOT_STOPPED.
clockevents_program_event function updates clockevent
device next_event by checking clockevent device state,
so always call clockevents_program_event() from tick_program_event.

Signed-off-by: Prasad Sodagudi <psodagud@...eaurora.org>
---
 kernel/time/tick-oneshot.c | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

diff --git a/kernel/time/tick-oneshot.c b/kernel/time/tick-oneshot.c
index 6b009c2..650b071 100644
--- a/kernel/time/tick-oneshot.c
+++ b/kernel/time/tick-oneshot.c
@@ -28,15 +28,12 @@ int tick_program_event(ktime_t expires, int force)
 {
 	struct clock_event_device *dev = __this_cpu_read(tick_cpu_device.evtdev);
 
-	if (unlikely(expires == KTIME_MAX)) {
+	if (expires == KTIME_MAX) {
 		/*
 		 * We don't need the clock event device any more, stop it.
 		 */
 		clockevents_switch_state(dev, CLOCK_EVT_STATE_ONESHOT_STOPPED);
-		return 0;
-	}
-
-	if (unlikely(clockevent_state_oneshot_stopped(dev))) {
+	} else if (clockevent_state_oneshot_stopped(dev)) {
 		/*
 		 * We need the clock event again, configure it in ONESHOT mode
 		 * before using it.
-- 
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
a Linux Foundation Collaborative Project

Powered by blists - more mailing lists