From owner-cvs-all@FreeBSD.ORG Mon Jan 12 10:37:13 2004 Return-Path: Delivered-To: cvs-all@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 69A0916A4D1 for ; Mon, 12 Jan 2004 10:37:13 -0800 (PST) Received: from root.org (root.org [67.118.192.226]) by mx1.FreeBSD.org (Postfix) with SMTP id 6211443D49 for ; Mon, 12 Jan 2004 10:37:08 -0800 (PST) (envelope-from nate@root.org) Received: (qmail 56859 invoked by uid 1000); 12 Jan 2004 18:37:09 -0000 Date: Mon, 12 Jan 2004 10:37:09 -0800 (PST) From: Nate Lawson To: Takeshi Shibagaki In-Reply-To: <20040112141909.B3EA416A54C@hub.freebsd.org> Message-ID: <20040112103615.W56837@root.org> References: <20040112141909.B3EA416A54C@hub.freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII cc: cvs-src@FreeBSD.org cc: src-committers@FreeBSD.org cc: cvs-all@FreeBSD.org Subject: Re: cvs commit: src/sys/dev/usb uhci.c uhci_pci.c X-BeenThere: cvs-all@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: CVS commit messages for the entire tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Jan 2004 18:37:13 -0000 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); }