Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 13 Dec 2010 07:47:52 -0500
From:      John Baldwin <jhb@freebsd.org>
To:        Andriy Gapon <avg@freebsd.org>
Cc:        svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org
Subject:   Re: svn commit: r216375 - head/sys/mips/rmi/dev/xlr
Message-ID:  <201012130747.52865.jhb@freebsd.org>
In-Reply-To: <201012111021.oBBALcrV004450@svn.freebsd.org>
References:  <201012111021.oBBALcrV004450@svn.freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On Saturday, December 11, 2010 5:21:38 am Andriy Gapon wrote:
> Author: avg
> Date: Sat Dec 11 10:21:38 2010
> New Revision: 216375
> URL: http://svn.freebsd.org/changeset/base/216375
> 
> Log:
>   fix atomic_set_xxx misuse in rge
>   
>   It seems that atomic_set_xxx and atomic_store_xxx were confused.
>   
>   Reviewed by:	jhb (general issue)
>   MFC after:	3 weeks
> 
> Modified:
>   head/sys/mips/rmi/dev/xlr/rge.c
> 
> Modified: head/sys/mips/rmi/dev/xlr/rge.c
> ==============================================================================
> --- head/sys/mips/rmi/dev/xlr/rge.c	Sat Dec 11 10:18:05 2010	(r216374)
> +++ head/sys/mips/rmi/dev/xlr/rge.c	Sat Dec 11 10:21:38 2010	(r216375)
> @@ -170,7 +170,7 @@ extern uint32_t cpu_ltop_map[32];
>  static int port_counters[4][8] __aligned(XLR_CACHELINE_SIZE);
>  
>  #define port_inc_counter(port, counter) 	atomic_add_int(&port_counters[port][(counter)], 1)
> -#define port_set_counter(port, counter, value) 	atomic_set_int(&port_counters[port][(counter)], (value))
> +#define port_set_counter(port, counter, value) 	atomic_store_int(&port_counters[port][(counter)], (value))
>  #else
>  #define port_inc_counter(port, counter)	/* Nothing */
>  #define port_set_counter(port, counter, value)	/* Nothing */
> @@ -2281,7 +2281,7 @@ rmi_xlr_mac_open(struct rge_softc *sc)
>  	mtx_unlock_spin(&priv->lock);
>  
>  	for (i = 0; i < 8; i++) {
> -		atomic_set_int(&(priv->frin_to_be_sent[i]), 0);
> +		atomic_store_int(&(priv->frin_to_be_sent[i]), 0);

Err, there is no such op for this.  If you don't need a memory barrier then a
simple assignment to 0 should suffice.

-- 
John Baldwin



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