Re: [Serious] busdma bug in -current in relation to USB hardware - review wanted

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: M. Warner Losh
Date: Monday, November 17, 2008 - 8:51 am

In message: <200811161408.21562.hselasky@c2i.net>
            Hans Petter Selasky <hselasky@c2i.net> writes:
: 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 */
: 
: 
: 
: Without this new feature in busdma the USB hardware will not work when the DMA 
: data is placed on bounce pages, for example on 64-bit architectures with more 
: than 4GB of RAM.

I'm having trouble understanding the need for this patch.  Can you
provide a patch to usb2 to use it as well as doing one of the
implementations (say i386 or amd64) so that it is easier to judge the
problem it is trying to solve?

Warner
_______________________________________________
freebsd-current@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to "freebsd-current-unsubscribe@freebsd.org"
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
Kernel panic when copying data to umass device (USB4BSD), Jeremy Chadwick, (Fri Nov 7, 1:27 am)
Re: Kernel panic when copying data to umass device (USB4BSD), Hans Petter Selasky, (Fri Nov 7, 9:07 am)
Re: Kernel panic when copying data to umass device (USB4BS ..., Hans Petter Selasky, (Fri Nov 7, 10:11 am)
Re: Kernel panic when copying data to umass device (USB4BS ..., Hans Petter Selasky, (Fri Nov 7, 2:23 pm)
Serious busdma bug in -current in relation to USB harware., Hans Petter Selasky, (Sat Nov 8, 2:23 am)
Re: (FWD) Serious busdma bug in -current in relation to US ..., Hans Petter Selasky, (Sat Nov 8, 5:53 am)
Re: (FWD) Serious busdma bug in -current in relation to US ..., Hans Petter Selasky, (Sat Nov 8, 9:27 am)
Re: [Serious] busdma bug in -current in relation to USB ha ..., Hans Petter Selasky, (Sun Nov 16, 6:08 am)
Re: [Serious] busdma bug in -current in relation to USB ha ..., Marcel Moolenaar, (Sun Nov 16, 12:12 pm)
Re: [Serious] busdma bug in -current in relation to USB ha ..., M. Warner Losh, (Mon Nov 17, 8:51 am)
Re: [Serious] busdma bug in -current in relation to USB ha ..., Hans Petter Selasky, (Sat Dec 6, 5:34 am)
Re: [Serious] busdma bug in -current in relation to USB ha ..., Hans Petter Selasky, (Sun Dec 7, 2:25 am)