From owner-p4-projects@FreeBSD.ORG Sat Nov 8 12:57:05 2008 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 0E47A1065677; Sat, 8 Nov 2008 12:57:05 +0000 (UTC) Delivered-To: perforce@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C59EB1065672 for ; Sat, 8 Nov 2008 12:57:04 +0000 (UTC) (envelope-from hselasky@freebsd.org) Received: from swip.net (mailfe04.swip.net [212.247.154.97]) by mx1.freebsd.org (Postfix) with ESMTP id 5B90E8FC0C for ; Sat, 8 Nov 2008 12:57:04 +0000 (UTC) (envelope-from hselasky@freebsd.org) X-Cloudmark-Score: 0.000000 [] X-Cloudmark-Analysis: v=1.0 c=1 a=K2GdiJWsnm8A:10 a=d6BVkb5LuPPVEe4iNQMLyA==:17 a=6I5d2MoRAAAA:8 a=Q6FdbtdLWJ1XLro0mNoA:9 a=3deygIMvzRsQO47dDqCaJQGasdEA:4 a=LY0hPdMaydYA:10 Received: from [62.113.135.6] (account mc467741@c2i.net [62.113.135.6] verified) by mailfe04.swip.net (CommuniGate Pro SMTP 5.2.6) with ESMTPA id 1144457821; Sat, 08 Nov 2008 12:57:01 +0100 From: Hans Petter Selasky To: Alexander Motin Date: Sat, 8 Nov 2008 12:59:05 +0100 User-Agent: KMail/1.9.7 References: <200811080910.mA89AgTZ048172@repoman.freebsd.org> <49156A0B.4030506@FreeBSD.org> In-Reply-To: <49156A0B.4030506@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset="koi8-r" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200811081259.08838.hselasky@freebsd.org> Cc: Perforce Change Reviews Subject: Re: PERFORCE change 152649 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 08 Nov 2008 12:57:05 -0000 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. Probably someone needs to sit down a think this through. Like it is now, it is very scary with regard to USB! Maybe it is time to create a new busdma tag flag? BUS_DMA_NOREALIGN? If this flag is set, busdma should refuse to load the memory if the memory is not aligned already to the given aligment in the DMA tag ? --HPS