aboutsummaryrefslogtreecommitdiffstats
path: root/arch/s390
diff options
context:
space:
mode:
authorMartin Schwidefsky <schwidefsky@de.ibm.com>2009-04-14 09:36:19 -0400
committerMartin Schwidefsky <schwidefsky@de.ibm.com>2009-04-14 09:37:23 -0400
commit0436230148c55e3afbe5c57775a1fb44ba4834ac (patch)
tree0896a3ca885bcd3c59f22ed9f37c8eb01dbca906 /arch/s390
parent81f64b87731aa33eef6b88af9d92c3398d48cf41 (diff)
[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: Martin Schwidefsky <schwidefsky@de.ibm.com>
Diffstat (limited to 'arch/s390')
-rw-r--r--arch/s390/kernel/time.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/arch/s390/kernel/time.c b/arch/s390/kernel/time.c
index f72d41068dc2..05f93e77870b 100644
--- a/arch/s390/kernel/time.c
+++ b/arch/s390/kernel/time.c
@@ -1423,6 +1423,7 @@ static void *stp_page;
1423static void stp_work_fn(struct work_struct *work); 1423static void stp_work_fn(struct work_struct *work);
1424static DEFINE_MUTEX(stp_work_mutex); 1424static DEFINE_MUTEX(stp_work_mutex);
1425static DECLARE_WORK(stp_work, stp_work_fn); 1425static DECLARE_WORK(stp_work, stp_work_fn);
1426static struct timer_list stp_timer;
1426 1427
1427static int __init early_parse_stp(char *p) 1428static int __init early_parse_stp(char *p)
1428{ 1429{
@@ -1454,10 +1455,16 @@ static void __init stp_reset(void)
1454 } 1455 }
1455} 1456}
1456 1457
1458static void stp_timeout(unsigned long dummy)
1459{
1460 queue_work(time_sync_wq, &stp_work);
1461}
1462
1457static int __init stp_init(void) 1463static int __init stp_init(void)
1458{ 1464{
1459 if (!test_bit(CLOCK_SYNC_HAS_STP, &clock_sync_flags)) 1465 if (!test_bit(CLOCK_SYNC_HAS_STP, &clock_sync_flags))
1460 return 0; 1466 return 0;
1467 setup_timer(&stp_timer, stp_timeout, 0UL);
1461 time_init_wq(); 1468 time_init_wq();
1462 if (!stp_online) 1469 if (!stp_online)
1463 return 0; 1470 return 0;
@@ -1565,6 +1572,7 @@ static void stp_work_fn(struct work_struct *work)
1565 1572
1566 if (!stp_online) { 1573 if (!stp_online) {
1567 chsc_sstpc(stp_page, STP_OP_CTRL, 0x0000); 1574 chsc_sstpc(stp_page, STP_OP_CTRL, 0x0000);
1575 del_timer_sync(&stp_timer);
1568 goto out_unlock; 1576 goto out_unlock;
1569 } 1577 }
1570 1578
@@ -1586,6 +1594,13 @@ static void stp_work_fn(struct work_struct *work)
1586 stop_machine(stp_sync_clock, &stp_sync, &cpu_online_map); 1594 stop_machine(stp_sync_clock, &stp_sync, &cpu_online_map);
1587 put_online_cpus(); 1595 put_online_cpus();
1588 1596
1597 if (!check_sync_clock())
1598 /*
1599 * There is a usable clock but the synchonization failed.
1600 * Retry after a second.
1601 */
1602 mod_timer(&stp_timer, jiffies + HZ);
1603
1589out_unlock: 1604out_unlock:
1590 mutex_unlock(&stp_work_mutex); 1605 mutex_unlock(&stp_work_mutex);
1591} 1606}