Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

s390/stp: Remove udelay from stp_sync_clock()

When an stp sync check is handled on a system with multiple
cpus each cpu gets a machine check but only the first one
actually handles the sync operation. All other CPUs spin
waiting for the first one to finish with a short udelay().
But udelay can't be used here as the first CPU modifies tod_clock_base
before performing the sync op. During this timeframe
get_tod_clock_monotonic() might return a non-monotonic time.

The time spent waiting should be very short and udelay is a busy loop
anyways, therefore simply remove the udelay.

Reviewed-by: Heiko Carstens <hca@linux.ibm.com>
Signed-off-by: Sven Schnelle <svens@linux.ibm.com>
Signed-off-by: Alexander Gordeev <agordeev@linux.ibm.com>

authored by

Sven Schnelle and committed by
Alexander Gordeev
b367017c 7cf636c9

+1 -1
+1 -1
arch/s390/kernel/time.c
··· 580 580 atomic_dec(&sync->cpus); 581 581 /* Wait for in_sync to be set. */ 582 582 while (READ_ONCE(sync->in_sync) == 0) 583 - __udelay(1); 583 + ; 584 584 } 585 585 if (sync->in_sync != 1) 586 586 /* Didn't work. Clear per-cpu in sync bit again. */