Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 27 Jun 2003 09:13:35 -0700 (PDT)
From:      Nate Lawson <nate@root.org>
To:        Scott Long <scottl@FreeBSD.org>
Cc:        cvs-all@FreeBSD.org
Subject:   Re: cvs commit: src/sys/alpha/alpha busdma_machdep.csrc/sys/i386/i386 busdma_machdep.c src/sys/ia64/ia64 busdma_machdep.c         src/sys/powerpc/powerpc busdma_machdep.c
Message-ID:  <20030627091203.B76929@root.org>
In-Reply-To: <20030627083158.E946C37B4A6@hub.freebsd.org>
References:  <20030627083158.E946C37B4A6@hub.freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On Fri, 27 Jun 2003, Scott Long wrote:
>   Do the first and mostly mechanical step of adding mutex support to the
>   bus_dma async callback scheme.  Note that sparc64 does not seem to do
>   async callbacks.  Note that ia64 callbacks might not be MPSAFE at the
>   moment.  Note that powerpc doesn't seem to do async callbacks due to
>   the implementation being incomplete.
>
>   Reviewed by:    mostly silence on arch@
>
>   Revision  Changes    Path
>   1.39      +5 -0      src/sys/alpha/alpha/busdma_machdep.c
>   1.47      +5 -0      src/sys/i386/i386/busdma_machdep.c
>   1.25      +5 -0      src/sys/ia64/ia64/busdma_machdep.c
>   1.16      +1 -0      src/sys/powerpc/powerpc/busdma_machdep.c
>
> @@ -931,8 +932,12 @@
>  	while ((map = STAILQ_FIRST(&bounce_map_callbacklist)) != NULL) {
>  		STAILQ_REMOVE_HEAD(&bounce_map_callbacklist, links);
>  		mtx_unlock(&bounce_lock);
> +		if (map->callback_mtx != NULL)
> +			mtx_lock(map->callback_mtx);
>  		bus_dmamap_load(map->dmat, map, map->buf, map->buflen,
>  				map->callback, map->callback_arg, /*flags*/0);
> +		if (map->callback_mtx != NULL)
> +			mtx_unlock(map->callback_mtx);
>  		mtx_lock(&bounce_lock);
>  	}
>  	mtx_unlock(&bounce_lock);

Good to see you working on this area.  Why would callback_mtx be null?  If
it is null, is it safe to call the function without the lock held?

-Nate



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