aboutsummaryrefslogtreecommitdiffstats
path: root/kernel
diff options
context:
space:
mode:
authorDavid Woodhouse <dwmw2@infradead.org>2007-07-04 20:24:57 -0400
committerDavid Woodhouse <dwmw2@infradead.org>2007-07-04 20:24:57 -0400
commit9c5ef0fbfa0b0be219290b05a39135b957479251 (patch)
treedeacd1ff7238ed0faf6a5d90f816e3135774b63d /kernel
parent8f1a866fc6831f13593fae6194e3150d45976628 (diff)
parent190045d53b9a8341e8600d6eb468b6081e903afb (diff)
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6
Diffstat (limited to 'kernel')
-rw-r--r--kernel/power/main.c6
-rw-r--r--kernel/relay.c11
-rw-r--r--kernel/time/ntp.c2
3 files changed, 14 insertions, 5 deletions
diff --git a/kernel/power/main.c b/kernel/power/main.c
index 8812985f3029..fc45ed22620f 100644
--- a/kernel/power/main.c
+++ b/kernel/power/main.c
@@ -15,7 +15,6 @@
15#include <linux/delay.h> 15#include <linux/delay.h>
16#include <linux/errno.h> 16#include <linux/errno.h>
17#include <linux/init.h> 17#include <linux/init.h>
18#include <linux/pm.h>
19#include <linux/console.h> 18#include <linux/console.h>
20#include <linux/cpu.h> 19#include <linux/cpu.h>
21#include <linux/resume-trace.h> 20#include <linux/resume-trace.h>
@@ -97,6 +96,11 @@ static int suspend_prepare(suspend_state_t state)
97 } 96 }
98 } 97 }
99 98
99 if (pm_ops->set_target) {
100 error = pm_ops->set_target(state);
101 if (error)
102 goto Thaw;
103 }
100 suspend_console(); 104 suspend_console();
101 error = device_suspend(PMSG_SUSPEND); 105 error = device_suspend(PMSG_SUSPEND);
102 if (error) { 106 if (error) {
diff --git a/kernel/relay.c b/kernel/relay.c
index 4311101b0ca7..95db8c79fe8f 100644
--- a/kernel/relay.c
+++ b/kernel/relay.c
@@ -812,7 +812,10 @@ static void relay_file_read_consume(struct rchan_buf *buf,
812 } 812 }
813 813
814 buf->bytes_consumed += bytes_consumed; 814 buf->bytes_consumed += bytes_consumed;
815 read_subbuf = read_pos / buf->chan->subbuf_size; 815 if (!read_pos)
816 read_subbuf = buf->subbufs_consumed % n_subbufs;
817 else
818 read_subbuf = read_pos / buf->chan->subbuf_size;
816 if (buf->bytes_consumed + buf->padding[read_subbuf] == subbuf_size) { 819 if (buf->bytes_consumed + buf->padding[read_subbuf] == subbuf_size) {
817 if ((read_subbuf == buf->subbufs_produced % n_subbufs) && 820 if ((read_subbuf == buf->subbufs_produced % n_subbufs) &&
818 (buf->offset == subbuf_size)) 821 (buf->offset == subbuf_size))
@@ -841,8 +844,9 @@ static int relay_file_read_avail(struct rchan_buf *buf, size_t read_pos)
841 } 844 }
842 845
843 if (unlikely(produced - consumed >= n_subbufs)) { 846 if (unlikely(produced - consumed >= n_subbufs)) {
844 consumed = (produced / n_subbufs) * n_subbufs; 847 consumed = produced - n_subbufs + 1;
845 buf->subbufs_consumed = consumed; 848 buf->subbufs_consumed = consumed;
849 buf->bytes_consumed = 0;
846 } 850 }
847 851
848 produced = (produced % n_subbufs) * subbuf_size + buf->offset; 852 produced = (produced % n_subbufs) * subbuf_size + buf->offset;
@@ -899,7 +903,10 @@ static size_t relay_file_read_start_pos(size_t read_pos,
899 size_t read_subbuf, padding, padding_start, padding_end; 903 size_t read_subbuf, padding, padding_start, padding_end;
900 size_t subbuf_size = buf->chan->subbuf_size; 904 size_t subbuf_size = buf->chan->subbuf_size;
901 size_t n_subbufs = buf->chan->n_subbufs; 905 size_t n_subbufs = buf->chan->n_subbufs;
906 size_t consumed = buf->subbufs_consumed % n_subbufs;
902 907
908 if (!read_pos)
909 read_pos = consumed * subbuf_size + buf->bytes_consumed;
903 read_subbuf = read_pos / subbuf_size; 910 read_subbuf = read_pos / subbuf_size;
904 padding = buf->padding[read_subbuf]; 911 padding = buf->padding[read_subbuf];
905 padding_start = (read_subbuf + 1) * subbuf_size - padding; 912 padding_start = (read_subbuf + 1) * subbuf_size - padding;
diff --git a/kernel/time/ntp.c b/kernel/time/ntp.c
index 87aa5ff931e0..cf53bb5814cb 100644
--- a/kernel/time/ntp.c
+++ b/kernel/time/ntp.c
@@ -122,7 +122,6 @@ void second_overflow(void)
122 */ 122 */
123 time_interpolator_update(-NSEC_PER_SEC); 123 time_interpolator_update(-NSEC_PER_SEC);
124 time_state = TIME_OOP; 124 time_state = TIME_OOP;
125 clock_was_set();
126 printk(KERN_NOTICE "Clock: inserting leap second " 125 printk(KERN_NOTICE "Clock: inserting leap second "
127 "23:59:60 UTC\n"); 126 "23:59:60 UTC\n");
128 } 127 }
@@ -137,7 +136,6 @@ void second_overflow(void)
137 */ 136 */
138 time_interpolator_update(NSEC_PER_SEC); 137 time_interpolator_update(NSEC_PER_SEC);
139 time_state = TIME_WAIT; 138 time_state = TIME_WAIT;
140 clock_was_set();
141 printk(KERN_NOTICE "Clock: deleting leap second " 139 printk(KERN_NOTICE "Clock: deleting leap second "
142 "23:59:59 UTC\n"); 140 "23:59:59 UTC\n");
143 } 141 }