diff options
author | john stultz <johnstul@us.ibm.com> | 2007-07-24 20:47:43 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-07-25 13:09:20 -0400 |
commit | 2c6b47de17c75d553de3e2fb426d8298d2074585 (patch) | |
tree | c8edc3d727d85cb3e1c043583c350a04a133e1a3 /drivers | |
parent | 0de085bb474f64e4fdb2f1ff3268590792648c7b (diff) |
Cleanup non-arch xtime uses, use get_seconds() or current_kernel_time().
This avoids use of the kernel-internal "xtime" variable directly outside
of the actual time-related functions. Instead, use the helper functions
that we already have available to us.
This doesn't actually change any behaviour, but this will allow us to
fix the fact that "xtime" isn't updated very often with CONFIG_NO_HZ
(because much of the realtime information is maintained as separate
offsets to 'xtime'), which has caused interfaces that use xtime directly
to get a time that is out of sync with the real-time clock by up to a
third of a second or so.
Signed-off-by: John Stultz <johnstul@us.ibm.com>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/rtc/class.c | 5 | ||||
-rw-r--r-- | drivers/s390/net/ctcmain.c | 6 | ||||
-rw-r--r-- | drivers/s390/net/netiucv.c | 4 |
3 files changed, 8 insertions, 7 deletions
diff --git a/drivers/rtc/class.c b/drivers/rtc/class.c index 8b3cd31d6a61..10ab3b71ffc6 100644 --- a/drivers/rtc/class.c +++ b/drivers/rtc/class.c | |||
@@ -46,6 +46,7 @@ static int rtc_suspend(struct device *dev, pm_message_t mesg) | |||
46 | { | 46 | { |
47 | struct rtc_device *rtc = to_rtc_device(dev); | 47 | struct rtc_device *rtc = to_rtc_device(dev); |
48 | struct rtc_time tm; | 48 | struct rtc_time tm; |
49 | struct timespec ts = current_kernel_time(); | ||
49 | 50 | ||
50 | if (strncmp(rtc->dev.bus_id, | 51 | if (strncmp(rtc->dev.bus_id, |
51 | CONFIG_RTC_HCTOSYS_DEVICE, | 52 | CONFIG_RTC_HCTOSYS_DEVICE, |
@@ -57,8 +58,8 @@ static int rtc_suspend(struct device *dev, pm_message_t mesg) | |||
57 | 58 | ||
58 | /* RTC precision is 1 second; adjust delta for avg 1/2 sec err */ | 59 | /* RTC precision is 1 second; adjust delta for avg 1/2 sec err */ |
59 | set_normalized_timespec(&delta, | 60 | set_normalized_timespec(&delta, |
60 | xtime.tv_sec - oldtime, | 61 | ts.tv_sec - oldtime, |
61 | xtime.tv_nsec - (NSEC_PER_SEC >> 1)); | 62 | ts.tv_nsec - (NSEC_PER_SEC >> 1)); |
62 | 63 | ||
63 | return 0; | 64 | return 0; |
64 | } | 65 | } |
diff --git a/drivers/s390/net/ctcmain.c b/drivers/s390/net/ctcmain.c index b20fd0681733..92e8a37b5022 100644 --- a/drivers/s390/net/ctcmain.c +++ b/drivers/s390/net/ctcmain.c | |||
@@ -674,7 +674,7 @@ ch_action_txdone(fsm_instance * fi, int event, void *arg) | |||
674 | int first = 1; | 674 | int first = 1; |
675 | int i; | 675 | int i; |
676 | unsigned long duration; | 676 | unsigned long duration; |
677 | struct timespec done_stamp = xtime; | 677 | struct timespec done_stamp = current_kernel_time(); |
678 | 678 | ||
679 | DBF_TEXT(trace, 4, __FUNCTION__); | 679 | DBF_TEXT(trace, 4, __FUNCTION__); |
680 | 680 | ||
@@ -730,7 +730,7 @@ ch_action_txdone(fsm_instance * fi, int event, void *arg) | |||
730 | spin_unlock(&ch->collect_lock); | 730 | spin_unlock(&ch->collect_lock); |
731 | ch->ccw[1].count = ch->trans_skb->len; | 731 | ch->ccw[1].count = ch->trans_skb->len; |
732 | fsm_addtimer(&ch->timer, CTC_TIMEOUT_5SEC, CH_EVENT_TIMER, ch); | 732 | fsm_addtimer(&ch->timer, CTC_TIMEOUT_5SEC, CH_EVENT_TIMER, ch); |
733 | ch->prof.send_stamp = xtime; | 733 | ch->prof.send_stamp = current_kernel_time(); |
734 | rc = ccw_device_start(ch->cdev, &ch->ccw[0], | 734 | rc = ccw_device_start(ch->cdev, &ch->ccw[0], |
735 | (unsigned long) ch, 0xff, 0); | 735 | (unsigned long) ch, 0xff, 0); |
736 | ch->prof.doios_multi++; | 736 | ch->prof.doios_multi++; |
@@ -2281,7 +2281,7 @@ transmit_skb(struct channel *ch, struct sk_buff *skb) | |||
2281 | fsm_newstate(ch->fsm, CH_STATE_TX); | 2281 | fsm_newstate(ch->fsm, CH_STATE_TX); |
2282 | fsm_addtimer(&ch->timer, CTC_TIMEOUT_5SEC, CH_EVENT_TIMER, ch); | 2282 | fsm_addtimer(&ch->timer, CTC_TIMEOUT_5SEC, CH_EVENT_TIMER, ch); |
2283 | spin_lock_irqsave(get_ccwdev_lock(ch->cdev), saveflags); | 2283 | spin_lock_irqsave(get_ccwdev_lock(ch->cdev), saveflags); |
2284 | ch->prof.send_stamp = xtime; | 2284 | ch->prof.send_stamp = current_kernel_time(); |
2285 | rc = ccw_device_start(ch->cdev, &ch->ccw[ccw_idx], | 2285 | rc = ccw_device_start(ch->cdev, &ch->ccw[ccw_idx], |
2286 | (unsigned long) ch, 0xff, 0); | 2286 | (unsigned long) ch, 0xff, 0); |
2287 | spin_unlock_irqrestore(get_ccwdev_lock(ch->cdev), saveflags); | 2287 | spin_unlock_irqrestore(get_ccwdev_lock(ch->cdev), saveflags); |
diff --git a/drivers/s390/net/netiucv.c b/drivers/s390/net/netiucv.c index 3d28e1a5bf79..268889474339 100644 --- a/drivers/s390/net/netiucv.c +++ b/drivers/s390/net/netiucv.c | |||
@@ -753,7 +753,7 @@ static void conn_action_txdone(fsm_instance *fi, int event, void *arg) | |||
753 | 753 | ||
754 | header.next = 0; | 754 | header.next = 0; |
755 | memcpy(skb_put(conn->tx_buff, NETIUCV_HDRLEN), &header, NETIUCV_HDRLEN); | 755 | memcpy(skb_put(conn->tx_buff, NETIUCV_HDRLEN), &header, NETIUCV_HDRLEN); |
756 | conn->prof.send_stamp = xtime; | 756 | conn->prof.send_stamp = current_kernel_time(); |
757 | txmsg.class = 0; | 757 | txmsg.class = 0; |
758 | txmsg.tag = 0; | 758 | txmsg.tag = 0; |
759 | rc = iucv_message_send(conn->path, &txmsg, 0, 0, | 759 | rc = iucv_message_send(conn->path, &txmsg, 0, 0, |
@@ -1185,7 +1185,7 @@ static int netiucv_transmit_skb(struct iucv_connection *conn, | |||
1185 | memcpy(skb_put(nskb, NETIUCV_HDRLEN), &header, NETIUCV_HDRLEN); | 1185 | memcpy(skb_put(nskb, NETIUCV_HDRLEN), &header, NETIUCV_HDRLEN); |
1186 | 1186 | ||
1187 | fsm_newstate(conn->fsm, CONN_STATE_TX); | 1187 | fsm_newstate(conn->fsm, CONN_STATE_TX); |
1188 | conn->prof.send_stamp = xtime; | 1188 | conn->prof.send_stamp = current_kernel_time(); |
1189 | 1189 | ||
1190 | msg.tag = 1; | 1190 | msg.tag = 1; |
1191 | msg.class = 0; | 1191 | msg.class = 0; |