Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 16 Jan 2007 16:01:05 -0500
From:      John Baldwin <jhb@freebsd.org>
To:        Paolo Pisati <piso@freebsd.org>
Cc:        Perforce Change Reviews <perforce@freebsd.org>
Subject:   Re: PERFORCE change 112980 for review
Message-ID:  <200701161601.05588.jhb@freebsd.org>
In-Reply-To: <200701161011.l0GABmDf081094@repoman.freebsd.org>
References:  <200701161011.l0GABmDf081094@repoman.freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On Tuesday 16 January 2007 05:11, Paolo Pisati wrote:
> http://perforce.freebsd.org/chv.cgi?CH=112980
> 
> Change 112980 by piso@piso_newluxor on 2007/01/16 10:10:55
> 
> 	Move spin lock acquisition inside the interrupt scanning
> 	function.
> 	While here, fix spacing and indentation.

FYI, callout_init_mtx() doesn't work with spin mutexes.

> Affected files ...
> 
> .. //depot/projects/soc2006/intr_filter/ia64/ia64/interrupt.c#20 edit
> 
> Differences ...
> 
> ==== //depot/projects/soc2006/intr_filter/ia64/ia64/interrupt.c#20 (text+ko) 
====
> 
> @@ -273,7 +273,7 @@
>  {
>  
>  	mtx_init(&ia64_intrs_lock, "intr table", NULL, MTX_SPIN);
> -	callout_init_mtx(&stray_callout_handle, &ia64_intrs_lock, 0);
> +	callout_init(&stray_callout_handle, 1);
>  }
>  SYSINIT(ithds_init, SI_SUB_INTR, SI_ORDER_SECOND, ithds_init, NULL);
>  
> @@ -361,10 +361,13 @@
>  walk_intr_ia64(void) {
>  	struct ia64_intr *ia64_i;
>  	static int i = 0;
> +	int j;
>  
> -	for (; i < IA64_NUMI; ) {
> -		int j = i++;
> +	for (; i < IA64_NUMI;) {
> +		j = i++;
> +		mtx_lock_spin(&ia64_intrs_lock);
>  		ia64_i = ia64_intrs[j];
> +		mtx_unlock_spin(&ia64_intrs_lock);
>  		if (ia64_i != NULL && ia64_i->event != NULL)
>  			return (ia64_i->event);
>  	}
> @@ -374,12 +377,10 @@
>  
>  void
>  intr_callout_reset(void) 
> -{
> -	
> -	mtx_lock_spin(&ia64_intrs_lock);
> +{	
> +
>  	callout_reset(&stray_callout_handle, hz, 
> -		      &stray_detection, &walk_intr_ia64);
> -	mtx_unlock_spin(&ia64_intrs_lock);	
> +	    &stray_detection, &walk_intr_ia64);
>  }
>  
>  static void
> 

-- 
John Baldwin



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200701161601.05588.jhb>