*** /usr/src/sys/dev/usb/uhci.c Tue Oct 31 23:23:29 2000
--- uhci.c      Wed Jul  3 13:53:16 2002
***************
*** 962,970 ****
--- 962,990 ----
                       USBDEVNAME(sc->sc_bus.bdev));
        }
        if (status & UHCI_STS_HCH) {
+               int s;
+ 
                /* no acknowledge needed */
                printf("%s: host controller halted\n", 
                       USBDEVNAME(sc->sc_bus.bdev));
+ 
+               /* Try to restart */
+               printf("DCRH: Restarting USB controller\n");
+               s = splusb();
+               sc->sc_bus.use_polling++; /* Switch to polling in case curproc=NULL */
+ 
+               UWRITE2(sc, UHCI_STS, 0xFFFF);  /* ack pending interrupts */
+               uhci_run(sc, 0);                /* stop the controller */
+               UWRITE2(sc, UHCI_INTR, 0);      /* disable interrupts */
+               uhci_busreset(sc);
+               UWRITE2(sc, UHCI_INTR, UHCI_INTR_TOCRCIE | UHCI_INTR_RIE |
+                       UHCI_INTR_IOCE | UHCI_INTR_SPIE);       /* enable interrupts */
+               UHCICMD(sc, UHCI_CMD_MAXP); /* Assume 64 byte packets at frame end */
+               uhci_run(sc, 1);               /* and here we go... */
+               sc->sc_bus.use_polling--;
+               splx(s);
+               ack = 0;
+               printf("DCRH: USB controller restarted\n");
        }
  
        if (ack)        /* acknowledge the ints */

