]> git.baikalelectronics.ru Git - kernel.git/commit
s390/spinlock: avoid yield to non existent cpu
authorHeiko Carstens <heiko.carstens@de.ibm.com>
Wed, 13 Apr 2016 09:05:20 +0000 (11:05 +0200)
committerMartin Schwidefsky <schwidefsky@de.ibm.com>
Fri, 15 Apr 2016 16:01:48 +0000 (18:01 +0200)
commitbdcfb6e2ca4d457e14beaa0e47b17d5bc9ad924e
tree4e7dd1e66cdb04771e40ea0dd18f92c9d3d0fc8b
parenta3311de1e3626c5d9bda9e7367fbb5d71931c158
s390/spinlock: avoid yield to non existent cpu

arch_spin_lock_wait_flags() checks if a spinlock is not held before
trying a compare and swap instruction. If the lock is unlocked it
tries the compare and swap instruction, however if a different cpu
grabbed the lock in the meantime the instruction will fail as
expected.

Subsequently the arch_spin_lock_wait_flags() incorrectly tries to
figure out if the cpu that holds the lock is running. However it is
using the wrong cpu number for this (-1) and then will also yield the
current cpu to the wrong cpu.

Fix this by adding a missing continue statement.

Fixes: 41d5d7dc5438 ("s390/spinlock: refactor arch_spin_lock_wait[_flags]")
Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Acked-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
arch/s390/lib/spinlock.c