public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Guenter Roeck <linux@roeck-us.net>
To: linux-kernel@vger.kernel.org
Cc: Geert Uytterhoeven <geert@linux-m68k.org>,
	Guenter Roeck <linux@roeck-us.net>,
	Rusty Russell <rusty@rustcorp.com.au>,
	linux-mips@linux-mips.org, Ralf Baechle <ralf@linux-mips.org>
Subject: [PATCH resend 2/5] mips: Fix SMP builds
Date: Mon,  4 May 2015 15:30:46 -0700	[thread overview]
Message-ID: <1430778649-28126-3-git-send-email-linux@roeck-us.net> (raw)
In-Reply-To: <1430778649-28126-1-git-send-email-linux@roeck-us.net>

Mips SMP builds fail with error messages similar to the following.

arch/mips/kernel/smp.c:211:2: error:
	passing argument 2 of 'cpumask_set_cpu' discards 'volatile'
	qualifier from pointer target type
arch/mips/kernel/process.c:52:2: error:
	passing argument 2 of 'cpumask_test_cpu' discards 'volatile'
	qualifier from pointer target type
arch/mips/cavium-octeon/smp.c:242:2: error:
	passing argument 2 of 'cpumask_clear_cpu' discards 'volatile'
	qualifier from pointer target type

cpu_callin_map is declared as volatile variable, but passed to various
functions with non-volatile arguments. Make it non-volatile and add a
memory barrier at the one location where volatile might be needed.

Fixes: 8dd928915a73 ("mips: fix up obsolete cpu function usage")
Cc: Rusty Russell <rusty@rustcorp.com.au>
Tested-by: Florian Fainelli <f.fainelli@gmail.com>
Tested-by: Aaro Koskinen <aaro.koskinen@nokia.com>
Tested-by: Paul Martin <paul.martin@codethink.co.uk>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
---
Please consider pushing this patch into mainline, or provide feedback
on how to improve it to be acceptable.

 arch/mips/include/asm/smp.h | 2 +-
 arch/mips/kernel/smp.c      | 6 ++++--
 2 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/arch/mips/include/asm/smp.h b/arch/mips/include/asm/smp.h
index bb02fac9b4fa..2b25d1ba1ea0 100644
--- a/arch/mips/include/asm/smp.h
+++ b/arch/mips/include/asm/smp.h
@@ -45,7 +45,7 @@ extern int __cpu_logical_map[NR_CPUS];
 #define SMP_DUMP		0x8
 #define SMP_ASK_C0COUNT		0x10
 
-extern volatile cpumask_t cpu_callin_map;
+extern cpumask_t cpu_callin_map;
 
 /* Mask of CPUs which are currently definitely operating coherently */
 extern cpumask_t cpu_coherent_mask;
diff --git a/arch/mips/kernel/smp.c b/arch/mips/kernel/smp.c
index 193ace7955fb..158191394770 100644
--- a/arch/mips/kernel/smp.c
+++ b/arch/mips/kernel/smp.c
@@ -43,7 +43,7 @@
 #include <asm/time.h>
 #include <asm/setup.h>
 
-volatile cpumask_t cpu_callin_map;	/* Bitmask of started secondaries */
+cpumask_t cpu_callin_map;		/* Bitmask of started secondaries */
 
 int __cpu_number_map[NR_CPUS];		/* Map physical to logical */
 EXPORT_SYMBOL(__cpu_number_map);
@@ -218,8 +218,10 @@ int __cpu_up(unsigned int cpu, struct task_struct *tidle)
 	/*
 	 * Trust is futile.  We should really have timeouts ...
 	 */
-	while (!cpumask_test_cpu(cpu, &cpu_callin_map))
+	while (!cpumask_test_cpu(cpu, &cpu_callin_map)) {
 		udelay(100);
+		mb();
+	}
 
 	synchronise_count_master(cpu);
 	return 0;
-- 
2.1.0


  parent reply	other threads:[~2015-05-04 22:31 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-05-04 22:30 [PATCH resend 0/5] Fix various build errors Guenter Roeck
2015-05-04 22:30 ` [PATCH resend 1/5] spi: bcm2835: Add GPIOLIB dependency Guenter Roeck
2015-05-04 23:34   ` Mark Brown
2015-05-05  0:02     ` Guenter Roeck
2015-05-05  2:00       ` Guenter Roeck
2015-05-05 11:16         ` Mark Brown
2015-05-05 11:32           ` Geert Uytterhoeven
2015-05-05 11:40             ` Mark Brown
2015-05-05 10:28       ` Mark Brown
2015-05-04 22:30 ` Guenter Roeck [this message]
2015-05-04 22:30 ` [PATCH resend 3/5] xtensa: Provide dummy dma_alloc_attrs() and dma_free_attrs() Guenter Roeck
2015-05-04 22:35   ` Chris Zankel
2015-05-23  4:24     ` Guenter Roeck
2015-05-04 22:30 ` [PATCH resend 4/5] score: Fix exception handler label Guenter Roeck
2015-05-06  2:00   ` Lennox Wu
2015-05-23  4:24   ` Guenter Roeck
2015-05-25 14:56     ` Lennox Wu
2015-05-04 22:30 ` [PATCH resend 5/5] blackfin: Fix build error Guenter Roeck
2015-05-06  9:15   ` Steven Miao
2015-05-23  4:25   ` Guenter Roeck

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=1430778649-28126-3-git-send-email-linux@roeck-us.net \
    --to=linux@roeck-us.net \
    --cc=geert@linux-m68k.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mips@linux-mips.org \
    --cc=ralf@linux-mips.org \
    --cc=rusty@rustcorp.com.au \
    /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