Commit Graph
4 Commits
Author SHA1 Message Date
Guo Ren 45e15c1a37 csky: Add qspinlock support
Enable qspinlock by the requirements mentioned in a8ad07e524
("asm-generic: qspinlock: Indicate the use of mixed-size atomics").

C-SKY only has "ldex/stex" for all atomic operations. So csky give a
strong forward guarantee for "ldex/stex." That means when ldex grabbed
the cache line into $L1, it would block other cores from snooping the
address with several cycles. The atomic_fetch_add & xchg16 has the same
forward guarantee level in C-SKY.

Qspinlock has better code size and performance in a fast path.

Signed-off-by: Guo Ren <[email protected]>
Signed-off-by: Guo Ren <[email protected]>
2022-07-31 05:24:42 -04:00
Guo Ren 9282d09969 csky: Move to generic ticket-spinlock
There is no benefit from custom implementation for ticket-spinlock,
so move to generic ticket-spinlock for easy maintenance.

Signed-off-by: Guo Ren <[email protected]>
Reviewed-by: Arnd Bergmann <[email protected]>
Signed-off-by: Palmer Dabbelt <[email protected]>
2022-05-11 11:50:15 -07:00
Guo Ren 8e35ac734f csky: Cleanup asm/spinlock.h
There are two implementation of spinlock in arch/csky:
 - simple one (NR_CPU = 1,2)
 - tick's one (NR_CPU = 3,4)
Remove the simple one.

There is already smp_mb in spinlock, so remove the definition of
smp_mb__after_spinlock.

Link: https://lore.kernel.org/linux-csky/[email protected]/#t
Signed-off-by: Guo Ren <[email protected]>
Cc: Peter Zijlstra <[email protected]>k
Cc: Arnd Bergmann <[email protected]>
2021-01-12 09:52:40 +08:00
Guo Ren a0ae62806f csky: Atomic operations
This patch adds atomic, cmpxchg, spinlock files.

Signed-off-by: Guo Ren <[email protected]>
Cc: Andrea Parri <[email protected]>
Cc: Arnd Bergmann <[email protected]>
Reviewed-by: Peter Zijlstra <[email protected]>
2018-10-26 00:54:23 +08:00