summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSven Schnelle <svens@linux.ibm.com>2025-07-10 09:43:40 +0200
committerAlexander Gordeev <agordeev@linux.ibm.com>2025-07-21 12:41:55 +0200
commit925f0707a67cae0a974c4bd5b718f0263dc56824 (patch)
treef51f71d702dea06a1513f415f5ca92a6f2559466
parente12570c9855555d2acd3360c57abc591a8ec570d (diff)
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 <svens@linux.ibm.com> Reviewed-by: Heiko Carstens <hca@linux.ibm.com> Signed-off-by: Alexander Gordeev <agordeev@linux.ibm.com>
-rw-r--r--drivers/s390/char/sclp.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/s390/char/sclp.c b/drivers/s390/char/sclp.c
index 9e15ea0682bb..f2e42c1d51aa 100644
--- a/drivers/s390/char/sclp.c
+++ b/drivers/s390/char/sclp.c
@@ -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();
}