From owner-p4-projects@FreeBSD.ORG Fri Nov 14 16:42:53 2008 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 8C0F4106568F; Fri, 14 Nov 2008 16:42:53 +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 4F3CF1065680 for ; Fri, 14 Nov 2008 16:42:53 +0000 (UTC) (envelope-from hselasky@c2i.net) Received: from swip.net (mailfe04.swip.net [212.247.154.97]) by mx1.freebsd.org (Postfix) with ESMTP id AD3338FC12 for ; Fri, 14 Nov 2008 16:42:52 +0000 (UTC) (envelope-from hselasky@c2i.net) X-Cloudmark-Score: 0.000000 [] X-Cloudmark-Analysis: v=1.0 c=1 a=Oumcy1zCVZoA:10 a=89sYFII7q9YA:10 a=aniA1o7mVp4QawOfT9qHqA==:17 a=P8rs4V1tjyh2YyMi-ycA:9 a=ITmKrcW1Hyd7bbT1lukA:7 a=1wyNtuAqd-szRHWdsA7A1-4Dt9YA:4 a=50e4U0PicR4A:10 Received: from [62.113.133.1] (account mc467741@c2i.net [62.113.133.1] verified) by mailfe04.swip.net (CommuniGate Pro SMTP 5.2.6) with ESMTPA id 1149290088; Fri, 14 Nov 2008 16:42:48 +0100 From: Hans Petter Selasky To: Alexander Motin Date: Fri, 14 Nov 2008 16:44:55 +0100 User-Agent: KMail/1.9.7 References: <200811080910.mA89AgTZ048172@repoman.freebsd.org> <200811140915.18846.hselasky@c2i.net> <491D8282.5060506@FreeBSD.org> In-Reply-To: <491D8282.5060506@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200811141644.55773.hselasky@c2i.net> Cc: Perforce Change Reviews Subject: Re: PERFORCE change 152649 for review - busdma problem 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: Fri, 14 Nov 2008 16:42:53 -0000 Hi, On Friday 14 November 2008, Alexander Motin wrote: > Hi. > > Hans Petter Selasky wrote: > > I am going to revert this patch and suggest a new one. I am not sure how > > to best implement it, but will it be Ok if I make the offset adjustment > > only for alignment <= 1 byte ? > > Alignment <= 1 byte means no (any possible) alignment. So busdma may use > any physical address within permitted range. Adding strict requirement > that this address should be aligned withing page same as logical address > will IMHO be too restrictive and as I understand will lead to additional > physical memory consumption. No, it won't. > > I am not very understand the problem and how are you going to manage it. > As I understand, the problem is that you can specify offset for > non-first scatter/gather segment only as page address. Is it correct? Yes. > So > which in-page offset used for that segments? If zero, you should just > specify busdma to align all segments to the page boundary. The thing is, you cannot specify how many bytes are on the first page which can take a full physical address. It is assumed that after the page offset wraps to zero a new page begins. Example: xxx: means data Virtual memory: PG0 PG1 | xxx|xxx | In busdma bounce buffer: PG0 PG1 |xxx |xxx | You see there is a hole just before PG1, and it is impossible to tell the USB hardware to skip this hole. > If it should > be the same as after the last sent data, then I can hardly imagine how > are you going to manage this to implement real scatter/gather for > misaligned data. > > > Is there any documentation or specification that needs to be updated? > > Sorry, I am not a busdma expert, I was just digging it several times > while working on some drivers. Thanks for your comment about alignment! I didn't see that in the first place. --HPS