Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751968AbbEDWbQ (ORCPT ); Mon, 4 May 2015 18:31:16 -0400 Received: from bh-25.webhostbox.net ([208.91.199.152]:48377 "EHLO bh-25.webhostbox.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751705AbbEDWa7 (ORCPT ); Mon, 4 May 2015 18:30:59 -0400 From: Guenter Roeck To: linux-kernel@vger.kernel.org Cc: Geert Uytterhoeven , Guenter Roeck , Rusty Russell , linux-mips@linux-mips.org, Ralf Baechle Subject: [PATCH resend 2/5] mips: Fix SMP builds Date: Mon, 4 May 2015 15:30:46 -0700 Message-Id: <1430778649-28126-3-git-send-email-linux@roeck-us.net> X-Mailer: git-send-email 2.1.0 In-Reply-To: <1430778649-28126-1-git-send-email-linux@roeck-us.net> References: <1430778649-28126-1-git-send-email-linux@roeck-us.net> X-Authenticated_sender: guenter@roeck-us.net X-OutGoing-Spam-Status: No, score=-1.0 X-CTCH-PVer: 0000001 X-CTCH-Spam: Unknown X-CTCH-VOD: Unknown X-CTCH-Flags: 0 X-CTCH-RefID: str=0001.0A020201.5547F322.01EC,ss=1,re=0.000,recu=0.000,reip=0.000,cl=1,cld=1,fgs=0 X-CTCH-Score: 0.000 X-CTCH-ScoreCust: 0.000 X-CTCH-Rules: X-CTCH-SenderID: linux@roeck-us.net X-CTCH-SenderID-Flags: 0 X-CTCH-SenderID-TotalMessages: 5 X-CTCH-SenderID-TotalSpam: 0 X-CTCH-SenderID-TotalSuspected: 0 X-CTCH-SenderID-TotalConfirmed: 0 X-CTCH-SenderID-TotalBulk: 0 X-CTCH-SenderID-TotalVirus: 0 X-CTCH-SenderID-TotalRecipients: 0 X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - bh-25.webhostbox.net X-AntiAbuse: Original Domain - vger.kernel.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - roeck-us.net X-Get-Message-Sender-Via: bh-25.webhostbox.net: mailgid no entry from get_relayhosts_entry X-Source: X-Source-Args: X-Source-Dir: Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2771 Lines: 76 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 Tested-by: Florian Fainelli Tested-by: Aaro Koskinen Tested-by: Paul Martin Signed-off-by: Guenter Roeck --- 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 #include -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 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/