Commit 925f0707 authored by Sven Schnelle's avatar Sven Schnelle Committed by Alexander Gordeev
Browse files

s390/sclp: Use monotonic clock in sclp_sync_wait()



sclp_sync_wait() should use the monotonic clock for the delay loop.
Otherwise the code won't work correctly when the clock is changed.

Signed-off-by: default avatarSven Schnelle <svens@linux.ibm.com>
Reviewed-by: default avatarHeiko Carstens <hca@linux.ibm.com>
Signed-off-by: default avatarAlexander Gordeev <agordeev@linux.ibm.com>
parent e12570c9
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -720,7 +720,7 @@ sclp_sync_wait(void)
	timeout = 0;
	if (timer_pending(&sclp_request_timer)) {
		/* Get timeout TOD value */
		timeout = get_tod_clock_fast() +
		timeout = get_tod_clock_monotonic() +
			  sclp_tod_from_jiffies(sclp_request_timer.expires -
						jiffies);
	}
@@ -740,7 +740,7 @@ sclp_sync_wait(void)
	/* Loop until driver state indicates finished request */
	while (sclp_running_state != sclp_running_state_idle) {
		/* Check for expired request timer */
		if (get_tod_clock_fast() > timeout && timer_delete(&sclp_request_timer))
		if (get_tod_clock_monotonic() > timeout && timer_delete(&sclp_request_timer))
			sclp_request_timer.function(&sclp_request_timer);
		cpu_relax();
	}