From owner-freebsd-usb@FreeBSD.ORG Sat Dec 6 17:45:06 2008 Return-Path: Delivered-To: freebsd-usb@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B075B106564A; Sat, 6 Dec 2008 17:45:06 +0000 (UTC) (envelope-from xcllnt@mac.com) Received: from asmtpout022.mac.com (asmtpout022.mac.com [17.148.16.97]) by mx1.freebsd.org (Postfix) with ESMTP id 688438FC08; Sat, 6 Dec 2008 17:45:06 +0000 (UTC) (envelope-from xcllnt@mac.com) MIME-version: 1.0 Content-transfer-encoding: 7BIT Content-type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Received: from [192.168.1.94] (209-128-86-226.BAYAREA.NET [209.128.86.226]) by asmtp022.mac.com (Sun Java(tm) System Messaging Server 6.3-7.03 (built Aug 7 2008; 32bit)) with ESMTPSA id <0KBG000P5UN55O30@asmtp022.mac.com>; Sat, 06 Dec 2008 09:45:06 -0800 (PST) Message-id: <031DE609-3E5B-4508-BAB0-95800B7F02F4@mac.com> From: Marcel Moolenaar To: Hans Petter Selasky In-reply-to: <200812061334.55365.hselasky@c2i.net> Date: Sat, 06 Dec 2008 09:45:04 -0800 References: <20081107082740.GA1334@icarus.home.lan> <200811081023.10058.hselasky@freebsd.org> <200811161408.21562.hselasky@c2i.net> <200812061334.55365.hselasky@c2i.net> X-Mailer: Apple Mail (2.929.2) Cc: freebsd-current@freebsd.org, freebsd-usb@freebsd.org Subject: Re: [Serious] busdma bug in -current in relation to USB hardware - review wanted X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 06 Dec 2008 17:45:06 -0000 On Dec 6, 2008, at 4:34 AM, Hans Petter Selasky wrote: > Hi, > > After various feedback from several people I have made a new patch > proposal > that will fix the busdma problem. > > See: > > http://perforce.freebsd.org/chv.cgi?CH=154181 > > Review wanted! The USB stack has a fixed page size of 4K. On our 64-bit platforms PAGE_SIZE is at least 8K. Your change is sloppy in that respect and doesn't make the distinction. That makes the patch a kluge. The definition of BUS_DMA_NO_REALIGN is based on circumstantial evidence only and as such, works as a side-effect. I don't think that's a good design. I don't think there's any reason not to preserve the page offset in all cases. So far all hardware worked whether or not their DMA pages were bounced and the non-bounced pages would have a possible non-zero page offset, whereas the bounced pages would always have a zero page offset. In short: it works either way. In particular, it works with the page offset preserved. Why not preserve it always? What's the downside? -- Marcel Moolenaar xcllnt@mac.com