MIPS busdma map questions

Scott Long scott4long at yahoo.com
Wed Aug 29 05:01:46 UTC 2012



On Aug 28, 2012, at 9:43 PM, Adrian Chadd <adrian at freebsd.org> wrote:

> On 28 August 2012 20:24, Warner Losh <imp at bsdimp.com> wrote:
>> 
>> On Aug 28, 2012, at 8:22 PM, Adrian Chadd wrote:
>> 
>>> Hi,
>>> 
>>> I have a couple of busdma map questions.
>>> 
>>> #1 - in mips/mips/busdma_machdep.c, bus_dmamap_destroy() calls
>>> _busdma_free_dmamap() and -then- goes and walks the dma map list. Is
>>> this a good idea or not? :)
>> 
>> Accessing free memory after freeing it is a free ticket to a free dose of free pain.  It should be freed after the if that checks to see if it is in use.
> 
> Excellent! Who knows busdma better than I and can wade through what
> that code path is doing? :)
> 
> 
> 

There is no need to create a separate map for memory allocated via this way. It's a convenience thing.

Scott


More information about the freebsd-mips mailing list