* [PATCH] metag: Fix atomic_*_return inline asm constraints
@ 2016-05-03 8:40 James Hogan
[not found] ` <1462264859-26544-1-git-send-email-james.hogan-1AXoQHu6uovQT0dZR+AlfA@public.gmane.org>
0 siblings, 1 reply; 3+ messages in thread
From: James Hogan @ 2016-05-03 8:40 UTC (permalink / raw)
To: linux-metag-u79uwXL29TY76Z2rM5mHXA; +Cc: James Hogan, Peter Zijlstra
The argument i of atomic_*_return() operations is given to inline asm
with the "bd" constraint, which means "An Op2 register where Op1 is a
data unit register and the instruction supports O2R", however Op1 is
constrained by "da" which allows an address unit register to be used.
Fix the constraint to use "br", meaning "An Op2 register and the
instruction supports O2R", i.e. not requiring Op1 to be a data unit
register.
Fixes: d6dfe2509da9 ("locking,arch,metag: Fold atomic_ops")
Signed-off-by: James Hogan <james.hogan-1AXoQHu6uovQT0dZR+AlfA@public.gmane.org>
Cc: Peter Zijlstra <peterz-wEGCiKHe2LqWVfeAwA7xHQ@public.gmane.org>
Cc: linux-metag-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
---
arch/metag/include/asm/atomic_lnkget.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/metag/include/asm/atomic_lnkget.h b/arch/metag/include/asm/atomic_lnkget.h
index a62581815624..88fa25fae8bd 100644
--- a/arch/metag/include/asm/atomic_lnkget.h
+++ b/arch/metag/include/asm/atomic_lnkget.h
@@ -61,7 +61,7 @@ static inline int atomic_##op##_return(int i, atomic_t *v) \
" CMPT %0, #HI(0x02000000)\n" \
" BNZ 1b\n" \
: "=&d" (temp), "=&da" (result) \
- : "da" (&v->counter), "bd" (i) \
+ : "da" (&v->counter), "br" (i) \
: "cc"); \
\
smp_mb(); \
--
2.4.10
^ permalink raw reply related [flat|nested] 3+ messages in thread[parent not found: <1462264859-26544-1-git-send-email-james.hogan-1AXoQHu6uovQT0dZR+AlfA@public.gmane.org>]
* Re: [PATCH] metag: Fix atomic_*_return inline asm constraints [not found] ` <1462264859-26544-1-git-send-email-james.hogan-1AXoQHu6uovQT0dZR+AlfA@public.gmane.org> @ 2016-05-03 8:52 ` Peter Zijlstra [not found] ` <20160503085246.GK3430-ndre7Fmf5hadTX5a5knrm8zTDFooKrT+cvkQGrU6aU0@public.gmane.org> 0 siblings, 1 reply; 3+ messages in thread From: Peter Zijlstra @ 2016-05-03 8:52 UTC (permalink / raw) To: James Hogan; +Cc: linux-metag-u79uwXL29TY76Z2rM5mHXA On Tue, May 03, 2016 at 09:40:59AM +0100, James Hogan wrote: > The argument i of atomic_*_return() operations is given to inline asm > with the "bd" constraint, which means "An Op2 register where Op1 is a > data unit register and the instruction supports O2R", however Op1 is > constrained by "da" which allows an address unit register to be used. > > Fix the constraint to use "br", meaning "An Op2 register and the > instruction supports O2R", i.e. not requiring Op1 to be a data unit > register. > > Fixes: d6dfe2509da9 ("locking,arch,metag: Fold atomic_ops") > Signed-off-by: James Hogan <james.hogan-1AXoQHu6uovQT0dZR+AlfA@public.gmane.org> > Cc: Peter Zijlstra <peterz-wEGCiKHe2LqWVfeAwA7xHQ@public.gmane.org> > Cc: linux-metag-u79uwXL29TY76Z2rM5mHXA@public.gmane.org Thanks James, I'd give an ack, but I really don't know about these funny constraints you have, so I'm not sure it'd actually mean something. ^ permalink raw reply [flat|nested] 3+ messages in thread
[parent not found: <20160503085246.GK3430-ndre7Fmf5hadTX5a5knrm8zTDFooKrT+cvkQGrU6aU0@public.gmane.org>]
* Re: [PATCH] metag: Fix atomic_*_return inline asm constraints [not found] ` <20160503085246.GK3430-ndre7Fmf5hadTX5a5knrm8zTDFooKrT+cvkQGrU6aU0@public.gmane.org> @ 2016-05-03 8:54 ` James Hogan 0 siblings, 0 replies; 3+ messages in thread From: James Hogan @ 2016-05-03 8:54 UTC (permalink / raw) To: Peter Zijlstra; +Cc: linux-metag-u79uwXL29TY76Z2rM5mHXA [-- Attachment #1: Type: text/plain, Size: 1144 bytes --] On Tue, May 03, 2016 at 10:52:46AM +0200, Peter Zijlstra wrote: > On Tue, May 03, 2016 at 09:40:59AM +0100, James Hogan wrote: > > The argument i of atomic_*_return() operations is given to inline asm > > with the "bd" constraint, which means "An Op2 register where Op1 is a > > data unit register and the instruction supports O2R", however Op1 is > > constrained by "da" which allows an address unit register to be used. > > > > Fix the constraint to use "br", meaning "An Op2 register and the > > instruction supports O2R", i.e. not requiring Op1 to be a data unit > > register. > > > > Fixes: d6dfe2509da9 ("locking,arch,metag: Fold atomic_ops") > > Signed-off-by: James Hogan <james.hogan-1AXoQHu6uovQT0dZR+AlfA@public.gmane.org> > > Cc: Peter Zijlstra <peterz-wEGCiKHe2LqWVfeAwA7xHQ@public.gmane.org> > > Cc: linux-metag-u79uwXL29TY76Z2rM5mHXA@public.gmane.org > > Thanks James, I'd give an ack, but I really don't know about these funny > constraints you have, so I'm not sure it'd actually mean something. No problem, meta is quite a quirky and non-orthogonal architecture. I've applied anyway. Thanks James [-- Attachment #2: Digital signature --] [-- Type: application/pgp-signature, Size: 819 bytes --] ^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2016-05-03 8:54 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-05-03 8:40 [PATCH] metag: Fix atomic_*_return inline asm constraints James Hogan
[not found] ` <1462264859-26544-1-git-send-email-james.hogan-1AXoQHu6uovQT0dZR+AlfA@public.gmane.org>
2016-05-03 8:52 ` Peter Zijlstra
[not found] ` <20160503085246.GK3430-ndre7Fmf5hadTX5a5knrm8zTDFooKrT+cvkQGrU6aU0@public.gmane.org>
2016-05-03 8:54 ` James Hogan
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox