Skip to content

Commit 925f070

Browse files
svens-s390Alexander Gordeev
authored andcommitted
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: Sven Schnelle <[email protected]> Reviewed-by: Heiko Carstens <[email protected]> Signed-off-by: Alexander Gordeev <[email protected]>
1 parent e12570c commit 925f070

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/s390/char/sclp.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -720,7 +720,7 @@ sclp_sync_wait(void)
720720
timeout = 0;
721721
if (timer_pending(&sclp_request_timer)) {
722722
/* Get timeout TOD value */
723-
timeout = get_tod_clock_fast() +
723+
timeout = get_tod_clock_monotonic() +
724724
sclp_tod_from_jiffies(sclp_request_timer.expires -
725725
jiffies);
726726
}
@@ -740,7 +740,7 @@ sclp_sync_wait(void)
740740
/* Loop until driver state indicates finished request */
741741
while (sclp_running_state != sclp_running_state_idle) {
742742
/* Check for expired request timer */
743-
if (get_tod_clock_fast() > timeout && timer_delete(&sclp_request_timer))
743+
if (get_tod_clock_monotonic() > timeout && timer_delete(&sclp_request_timer))
744744
sclp_request_timer.function(&sclp_request_timer);
745745
cpu_relax();
746746
}

0 commit comments

Comments
 (0)