Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 29 Jan 2005 12:13:18 -0800 (PST)
From:      Doug White <dwhite@gumbysoft.com>
To:        Petr Lampa <lampa@fit.vutbr.cz>
Cc:        vkashyap@amcc.com
Subject:   Re: bus_dmamap_create() breakage (alias 3Ware driver problems)
Message-ID:  <20050129121051.X85926@carver.gumbysoft.com>
In-Reply-To: <20050128100151.GA43728@fit.vutbr.cz>
References:  <20050128100151.GA43728@fit.vutbr.cz>

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



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