From: Hans-Christian Noren Egtvedt <egtvedt@samfundet.no>
To: Mans Rullgard <mans@mansr.com>
Cc: Haavard Skinnemoen <hskinnemoen@gmail.com>,
Andy Shevchenko <andy.shevchenko@gmail.com>,
Guenter Roeck <linux@roeck-us.net>,
Sudip Mukherjee <sudipm.mukherjee@gmail.com>,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] avr32: fix asm operand constraint in cmpxchg()
Date: Thu, 10 Mar 2016 15:26:25 +0100 [thread overview]
Message-ID: <20160310142625.GA8701@samfundet.no> (raw)
In-Reply-To: <1457619829-27105-1-git-send-email-mans@mansr.com>
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 <mans@mansr.com>
> ---
> This fixes link errors in linux-next with CONFIG_AIO_THREAD enabled.
Good find, thank you for fixing.
Acked-by: Hans-Christian Noren Egtvedt <egtvedt@samfundet.no>
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
next prev parent reply other threads:[~2016-03-10 14:26 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-03-10 14:23 [PATCH] avr32: fix asm operand constraint in cmpxchg() Mans Rullgard
2016-03-10 14:26 ` Hans-Christian Noren Egtvedt [this message]
2016-03-10 15:26 ` Andy Shevchenko
2016-03-10 17:39 ` Sudip Mukherjee
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=20160310142625.GA8701@samfundet.no \
--to=egtvedt@samfundet.no \
--cc=andy.shevchenko@gmail.com \
--cc=hskinnemoen@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@roeck-us.net \
--cc=mans@mansr.com \
--cc=sudipm.mukherjee@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.