aboutsummaryrefslogtreecommitdiffstats
path: root/arch/s390/kernel/time.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/s390/kernel/time.c')
-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}