From owner-freebsd-current@FreeBSD.ORG Tue Jul 29 02:11:33 2003 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 934FE37B401 for ; Tue, 29 Jul 2003 02:11:33 -0700 (PDT) Received: from peedub.jennejohn.org (p213.54.197.248.tisdip.tiscali.de [213.54.197.248]) by mx1.FreeBSD.org (Postfix) with ESMTP id B41C443F93 for ; Tue, 29 Jul 2003 02:11:30 -0700 (PDT) (envelope-from garyj@jennejohn.org) Received: from peedub.jennejohn.org (localhost [127.0.0.1]) by peedub.jennejohn.org (8.12.9/8.11.6) with ESMTP id h6T9B9F9001565; Tue, 29 Jul 2003 11:11:10 +0200 (CEST) (envelope-from garyj@peedub.jennejohn.org) Message-Id: <200307290911.h6T9B9F9001565@peedub.jennejohn.org> X-Mailer: exmh version 2.6.3 04/04/2003 with nmh-1.0.4 To: John-Mark Gurney In-reply-to: Your message of "Mon, 28 Jul 2003 12:52:01 PDT." <20030728195201.GT10708@funkthat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Tue, 29 Jul 2003 11:11:09 +0200 From: Gary Jennejohn cc: freebsd-current@freebsd.org cc: Mark Blackman cc: Lukas Ertl Subject: Re: device driver memory leak in 5.1-20030726? X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: Gary Jennejohn List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 29 Jul 2003 09:11:33 -0000 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