linux/arch/powerpc
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
..
boot [POWERPC] Fix FEC node in 8540 ADS dts 2006-08-23 15:51:18 +10:00
configs [POWERPC] update {g5,iseries,pseries}_defconfigs 2006-08-17 16:41:10 +10:00
kernel [POWERPC] Fix gettimeofday inaccuracies 2006-08-23 15:51:18 +10:00
lib Remove obsolete #include <linux/config.h> 2006-06-30 19:25:36 +02:00
math-emu Remove obsolete #include <linux/config.h> 2006-06-30 19:25:36 +02:00
mm [POWERPC] Fix mem= handling when the memory limit is > RMO size 2006-07-26 01:28:24 +10:00
oprofile [PATCH] oprofile: Fix unnecessary cleverness 2006-06-26 09:58:17 -07:00
platforms [POWERPC] Rewrite the PPC 86xx IRQ handling to use Flat Device Tree 2006-08-23 15:51:18 +10:00
sysdev [POWERPC] Rewrite the PPC 86xx IRQ handling to use Flat Device Tree 2006-08-23 15:51:18 +10:00
xmon Remove obsolete #include <linux/config.h> 2006-06-30 19:25:36 +02:00
Kconfig [POWERPC] Offer PCI as a CONFIG choice for PPC_86xx. 2006-08-18 10:08:36 +10:00
Kconfig.debug [POWERPC] Add udbg support for RTAS console 2006-06-28 11:59:48 +10:00
Makefile [POWERPC] Remove stale 64bit on 32bit kernel code 2006-06-15 19:31:26 +10:00