mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Thomas Gleixner <tglx@linutronix.de>
To: LKML <linux-kernel@vger.kernel.org>
Cc: Ingo Molnar <mingo@elte.hu>,
	Venkatesh Pallipadi <venkatesh.pallipadi@intel.com>,
	"Luiz Fernando N. Capitulino" <lcapitulino@mandriva.com.br>,
	Dmitry Nezhevenko <dion@inhex.net>
Subject: [patch 3/6] clockevents: enforce reprogram in oneshot setup
Date: Wed, 03 Sep 2008 21:37:03 -0000	[thread overview]
Message-ID: <20080903212753.233424002@linutronix.de> (raw)
In-Reply-To: <20080903212735.713411776@linutronix.de>

[-- Attachment #1: clockevents-enforce-reprogram-in-oneshot-setup.patch --]
[-- Type: text/plain, Size: 1830 bytes --]

In tick_oneshot_setup we program the device to the given next_event,
but we do not check the return value. We need to make sure that the
device is programmed enforced so the interrupt handler engine starts
working. Split out the reprogramming function from tick_program_event()
and call it with the device, which was handed in to tick_setup_oneshot().
Set the force argument, so the devices is firing an interrupt.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
---
 kernel/time/tick-oneshot.c |   18 ++++++++++++++----
 1 file changed, 14 insertions(+), 4 deletions(-)

Index: linux-2.6/kernel/time/tick-oneshot.c
===================================================================
--- linux-2.6.orig/kernel/time/tick-oneshot.c
+++ linux-2.6/kernel/time/tick-oneshot.c
@@ -23,11 +23,11 @@
 #include "tick-internal.h"
 
 /**
- * tick_program_event
+ * tick_program_event internal worker function
  */
-int tick_program_event(ktime_t expires, int force)
+static int __tick_program_event(struct clock_event_device *dev,
+				ktime_t expires, int force)
 {
-	struct clock_event_device *dev = __get_cpu_var(tick_cpu_device).evtdev;
 	ktime_t now = ktime_get();
 
 	while (1) {
@@ -41,6 +41,16 @@ int tick_program_event(ktime_t expires, 
 }
 
 /**
+ * tick_program_event
+ */
+int tick_program_event(ktime_t expires, int force)
+{
+	struct clock_event_device *dev = __get_cpu_var(tick_cpu_device).evtdev;
+
+	return __tick_program_event(dev, expires, force);
+}
+
+/**
  * tick_resume_onshot - resume oneshot mode
  */
 void tick_resume_oneshot(void)
@@ -61,7 +71,7 @@ void tick_setup_oneshot(struct clock_eve
 {
 	newdev->event_handler = handler;
 	clockevents_set_mode(newdev, CLOCK_EVT_MODE_ONESHOT);
-	clockevents_program_event(newdev, next_event, ktime_get());
+	__tick_program_event(newdev, next_event, 1);
 }
 
 /**

-- 


  parent reply	other threads:[~2008-09-03 21:38 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-09-03 21:36 [patch 0/6] final clockevents/hpet fixes Thomas Gleixner
2008-09-03 21:36 ` [patch 1/6] clockevents: Prevent clockevent event_handler ending up handler_noop Thomas Gleixner
2008-09-03 21:36 ` [patch 2/6] clockevents: prevent endless loop in periodic broadcast handler Thomas Gleixner
2008-09-03 21:37 ` Thomas Gleixner [this message]
2008-09-03 21:37 ` [patch 4/6] clockevents: prevent multiple init/shutdown Thomas Gleixner
2008-09-03 21:37 ` [patch 5/6] clockevents: prevent endless loop lockup Thomas Gleixner
2008-09-03 21:37 ` [patch 6/6] HPET: make minimum reprogramming delta useful Thomas Gleixner
2008-09-03 23:00 ` [patch 0/6] final clockevents/hpet fixes Dmitry Nezhevenko
2008-09-03 23:04   ` Thomas Gleixner
2008-09-03 23:27     ` Dmitry Nezhevenko
2008-09-04 18:33   ` Luiz Fernando N. Capitulino

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=20080903212753.233424002@linutronix.de \
    --to=tglx@linutronix.de \
    --cc=dion@inhex.net \
    --cc=lcapitulino@mandriva.com.br \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=venkatesh.pallipadi@intel.com \
    /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

all inboxes | Powered by JetHome®