cvs commit: src/sys/bus/usb ehci.c ehcireg.h usb_port.h

Sepherosa Ziehau sepherosa at gmail.com
Sat Sep 3 01:41:44 PDT 2005


I have a very simple question here:

@@ -420,6 +430,46 @@ ehci_init(ehci_softc_t *sc)
. ...
+	for (i = 0; i < EHCI_INTRQHS; i++) {
+		sqh = sc->sc_islots[i].sqh;
+		if (i == 0) {
+			/* The last (1ms) QH terminates. */
+			sqh->qh.qh_link = EHCI_NULL;
+			sqh->next = NULL;
+		} else {
+			/* Otherwise the next QH has half the poll interval */

<<<<<<<<<<<<
+			sqh->next = sc->sc_islots[(i + 1) / 2 - 1].sqh;
+			sqh->qh.qh_link = htole32(sqh->next->physaddr |
+						  EHCI_LINK_QH);
>>>>>>>>>>>>>

here we set sqh->next, sqh->qh.qh_link conditionally to a non-NULL value.

+		}
+		sqh->qh.qh_endp = htole32(EHCI_QH_SET_EPS(EHCI_QH_SPEED_HIGH));

>>>>>>>>>>>>
+		sqh->qh.qh_link = EHCI_NULL;
+		sqh->qh.qh_curqtd = EHCI_NULL;
+		sqh->next = NULL;
<<<<<<<<<<<<

but here we reset sqh->next, sqh->qh.qh_link to NULL immediately.

+		sqh->qh.qh_qtd.qtd_next = EHCI_NULL;
+		sqh->qh.qh_qtd.qtd_altnext = EHCI_NULL;
+		sqh->qh.qh_qtd.qtd_status = htole32(EHCI_QTD_HALTED);
+		sqh->sqtd = NULL;
+	}

On 9/3/05, Matthew Dillon <dillon at xxxxxxxxxxxxxxxxxxxx> wrote:
> 
> :-On [20050903 09:12], Matthew Dillon (dillon at xxxxxxxxxxxxxxxxxxxx) wrote:
> :>    Something in this last commit is causing my machine to lockup on boot
> :>    while trying to attach EHCI.  As a hint, after ~60+ seconds it
> :>    gives me an error:  'usbd_new_device: addr=2, getting first desc failed'.
> :>    I don't know what part of the commit is blowing things up.
> :
> :I am guessing the interrupt transfers.  I think I missed a DragonFly
> :specific way to deal with that.
> :There were some changes there, right?
> :
> :--
> :Jeroen Ruigrok van der Werven <asmodai(at)wxs.nl> / asmodai / kita no mono
> :Free Tibet! http://www.savetibet.org/ | http://www.andf.info/
> 
>     I did a lot of stability work in the USB code, but apart from that
>     I just don't know.  It could have something to do with the polling mode
>     (which is used at boot time I think).  I'll take a look at it tomorrow.
> 
>                                         -Matt
>                                         Matthew Dillon
>                                         <dillon at xxxxxxxxxxxxx>
> 


-- 
Live Free or Die






More information about the Commits mailing list