mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-29 13:53:33 +00:00
s390/stp: clock_delta should be signed
commit 5ace65ebb5
upstream.
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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
efef10d04b
commit
f6fa745813
3 changed files with 7 additions and 7 deletions
|
@ -369,7 +369,7 @@ void cio_gp_dma_destroy(struct gen_pool *gp_dma, struct device *dma_dev);
|
||||||
struct gen_pool *cio_gp_dma_create(struct device *dma_dev, int nr_pages);
|
struct gen_pool *cio_gp_dma_create(struct device *dma_dev, int nr_pages);
|
||||||
|
|
||||||
/* Function from drivers/s390/cio/chsc.c */
|
/* Function from drivers/s390/cio/chsc.c */
|
||||||
int chsc_sstpc(void *page, unsigned int op, u16 ctrl, u64 *clock_delta);
|
int chsc_sstpc(void *page, unsigned int op, u16 ctrl, long *clock_delta);
|
||||||
int chsc_sstpi(void *page, void *result, size_t size);
|
int chsc_sstpi(void *page, void *result, size_t size);
|
||||||
int chsc_stzi(void *page, void *result, size_t size);
|
int chsc_stzi(void *page, void *result, size_t size);
|
||||||
int chsc_sgib(u32 origin);
|
int chsc_sgib(u32 origin);
|
||||||
|
|
|
@ -364,7 +364,7 @@ static inline int check_sync_clock(void)
|
||||||
* Apply clock delta to the global data structures.
|
* Apply clock delta to the global data structures.
|
||||||
* This is called once on the CPU that performed the clock sync.
|
* 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;
|
unsigned long now, adj;
|
||||||
struct ptff_qto qto;
|
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.
|
* 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.
|
* 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. */
|
/* Add the delta to the clock comparator. */
|
||||||
if (S390_lowcore.clock_comparator != clock_comparator_max) {
|
if (S390_lowcore.clock_comparator != clock_comparator_max) {
|
||||||
|
@ -424,7 +424,7 @@ static void __init time_init_wq(void)
|
||||||
struct clock_sync_data {
|
struct clock_sync_data {
|
||||||
atomic_t cpus;
|
atomic_t cpus;
|
||||||
int in_sync;
|
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)
|
static int stp_sync_clock(void *data)
|
||||||
{
|
{
|
||||||
struct clock_sync_data *sync = data;
|
struct clock_sync_data *sync = data;
|
||||||
u64 clock_delta, flags;
|
long clock_delta, flags;
|
||||||
static int first;
|
static int first;
|
||||||
int rc;
|
int rc;
|
||||||
|
|
||||||
|
|
|
@ -1255,7 +1255,7 @@ chsc_determine_css_characteristics(void)
|
||||||
EXPORT_SYMBOL_GPL(css_general_characteristics);
|
EXPORT_SYMBOL_GPL(css_general_characteristics);
|
||||||
EXPORT_SYMBOL_GPL(css_chsc_characteristics);
|
EXPORT_SYMBOL_GPL(css_chsc_characteristics);
|
||||||
|
|
||||||
int chsc_sstpc(void *page, unsigned int op, u16 ctrl, u64 *clock_delta)
|
int chsc_sstpc(void *page, unsigned int op, u16 ctrl, long *clock_delta)
|
||||||
{
|
{
|
||||||
struct {
|
struct {
|
||||||
struct chsc_header request;
|
struct chsc_header request;
|
||||||
|
@ -1266,7 +1266,7 @@ int chsc_sstpc(void *page, unsigned int op, u16 ctrl, u64 *clock_delta)
|
||||||
unsigned int rsvd2[5];
|
unsigned int rsvd2[5];
|
||||||
struct chsc_header response;
|
struct chsc_header response;
|
||||||
unsigned int rsvd3[3];
|
unsigned int rsvd3[3];
|
||||||
u64 clock_delta;
|
s64 clock_delta;
|
||||||
unsigned int rsvd4[2];
|
unsigned int rsvd4[2];
|
||||||
} *rr;
|
} *rr;
|
||||||
int rc;
|
int rc;
|
||||||
|
|
Loading…
Reference in a new issue