Date: Sat, 08 Nov 2008 11:08:02 -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: (FWD) Serious busdma bug in -current in relation to USB harware. Message-ID: <61594882-04B6-4DC9-AE16-FD3F0638EDCC@mac.com> In-Reply-To: <200811081353.09697.hselasky@c2i.net> References: <20081107082740.GA1334@icarus.home.lan> <20081108001128.GA1437@icarus.home.lan> <200811081023.10058.hselasky@freebsd.org> <200811081353.09697.hselasky@c2i.net>
next in thread | previous in thread | raw e-mail | index | archive | help
On Nov 8, 2008, at 4:53 AM, Hans Petter Selasky wrote: > On Saturday 08 November 2008, Alexander Motin wrote: >> Hans Petter Selasky wrote: >>> http://perforce.freebsd.org/chv.cgi?CH=152649 >>> >>> Change 152649 by hselasky@hselasky_laptop001 on 2008/11/08 09:09:50 >>> >>> >>> Fix a serious BUSDMA bug: The initial virtual page offset is >>> not retained on the bounce pages, which is what the EHCI and >>> the OHCI expects. >> >> I'm sorry, but are you sure with this? If bounce page will have the >> same >> page offset as original data, then how bus_dma_tag_create()'s >> alignment >> parameter expected to work? What if data are misaligned, but hardware >> require alignment? > > Hi, > > I'm not saying that my patch is fully correct for all cases, but at > least it > solves the USB case. USB uses an alignment of 1-byte for data. Another way to look at it is that USB (at least EHCI) uses page-aligned data and that for the first descriptor you can optionally add an offset within the page. Effectively this gives you 1-byte alignment, but it comes with the restriction that on crossing the page boundary, all data comes from offset 0 on subsequent pages. -- Marcel Moolenaar xcllnt@mac.com
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?61594882-04B6-4DC9-AE16-FD3F0638EDCC>