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
..
2006-06-28 15:18:55 +10:00
2006-01-09 14:49:54 +11:00
2005-09-28 15:42:53 +10:00
2006-04-29 16:15:57 +10:00
2006-02-15 15:32:22 -08:00
2006-06-30 18:20:44 +02:00
2006-06-15 19:31:26 +10:00
2006-07-03 15:27:00 -07:00
2006-06-30 18:20:44 +02:00
2006-06-21 15:01:29 +10:00
2005-10-31 13:37:12 +11:00
2005-11-03 16:24:25 +11:00
2006-06-29 16:58:06 -07:00
2005-11-03 16:02:23 +11:00
2006-03-25 09:41:40 -08:00
2006-06-21 15:01:32 +10:00
2006-04-29 18:07:54 +10:00
2005-11-01 14:36:55 +11:00
2006-06-28 15:18:56 +10:00
2005-11-03 16:59:17 +11:00