diff options
| author | Martin Schwidefsky <schwidefsky@de.ibm.com> | 2009-04-14 09:36:19 -0400 |
|---|---|---|
| committer | Martin Schwidefsky <schwidefsky@de.ibm.com> | 2009-04-14 09:37:23 -0400 |
| commit | 0436230148c55e3afbe5c57775a1fb44ba4834ac (patch) | |
| tree | 0896a3ca885bcd3c59f22ed9f37c8eb01dbca906 /arch | |
| parent | 81f64b87731aa33eef6b88af9d92c3398d48cf41 (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')
| -rw-r--r-- | arch/s390/kernel/time.c | 15 |
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; | |||
| 1423 | static void stp_work_fn(struct work_struct *work); | 1423 | static void stp_work_fn(struct work_struct *work); |
| 1424 | static DEFINE_MUTEX(stp_work_mutex); | 1424 | static DEFINE_MUTEX(stp_work_mutex); |
| 1425 | static DECLARE_WORK(stp_work, stp_work_fn); | 1425 | static DECLARE_WORK(stp_work, stp_work_fn); |
| 1426 | static struct timer_list stp_timer; | ||
| 1426 | 1427 | ||
| 1427 | static int __init early_parse_stp(char *p) | 1428 | static 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 | ||
| 1458 | static void stp_timeout(unsigned long dummy) | ||
| 1459 | { | ||
| 1460 | queue_work(time_sync_wq, &stp_work); | ||
| 1461 | } | ||
| 1462 | |||
| 1457 | static int __init stp_init(void) | 1463 | static 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 | |||
| 1589 | out_unlock: | 1604 | out_unlock: |
| 1590 | mutex_unlock(&stp_work_mutex); | 1605 | mutex_unlock(&stp_work_mutex); |
| 1591 | } | 1606 | } |
