Date: Fri, 20 Dec 2002 10:40:17 -0800 (PST) From: Matthew Dillon <dillon@apollo.backplane.com> To: Bernd Walter <ticso@cicely8.cicely.de>, toshii@netbsd.org Cc: Nate Lawson <nate@root.org>, freebsd-current@FreeBSD.ORG Subject: Re: UMASS USB bug? (getting the Sony disk-on-key device working) Message-ID: <200212201840.gBKIeHIi052554@apollo.backplane.com> References: <Pine.BSF.4.21.0212191442450.60085-100000@root.org> <200212200111.gBK1BW0h026510@apollo.backplane.com> <20021220121100.GA658@cicely8.cicely.de>
next in thread | previous in thread | raw e-mail | index | archive | help
:The NetBSD code is already different:
:1.48 (augustss 15-Sep-99): /* The OHCI hardware can handle at most one page crossing. */
:1.48 (augustss 15-Sep-99): if (OHCI_PAGE(dataphys) == dataphysend ||
:1.48 (augustss 15-Sep-99): OHCI_PAGE(dataphys) + OHCI_PAGE_SIZE == dataphysend) {
:1.48 (augustss 15-Sep-99): /* we can handle it in this TD */
:1.48 (augustss 15-Sep-99): curlen = len;
:1.48 (augustss 15-Sep-99): } else {
:1.48 (augustss 15-Sep-99): /* must use multiple TDs, fill as much as possible. */
:1.120 (augustss 03-Feb-02): curlen = 2 * OHCI_PAGE_SIZE -
:1.48 (augustss 15-Sep-99): (dataphys & (OHCI_PAGE_SIZE-1));
:1.78 (augustss 20-Mar-00): /* the length must be a multiple of the max size */
:1.78 (augustss 20-Mar-00): curlen -= curlen % UGETW(opipe->pipe.endpoint->edesc->wMaxPacketSize);
:1.78 (augustss 20-Mar-00): #ifdef DIAGNOSTIC
:1.78 (augustss 20-Mar-00): if (curlen == 0)
:1.128 (provos 27-Sep-02): panic("ohci_alloc_std: curlen == 0");
:1.78 (augustss 20-Mar-00): #endif
:1.48 (augustss 15-Sep-99): }
:
:
:To bad we did not catch it.
:
:--
:B.Walter COSMO-Project http://www.cosmo-project.de
Well, that's the curlen fix, which doesn't apply to us at all
(in FreeBSD we do not try to optimize for two physically contiguous
pages). I'm not sure why they are using a mod there, I think
it is as simple as if (curlen > len) curlen = len, but I don't
understand the 'the length must be a multiple of the max size'
comment so maybe there is some magic there that I haven't considered.
The fix that applies to both FreeBSD and NetBSD was the calculation of
dataphysend just above the code you indicate. When I look at ohci.c
via cvsweb for NetBSD, their 1.135, they have not fixed the
dataphysend calculation yet.
They still have (which is WRONG):
dataphysend = OHCI_PAGE(dataphys + len - 1);
The correct answer is:
dataphysend = OHCI_PAGE(DMAADDR(dma, len - 1));
I am going to attempt to add toshii@netbsd.org to this thread, I
don't know if that is a valid email address :-)
-Matt
To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-current" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200212201840.gBKIeHIi052554>
