aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--arch/frv/Kconfig4
-rw-r--r--arch/frv/kernel/time.c81
-rw-r--r--fs/super.c1
-rw-r--r--include/asm-i386/Kbuild2
-rw-r--r--include/linux/atmdev.h2
-rw-r--r--include/linux/hrtimer.h1
-rw-r--r--include/linux/ktime.h7
-rw-r--r--kernel/panic.c2
-rw-r--r--kernel/power/Kconfig6
-rw-r--r--kernel/spinlock.c2
10 files changed, 21 insertions, 87 deletions
diff --git a/arch/frv/Kconfig b/arch/frv/Kconfig
index 95a3892b8d1b..a601a17cf568 100644
--- a/arch/frv/Kconfig
+++ b/arch/frv/Kconfig
@@ -29,6 +29,10 @@ config GENERIC_HARDIRQS
29 bool 29 bool
30 default n 30 default n
31 31
32config GENERIC_TIME
33 bool
34 default y
35
32config TIME_LOW_RES 36config TIME_LOW_RES
33 bool 37 bool
34 default y 38 default y
diff --git a/arch/frv/kernel/time.c b/arch/frv/kernel/time.c
index d5b64e193d92..68a77fe3bb40 100644
--- a/arch/frv/kernel/time.c
+++ b/arch/frv/kernel/time.c
@@ -32,8 +32,6 @@
32 32
33#define TICK_SIZE (tick_nsec / 1000) 33#define TICK_SIZE (tick_nsec / 1000)
34 34
35extern unsigned long wall_jiffies;
36
37unsigned long __nongprelbss __clkin_clock_speed_HZ; 35unsigned long __nongprelbss __clkin_clock_speed_HZ;
38unsigned long __nongprelbss __ext_bus_clock_speed_HZ; 36unsigned long __nongprelbss __ext_bus_clock_speed_HZ;
39unsigned long __nongprelbss __res_bus_clock_speed_HZ; 37unsigned long __nongprelbss __res_bus_clock_speed_HZ;
@@ -145,85 +143,6 @@ void time_init(void)
145} 143}
146 144
147/* 145/*
148 * This version of gettimeofday has near microsecond resolution.
149 */
150void do_gettimeofday(struct timeval *tv)
151{
152 unsigned long seq;
153 unsigned long usec, sec;
154 unsigned long max_ntp_tick;
155
156 do {
157 unsigned long lost;
158
159 seq = read_seqbegin(&xtime_lock);
160
161 usec = 0;
162 lost = jiffies - wall_jiffies;
163
164 /*
165 * If time_adjust is negative then NTP is slowing the clock
166 * so make sure not to go into next possible interval.
167 * Better to lose some accuracy than have time go backwards..
168 */
169 if (unlikely(time_adjust < 0)) {
170 max_ntp_tick = (USEC_PER_SEC / HZ) - tickadj;
171 usec = min(usec, max_ntp_tick);
172
173 if (lost)
174 usec += lost * max_ntp_tick;
175 }
176 else if (unlikely(lost))
177 usec += lost * (USEC_PER_SEC / HZ);
178
179 sec = xtime.tv_sec;
180 usec += (xtime.tv_nsec / 1000);
181 } while (read_seqretry(&xtime_lock, seq));
182
183 while (usec >= 1000000) {
184 usec -= 1000000;
185 sec++;
186 }
187
188 tv->tv_sec = sec;
189 tv->tv_usec = usec;
190}
191
192EXPORT_SYMBOL(do_gettimeofday);
193
194int do_settimeofday(struct timespec *tv)
195{
196 time_t wtm_sec, sec = tv->tv_sec;
197 long wtm_nsec, nsec = tv->tv_nsec;
198
199 if ((unsigned long)tv->tv_nsec >= NSEC_PER_SEC)
200 return -EINVAL;
201
202 write_seqlock_irq(&xtime_lock);
203 /*
204 * This is revolting. We need to set "xtime" correctly. However, the
205 * value in this location is the value at the most recent update of
206 * wall time. Discover what correction gettimeofday() would have
207 * made, and then undo it!
208 */
209 nsec -= 0 * NSEC_PER_USEC;
210 nsec -= (jiffies - wall_jiffies) * TICK_NSEC;
211
212 wtm_sec = wall_to_monotonic.tv_sec + (xtime.tv_sec - sec);
213 wtm_nsec = wall_to_monotonic.tv_nsec + (xtime.tv_nsec - nsec);
214
215 set_normalized_timespec(&xtime, sec, nsec);
216 set_normalized_timespec(&wall_to_monotonic, wtm_sec, wtm_nsec);
217
218 ntp_clear();
219 write_sequnlock_irq(&xtime_lock);
220 clock_was_set();
221 return 0;
222}
223
224EXPORT_SYMBOL(do_settimeofday);
225
226/*
227 * Scheduler clock - returns current time in nanosec units. 146 * Scheduler clock - returns current time in nanosec units.
228 */ 147 */
229unsigned long long sched_clock(void) 148unsigned long long sched_clock(void)
diff --git a/fs/super.c b/fs/super.c
index 6d4e8174b6db..5c4c94d5495e 100644
--- a/fs/super.c
+++ b/fs/super.c
@@ -49,6 +49,7 @@ DEFINE_SPINLOCK(sb_lock);
49 49
50/** 50/**
51 * alloc_super - create new superblock 51 * alloc_super - create new superblock
52 * @type: filesystem type superblock should belong to
52 * 53 *
53 * Allocates and initializes a new &struct super_block. alloc_super() 54 * Allocates and initializes a new &struct super_block. alloc_super()
54 * returns a pointer new superblock or %NULL if allocation had failed. 55 * returns a pointer new superblock or %NULL if allocation had failed.
diff --git a/include/asm-i386/Kbuild b/include/asm-i386/Kbuild
index c064a8e9170f..335b2fa4e066 100644
--- a/include/asm-i386/Kbuild
+++ b/include/asm-i386/Kbuild
@@ -1,5 +1,5 @@
1include include/asm-generic/Kbuild.asm 1include include/asm-generic/Kbuild.asm
2 2
3header-y += boot.h cpufeature.h debugreg.h ldt.h setup.h ucontext.h 3header-y += boot.h debugreg.h ldt.h setup.h ucontext.h
4 4
5unifdef-y += mtrr.h vm86.h 5unifdef-y += mtrr.h vm86.h
diff --git a/include/linux/atmdev.h b/include/linux/atmdev.h
index 41788a31c438..2096e5c72827 100644
--- a/include/linux/atmdev.h
+++ b/include/linux/atmdev.h
@@ -7,7 +7,6 @@
7#define LINUX_ATMDEV_H 7#define LINUX_ATMDEV_H
8 8
9 9
10#include <linux/device.h>
11#include <linux/atmapi.h> 10#include <linux/atmapi.h>
12#include <linux/atm.h> 11#include <linux/atm.h>
13#include <linux/atmioc.h> 12#include <linux/atmioc.h>
@@ -210,6 +209,7 @@ struct atm_cirange {
210 209
211#ifdef __KERNEL__ 210#ifdef __KERNEL__
212 211
212#include <linux/device.h>
213#include <linux/wait.h> /* wait_queue_head_t */ 213#include <linux/wait.h> /* wait_queue_head_t */
214#include <linux/time.h> /* struct timeval */ 214#include <linux/time.h> /* struct timeval */
215#include <linux/net.h> 215#include <linux/net.h>
diff --git a/include/linux/hrtimer.h b/include/linux/hrtimer.h
index e4bccbcc2750..4fc379de6c2f 100644
--- a/include/linux/hrtimer.h
+++ b/include/linux/hrtimer.h
@@ -80,6 +80,7 @@ struct hrtimer_sleeper {
80 * @get_softirq_time: function to retrieve the current time from the softirq 80 * @get_softirq_time: function to retrieve the current time from the softirq
81 * @curr_timer: the timer which is executing a callback right now 81 * @curr_timer: the timer which is executing a callback right now
82 * @softirq_time: the time when running the hrtimer queue in the softirq 82 * @softirq_time: the time when running the hrtimer queue in the softirq
83 * @lock_key: the lock_class_key for use with lockdep
83 */ 84 */
84struct hrtimer_base { 85struct hrtimer_base {
85 clockid_t index; 86 clockid_t index;
diff --git a/include/linux/ktime.h b/include/linux/ktime.h
index ed3396dcc4f7..84eeecd60a02 100644
--- a/include/linux/ktime.h
+++ b/include/linux/ktime.h
@@ -56,7 +56,8 @@ typedef union {
56#endif 56#endif
57} ktime_t; 57} ktime_t;
58 58
59#define KTIME_MAX (~((u64)1 << 63)) 59#define KTIME_MAX ((s64)~((u64)1 << 63))
60#define KTIME_SEC_MAX (KTIME_MAX / NSEC_PER_SEC)
60 61
61/* 62/*
62 * ktime_t definitions when using the 64-bit scalar representation: 63 * ktime_t definitions when using the 64-bit scalar representation:
@@ -73,6 +74,10 @@ typedef union {
73 */ 74 */
74static inline ktime_t ktime_set(const long secs, const unsigned long nsecs) 75static inline ktime_t ktime_set(const long secs, const unsigned long nsecs)
75{ 76{
77#if (BITS_PER_LONG == 64)
78 if (unlikely(secs >= KTIME_SEC_MAX))
79 return (ktime_t){ .tv64 = KTIME_MAX };
80#endif
76 return (ktime_t) { .tv64 = (s64)secs * NSEC_PER_SEC + (s64)nsecs }; 81 return (ktime_t) { .tv64 = (s64)secs * NSEC_PER_SEC + (s64)nsecs };
77} 82}
78 83
diff --git a/kernel/panic.c b/kernel/panic.c
index 9b8dcfd1ca93..8010b9b17aca 100644
--- a/kernel/panic.c
+++ b/kernel/panic.c
@@ -173,7 +173,7 @@ const char *print_tainted(void)
173 173
174void add_taint(unsigned flag) 174void add_taint(unsigned flag)
175{ 175{
176 debug_locks_off(); /* can't trust the integrity of the kernel anymore */ 176 debug_locks = 0; /* can't trust the integrity of the kernel anymore */
177 tainted |= flag; 177 tainted |= flag;
178} 178}
179EXPORT_SYMBOL(add_taint); 179EXPORT_SYMBOL(add_taint);
diff --git a/kernel/power/Kconfig b/kernel/power/Kconfig
index ae44a70aae8a..619ecabf7c58 100644
--- a/kernel/power/Kconfig
+++ b/kernel/power/Kconfig
@@ -56,7 +56,7 @@ config PM_TRACE
56 56
57config SOFTWARE_SUSPEND 57config SOFTWARE_SUSPEND
58 bool "Software Suspend" 58 bool "Software Suspend"
59 depends on PM && SWAP && (X86 && (!SMP || SUSPEND_SMP)) || ((FRV || PPC32) && !SMP) 59 depends on PM && SWAP && ((X86 && (!SMP || SUSPEND_SMP) && !X86_PAE) || ((FRV || PPC32) && !SMP))
60 ---help--- 60 ---help---
61 Enable the possibility of suspending the machine. 61 Enable the possibility of suspending the machine.
62 It doesn't need ACPI or APM. 62 It doesn't need ACPI or APM.
@@ -78,6 +78,10 @@ config SOFTWARE_SUSPEND
78 78
79 For more information take a look at <file:Documentation/power/swsusp.txt>. 79 For more information take a look at <file:Documentation/power/swsusp.txt>.
80 80
81 (For now, swsusp is incompatible with PAE aka HIGHMEM_64G on i386.
82 we need identity mapping for resume to work, and that is trivial
83 to get with 4MB pages, but less than trivial on PAE).
84
81config PM_STD_PARTITION 85config PM_STD_PARTITION
82 string "Default resume partition" 86 string "Default resume partition"
83 depends on SOFTWARE_SUSPEND 87 depends on SOFTWARE_SUSPEND
diff --git a/kernel/spinlock.c b/kernel/spinlock.c
index bfd6ad9c0330..fb524b009eef 100644
--- a/kernel/spinlock.c
+++ b/kernel/spinlock.c
@@ -72,7 +72,7 @@ EXPORT_SYMBOL(_write_trylock);
72 * not re-enabled during lock-acquire (which the preempt-spin-ops do): 72 * not re-enabled during lock-acquire (which the preempt-spin-ops do):
73 */ 73 */
74#if !defined(CONFIG_PREEMPT) || !defined(CONFIG_SMP) || \ 74#if !defined(CONFIG_PREEMPT) || !defined(CONFIG_SMP) || \
75 defined(CONFIG_PROVE_LOCKING) 75 defined(CONFIG_DEBUG_LOCK_ALLOC)
76 76
77void __lockfunc _read_lock(rwlock_t *lock) 77void __lockfunc _read_lock(rwlock_t *lock)
78{ 78{