Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge branch 'timers-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip

Pull timer fix from Ingo Molnar:
"One more timekeeping fix for v3.6"

* 'timers-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
time: Fix timeekeping_get_ns overflow on 32bit systems

+12 -7
+12 -7
kernel/time/timekeeping.c
··· 303 303 seq = read_seqbegin(&tk->lock); 304 304 305 305 ts->tv_sec = tk->xtime_sec; 306 - ts->tv_nsec = timekeeping_get_ns(tk); 306 + nsecs = timekeeping_get_ns(tk); 307 307 308 308 } while (read_seqretry(&tk->lock, seq)); 309 309 310 + ts->tv_nsec = 0; 310 311 timespec_add_ns(ts, nsecs); 311 312 } 312 313 EXPORT_SYMBOL(getnstimeofday); ··· 346 345 { 347 346 struct timekeeper *tk = &timekeeper; 348 347 struct timespec tomono; 348 + s64 nsec; 349 349 unsigned int seq; 350 350 351 351 WARN_ON(timekeeping_suspended); ··· 354 352 do { 355 353 seq = read_seqbegin(&tk->lock); 356 354 ts->tv_sec = tk->xtime_sec; 357 - ts->tv_nsec = timekeeping_get_ns(tk); 355 + nsec = timekeeping_get_ns(tk); 358 356 tomono = tk->wall_to_monotonic; 359 357 360 358 } while (read_seqretry(&tk->lock, seq)); 361 359 362 - set_normalized_timespec(ts, ts->tv_sec + tomono.tv_sec, 363 - ts->tv_nsec + tomono.tv_nsec); 360 + ts->tv_sec += tomono.tv_sec; 361 + ts->tv_nsec = 0; 362 + timespec_add_ns(ts, nsec + tomono.tv_nsec); 364 363 } 365 364 EXPORT_SYMBOL_GPL(ktime_get_ts); 366 365 ··· 1247 1244 { 1248 1245 struct timekeeper *tk = &timekeeper; 1249 1246 struct timespec tomono, sleep; 1247 + s64 nsec; 1250 1248 unsigned int seq; 1251 1249 1252 1250 WARN_ON(timekeeping_suspended); ··· 1255 1251 do { 1256 1252 seq = read_seqbegin(&tk->lock); 1257 1253 ts->tv_sec = tk->xtime_sec; 1258 - ts->tv_nsec = timekeeping_get_ns(tk); 1254 + nsec = timekeeping_get_ns(tk); 1259 1255 tomono = tk->wall_to_monotonic; 1260 1256 sleep = tk->total_sleep_time; 1261 1257 1262 1258 } while (read_seqretry(&tk->lock, seq)); 1263 1259 1264 - set_normalized_timespec(ts, ts->tv_sec + tomono.tv_sec + sleep.tv_sec, 1265 - ts->tv_nsec + tomono.tv_nsec + sleep.tv_nsec); 1260 + ts->tv_sec += tomono.tv_sec + sleep.tv_sec; 1261 + ts->tv_nsec = 0; 1262 + timespec_add_ns(ts, nsec + tomono.tv_nsec + sleep.tv_nsec); 1266 1263 } 1267 1264 EXPORT_SYMBOL_GPL(get_monotonic_boottime); 1268 1265