Skip to contentSkip to conversation

metag: Fix atomic_*_return inline asm constraints

PATCH In review James Hogan 2 participants 3 messages May 3, 2016 2 messages not in the archive Atomic infrastructure

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 metag: Fix atomic_*_return inline asm constraints

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")
Cc Peter Zijlstra <[email protected]>
---
 arch/metag/include/asm/atomic_lnkget.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/metag/include/asm/atomic_lnkget.h +1 -1
index a62581815624..88fa25fae8bd 100644
@@ -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();							\
Signature · 1 line
2.4.10

A message that is not in the archive (sent off-list or not yet received): 1462264859-26544-1-git-send-email-james.hogan-1AXoQHu6uovQT0dZR+AlfA@public.gmane.org

#2 lore raw
Quoted 5 lines · James Hogan

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.

Quoted 8 lines

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")
Cc Peter Zijlstra <[email protected]>

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.

A message that is not in the archive (sent off-list or not yet received): 20160503085246.GK3430-ndre7Fmf5hadTX5a5knrm8zTDFooKrT+cvkQGrU6aU0@public.gmane.org

#4 lore raw
Quoted 10 lines · Peter Zijlstra
Quoted 9 lines · James Hogan

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.

Quoted 7 lines
Quoted 4 lines
Fixes d6dfe2509da9 ("locking,arch,metag: Fold atomic_ops")
Cc Peter Zijlstra <[email protected]>

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