aboutsummaryrefslogtreecommitdiffstats
path: root/arch/s390/kernel/time.c
diff options
context:
space:
mode:
authorGlenn Elliott <gelliott@cs.unc.edu>2012-03-04 19:47:13 -0500
committerGlenn Elliott <gelliott@cs.unc.edu>2012-03-04 19:47:13 -0500
commitc71c03bda1e86c9d5198c5d83f712e695c4f2a1e (patch)
treeecb166cb3e2b7e2adb3b5e292245fefd23381ac8 /arch/s390/kernel/time.c
parentea53c912f8a86a8567697115b6a0d8152beee5c8 (diff)
parent6a00f206debf8a5c8899055726ad127dbeeed098 (diff)
Merge branch 'mpi-master' into wip-k-fmlpwip-k-fmlp
Conflicts: litmus/sched_cedf.c
Diffstat (limited to 'arch/s390/kernel/time.c')
-rw-r--r--arch/s390/kernel/time.c34
1 files changed, 19 insertions, 15 deletions
diff --git a/arch/s390/kernel/time.c b/arch/s390/kernel/time.c
index 2896cac9c14a..dff933065ab6 100644
--- a/arch/s390/kernel/time.c
+++ b/arch/s390/kernel/time.c
@@ -15,6 +15,7 @@
15#define KMSG_COMPONENT "time" 15#define KMSG_COMPONENT "time"
16#define pr_fmt(fmt) KMSG_COMPONENT ": " fmt 16#define pr_fmt(fmt) KMSG_COMPONENT ": " fmt
17 17
18#include <linux/kernel_stat.h>
18#include <linux/errno.h> 19#include <linux/errno.h>
19#include <linux/module.h> 20#include <linux/module.h>
20#include <linux/sched.h> 21#include <linux/sched.h>
@@ -37,9 +38,9 @@
37#include <linux/clocksource.h> 38#include <linux/clocksource.h>
38#include <linux/clockchips.h> 39#include <linux/clockchips.h>
39#include <linux/gfp.h> 40#include <linux/gfp.h>
41#include <linux/kprobes.h>
40#include <asm/uaccess.h> 42#include <asm/uaccess.h>
41#include <asm/delay.h> 43#include <asm/delay.h>
42#include <asm/s390_ext.h>
43#include <asm/div64.h> 44#include <asm/div64.h>
44#include <asm/vdso.h> 45#include <asm/vdso.h>
45#include <asm/irq.h> 46#include <asm/irq.h>
@@ -60,7 +61,7 @@ static DEFINE_PER_CPU(struct clock_event_device, comparators);
60/* 61/*
61 * Scheduler clock - returns current time in nanosec units. 62 * Scheduler clock - returns current time in nanosec units.
62 */ 63 */
63unsigned long long notrace sched_clock(void) 64unsigned long long notrace __kprobes sched_clock(void)
64{ 65{
65 return (get_clock_monotonic() * 125) >> 9; 66 return (get_clock_monotonic() * 125) >> 9;
66} 67}
@@ -155,8 +156,11 @@ void init_cpu_timer(void)
155 __ctl_set_bit(0, 4); 156 __ctl_set_bit(0, 4);
156} 157}
157 158
158static void clock_comparator_interrupt(__u16 code) 159static void clock_comparator_interrupt(unsigned int ext_int_code,
160 unsigned int param32,
161 unsigned long param64)
159{ 162{
163 kstat_cpu(smp_processor_id()).irqs[EXTINT_CLK]++;
160 if (S390_lowcore.clock_comparator == -1ULL) 164 if (S390_lowcore.clock_comparator == -1ULL)
161 set_clock_comparator(S390_lowcore.clock_comparator); 165 set_clock_comparator(S390_lowcore.clock_comparator);
162} 166}
@@ -164,14 +168,14 @@ static void clock_comparator_interrupt(__u16 code)
164static void etr_timing_alert(struct etr_irq_parm *); 168static void etr_timing_alert(struct etr_irq_parm *);
165static void stp_timing_alert(struct stp_irq_parm *); 169static void stp_timing_alert(struct stp_irq_parm *);
166 170
167static void timing_alert_interrupt(__u16 code) 171static void timing_alert_interrupt(unsigned int ext_int_code,
172 unsigned int param32, unsigned long param64)
168{ 173{
169 if (S390_lowcore.ext_params & 0x00c40000) 174 kstat_cpu(smp_processor_id()).irqs[EXTINT_TLA]++;
170 etr_timing_alert((struct etr_irq_parm *) 175 if (param32 & 0x00c40000)
171 &S390_lowcore.ext_params); 176 etr_timing_alert((struct etr_irq_parm *) &param32);
172 if (S390_lowcore.ext_params & 0x00038000) 177 if (param32 & 0x00038000)
173 stp_timing_alert((struct stp_irq_parm *) 178 stp_timing_alert((struct stp_irq_parm *) &param32);
174 &S390_lowcore.ext_params);
175} 179}
176 180
177static void etr_reset(void); 181static void etr_reset(void);
@@ -719,7 +723,7 @@ static void clock_sync_cpu(struct clock_sync_data *sync)
719} 723}
720 724
721/* 725/*
722 * Sync the TOD clock using the port refered to by aibp. This port 726 * Sync the TOD clock using the port referred to by aibp. This port
723 * has to be enabled and the other port has to be disabled. The 727 * has to be enabled and the other port has to be disabled. The
724 * last eacr update has to be more than 1.6 seconds in the past. 728 * last eacr update has to be more than 1.6 seconds in the past.
725 */ 729 */
@@ -805,7 +809,7 @@ static int etr_sync_clock_stop(struct etr_aib *aib, int port)
805 etr_sync.etr_port = port; 809 etr_sync.etr_port = port;
806 get_online_cpus(); 810 get_online_cpus();
807 atomic_set(&etr_sync.cpus, num_online_cpus() - 1); 811 atomic_set(&etr_sync.cpus, num_online_cpus() - 1);
808 rc = stop_machine(etr_sync_clock, &etr_sync, &cpu_online_map); 812 rc = stop_machine(etr_sync_clock, &etr_sync, cpu_online_mask);
809 put_online_cpus(); 813 put_online_cpus();
810 return rc; 814 return rc;
811} 815}
@@ -1007,7 +1011,7 @@ static void etr_work_fn(struct work_struct *work)
1007 eacr = etr_handle_update(&aib, eacr); 1011 eacr = etr_handle_update(&aib, eacr);
1008 1012
1009 /* 1013 /*
1010 * Select ports to enable. The prefered synchronization mode is PPS. 1014 * Select ports to enable. The preferred synchronization mode is PPS.
1011 * If a port can be enabled depends on a number of things: 1015 * If a port can be enabled depends on a number of things:
1012 * 1) The port needs to be online and uptodate. A port is not 1016 * 1) The port needs to be online and uptodate. A port is not
1013 * disabled just because it is not uptodate, but it is only 1017 * disabled just because it is not uptodate, but it is only
@@ -1086,7 +1090,7 @@ static void etr_work_fn(struct work_struct *work)
1086 /* 1090 /*
1087 * Update eacr and try to synchronize the clock. If the update 1091 * Update eacr and try to synchronize the clock. If the update
1088 * of eacr caused a stepping port switch (or if we have to 1092 * of eacr caused a stepping port switch (or if we have to
1089 * assume that a stepping port switch has occured) or the 1093 * assume that a stepping port switch has occurred) or the
1090 * clock syncing failed, reset the sync check control bit 1094 * clock syncing failed, reset the sync check control bit
1091 * and set up a timer to try again after 0.5 seconds 1095 * and set up a timer to try again after 0.5 seconds
1092 */ 1096 */
@@ -1574,7 +1578,7 @@ static void stp_work_fn(struct work_struct *work)
1574 memset(&stp_sync, 0, sizeof(stp_sync)); 1578 memset(&stp_sync, 0, sizeof(stp_sync));
1575 get_online_cpus(); 1579 get_online_cpus();
1576 atomic_set(&stp_sync.cpus, num_online_cpus() - 1); 1580 atomic_set(&stp_sync.cpus, num_online_cpus() - 1);
1577 stop_machine(stp_sync_clock, &stp_sync, &cpu_online_map); 1581 stop_machine(stp_sync_clock, &stp_sync, cpu_online_mask);
1578 put_online_cpus(); 1582 put_online_cpus();
1579 1583
1580 if (!check_sync_clock()) 1584 if (!check_sync_clock())