Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 29 Jul 2003 11:11:09 +0200
From:      Gary Jennejohn <garyj@jennejohn.org>
To:        John-Mark Gurney <gurney_j@efn.org>
Cc:        Lukas Ertl <l.ertl@univie.ac.at>
Subject:   Re: device driver memory leak in 5.1-20030726? 
Message-ID:  <200307290911.h6T9B9F9001565@peedub.jennejohn.org>
In-Reply-To: Your message of "Mon, 28 Jul 2003 12:52:01 PDT." <20030728195201.GT10708@funkthat.com> 

next in thread | previous in thread | raw e-mail | index | archive | help
John-Mark Gurney writes:
> Gary Jennejohn wrote this message on Mon, Jul 28, 2003 at 12:58 +0200:
> > It appears to me that the test in usb_block_allocmem() should be
> > (p->tag->parent == tag || p->tag->parent == tag->parent) and NOT
> > p->tag == tag! That's because bus_dma_tag_create() uses the tag
> > passed into usb_block_allocmem() as newtag->parent!
> > 
> > Unfortunately, bus_dma_tag is an opaque type and there's no way to
> > access the parent member anywhere but in the MD busdma_machdep.c :-(
> > 
> > Anyway, as written there's no way that I can see that the code can
> > work correctly.
> 
> You miss the code in the XXX bit that overrides the tag with the tag
> passed in.  If we allocate a fullblock, the tag doesn't need to be
> overwriten since we end up freeing it, but in the fragment case, we
> override the tag, and we don't need to keep the tag allocated by
> usb_block_allocmem since we never end up freeing the block that is
> part of the fragments.
> 
> The bug fixed in rev1.2 was because of a difference in how NetBSD/OpenBSD
> handles things.  We wouldn't need this if we had a size parameter to
> bus_dmamem_alloc.
> 
> Please reread the code and see what I mean.
> 

OK. The questions still remains why it isn't working, or have you
figured that out? Obviously, I don't understand it ;-)

---
Gary Jennejohn / garyj[at]jennejohn.org gj[at]freebsd.org gj[at]denx.de



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