public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: "Paul E. McKenney" <paulmck@linux.vnet.ibm.com>
To: linux-kernel@vger.kernel.org
Cc: akpm@linux-foundation.org, benh@kernel.crashing.org,
	anton@samba.org, paulus@samba.org, mingo@elte.hu
Subject: [PATCH] Silence warning in rtas_event_scan()
Date: Sun, 8 Nov 2009 16:49:24 -0800	[thread overview]
Message-ID: <20091109004924.GA28481@linux.vnet.ibm.com> (raw)

The rtas_event_scan() function uses smp_processor_id() without having
disabled preemption, which results in a warning as follows:

	BUG: using smp_processor_id() in preemptible [00000000] code: events/0/9677
	caller is .rtas_event_scan+0x9c/0x1ac
	Call Trace:
	[c00000001bb9fc20] [c0000000000102c8] .show_stack+0x70/0x184 (unreliable)
	[c00000001bb9fcd0] [c0000000002ebecc] .debug_smp_processor_id+0xe8/0x11c
	[c00000001bb9fd60] [c0000000000434f8] .rtas_event_scan+0x9c/0x1ac
	[c00000001bb9fdf0] [c000000000087494] .worker_thread+0x1d8/0x2a8
	[c00000001bb9fed0] [c00000000008c41c] .kthread+0xa8/0xb4
	[c00000001bb9ff90] [c0000000000272b0] .kernel_thread+0x54/0x70

However, this code is simply chosing a starting point for a traversal
of all online CPUs, and under get_online_cpus() protection.  Therefore,
unprotected use of smp_processor_id() is permissible here.  Change the
smp_processor_id() to raw_smp_processor_id() to silence the warning.

Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
---
 arch/powerpc/platforms/pseries/rtasd.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/arch/powerpc/platforms/pseries/rtasd.c b/arch/powerpc/platforms/pseries/rtasd.c
index b3cbac8..64394a6 100644
--- a/arch/powerpc/platforms/pseries/rtasd.c
+++ b/arch/powerpc/platforms/pseries/rtasd.c
@@ -405,7 +405,7 @@ static void rtas_event_scan(struct work_struct *w)
 
 	get_online_cpus();
 
-	cpu = next_cpu(smp_processor_id(), cpu_online_map);
+	cpu = next_cpu(raw_smp_processor_id(), cpu_online_map);
 	if (cpu == NR_CPUS) {
 		cpu = first_cpu(cpu_online_map);
 
-- 
1.5.2.5


                 reply	other threads:[~2009-11-09  0:49 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20091109004924.GA28481@linux.vnet.ibm.com \
    --to=paulmck@linux.vnet.ibm.com \
    --cc=akpm@linux-foundation.org \
    --cc=anton@samba.org \
    --cc=benh@kernel.crashing.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=paulus@samba.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