Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 20 Dec 2002 13:48:13 -0700
From:      Scott Long <scott_long@btc.adaptec.com>
To:        Matt Dillon <dillon@freebsd.org>
Cc:        cvs-committers@freebsd.org, cvs-all@freebsd.org
Subject:   Re: cvs commit: src/sys/dev/usb ohci.c
Message-ID:  <3E03820D.4070004@btc.adaptec.com>
In-Reply-To: <200212201847.gBKIldGZ071133@repoman.freebsd.org>
References:  <200212201847.gBKIldGZ071133@repoman.freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?3E03820D.4070004>