All of lore.kernel.org
 help / color / mirror / Atom feed
From: Rusty Russell <rusty@rustcorp.com.au>
To: Tony Luck <tony.luck@gmail.com>
Cc: Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Fenghua Yu <fenghua.yu@intel.com>,
	"linux-ia64@vger.kernel.org" <linux-ia64@vger.kernel.org>
Subject: Re: [PATCH 06/16] ia64: fix up obsolete cpu function usage.
Date: Wed, 27 May 2015 01:30:35 +0000	[thread overview]
Message-ID: <87mw0qn7h0.fsf@rustcorp.com.au> (raw)
In-Reply-To: <CA+8MBbJiQeP3SHoqM+D0v6q5oOvaDgwr7RnFNJZ=TS8oPpoa5A@mail.gmail.com>

Tony Luck <tony.luck@gmail.com> writes:
> On Mon, Mar 2, 2015 at 3:35 AM, Rusty Russell <rusty@rustcorp.com.au> wrote:
>> Thanks to spatch, then a sweep for for_each_cpu_mask => for_each_cpu.
>>
>> Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
>
> I'm seeing a bunch of warnings building the ia64 tree:

Indeed, here's the forgotten fix sitting in my patch collection.

> Should cpumask_set_cpu() and friends specify a volatile argument???

It's weird, but it turns out hardly anyone wants that.

Cheers,
Rusty.

ia64: make cpu_callin_map non-volatile.

cpumask_test_cpu() doesn't take volatile, unlike the obsoleted
cpu_isset.  The only place ia64 really cares is the spin waiting for a
bit; udelay() is probably a barrier but insert rmb() to be sure.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>

diff --git a/arch/ia64/kernel/smpboot.c b/arch/ia64/kernel/smpboot.c
index 15051e9c2c6f..629975b56608 100644
--- a/arch/ia64/kernel/smpboot.c
+++ b/arch/ia64/kernel/smpboot.c
@@ -127,7 +127,7 @@ int smp_num_siblings = 1;
 volatile int ia64_cpu_to_sapicid[NR_CPUS];
 EXPORT_SYMBOL(ia64_cpu_to_sapicid);
 
-static volatile cpumask_t cpu_callin_map;
+static cpumask_t cpu_callin_map;
 
 struct smp_boot_data smp_boot_data __initdata;
 
@@ -477,6 +477,7 @@ do_boot_cpu (int sapicid, int cpu, struct task_struct *idle)
 	for (timeout = 0; timeout < 100000; timeout++) {
 		if (cpumask_test_cpu(cpu, &cpu_callin_map))
 			break;  /* It has booted */
+		rmb(); /* Make sure we re-read cpu_callin_map */
 		udelay(100);
 	}
 	Dprintk("\n");

WARNING: multiple messages have this Message-ID (diff)
From: Rusty Russell <rusty@rustcorp.com.au>
To: Tony Luck <tony.luck@gmail.com>
Cc: Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Fenghua Yu <fenghua.yu@intel.com>,
	"linux-ia64\@vger.kernel.org" <linux-ia64@vger.kernel.org>
Subject: Re: [PATCH 06/16] ia64: fix up obsolete cpu function usage.
Date: Wed, 27 May 2015 10:48:35 +0930	[thread overview]
Message-ID: <87mw0qn7h0.fsf@rustcorp.com.au> (raw)
In-Reply-To: <CA+8MBbJiQeP3SHoqM+D0v6q5oOvaDgwr7RnFNJZ=TS8oPpoa5A@mail.gmail.com>

Tony Luck <tony.luck@gmail.com> writes:
> On Mon, Mar 2, 2015 at 3:35 AM, Rusty Russell <rusty@rustcorp.com.au> wrote:
>> Thanks to spatch, then a sweep for for_each_cpu_mask => for_each_cpu.
>>
>> Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
>
> I'm seeing a bunch of warnings building the ia64 tree:

Indeed, here's the forgotten fix sitting in my patch collection.

> Should cpumask_set_cpu() and friends specify a volatile argument???

It's weird, but it turns out hardly anyone wants that.

Cheers,
Rusty.

ia64: make cpu_callin_map non-volatile.

cpumask_test_cpu() doesn't take volatile, unlike the obsoleted
cpu_isset.  The only place ia64 really cares is the spin waiting for a
bit; udelay() is probably a barrier but insert rmb() to be sure.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>

diff --git a/arch/ia64/kernel/smpboot.c b/arch/ia64/kernel/smpboot.c
index 15051e9c2c6f..629975b56608 100644
--- a/arch/ia64/kernel/smpboot.c
+++ b/arch/ia64/kernel/smpboot.c
@@ -127,7 +127,7 @@ int smp_num_siblings = 1;
 volatile int ia64_cpu_to_sapicid[NR_CPUS];
 EXPORT_SYMBOL(ia64_cpu_to_sapicid);
 
-static volatile cpumask_t cpu_callin_map;
+static cpumask_t cpu_callin_map;
 
 struct smp_boot_data smp_boot_data __initdata;
 
@@ -477,6 +477,7 @@ do_boot_cpu (int sapicid, int cpu, struct task_struct *idle)
 	for (timeout = 0; timeout < 100000; timeout++) {
 		if (cpumask_test_cpu(cpu, &cpu_callin_map))
 			break;  /* It has booted */
+		rmb(); /* Make sure we re-read cpu_callin_map */
 		udelay(100);
 	}
 	Dprintk("\n");

  reply	other threads:[~2015-05-27  1:30 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-02 11:35 [PATCH 01/16] CONFIG_DISABLE_OBSOLETE_CPUMASK_FUNCTIONS: set if CPUMASK_OFFSTACK Rusty Russell
2015-03-02 11:35 ` [PATCH 02/16] cpumask: fix cpu-hotplug documentation Rusty Russell
2015-03-02 11:35 ` [PATCH 03/16] ia64: Use for_each_cpu_and() and cpumask_any_and() instead of temp var Rusty Russell
2015-03-02 11:47   ` Rusty Russell
2015-03-02 11:35 ` [PATCH 04/16] drivers: fix up obsolete cpu function usage Rusty Russell
2015-03-02 22:23   ` Rafael J. Wysocki
2015-03-02 11:35 ` [PATCH 05/16] staging/lustre: " Rusty Russell
2015-03-02 17:50   ` Oleg Drokin
2015-03-02 23:39     ` Rusty Russell
2015-03-03  1:16       ` Oleg Drokin
2015-03-03  3:12         ` Rusty Russell
2015-03-02 11:35 ` [PATCH 06/16] ia64: " Rusty Russell
2015-03-02 11:47   ` Rusty Russell
2015-05-26 20:45   ` Tony Luck
2015-05-26 20:45     ` Tony Luck
2015-05-27  1:18     ` Rusty Russell [this message]
2015-05-27  1:30       ` Rusty Russell
2015-05-27 17:37       ` Tony Luck
2015-05-27 17:37         ` Tony Luck
2015-05-28  3:44         ` Rusty Russell
2015-05-28  3:56           ` Rusty Russell
2015-03-02 11:35 ` [uml-devel] [PATCH 07/16] um: " Rusty Russell
2015-03-02 11:35   ` Rusty Russell
2015-03-02 11:35 ` [PATCH 08/16] x86: " Rusty Russell
2015-03-02 13:36   ` [tip:x86/cleanups] x86: Fix up obsolete __cpu_set() " tip-bot for Rusty Russell
2015-03-02 11:35 ` [PATCH 09/16] mips: fix up obsolete cpu " Rusty Russell
2015-03-02 12:34 ` [PATCH 01/16] CONFIG_DISABLE_OBSOLETE_CPUMASK_FUNCTIONS: set if CPUMASK_OFFSTACK Paul Bolle
2015-03-02 23:40   ` Rusty Russell

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=87mw0qn7h0.fsf@rustcorp.com.au \
    --to=rusty@rustcorp.com.au \
    --cc=fenghua.yu@intel.com \
    --cc=linux-ia64@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=tony.luck@gmail.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 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.