kern/67455: EHCI controller is being programmed with incorrect address during ehci_open ( ehci.c)

Rajesh Mittal raj_mittal at yahoo.com
Tue Jun 1 09:40:18 PDT 2004


>Number:         67455
>Category:       kern
>Synopsis:       EHCI controller is being programmed with incorrect address during ehci_open ( ehci.c)
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Tue Jun 01 09:40:17 PDT 2004
>Closed-Date:
>Last-Modified:
>Originator:     Rajesh Mittal
>Release:        FreeBSD 5.2.1-RELEASE
>Organization:
>Environment:
>Description:
EHCI controller QH endp field can take only 4 bit wide address address ( Refer EHCI specs). The address value being supplied in ehci_open() (ehci.c code)  is 8 bits. This is bug as the  highest bit in this 8 bit field is  the direction of endpoint ( UE_DIR_IN/UE_DIR_OUT) not part of the real endpoint address.
This bit needs to be stripped off from the addr value while programming the QH endp field. Currently This bug results in to EHCI_QH_HRECL incorrectly getting set in the Queue head when the endpoint is an IN endpoint. 
According to EHCI specs ( EHCI revision 0.96 page 74)
"Software must ensure that there is at most one queue head with H-bit set to one".
 
Please note that it is not just a non-compliance issue with the specs. As this bit is used by EHCI controller to decide when to terminate the async schedule , incorrect assignment of this bit will result in to occassional async transfer timeouts.
>How-To-Repeat:
I ran in to this issue while using the DIAGNOSTIC version of FreeBsd build on my custom hadware setup. As this is a bug affecting the ehci schedule it is a must fix issue for all hw platforms.
>Fix:
Here is a patch in ehci.c.
                                                                                                                    
                                                                                                                    
1253c1253
<               EHCI_QH_SET_ADDR(addr) |
---
>               EHCI_QH_SET_ADDR(UE_GET_ADDR(addr)) |
>Release-Note:
>Audit-Trail:
>Unformatted:


More information about the freebsd-bugs mailing list