cvs commit: src/sys/dev/usb uhci.c uhci_pci.c

Nate Lawson nate at root.org
Mon Jan 12 10:37:13 PST 2004


On Mon, 12 Jan 2004, Takeshi Shibagaki wrote:
>   Modified files:
>     sys/dev/usb          uhci.c uhci_pci.c
>   Log:
>   Fix a suspend/resume issue. My Compaq N400c works fine.
>
>   Revision  Changes    Path
>   1.150     +3 -0      src/sys/dev/usb/uhci.c
>   1.52      +2 -0      src/sys/dev/usb/uhci_pci.c

Thank you for looking at this!  I'll test it out once I have S3 working
again.  Here is a patch I have that reduces diffs to NetBSD.  Is it
helpful?

Index: sys/dev/usb/uhci.c
===================================================================
RCS file: /home/ncvs/src/sys/dev/usb/uhci.c,v
retrieving revision 1.149
diff -u -r1.149 uhci.c
--- sys/dev/usb/uhci.c	10 Nov 2003 00:08:41 -0000	1.149
+++ sys/dev/usb/uhci.c	21 Nov 2003 21:41:33 -0000
@@ -695,7 +695,8 @@
 	DPRINTF(("uhci_power: sc=%p, why=%d (was %d), cmd=0x%x\n",
 		 sc, why, sc->sc_suspend, cmd));

-	if (why != PWR_RESUME) {
+	switch (why) {
+	case PWR_SUSPEND:
 #ifdef USB_DEBUG
 		if (uhcidebug > 2)
 			uhci_dumpregs(sc);
@@ -717,7 +718,8 @@
 		sc->sc_suspend = why;
 		sc->sc_bus.use_polling--;
 		DPRINTF(("uhci_power: cmd=0x%x\n", UREAD2(sc, UHCI_CMD)));
-	} else {
+		break;
+	case PWR_RESUME:
 #ifdef DIAGNOSTIC
 		if (sc->sc_suspend == PWR_RESUME)
 			printf("uhci_power: weird, resume without suspend.\n");
@@ -735,9 +737,9 @@
 		UHCICMD(sc, cmd | UHCI_CMD_FGR); /* force global resume */
 		usb_delay_ms(&sc->sc_bus, USB_RESUME_DELAY);
 		UHCICMD(sc, cmd & ~UHCI_CMD_EGSM); /* back to normal */
+		UHCICMD(sc, UHCI_CMD_MAXP);
 		UWRITE2(sc, UHCI_INTR, UHCI_INTR_TOCRCIE | UHCI_INTR_RIE |
 			UHCI_INTR_IOCE | UHCI_INTR_SPIE); /* re-enable intrs */
-		UHCICMD(sc, UHCI_CMD_MAXP);
 		uhci_run(sc, 1); /* and start traffic again */
 		usb_delay_ms(&sc->sc_bus, USB_RESUME_RECOVERY);
 		sc->sc_bus.use_polling--;
@@ -748,6 +750,7 @@
 		if (uhcidebug > 2)
 			uhci_dumpregs(sc);
 #endif
+		break;
 	}
 	splx(s);
 }


More information about the cvs-all mailing list