Commit 04362301 authored by Martin Schwidefsky's avatar Martin Schwidefsky

[S390] stp synchronization retry timer

Add a timer that retries the clock synchronization via the server time
protocol if there is a usable clock but the synchronization failed.
Signed-off-by: default avatarMartin Schwidefsky <schwidefsky@de.ibm.com>
parent 81f64b87
...@@ -1423,6 +1423,7 @@ static void *stp_page; ...@@ -1423,6 +1423,7 @@ static void *stp_page;
static void stp_work_fn(struct work_struct *work); static void stp_work_fn(struct work_struct *work);
static DEFINE_MUTEX(stp_work_mutex); static DEFINE_MUTEX(stp_work_mutex);
static DECLARE_WORK(stp_work, stp_work_fn); static DECLARE_WORK(stp_work, stp_work_fn);
static struct timer_list stp_timer;
static int __init early_parse_stp(char *p) static int __init early_parse_stp(char *p)
{ {
...@@ -1454,10 +1455,16 @@ static void __init stp_reset(void) ...@@ -1454,10 +1455,16 @@ static void __init stp_reset(void)
} }
} }
static void stp_timeout(unsigned long dummy)
{
queue_work(time_sync_wq, &stp_work);
}
static int __init stp_init(void) static int __init stp_init(void)
{ {
if (!test_bit(CLOCK_SYNC_HAS_STP, &clock_sync_flags)) if (!test_bit(CLOCK_SYNC_HAS_STP, &clock_sync_flags))
return 0; return 0;
setup_timer(&stp_timer, stp_timeout, 0UL);
time_init_wq(); time_init_wq();
if (!stp_online) if (!stp_online)
return 0; return 0;
...@@ -1565,6 +1572,7 @@ static void stp_work_fn(struct work_struct *work) ...@@ -1565,6 +1572,7 @@ static void stp_work_fn(struct work_struct *work)
if (!stp_online) { if (!stp_online) {
chsc_sstpc(stp_page, STP_OP_CTRL, 0x0000); chsc_sstpc(stp_page, STP_OP_CTRL, 0x0000);
del_timer_sync(&stp_timer);
goto out_unlock; goto out_unlock;
} }
...@@ -1586,6 +1594,13 @@ static void stp_work_fn(struct work_struct *work) ...@@ -1586,6 +1594,13 @@ static void stp_work_fn(struct work_struct *work)
stop_machine(stp_sync_clock, &stp_sync, &cpu_online_map); stop_machine(stp_sync_clock, &stp_sync, &cpu_online_map);
put_online_cpus(); put_online_cpus();
if (!check_sync_clock())
/*
* There is a usable clock but the synchonization failed.
* Retry after a second.
*/
mod_timer(&stp_timer, jiffies + HZ);
out_unlock: out_unlock:
mutex_unlock(&stp_work_mutex); mutex_unlock(&stp_work_mutex);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment