summaryrefslogtreecommitdiffstats
path: root/arch/s390/kernel/time.c
diff options
context:
space:
mode:
authorSven Schnelle <svens@linux.ibm.com>2022-05-03 09:58:33 +0200
committerHeiko Carstens <hca@linux.ibm.com>2022-05-11 14:40:57 +0200
commit5ace65ebb5ce9fe1cc8fdbdd97079fb566ef0ea4 (patch)
treef40939cdc8e4c16a646cef349c46e49bc5e219e4 /arch/s390/kernel/time.c
parent03780c83c78546310c084ef3df69da2a0bafbcb5 (diff)
downloadlinux-5ace65ebb5ce9fe1cc8fdbdd97079fb566ef0ea4.tar.gz
linux-5ace65ebb5ce9fe1cc8fdbdd97079fb566ef0ea4.tar.bz2
linux-5ace65ebb5ce9fe1cc8fdbdd97079fb566ef0ea4.zip
s390/stp: clock_delta should be signed
clock_delta is declared as unsigned long in various places. However, the clock sync delta can be negative. This would add a huge positive offset in clock_sync_global where clock_delta is added to clk.eitod which is a 72 bit integer. Declare it as signed long to fix this. Cc: stable@vger.kernel.org Signed-off-by: Sven Schnelle <svens@linux.ibm.com> Reviewed-by: Heiko Carstens <hca@linux.ibm.com> Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
Diffstat (limited to 'arch/s390/kernel/time.c')
-rw-r--r--arch/s390/kernel/time.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/arch/s390/kernel/time.c b/arch/s390/kernel/time.c
index 2506bfdc91c7..6b7b6d5e3632 100644
--- a/arch/s390/kernel/time.c
+++ b/arch/s390/kernel/time.c
@@ -364,7 +364,7 @@ static inline int check_sync_clock(void)
* Apply clock delta to the global data structures.
* This is called once on the CPU that performed the clock sync.
*/
-static void clock_sync_global(unsigned long delta)
+static void clock_sync_global(long delta)
{
unsigned long now, adj;
struct ptff_qto qto;
@@ -400,7 +400,7 @@ static void clock_sync_global(unsigned long delta)
* Apply clock delta to the per-CPU data structures of this CPU.
* This is called for each online CPU after the call to clock_sync_global.
*/
-static void clock_sync_local(unsigned long delta)
+static void clock_sync_local(long delta)
{
/* Add the delta to the clock comparator. */
if (S390_lowcore.clock_comparator != clock_comparator_max) {
@@ -424,7 +424,7 @@ static void __init time_init_wq(void)
struct clock_sync_data {
atomic_t cpus;
int in_sync;
- unsigned long clock_delta;
+ long clock_delta;
};
/*
@@ -544,7 +544,7 @@ static int stpinfo_valid(void)
static int stp_sync_clock(void *data)
{
struct clock_sync_data *sync = data;
- u64 clock_delta, flags;
+ long clock_delta, flags;
static int first;
int rc;