Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 28 Aug 2012 19:22:57 -0700
From:      Adrian Chadd <adrian@freebsd.org>
To:        scottl@freebsd.org, freebsd-mips@freebsd.org
Subject:   MIPS busdma map questions
Message-ID:  <CAJ-VmomuwKKaQ6AszeDo-iQwL%2B8DPJpBB9av0K%2BVbaj2feHO7g@mail.gmail.com>

next in thread | raw e-mail | index | archive | help
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? :)

#2 - the ath(4) code (in sys/dev/ath/if_ath.c:ath_descdma_alloc_desc()
on -HEAD) does the following:

* creates a tag
* allocates a dmamap (bus_dmamap_create) - storing it in dd->dd_dmamap;
* allocates memory via bus_dmamem_alloc - also storing it in dd->dd_dmamap.

Now, I saw some NULL pointer derefernce going on when thigns failed to
load - and what I found was bus_dmamem_alloc() overwrites the dmat
pointer passed in (dd_dmamap above). So the dmamap allocated via
bus_dmamap_create() is just plain overwritten.

I'm guessing that when allocating memory via bus_dmamem_alloc(), the
call to bus_dmamap_create() (and the bus_dmamap_destroy()) isn't
needed.

Scott/mips people - what do you think?



Adrian



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAJ-VmomuwKKaQ6AszeDo-iQwL%2B8DPJpBB9av0K%2BVbaj2feHO7g>