Skip to content

Commit 5ace65e

Browse files
svens-s390hcahca
authored andcommitted
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: [email protected] Signed-off-by: Sven Schnelle <[email protected]> Reviewed-by: Heiko Carstens <[email protected]> Signed-off-by: Heiko Carstens <[email protected]>
1 parent 03780c8 commit 5ace65e

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

arch/s390/include/asm/cio.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -369,7 +369,7 @@ void cio_gp_dma_destroy(struct gen_pool *gp_dma, struct device *dma_dev);
369369
struct gen_pool *cio_gp_dma_create(struct device *dma_dev, int nr_pages);
370370

371371
/* Function from drivers/s390/cio/chsc.c */
372-
int chsc_sstpc(void *page, unsigned int op, u16 ctrl, u64 *clock_delta);
372+
int chsc_sstpc(void *page, unsigned int op, u16 ctrl, long *clock_delta);
373373
int chsc_sstpi(void *page, void *result, size_t size);
374374
int chsc_stzi(void *page, void *result, size_t size);
375375
int chsc_sgib(u32 origin);

arch/s390/kernel/time.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -364,7 +364,7 @@ static inline int check_sync_clock(void)
364364
* Apply clock delta to the global data structures.
365365
* This is called once on the CPU that performed the clock sync.
366366
*/
367-
static void clock_sync_global(unsigned long delta)
367+
static void clock_sync_global(long delta)
368368
{
369369
unsigned long now, adj;
370370
struct ptff_qto qto;
@@ -400,7 +400,7 @@ static void clock_sync_global(unsigned long delta)
400400
* Apply clock delta to the per-CPU data structures of this CPU.
401401
* This is called for each online CPU after the call to clock_sync_global.
402402
*/
403-
static void clock_sync_local(unsigned long delta)
403+
static void clock_sync_local(long delta)
404404
{
405405
/* Add the delta to the clock comparator. */
406406
if (S390_lowcore.clock_comparator != clock_comparator_max) {
@@ -424,7 +424,7 @@ static void __init time_init_wq(void)
424424
struct clock_sync_data {
425425
atomic_t cpus;
426426
int in_sync;
427-
unsigned long clock_delta;
427+
long clock_delta;
428428
};
429429

430430
/*
@@ -544,7 +544,7 @@ static int stpinfo_valid(void)
544544
static int stp_sync_clock(void *data)
545545
{
546546
struct clock_sync_data *sync = data;
547-
u64 clock_delta, flags;
547+
long clock_delta, flags;
548548
static int first;
549549
int rc;
550550

drivers/s390/cio/chsc.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1255,7 +1255,7 @@ chsc_determine_css_characteristics(void)
12551255
EXPORT_SYMBOL_GPL(css_general_characteristics);
12561256
EXPORT_SYMBOL_GPL(css_chsc_characteristics);
12571257

1258-
int chsc_sstpc(void *page, unsigned int op, u16 ctrl, u64 *clock_delta)
1258+
int chsc_sstpc(void *page, unsigned int op, u16 ctrl, long *clock_delta)
12591259
{
12601260
struct {
12611261
struct chsc_header request;
@@ -1266,7 +1266,7 @@ int chsc_sstpc(void *page, unsigned int op, u16 ctrl, u64 *clock_delta)
12661266
unsigned int rsvd2[5];
12671267
struct chsc_header response;
12681268
unsigned int rsvd3[3];
1269-
u64 clock_delta;
1269+
s64 clock_delta;
12701270
unsigned int rsvd4[2];
12711271
} *rr;
12721272
int rc;

0 commit comments

Comments
 (0)