Subject: Re: CVS commit: src/sys/kern
To: None <simonb@NetBSD.org>
From: Izumi Tsutsui <tsutsui@ceres.dti.ne.jp>
List: source-changes
Date: 09/09/2006 20:39:09
simonb@NetBSD.org wrote:

> Module Name:	src
> Committed By:	simonb
> Date:		Thu Sep  7 15:48:14 UTC 2006
> 
> Modified Files:
> 	src/sys/kern: kern_tc.c
> 
> Log Message:
> Guard the timecounter manipulations including the call to tc_windup()
> in tc_init() with splclock().  Fixes doubled-up "selected timecounter"
> messages on some architectures, including pc532 and cobalt.
> 
> Fix suggested by Frank Kardel.

splclock()/splx() unmatch?

Index: kern_tc.c
===================================================================
RCS file: /cvsroot/src/sys/kern/kern_tc.c,v
retrieving revision 1.11
diff -u -r1.11 kern_tc.c
--- kern_tc.c	7 Sep 2006 15:48:14 -0000	1.11
+++ kern_tc.c	9 Sep 2006 11:34:27 -0000
@@ -455,17 +455,18 @@
 	 * worse since this timecounter may not be monotonous.
 	 */
 	if (tc->tc_quality < 0)
-		return;
+		goto out;
 	if (tc->tc_quality < timecounter->tc_quality)
-		return;
+		goto out;
 	if (tc->tc_quality == timecounter->tc_quality &&
 	    tc->tc_frequency < timecounter->tc_frequency)
-		return;
+		goto out;
 	(void)tc->tc_get_timecount(tc);
 	(void)tc->tc_get_timecount(tc);
 	timecounter = tc;
 	tc_windup();
 
+ out:
 	splx(s);
 }
 
---
Izumi Tsutsui