kernel-hacking-2024-linux-s.../arch
Nathan Lynch 5db9fa9593 [POWERPC] Fix gettimeofday inaccuracies
There are two problems in the powerpc gettimeofday code which can
cause incorrect results to be returned.

The first is that there is a race between do_gettimeofday and the
timer interrupt:

1. do_gettimeofday does get_tb()

2. decrementer exception on boot cpu which runs timer_recalc_offset,
   which also samples the timebase and updates the do_gtod structure
   with a greater timebase value.

3. do_gettimeofday calls __do_gettimeofday, which leads to the
   negative result from tb_val - temp_varp->tb_orig_stamp.

The second is caused by taking the boot cpu offline, which can cause
the value of tb_last_jiffy to be increased past the currently
available timebase, causing the same underflow as above.

[paulus@samba.org - define and use data_barrier() instead of mb().]

Signed-off-by: Nathan Lynch <ntl@pobox.com>
Signed-off-by: Paul Mackerras <paulus@samba.org>
2006-08-23 15:51:18 +10:00
..
alpha [PATCH] arch/alpha: Use ARRAY_SIZE macro 2006-07-31 13:28:38 -07:00
arm [ARM] 3739/1: genirq updates: irq_chip, add and use irq_chip.name 2006-08-01 22:26:25 +01:00
arm26 [PATCH] tty: Remove include of screen_info.h from tty.h 2006-07-10 13:24:16 -07:00
cris [PATCH] pcf8563: remove MOD_INC_USE_COUNT, MOD_DEC_USE_COUNT 2006-07-10 13:24:22 -07:00
frv [PATCH] FRV: Introduce asm-offsets for FRV arch 2006-07-10 13:24:22 -07:00
h8300 [PATCH] irq-flags: H8300: Use the new IRQF_ constants 2006-07-02 13:58:47 -07:00
i386 [CPUFREQ] Propagate acpi_processor_preregister_performance return value. 2006-07-31 18:37:06 -04:00
ia64 [IA64] make uncached allocator more node aware 2006-08-04 10:27:27 -07:00
m32r [PATCH] tty: Remove include of screen_info.h from tty.h 2006-07-10 13:24:16 -07:00
m68k [PATCH] irq-flags: M68K: Use the new IRQF_ constants 2006-07-02 13:58:47 -07:00
m68knommu [PATCH] irq-flags: M68KNOMMU: Use the new IRQF_ constants 2006-07-02 13:58:47 -07:00
mips [MIPS] sparsemem: fix crash in show_mem 2006-07-13 21:26:22 +01:00
parisc [PATCH] vDSO hash-style fix 2006-07-31 13:28:43 -07:00
powerpc [POWERPC] Fix gettimeofday inaccuracies 2006-08-23 15:51:18 +10:00
ppc [PATCH] vDSO hash-style fix 2006-07-31 13:28:43 -07:00
s390 [PATCH] cpu hotplug: use hotplug version of registration in late inits 2006-07-31 13:28:39 -07:00
sh [PATCH] sh: fix proc file removal for superh store queue module 2006-08-06 08:57:48 -07:00
sh64 [PATCH] tty: Remove include of screen_info.h from tty.h 2006-07-10 13:24:16 -07:00
sparc [SPARC]: Defer clock_probe to fs_initcall() 2006-07-27 22:08:01 -07:00
sparc64 [SPARC64]: Explicitly print return PC when the kernel fault PC is bogus. 2006-07-24 22:33:58 -07:00
um [PATCH] vDSO hash-style fix 2006-07-31 13:28:43 -07:00
v850 [PATCH] v850: call init_page_count() instead of set_page_count() 2006-07-31 13:28:38 -07:00
x86_64 [PATCH] Fix more per-cpu typos 2006-08-06 08:57:47 -07:00
xtensa [PATCH] panic_on_oops: remove ssleep() 2006-07-31 13:28:39 -07:00