]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
Fix a race between clock_intr() and tick_ticker() when updating
authorNeel Natu <neel@FreeBSD.org>
Thu, 5 Aug 2010 04:59:54 +0000 (04:59 +0000)
committerNeel Natu <neel@FreeBSD.org>
Thu, 5 Aug 2010 04:59:54 +0000 (04:59 +0000)
commitf49fde7faf062469b63209e4e33858119e0ecf35
treeca9890e2ed549337f4fc588e892e0e216b9b9f95
parent01e14bff35320d489c4647b89b4961433ba2e9e4
Fix a race between clock_intr() and tick_ticker() when updating
'counter_upper' and 'counter_lower_last'. The race exists because
interrupts are enabled even though tick_ticker() executes in a
critical section.

Fix a bug in clock_intr() in how it updates the cached values of
'counter_upper' and 'counter_lower_last'. They are updated only
when the COUNT register rolls over. More interestingly it will *never*
update the cached values if 'counter_lower_last' happens to be zero.

Get rid of superfluous critical section in clock_intr(). There is no
reason to do this because clock_intr() executes in hard interrupt
context.

Switch back to using 'tick_ticker()' as the cpu ticker for Sibyte.

Reviewed by: jmallett, mav
sys/mips/mips/tick.c
sys/mips/sibyte/sb_machdep.c