From owner-cvs-all Fri Dec 20 12:51:11 2002 Delivered-To: cvs-all@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 7CA4B37B401; Fri, 20 Dec 2002 12:51:09 -0800 (PST) Received: from magic.adaptec.com (magic.adaptec.com [208.236.45.80]) by mx1.FreeBSD.org (Postfix) with ESMTP id 0208943EEA; Fri, 20 Dec 2002 12:51:09 -0800 (PST) (envelope-from scott_long@btc.adaptec.com) Received: from redfish.adaptec.com (redfish.adaptec.com [162.62.50.11]) by magic.adaptec.com (8.11.6+Sun/8.11.6) with ESMTP id gBKKp7j28206; Fri, 20 Dec 2002 12:51:07 -0800 (PST) Received: from btc.btc.adaptec.com (btc.btc.adaptec.com [10.100.0.52]) by redfish.adaptec.com (8.8.8+Sun/8.8.8) with ESMTP id MAA00033; Fri, 20 Dec 2002 12:51:06 -0800 (PST) Received: from btc.adaptec.com (hollin [10.100.253.56]) by btc.btc.adaptec.com (8.8.8+Sun/8.8.8) with ESMTP id NAA29735; Fri, 20 Dec 2002 13:51:02 -0700 (MST) Message-ID: <3E03820D.4070004@btc.adaptec.com> Date: Fri, 20 Dec 2002 13:48:13 -0700 From: Scott Long User-Agent: Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:1.2b) Gecko/20021216 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Matt Dillon Cc: cvs-committers@freebsd.org, cvs-all@freebsd.org Subject: Re: cvs commit: src/sys/dev/usb ohci.c References: <200212201847.gBKIldGZ071133@repoman.freebsd.org> In-Reply-To: <200212201847.gBKIldGZ071133@repoman.freebsd.org> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Sender: owner-cvs-all@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG Matt Dillon wrote: > dillon 2002/12/20 10:47:39 PST > > Modified files: > sys/dev/usb ohci.c > Log: > Fix two bugs in the DMA chaining code for OHCI. The first bug is that > the dataphysend calculation could only possibly work if the virtual > buffer > is also physically contiguous. Calculate dataphysend by calculating the > ending virtual address first, then converting to a physical address. > > The second bug applies only to NetBSD and OpenBSD and involves the > curlen > calculation in the two-contiguous-physical-pages case (which we > don't support). > > Also cleanup the use of the OHIC_PAGE() macro on dataphysend and add > a panic > if len goes negative (meaning we lost the physical page translation > representing the end of the buffer). > > IMHO the dataphysend is still bokered since it might be misrepresented > by shared userland page mappings. The whole section needs to be > rewritten > to use the virtual address range. > > MFC after: 3 days > > Revision Changes Path > 1.117 +9 -5 src/sys/dev/usb/ohci.c Matt, While the effort that you put into this problem is without doubt appreciated, I wonder why you chose this approach rather that converting the driver to use busdma? NetBSD and OpenBSD use busdma, although of course their implementation differs from ours. The FreeBSD code is already ugly enough since alpha is special cased and I doubt that ia64 or sparc64 could possibly work. And as you point out, your hack still isn't totally correct. Scott To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe cvs-all" in the body of the message