Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 26 Feb 2003 13:46:33 +0100
From:      Thomas Moestl <tmoestl@gmx.net>
To:        Maxime Henrion <mux@FreeBSD.org>
Cc:        src-committers@FreeBSD.org, cvs-src@FreeBSD.org, cvs-all@FreeBSD.org
Subject:   Re: cvs commit: src/sys/alpha/alpha busdma_machdep.c src/sys/alpha/include bus.h src/sys/i386/i386 busdma_machdep.c src/sys/i386/include bus_at386.h bus_pc98.h src/sys/ia64/ia64 busdma_machdep.c src/sys/ia64/include bus.h src/sys/powerpc/include bus.h ...
Message-ID:  <20030226124632.GA631@crow.dom2ip.de>
In-Reply-To: <200302260216.h1Q2G6UK033030@repoman.freebsd.org>
References:  <200302260216.h1Q2G6UK033030@repoman.freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On Tue, 2003/02/25 at 18:16:06 -0800, Maxime Henrion wrote:
> mux         2003/02/25 18:16:06 PST
> 
>   Modified files:
>     sys/alpha/alpha      busdma_machdep.c 
>     sys/alpha/include    bus.h 
>     sys/i386/i386        busdma_machdep.c 
>     sys/i386/include     bus_at386.h bus_pc98.h 
>     sys/ia64/ia64        busdma_machdep.c 
>     sys/ia64/include     bus.h 
>     sys/powerpc/include  bus.h 
>     sys/sparc64/include  bus.h 
>   Log:
>   Correctly set BUS_SPACE_MAXSIZE in all the busdma backends.
>   It was bogusly set to 64 * 1024 or 128 * 1024 because it was
>   bogusly reused in the BUS_DMAMAP_NSEGS definition.

Hmmm, I think that this was quite useful, since it gave the size
the backend is guaranteed to be able to handle (as the comments
besides the definitions noted), although being a bit of a misnomer. 

Users of the busdma interface should use realistic sizes and for the
maxsize argument to bus_dma_tag_create(), since tag creation can in
fact result in bounce buffer allocation (or e.g. DVMA allocation), so
excessive sizes  will just suck up resources, and this constant was a
useful hint (while the new one might be used for maxsegsz like the
old one could be too, but should not be for maxsize).

While some implementations did not stricly enforce that limit in the
non-__GNUC__ case, it was still mostly correct, as it is arbitrary
except for the stack space and bounce buffer usage in some places in
those busdma implementations; if we can tolerate memory usage there 
BUS_SPACE_MAXSIZE could as well have been increased.

This change also breaks the sparc64 IOMMU code, which relied on the
old semantics for it's preallocation clamping code.

	- Thomas

-- 
Thomas Moestl <tmoestl@gmx.net>	http://www.tu-bs.de/~y0015675/
              <tmm@FreeBSD.org>	http://people.FreeBSD.org/~tmm/
PGP fingerprint: 1C97 A604 2BD0 E492 51D0  9C0F 1FE6 4F1D 419C 776C

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe cvs-all" in the body of the message




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