cvs commit: src/sys/alpha/alpha busdma_machdep.c src/sys/i386/i386 busdma_machdep.c src/sys/ia64/ia64 busdma_machdep.c src/sys/powerpc/powerpc busdma_machdep.c

Justin T. Gibbs gibbs at scsiguy.com
Fri Jun 27 22:21:41 PDT 2003


>>> @@ -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
>> 
> 
> Yes, calling with a NULL mutex would be allowed and would behave as
> expected.

Does this code run without giant?  If not, shouldn't it be dropping giant
upon calling what should be an MP safe client?  If so, doesn't it need
to pick up giant in for the non-MP safe clients?

--
Justin



More information about the cvs-src mailing list