From owner-freebsd-current@FreeBSD.ORG Sat Jan 29 20:13:18 2005 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 EC48C16A4CE for ; Sat, 29 Jan 2005 20:13:18 +0000 (GMT) Received: from carver.gumbysoft.com (carver.gumbysoft.com [66.220.23.50]) by mx1.FreeBSD.org (Postfix) with ESMTP id C04C543D53 for ; Sat, 29 Jan 2005 20:13:18 +0000 (GMT) (envelope-from dwhite@gumbysoft.com) Received: by carver.gumbysoft.com (Postfix, from userid 1000) id A6E5072DD4; Sat, 29 Jan 2005 12:13:18 -0800 (PST) Received: from localhost (localhost [127.0.0.1]) by carver.gumbysoft.com (Postfix) with ESMTP id A277D72DCB; Sat, 29 Jan 2005 12:13:18 -0800 (PST) Date: Sat, 29 Jan 2005 12:13:18 -0800 (PST) From: Doug White To: Petr Lampa In-Reply-To: <20050128100151.GA43728@fit.vutbr.cz> Message-ID: <20050129121051.X85926@carver.gumbysoft.com> References: <20050128100151.GA43728@fit.vutbr.cz> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII cc: freebsd-current@freebsd.org cc: vkashyap@amcc.com Subject: Re: bus_dmamap_create() breakage (alias 3Ware driver problems) X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 29 Jan 2005 20:13:19 -0000 Hello Petr, Thanks for the analysis on this. On Fri, 28 Jan 2005, Petr Lampa wrote: > > I have got similar problems with the new 3Ware driver like others, > but on the second controller. After some debugging and playing with > bus_dma_tag_create() etc. arguments (new driver is using 3 busdma_tags > instead 1 in old driver), I have located source of failure > in bus_dmamap_create(). Here is the trouble spot: > > $FreeBSD: src/sys/i386/i386/busdma_machdep.c,v 1.59.2.3 2004/12/04 05: > 55:10 scottl Exp $ > > bus_dmamap_create(bus_dma_tag_t dmat, int flags, bus_dmamap_t *mapp) > { > ... > maxpages = MIN(MAX_BPAGES, Maxmem - atop(dmat->lowaddr)); > if ((dmat->flags & BUS_DMA_MIN_ALLOC_COMP) == 0 > || (dmat->map_count > 0 && total_bpages < maxpages)) { > int pages; > ... > pages = MAX(atop(dmat->maxsize), 1); > > At this location maxpages=512, total_bpages=513, dmat->maxsize=131072, pages=32 > > pages = MIN(maxpages - total_bpages, pages); > > Here pages=-1! Ooh, thats not so good. Could you bundle up your changes into a patch? Its a lot easier to follow and compare your changes, as well as test :) Also, can you please submit a PR with the patch so it doesn't get lost? scottl is out for the weekend but I'll bring this to his attention when he returns. Thanks! -- Doug White | FreeBSD: The Power to Serve dwhite@gumbysoft.com | www.FreeBSD.org