mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Prasad Sodagudi <psodagud@codeaurora.org>
To: tglx@linutronix.de, mingo@kernel.org, viresh.kumar@linaro.org
Cc: linux-kernel@vger.kernel.org, psodagud@codeaurora.org
Subject: [PATCH] Clockevents:  Always call clockevents_program_event
Date: Tue, 24 Oct 2017 01:06:28 -0700	[thread overview]
Message-ID: <1508832388-30929-1-git-send-email-psodagud@codeaurora.org> (raw)
In-Reply-To: <664eaf79d594e82c2b3fb736f7c1a50f@codeaurora.org>

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@codeaurora.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

  reply	other threads:[~2017-10-24  8:06 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-10-24  4:33 clock event device’s next_event Sodagudi Prasad
2017-10-24  7:23 ` Thomas Gleixner
2017-10-24  7:56   ` Sodagudi Prasad
2017-10-24  8:06     ` Prasad Sodagudi [this message]
2017-10-24  8:37       ` [PATCH] Clockevents: Always call clockevents_program_event Thomas Gleixner
2017-10-24  9:21         ` Sodagudi Prasad
2017-10-24 10:13           ` Thomas Gleixner
2017-10-26 18:37             ` [PATCH] clockevents: Update clockevents device next_event Prasad Sodagudi
2017-11-01 17:25               ` [tip:timers/core] clockevents: Update clockevents device next_event on stop tip-bot for Prasad Sodagudi

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1508832388-30929-1-git-send-email-psodagud@codeaurora.org \
    --to=psodagud@codeaurora.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=tglx@linutronix.de \
    --cc=viresh.kumar@linaro.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome