Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 16 Nov 2008 11:12:10 -0800
From:      Marcel Moolenaar <xcllnt@mac.com>
To:        Hans Petter Selasky <hselasky@c2i.net>
Cc:        freebsd-current@freebsd.org, freebsd-usb@freebsd.org
Subject:   Re: [Serious] busdma bug in -current in relation to USB hardware - review wanted
Message-ID:  <B7285D6E-520D-48D2-9287-824976138846@mac.com>
In-Reply-To: <200811161408.21562.hselasky@c2i.net>
References:  <20081107082740.GA1334@icarus.home.lan> <20081108001128.GA1437@icarus.home.lan> <200811081023.10058.hselasky@freebsd.org> <200811161408.21562.hselasky@c2i.net>

next in thread | previous in thread | raw e-mail | index | archive | help

On Nov 16, 2008, at 5:08 AM, Hans Petter Selasky wrote:

> Hi,
>
> It turns out my initial patch need to be limited to the use-case  
> only. Before
> I start any real work, I want to know if anyone will object if I  
> implement
> the following new BUS_DMA flag into FreeBSD's busdma system?
>
> amd64/amd64/busdma_machdep.c
> i386/i386/busdma_machdep.c
> arm/arm/busdma_machdep.c
> ia64/ia64/busdma_machdep.c
> mips/mips/busdma_machdep.c
> powerpc/powerpc/busdma_machdep.c
> sparc64/sparc64/bus_machdep.c
> sun4v/sun4v/bus_machdep.c
> sys/bus_dma.h
>
> /*
> * The following flag specifies that no re-alignment of individual
> * memory pages is allowed when loaded into DMA. It can only be used
> * when "maxsegsz" is equal to "PAGE_SIZE" and "alignment" is less
> * than or equal to 1.
> *
> * Background: Some kinds of DMA hardware only stores the full
> * physical address of the first memory page when multiple memory
> * pages are loaded into DMA. Consequtive memory pages only gets the
> * non-offset part of the physical address updated. The hardware
> * computes the amount of data that should be stored in the first
> * memory page from the minimum of the total transfer length and
> * PAGE_SIZE minus the initial page offset. When the initial page
> * offset is not preserved the hardware ends up transferring an
> * invalid number of bytes to or from the initial memory page.
> */
> #define	BUS_DMA_NOREAL		0x400	/* no page re-alignment allowed */

No objection, but please call it
	BUS_DMA_NOREALIGN

NOREAL reads as NO-REAL and not as NO-RE-AL. And with
real addressing an existing concept, confusion is not
far around the corner...

-- 
Marcel Moolenaar
xcllnt@mac.com






Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?B7285D6E-520D-48D2-9287-824976138846>