aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/s390
diff options
context:
space:
mode:
authorAya Mahfouz <mahfouz.saif.elyazal@gmail.com>2015-01-16 08:05:45 -0500
committerDavid S. Miller <davem@davemloft.net>2015-01-17 23:54:59 -0500
commitee6edb9707cf2c50bc3df66b06df33a6aa8c9075 (patch)
treee4affe7fbf95115b23f617f3a9c6e5dce2e26050 /drivers/s390
parent33e9fcc666e23d2a09d413ab89a43e0514b91d77 (diff)
s390/ctcm, netiucv: migrate variables to handle y2038 problem
This patch is concerned with migrating the time variables for the s390 network drivers. The changes handle the y2038 problem where timespec will overflow in the year 2038. timespec was replaced by unsigned long and all time variables get their values from the jiffies global variable. This was done for the sake of speed and efficiency. Signed-off-by: Aya Mahfouz <mahfouz.saif.elyazal@gmail.com> Signed-off-by: Ursula Braun <ursula.braun@de.ibm.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/s390')
-rw-r--r--drivers/s390/net/ctcm_fsms.c18
-rw-r--r--drivers/s390/net/ctcm_main.c4
-rw-r--r--drivers/s390/net/ctcm_main.h2
-rw-r--r--drivers/s390/net/ctcm_sysfs.c4
-rw-r--r--drivers/s390/net/netiucv.c6
5 files changed, 15 insertions, 19 deletions
diff --git a/drivers/s390/net/ctcm_fsms.c b/drivers/s390/net/ctcm_fsms.c
index fb92524d24ef..fd5944bbe224 100644
--- a/drivers/s390/net/ctcm_fsms.c
+++ b/drivers/s390/net/ctcm_fsms.c
@@ -251,13 +251,11 @@ static void chx_txdone(fsm_instance *fi, int event, void *arg)
251 int first = 1; 251 int first = 1;
252 int i; 252 int i;
253 unsigned long duration; 253 unsigned long duration;
254 struct timespec done_stamp = current_kernel_time(); /* xtime */ 254 unsigned long done_stamp = jiffies;
255 255
256 CTCM_PR_DEBUG("%s(%s): %s\n", __func__, ch->id, dev->name); 256 CTCM_PR_DEBUG("%s(%s): %s\n", __func__, ch->id, dev->name);
257 257
258 duration = 258 duration = done_stamp - ch->prof.send_stamp;
259 (done_stamp.tv_sec - ch->prof.send_stamp.tv_sec) * 1000000 +
260 (done_stamp.tv_nsec - ch->prof.send_stamp.tv_nsec) / 1000;
261 if (duration > ch->prof.tx_time) 259 if (duration > ch->prof.tx_time)
262 ch->prof.tx_time = duration; 260 ch->prof.tx_time = duration;
263 261
@@ -307,7 +305,7 @@ static void chx_txdone(fsm_instance *fi, int event, void *arg)
307 spin_unlock(&ch->collect_lock); 305 spin_unlock(&ch->collect_lock);
308 ch->ccw[1].count = ch->trans_skb->len; 306 ch->ccw[1].count = ch->trans_skb->len;
309 fsm_addtimer(&ch->timer, CTCM_TIME_5_SEC, CTC_EVENT_TIMER, ch); 307 fsm_addtimer(&ch->timer, CTCM_TIME_5_SEC, CTC_EVENT_TIMER, ch);
310 ch->prof.send_stamp = current_kernel_time(); /* xtime */ 308 ch->prof.send_stamp = jiffies;
311 rc = ccw_device_start(ch->cdev, &ch->ccw[0], 309 rc = ccw_device_start(ch->cdev, &ch->ccw[0],
312 (unsigned long)ch, 0xff, 0); 310 (unsigned long)ch, 0xff, 0);
313 ch->prof.doios_multi++; 311 ch->prof.doios_multi++;
@@ -1229,14 +1227,12 @@ static void ctcmpc_chx_txdone(fsm_instance *fi, int event, void *arg)
1229 int rc; 1227 int rc;
1230 struct th_header *header; 1228 struct th_header *header;
1231 struct pdu *p_header; 1229 struct pdu *p_header;
1232 struct timespec done_stamp = current_kernel_time(); /* xtime */ 1230 unsigned long done_stamp = jiffies;
1233 1231
1234 CTCM_PR_DEBUG("Enter %s: %s cp:%i\n", 1232 CTCM_PR_DEBUG("Enter %s: %s cp:%i\n",
1235 __func__, dev->name, smp_processor_id()); 1233 __func__, dev->name, smp_processor_id());
1236 1234
1237 duration = 1235 duration = done_stamp - ch->prof.send_stamp;
1238 (done_stamp.tv_sec - ch->prof.send_stamp.tv_sec) * 1000000 +
1239 (done_stamp.tv_nsec - ch->prof.send_stamp.tv_nsec) / 1000;
1240 if (duration > ch->prof.tx_time) 1236 if (duration > ch->prof.tx_time)
1241 ch->prof.tx_time = duration; 1237 ch->prof.tx_time = duration;
1242 1238
@@ -1361,7 +1357,7 @@ static void ctcmpc_chx_txdone(fsm_instance *fi, int event, void *arg)
1361 1357
1362 ch->ccw[1].count = ch->trans_skb->len; 1358 ch->ccw[1].count = ch->trans_skb->len;
1363 fsm_addtimer(&ch->timer, CTCM_TIME_5_SEC, CTC_EVENT_TIMER, ch); 1359 fsm_addtimer(&ch->timer, CTCM_TIME_5_SEC, CTC_EVENT_TIMER, ch);
1364 ch->prof.send_stamp = current_kernel_time(); /* xtime */ 1360 ch->prof.send_stamp = jiffies;
1365 if (do_debug_ccw) 1361 if (do_debug_ccw)
1366 ctcmpc_dumpit((char *)&ch->ccw[0], sizeof(struct ccw1) * 3); 1362 ctcmpc_dumpit((char *)&ch->ccw[0], sizeof(struct ccw1) * 3);
1367 rc = ccw_device_start(ch->cdev, &ch->ccw[0], 1363 rc = ccw_device_start(ch->cdev, &ch->ccw[0],
@@ -1827,7 +1823,7 @@ static void ctcmpc_chx_send_sweep(fsm_instance *fsm, int event, void *arg)
1827 fsm_newstate(wch->fsm, CTC_STATE_TX); 1823 fsm_newstate(wch->fsm, CTC_STATE_TX);
1828 1824
1829 spin_lock_irqsave(get_ccwdev_lock(wch->cdev), saveflags); 1825 spin_lock_irqsave(get_ccwdev_lock(wch->cdev), saveflags);
1830 wch->prof.send_stamp = current_kernel_time(); /* xtime */ 1826 wch->prof.send_stamp = jiffies;
1831 rc = ccw_device_start(wch->cdev, &wch->ccw[3], 1827 rc = ccw_device_start(wch->cdev, &wch->ccw[3],
1832 (unsigned long) wch, 0xff, 0); 1828 (unsigned long) wch, 0xff, 0);
1833 spin_unlock_irqrestore(get_ccwdev_lock(wch->cdev), saveflags); 1829 spin_unlock_irqrestore(get_ccwdev_lock(wch->cdev), saveflags);
diff --git a/drivers/s390/net/ctcm_main.c b/drivers/s390/net/ctcm_main.c
index e056dd4fe44d..05c37d6d4afe 100644
--- a/drivers/s390/net/ctcm_main.c
+++ b/drivers/s390/net/ctcm_main.c
@@ -567,7 +567,7 @@ static int ctcm_transmit_skb(struct channel *ch, struct sk_buff *skb)
567 fsm_newstate(ch->fsm, CTC_STATE_TX); 567 fsm_newstate(ch->fsm, CTC_STATE_TX);
568 fsm_addtimer(&ch->timer, CTCM_TIME_5_SEC, CTC_EVENT_TIMER, ch); 568 fsm_addtimer(&ch->timer, CTCM_TIME_5_SEC, CTC_EVENT_TIMER, ch);
569 spin_lock_irqsave(get_ccwdev_lock(ch->cdev), saveflags); 569 spin_lock_irqsave(get_ccwdev_lock(ch->cdev), saveflags);
570 ch->prof.send_stamp = current_kernel_time(); /* xtime */ 570 ch->prof.send_stamp = jiffies;
571 rc = ccw_device_start(ch->cdev, &ch->ccw[ccw_idx], 571 rc = ccw_device_start(ch->cdev, &ch->ccw[ccw_idx],
572 (unsigned long)ch, 0xff, 0); 572 (unsigned long)ch, 0xff, 0);
573 spin_unlock_irqrestore(get_ccwdev_lock(ch->cdev), saveflags); 573 spin_unlock_irqrestore(get_ccwdev_lock(ch->cdev), saveflags);
@@ -831,7 +831,7 @@ static int ctcmpc_transmit_skb(struct channel *ch, struct sk_buff *skb)
831 sizeof(struct ccw1) * 3); 831 sizeof(struct ccw1) * 3);
832 832
833 spin_lock_irqsave(get_ccwdev_lock(ch->cdev), saveflags); 833 spin_lock_irqsave(get_ccwdev_lock(ch->cdev), saveflags);
834 ch->prof.send_stamp = current_kernel_time(); /* xtime */ 834 ch->prof.send_stamp = jiffies;
835 rc = ccw_device_start(ch->cdev, &ch->ccw[ccw_idx], 835 rc = ccw_device_start(ch->cdev, &ch->ccw[ccw_idx],
836 (unsigned long)ch, 0xff, 0); 836 (unsigned long)ch, 0xff, 0);
837 spin_unlock_irqrestore(get_ccwdev_lock(ch->cdev), saveflags); 837 spin_unlock_irqrestore(get_ccwdev_lock(ch->cdev), saveflags);
diff --git a/drivers/s390/net/ctcm_main.h b/drivers/s390/net/ctcm_main.h
index 477c933685f3..6f4417c80247 100644
--- a/drivers/s390/net/ctcm_main.h
+++ b/drivers/s390/net/ctcm_main.h
@@ -121,7 +121,7 @@ struct ctcm_profile {
121 unsigned long doios_multi; 121 unsigned long doios_multi;
122 unsigned long txlen; 122 unsigned long txlen;
123 unsigned long tx_time; 123 unsigned long tx_time;
124 struct timespec send_stamp; 124 unsigned long send_stamp;
125}; 125};
126 126
127/* 127/*
diff --git a/drivers/s390/net/ctcm_sysfs.c b/drivers/s390/net/ctcm_sysfs.c
index 47773c4d235a..ddb0aa321339 100644
--- a/drivers/s390/net/ctcm_sysfs.c
+++ b/drivers/s390/net/ctcm_sysfs.c
@@ -100,8 +100,8 @@ static void ctcm_print_statistics(struct ctcm_priv *priv)
100 priv->channel[WRITE]->prof.doios_multi); 100 priv->channel[WRITE]->prof.doios_multi);
101 p += sprintf(p, " Netto bytes written: %ld\n", 101 p += sprintf(p, " Netto bytes written: %ld\n",
102 priv->channel[WRITE]->prof.txlen); 102 priv->channel[WRITE]->prof.txlen);
103 p += sprintf(p, " Max. TX IO-time: %ld\n", 103 p += sprintf(p, " Max. TX IO-time: %u\n",
104 priv->channel[WRITE]->prof.tx_time); 104 jiffies_to_usecs(priv->channel[WRITE]->prof.tx_time));
105 105
106 printk(KERN_INFO "Statistics for %s:\n%s", 106 printk(KERN_INFO "Statistics for %s:\n%s",
107 priv->channel[CTCM_WRITE]->netdev->name, sbuf); 107 priv->channel[CTCM_WRITE]->netdev->name, sbuf);
diff --git a/drivers/s390/net/netiucv.c b/drivers/s390/net/netiucv.c
index 0a87809c8af7..7e91f54be7ba 100644
--- a/drivers/s390/net/netiucv.c
+++ b/drivers/s390/net/netiucv.c
@@ -178,7 +178,7 @@ struct connection_profile {
178 unsigned long doios_multi; 178 unsigned long doios_multi;
179 unsigned long txlen; 179 unsigned long txlen;
180 unsigned long tx_time; 180 unsigned long tx_time;
181 struct timespec send_stamp; 181 unsigned long send_stamp;
182 unsigned long tx_pending; 182 unsigned long tx_pending;
183 unsigned long tx_max_pending; 183 unsigned long tx_max_pending;
184}; 184};
@@ -786,7 +786,7 @@ static void conn_action_txdone(fsm_instance *fi, int event, void *arg)
786 786
787 header.next = 0; 787 header.next = 0;
788 memcpy(skb_put(conn->tx_buff, NETIUCV_HDRLEN), &header, NETIUCV_HDRLEN); 788 memcpy(skb_put(conn->tx_buff, NETIUCV_HDRLEN), &header, NETIUCV_HDRLEN);
789 conn->prof.send_stamp = current_kernel_time(); 789 conn->prof.send_stamp = jiffies;
790 txmsg.class = 0; 790 txmsg.class = 0;
791 txmsg.tag = 0; 791 txmsg.tag = 0;
792 rc = iucv_message_send(conn->path, &txmsg, 0, 0, 792 rc = iucv_message_send(conn->path, &txmsg, 0, 0,
@@ -1220,7 +1220,7 @@ static int netiucv_transmit_skb(struct iucv_connection *conn,
1220 memcpy(skb_put(nskb, NETIUCV_HDRLEN), &header, NETIUCV_HDRLEN); 1220 memcpy(skb_put(nskb, NETIUCV_HDRLEN), &header, NETIUCV_HDRLEN);
1221 1221
1222 fsm_newstate(conn->fsm, CONN_STATE_TX); 1222 fsm_newstate(conn->fsm, CONN_STATE_TX);
1223 conn->prof.send_stamp = current_kernel_time(); 1223 conn->prof.send_stamp = jiffies;
1224 1224
1225 msg.tag = 1; 1225 msg.tag = 1;
1226 msg.class = 0; 1226 msg.class = 0;