All of lore.kernel.org
 help / color / mirror / Atom feed
From: Feng Tang <feng.tang@intel.com>
To: <mingo@elte.hu>, <tglx@linutronix.de>, <linux-kernel@vger.kernel.org>
Subject: [PATCH] tick: add check for the existence of broadcast clock event device
Date: Fri, 5 Jun 2009 11:27:11 +0800	[thread overview]
Message-ID: <20090605112711.67e7d5cb@feng-desktop> (raw)

>From 2f076e1867c8bbb145b74d289358174644d9fed8 Mon Sep 17 00:00:00 2001
From: Feng Tang <feng.tang@intel.com>
Date: Fri, 5 Jun 2009 10:36:15 +0800
Subject: [PATCH] tick: add check for the existence of broadcast clock event device

Some platform may have no broadcast clock event device, as it use always-on
external timers for per-cpu timer and has no extra one for broadcast device.
This check will secure the access to bc device when system get some boradcast
on/off and enter/exit message

Signed-off-by: Feng Tang <feng.tang@intel.com>
---
 kernel/time/tick-broadcast.c |    8 +++++++-
 1 files changed, 7 insertions(+), 1 deletions(-)

diff --git a/kernel/time/tick-broadcast.c b/kernel/time/tick-broadcast.c
index 118a3b3..110e0bc 100644
--- a/kernel/time/tick-broadcast.c
+++ b/kernel/time/tick-broadcast.c
@@ -214,10 +214,13 @@ static void tick_do_broadcast_on_off(void *why)
 
 	spin_lock_irqsave(&tick_broadcast_lock, flags);
 
+	bc = tick_broadcast_device.evtdev;
+	if (!bc)
+		goto out;
+
 	cpu = smp_processor_id();
 	td = &per_cpu(tick_cpu_device, cpu);
 	dev = td->evtdev;
-	bc = tick_broadcast_device.evtdev;
 
 	/*
 	 * Is the device not affected by the powerstate ?
@@ -468,6 +471,9 @@ void tick_broadcast_oneshot_control(unsigned long reason)
 		goto out;
 
 	bc = tick_broadcast_device.evtdev;
+	if (!bc)
+		goto out;
+
 	cpu = smp_processor_id();
 	td = &per_cpu(tick_cpu_device, cpu);
 	dev = td->evtdev;
-- 
1.5.6.3

             reply	other threads:[~2009-06-05  3:29 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-06-05  3:27 Feng Tang [this message]
2009-06-06  9:24 ` [PATCH] tick: add check for the existence of broadcast clock event device Thomas Gleixner
2009-06-06 12:47   ` Feng Tang
2009-06-06 12:54     ` Thomas Gleixner
2009-06-06 16:18       ` Thomas Gleixner
2009-06-08  1:57         ` Feng Tang
2009-06-08  5:43           ` Thomas Gleixner
2009-06-08  6:12             ` Feng Tang
2009-06-08  6:33               ` Thomas Gleixner
2009-06-08  6:47                 ` Feng Tang
2009-06-08  7:00                   ` Thomas Gleixner
2009-06-08  7:47                     ` Tang, Feng
2009-06-08 13:41                       ` Thomas Gleixner
2009-06-09  0:21                         ` Pan, Jacob jun
2009-06-09  8:18                           ` Thomas Gleixner
2009-06-09 12:49                             ` Pan, Jacob jun
2009-06-09 16:53                               ` Thomas Gleixner

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=20090605112711.67e7d5cb@feng-desktop \
    --to=feng.tang@intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=tglx@linutronix.de \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.