Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752087AbcCJO0o (ORCPT ); Thu, 10 Mar 2016 09:26:44 -0500 Received: from cassarossa.samfundet.no ([193.35.52.29]:46542 "EHLO cassarossa.samfundet.no" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751579AbcCJO0h (ORCPT ); Thu, 10 Mar 2016 09:26:37 -0500 Date: Thu, 10 Mar 2016 15:26:25 +0100 From: Hans-Christian Noren Egtvedt To: Mans Rullgard Cc: Haavard Skinnemoen , Andy Shevchenko , Guenter Roeck , Sudip Mukherjee , linux-kernel@vger.kernel.org Subject: Re: [PATCH] avr32: fix asm operand constraint in cmpxchg() Message-ID: <20160310142625.GA8701@samfundet.no> References: <1457619829-27105-1-git-send-email-mans@mansr.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1457619829-27105-1-git-send-email-mans@mansr.com> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1267 Lines: 37 Around Thu 10 Mar 2016 14:23:49 +0000 or thereabout, Mans Rullgard wrote: > If the 'old' operand to cmpxchg() is a constant wider than 21 bits, > linking fails with a "relocation truncated to fit: R_AVR32_21S" error. > > Fix this by replacing the "i" constraint with "Ks21" which makes the > compiler use a temporary register for out of range constants. > > Signed-off-by: Mans Rullgard > --- > This fixes link errors in linux-next with CONFIG_AIO_THREAD enabled. Good find, thank you for fixing. Acked-by: Hans-Christian Noren Egtvedt I'll push this for next merge window. > --- > arch/avr32/include/asm/cmpxchg.h | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/arch/avr32/include/asm/cmpxchg.h b/arch/avr32/include/asm/cmpxchg.h > index 366bbeaeb405..572739b4c4b4 100644 > --- a/arch/avr32/include/asm/cmpxchg.h > +++ b/arch/avr32/include/asm/cmpxchg.h > @@ -57,7 +57,7 @@ static inline unsigned long __cmpxchg_u32(volatile int *m, unsigned long old, > " brne 1b\n" > "2:\n" > : [ret] "=&r"(ret), [m] "=m"(*m) > - : "m"(m), [old] "ir"(old), [new] "r"(new) > + : "m"(m), [old] "Ks21r"(old), [new] "r"(new) > : "memory", "cc"); > return ret; > } -- mvh Hans-Christian Egtvedt