Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932446AbbFBGMw (ORCPT ); Tue, 2 Jun 2015 02:12:52 -0400 Received: from e28smtp06.in.ibm.com ([122.248.162.6]:41957 "EHLO e28smtp06.in.ibm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932246AbbFBGMo (ORCPT ); Tue, 2 Jun 2015 02:12:44 -0400 Message-ID: <556D492C.1050403@linux.vnet.ibm.com> Date: Tue, 02 Jun 2015 11:41:56 +0530 From: Raghavendra K T Organization: IBM User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130625 Thunderbird/17.0.7 MIME-Version: 1.0 To: ganguly.s@samsung.com CC: Arnd Bergmann , "linux-arm-kernel@lists.infradead.org" , SUNEEL KUMAR SURIMANI , "vikram.m@samsung.com" , "tglx@linutronix.de" , "mingo@redhat.com" , "hpa@zytor.com" , "peterz@infradead.org" , "Waiman.Long@hp.com" , "oleg@redhat.com" , "linux-kernel@vger.kernel.org" , SHARAN ALLUR , "torvalds@linux-foundation.org" Subject: Re: [RFC] arm: Add for atomic half word exchange References: <1357570181.391771433224164775.JavaMail.weblogic@epmlwas06d> In-Reply-To: <1357570181.391771433224164775.JavaMail.weblogic@epmlwas06d> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-TM-AS-MML: disable X-Content-Scanned: Fidelis XPS MAILER x-cbid: 15060206-0021-0000-0000-000005918AEF Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2648 Lines: 83 On 06/02/2015 11:19 AM, Sarbojit Ganguly wrote: > I made the CONFIG_ARCH_MULTI_V6=y and > CONFIG_CPU_V6K=y > CONFIG_CPU_32v6=y > CONFIG_CPU_32v6K=y > > and compiled 4.0.4 with the patch. Result is a compilation success. > > Regards, > Sarbojit > Hi Sarbojit, I am not familiar about the implication of setting those options unconditionally, But from Kconfig point of view Arnd was expecting something like below IIUC with the patch: (a quick example) ---8<--- diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig index 9f1f09a..194fc13 100644 --- a/arch/arm/Kconfig +++ b/arch/arm/Kconfig @@ -812,6 +812,8 @@ config ARCH_MULTI_V6 bool "ARMv6 based platforms (ARM11)" select ARCH_MULTI_V6_V7 select CPU_V6K + select CPU_32v6 + select CPU_32v6k config ARCH_MULTI_V7 bool "ARMv7 based platforms (Cortex-A, PJ4, Scorpion, Krait)" > ------- Original Message ------- > Sender : Arnd Bergmann > Date : May 19, 2015 18:51 (GMT+09:00) > Title : Re: [RFC] arm: Add for atomic half word exchange > > On Tuesday 19 May 2015 09:39:33 Sarbojit Ganguly wrote: >> Since 16 bit half word exchange was not there and MCS based qspinlock by Waiman's xchg_tail() requires an atomic exchange on a half word, >> here is a small modification to __xchg() code. > > We have discussed a similar patch before, see > https://lkml.org/lkml/2015/2/25/390 > >> #if __LINUX_ARM_ARCH__ >= 6 >> @@ -50,6 +52,23 @@ >> : "r" (x), "r" (ptr) >> : "memory", "cc"); >> break; >> + /* >> + * halfword exclusive exchange >> + * This is new implementation as qspinlock >> + * wants 16 bit atomic CAS. >> + */ >> + case 2: >> + asm volatile("@ __xchg2\n" >> + "1: ldrexh %0, [%3]\n" >> + " strexh %1, %2, [%3]\n" >> + " teq %1, #0\n" >> + " bne 1b" >> + : "=&r" (ret), "=&r" (tmp) >> + : "r" (x), "r" (ptr) >> + : "memory", "cc"); >> + break; >> case 4: >> asm volatile("@ __xchg4\n" >> "1: ldrex %0, [%3]\n" > > Please try to find a way to make this compile when CONFIG_CPU_V6 > is set. > > Arnd > -- 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/