Skip to content

Commit 1aae056

Browse files
heicarstMartin Schwidefsky
authored andcommitted
s390/time: rename tod clock access functions
Fix name clash with some common code device drivers and add "tod" to all tod clock access function names. Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com> Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
1 parent 58fece7 commit 1aae056

31 files changed

Lines changed: 106 additions & 106 deletions

‎arch/s390/appldata/appldata_mem.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ static void appldata_get_mem_data(void *data)
108108
mem_data->totalswap = P2K(val.totalswap);
109109
mem_data->freeswap = P2K(val.freeswap);
110110

111-
mem_data->timestamp = get_clock();
111+
mem_data->timestamp = get_tod_clock();
112112
mem_data->sync_count_2++;
113113
}
114114

‎arch/s390/appldata/appldata_net_sum.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ static void appldata_get_net_sum_data(void *data)
111111
net_data->tx_dropped = tx_dropped;
112112
net_data->collisions = collisions;
113113

114-
net_data->timestamp = get_clock();
114+
net_data->timestamp = get_tod_clock();
115115
net_data->sync_count_2++;
116116
}
117117

‎arch/s390/appldata/appldata_os.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ static void appldata_get_os_data(void *data)
156156
}
157157
ops.size = new_size;
158158
}
159-
os_data->timestamp = get_clock();
159+
os_data->timestamp = get_tod_clock();
160160
os_data->sync_count_2++;
161161
}
162162

‎arch/s390/hypfs/hypfs_vm.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -245,7 +245,7 @@ static int dbfs_diag2fc_create(void **data, void **data_free_ptr, size_t *size)
245245
d2fc = diag2fc_store(guest_query, &count, sizeof(d2fc->hdr));
246246
if (IS_ERR(d2fc))
247247
return PTR_ERR(d2fc);
248-
get_clock_ext(d2fc->hdr.tod_ext);
248+
get_tod_clock_ext(d2fc->hdr.tod_ext);
249249
d2fc->hdr.len = count * sizeof(struct diag2fc_data);
250250
d2fc->hdr.version = DBFS_D2FC_HDR_VERSION;
251251
d2fc->hdr.count = count;

‎arch/s390/include/asm/timex.h‎

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
#define TOD_UNIX_EPOCH 0x7d91048bca000000ULL
1616

1717
/* Inline functions for clock register access. */
18-
static inline int set_clock(__u64 time)
18+
static inline int set_tod_clock(__u64 time)
1919
{
2020
int cc;
2121

@@ -27,7 +27,7 @@ static inline int set_clock(__u64 time)
2727
return cc;
2828
}
2929

30-
static inline int store_clock(__u64 *time)
30+
static inline int store_tod_clock(__u64 *time)
3131
{
3232
int cc;
3333

@@ -71,7 +71,7 @@ static inline void local_tick_enable(unsigned long long comp)
7171

7272
typedef unsigned long long cycles_t;
7373

74-
static inline unsigned long long get_clock(void)
74+
static inline unsigned long long get_tod_clock(void)
7575
{
7676
unsigned long long clk;
7777

@@ -83,21 +83,21 @@ static inline unsigned long long get_clock(void)
8383
return clk;
8484
}
8585

86-
static inline void get_clock_ext(char *clk)
86+
static inline void get_tod_clock_ext(char *clk)
8787
{
8888
asm volatile("stcke %0" : "=Q" (*clk) : : "cc");
8989
}
9090

91-
static inline unsigned long long get_clock_xt(void)
91+
static inline unsigned long long get_tod_clock_xt(void)
9292
{
9393
unsigned char clk[16];
94-
get_clock_ext(clk);
94+
get_tod_clock_ext(clk);
9595
return *((unsigned long long *)&clk[1]);
9696
}
9797

9898
static inline cycles_t get_cycles(void)
9999
{
100-
return (cycles_t) get_clock() >> 2;
100+
return (cycles_t) get_tod_clock() >> 2;
101101
}
102102

103103
int get_sync_clock(unsigned long long *clock);
@@ -123,9 +123,9 @@ extern u64 sched_clock_base_cc;
123123
* function, otherwise the returned value is not guaranteed to
124124
* be monotonic.
125125
*/
126-
static inline unsigned long long get_clock_monotonic(void)
126+
static inline unsigned long long get_tod_clock_monotonic(void)
127127
{
128-
return get_clock_xt() - sched_clock_base_cc;
128+
return get_tod_clock_xt() - sched_clock_base_cc;
129129
}
130130

131131
/**

‎arch/s390/kernel/debug.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -867,7 +867,7 @@ static inline void
867867
debug_finish_entry(debug_info_t * id, debug_entry_t* active, int level,
868868
int exception)
869869
{
870-
active->id.stck = get_clock();
870+
active->id.stck = get_tod_clock();
871871
active->id.fields.cpuid = smp_processor_id();
872872
active->caller = __builtin_return_address(0);
873873
active->id.fields.exception = exception;

‎arch/s390/kernel/early.c‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,10 +47,10 @@ static void __init reset_tod_clock(void)
4747
{
4848
u64 time;
4949

50-
if (store_clock(&time) == 0)
50+
if (store_tod_clock(&time) == 0)
5151
return;
5252
/* TOD clock not running. Set the clock to Unix Epoch. */
53-
if (set_clock(TOD_UNIX_EPOCH) != 0 || store_clock(&time) != 0)
53+
if (set_tod_clock(TOD_UNIX_EPOCH) != 0 || store_tod_clock(&time) != 0)
5454
disabled_wait(0);
5555

5656
sched_clock_base_cc = TOD_UNIX_EPOCH;
@@ -173,7 +173,7 @@ static noinline __init void create_kernel_nss(void)
173173
}
174174

175175
/* re-initialize cputime accounting. */
176-
sched_clock_base_cc = get_clock();
176+
sched_clock_base_cc = get_tod_clock();
177177
S390_lowcore.last_update_clock = sched_clock_base_cc;
178178
S390_lowcore.last_update_timer = 0x7fffffffffffffffULL;
179179
S390_lowcore.user_timer = 0;

‎arch/s390/kernel/nmi.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -293,7 +293,7 @@ void notrace s390_do_machine_check(struct pt_regs *regs)
293293
* retry this instruction.
294294
*/
295295
spin_lock(&ipd_lock);
296-
tmp = get_clock();
296+
tmp = get_tod_clock();
297297
if (((tmp - last_ipd) >> 12) < MAX_IPD_TIME)
298298
ipd_count++;
299299
else

‎arch/s390/kernel/smp.c‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -365,16 +365,16 @@ void smp_emergency_stop(cpumask_t *cpumask)
365365
u64 end;
366366
int cpu;
367367

368-
end = get_clock() + (1000000UL << 12);
368+
end = get_tod_clock() + (1000000UL << 12);
369369
for_each_cpu(cpu, cpumask) {
370370
struct pcpu *pcpu = pcpu_devices + cpu;
371371
set_bit(ec_stop_cpu, &pcpu->ec_mask);
372372
while (__pcpu_sigp(pcpu->address, SIGP_EMERGENCY_SIGNAL,
373373
0, NULL) == SIGP_CC_BUSY &&
374-
get_clock() < end)
374+
get_tod_clock() < end)
375375
cpu_relax();
376376
}
377-
while (get_clock() < end) {
377+
while (get_tod_clock() < end) {
378378
for_each_cpu(cpu, cpumask)
379379
if (pcpu_stopped(pcpu_devices + cpu))
380380
cpumask_clear_cpu(cpu, cpumask);
@@ -694,7 +694,7 @@ static void __init smp_detect_cpus(void)
694694
*/
695695
static void __cpuinit smp_start_secondary(void *cpuvoid)
696696
{
697-
S390_lowcore.last_update_clock = get_clock();
697+
S390_lowcore.last_update_clock = get_tod_clock();
698698
S390_lowcore.restart_stack = (unsigned long) restart_stack;
699699
S390_lowcore.restart_fn = (unsigned long) do_restart;
700700
S390_lowcore.restart_data = 0;
@@ -947,7 +947,7 @@ static ssize_t show_idle_time(struct device *dev,
947947
unsigned int sequence;
948948

949949
do {
950-
now = get_clock();
950+
now = get_tod_clock();
951951
sequence = ACCESS_ONCE(idle->sequence);
952952
idle_time = ACCESS_ONCE(idle->idle_time);
953953
idle_enter = ACCESS_ONCE(idle->clock_idle_enter);

‎arch/s390/kernel/time.c‎

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ static DEFINE_PER_CPU(struct clock_event_device, comparators);
6363
*/
6464
unsigned long long notrace __kprobes sched_clock(void)
6565
{
66-
return tod_to_ns(get_clock_monotonic());
66+
return tod_to_ns(get_tod_clock_monotonic());
6767
}
6868

6969
/*
@@ -194,7 +194,7 @@ static void stp_reset(void);
194194

195195
void read_persistent_clock(struct timespec *ts)
196196
{
197-
tod_to_timeval(get_clock() - TOD_UNIX_EPOCH, ts);
197+
tod_to_timeval(get_tod_clock() - TOD_UNIX_EPOCH, ts);
198198
}
199199

200200
void read_boot_clock(struct timespec *ts)
@@ -204,7 +204,7 @@ void read_boot_clock(struct timespec *ts)
204204

205205
static cycle_t read_tod_clock(struct clocksource *cs)
206206
{
207-
return get_clock();
207+
return get_tod_clock();
208208
}
209209

210210
static struct clocksource clocksource_tod = {
@@ -342,7 +342,7 @@ int get_sync_clock(unsigned long long *clock)
342342

343343
sw_ptr = &get_cpu_var(clock_sync_word);
344344
sw0 = atomic_read(sw_ptr);
345-
*clock = get_clock();
345+
*clock = get_tod_clock();
346346
sw1 = atomic_read(sw_ptr);
347347
put_cpu_var(clock_sync_word);
348348
if (sw0 == sw1 && (sw0 & 0x80000000U))
@@ -486,7 +486,7 @@ static void etr_reset(void)
486486
.p0 = 0, .p1 = 0, ._pad1 = 0, .ea = 0,
487487
.es = 0, .sl = 0 };
488488
if (etr_setr(&etr_eacr) == 0) {
489-
etr_tolec = get_clock();
489+
etr_tolec = get_tod_clock();
490490
set_bit(CLOCK_SYNC_HAS_ETR, &clock_sync_flags);
491491
if (etr_port0_online && etr_port1_online)
492492
set_bit(CLOCK_SYNC_ETR, &clock_sync_flags);
@@ -768,8 +768,8 @@ static int etr_sync_clock(void *data)
768768
__ctl_set_bit(14, 21);
769769
__ctl_set_bit(0, 29);
770770
clock = ((unsigned long long) (aib->edf2.etv + 1)) << 32;
771-
old_clock = get_clock();
772-
if (set_clock(clock) == 0) {
771+
old_clock = get_tod_clock();
772+
if (set_tod_clock(clock) == 0) {
773773
__udelay(1); /* Wait for the clock to start. */
774774
__ctl_clear_bit(0, 29);
775775
__ctl_clear_bit(14, 21);
@@ -845,7 +845,7 @@ static struct etr_eacr etr_handle_events(struct etr_eacr eacr)
845845
* assume that this can have caused an stepping
846846
* port switch.
847847
*/
848-
etr_tolec = get_clock();
848+
etr_tolec = get_tod_clock();
849849
eacr.p0 = etr_port0_online;
850850
if (!eacr.p0)
851851
eacr.e0 = 0;
@@ -858,7 +858,7 @@ static struct etr_eacr etr_handle_events(struct etr_eacr eacr)
858858
* assume that this can have caused an stepping
859859
* port switch.
860860
*/
861-
etr_tolec = get_clock();
861+
etr_tolec = get_tod_clock();
862862
eacr.p1 = etr_port1_online;
863863
if (!eacr.p1)
864864
eacr.e1 = 0;
@@ -974,7 +974,7 @@ static void etr_update_eacr(struct etr_eacr eacr)
974974
etr_eacr = eacr;
975975
etr_setr(&etr_eacr);
976976
if (dp_changed)
977-
etr_tolec = get_clock();
977+
etr_tolec = get_tod_clock();
978978
}
979979

980980
/*
@@ -1012,7 +1012,7 @@ static void etr_work_fn(struct work_struct *work)
10121012
/* Store aib to get the current ETR status word. */
10131013
BUG_ON(etr_stetr(&aib) != 0);
10141014
etr_port0.esw = etr_port1.esw = aib.esw; /* Copy status word. */
1015-
now = get_clock();
1015+
now = get_tod_clock();
10161016

10171017
/*
10181018
* Update the port information if the last stepping port change
@@ -1537,10 +1537,10 @@ static int stp_sync_clock(void *data)
15371537
if (stp_info.todoff[0] || stp_info.todoff[1] ||
15381538
stp_info.todoff[2] || stp_info.todoff[3] ||
15391539
stp_info.tmd != 2) {
1540-
old_clock = get_clock();
1540+
old_clock = get_tod_clock();
15411541
rc = chsc_sstpc(stp_page, STP_OP_SYNC, 0);
15421542
if (rc == 0) {
1543-
delta = adjust_time(old_clock, get_clock(), 0);
1543+
delta = adjust_time(old_clock, get_tod_clock(), 0);
15441544
fixup_clock_comparator(delta);
15451545
rc = chsc_sstpi(stp_page, &stp_info,
15461546
sizeof(struct stp_sstpi));

0 commit comments

Comments
 (0)