lkml.org 
[lkml]   [2018]   [Aug]   [30]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: Patch "asm-generic/bitops/lock.h: Rewrite using atomic_fetch_" causes kernel crash
On Thu, Aug 30, 2018 at 03:23:55PM +0100, Will Deacon wrote:

> Yes, that would be worth trying. However, I also just noticed that the
> fetch-ops (which are now used to implement test_and_set_bit_lock()) seem
> to be missing the backwards branch in the LL/SC case. Yet another diff
> below.
>
> Will
>
> --->8
>
> diff --git a/arch/arc/include/asm/atomic.h b/arch/arc/include/asm/atomic.h
> index 4e0072730241..f06c5ed672b3 100644
> --- a/arch/arc/include/asm/atomic.h
> +++ b/arch/arc/include/asm/atomic.h
> @@ -84,7 +84,7 @@ static inline int atomic_fetch_##op(int i, atomic_t *v) \
> "1: llock %[orig], [%[ctr]] \n" \
> " " #asm_op " %[val], %[orig], %[i] \n" \
> " scond %[val], [%[ctr]] \n" \
> - " \n" \
> + " bnz 1b \n" \
> : [val] "=&r" (val), \
> [orig] "=&r" (orig) \
> : [ctr] "r" (&v->counter), \

ACK!! sorry about that, no idea how I messed that up.

Also, once it all works, they should look at switching to _relaxed
atomics for LL/SC.

\
 
 \ /
  Last update: 2018-08-30 20:07    [W:1.028 / U:0.020 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site