: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 [EMAIL PROTECTED] to this thread, I don't know if that is a valid email address :-) -Matt To Unsubscribe: send mail to [EMAIL PROTECTED] with "unsubscribe freebsd-current" in the body of the message