@@ -69,8 +69,6 @@ unsigned char ptff_function_mask[16];
69
69
70
70
static unsigned long lpar_offset ;
71
71
static unsigned long initial_leap_seconds ;
72
- static unsigned long tod_steering_end ;
73
- static long tod_steering_delta ;
74
72
75
73
/*
76
74
* Get time offsets with PTFF
@@ -80,9 +78,7 @@ void __init time_early_init(void)
80
78
struct ptff_qto qto ;
81
79
struct ptff_qui qui ;
82
80
83
- /* Initialize TOD steering parameters */
84
- tod_steering_end = tod_clock_base .tod ;
85
- vdso_k_time_data -> arch_data .tod_steering_end = tod_steering_end ;
81
+ vdso_k_time_data -> arch_data .tod_delta = tod_clock_base .tod ;
86
82
87
83
if (!test_facility (28 ))
88
84
return ;
@@ -226,21 +222,7 @@ void __init read_persistent_wall_and_boot_offset(struct timespec64 *wall_time,
226
222
227
223
static u64 read_tod_clock (struct clocksource * cs )
228
224
{
229
- unsigned long now , adj ;
230
-
231
- preempt_disable (); /* protect from changes to steering parameters */
232
- now = get_tod_clock ();
233
- adj = tod_steering_end - now ;
234
- if (unlikely ((s64 ) adj > 0 ))
235
- /*
236
- * manually steer by 1 cycle every 2^16 cycles. This
237
- * corresponds to shifting the tod delta by 15. 1s is
238
- * therefore steered in ~9h. The adjust will decrease
239
- * over time, until it finally reaches 0.
240
- */
241
- now += (tod_steering_delta < 0 ) ? (adj >> 15 ) : - (adj >> 15 );
242
- preempt_enable ();
243
- return now ;
225
+ return get_tod_clock_monotonic ();
244
226
}
245
227
246
228
static struct clocksource clocksource_tod = {
@@ -369,26 +351,11 @@ static inline int check_sync_clock(void)
369
351
*/
370
352
static void clock_sync_global (long delta )
371
353
{
372
- unsigned long now , adj ;
373
354
struct ptff_qto qto ;
374
355
375
356
/* Fixup the monotonic sched clock. */
376
357
tod_clock_base .eitod += delta ;
377
- /* Adjust TOD steering parameters. */
378
- now = get_tod_clock ();
379
- adj = tod_steering_end - now ;
380
- if (unlikely ((s64 ) adj >= 0 ))
381
- /* Calculate how much of the old adjustment is left. */
382
- tod_steering_delta = (tod_steering_delta < 0 ) ?
383
- - (adj >> 15 ) : (adj >> 15 );
384
- tod_steering_delta += delta ;
385
- if ((abs (tod_steering_delta ) >> 48 ) != 0 )
386
- panic ("TOD clock sync offset %li is too large to drift\n" ,
387
- tod_steering_delta );
388
- tod_steering_end = now + (abs (tod_steering_delta ) << 15 );
389
- vdso_k_time_data -> arch_data .tod_steering_end = tod_steering_end ;
390
- vdso_k_time_data -> arch_data .tod_steering_delta = tod_steering_delta ;
391
-
358
+ vdso_k_time_data -> arch_data .tod_delta = tod_clock_base .tod ;
392
359
/* Update LPAR offset. */
393
360
if (ptff_query (PTFF_QTO ) && ptff (& qto , sizeof (qto ), PTFF_QTO ) == 0 )
394
361
lpar_offset = qto .tod_epoch_difference ;
0 commit comments