From owner-freebsd-current@FreeBSD.ORG Sun Aug 12 00:26:46 2007 Return-Path: Delivered-To: current@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7ABEE16A420 for ; Sun, 12 Aug 2007 00:26:46 +0000 (UTC) (envelope-from brucec@muon.bluestop.org) Received: from muon.bluestop.org (muon.bluestop.org [80.68.94.188]) by mx1.freebsd.org (Postfix) with ESMTP id 30D6B13C458 for ; Sun, 12 Aug 2007 00:26:45 +0000 (UTC) (envelope-from brucec@muon.bluestop.org) Received: by muon.bluestop.org (Postfix, from userid 1000) id 3BAB530123; Sun, 12 Aug 2007 01:22:52 +0100 (BST) Date: Sun, 12 Aug 2007 01:22:51 +0100 From: bruce@cran.org.uk To: Don Lewis Message-ID: <20070812002251.GA19278@muon.bluestop.org> References: <46BC1418.9070008@cran.org.uk> <200708101505.l7AF53jG043973@gw.catspoiler.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200708101505.l7AF53jG043973@gw.catspoiler.org> User-Agent: Mutt/1.5.13 (2006-08-11) Cc: current@FreeBSD.org Subject: Re: RE: Reboot on "shutdown -r" hangs after final "uptime ..." string X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 12 Aug 2007 00:26:46 -0000 On Fri, Aug 10, 2007 at 08:05:03AM -0700, Don Lewis wrote: > I'm seeing this problem on an Athlon 64 desktop machine with the NVIDIA > GeForce 7050PV / nForce 630a chipset. The hang is occuring at this > point in boot() in kern_shutdown.c: > > /* Now that we're going to really halt the system... */ > EVENTHANDLER_INVOKE(shutdown_final, howto); > > The culprit is an infinite loop in ehci_pci_givecontroller(), which is > called from ehci_shutdown(). The infinite loop is triggered by reading > the incorrect value from one of the EHCI controller registers because > the register is being read before a reset of the controller has > completed. > > Try this patch: > > Index: sys/dev/usb/ehci.c > + usb_delay_ms(&sc->sc_bus, 1); > + EOWRITE4(sc, EHCI_USBCMD, EHCI_CMD_HCRESET); > + for (i = 0; i < 100; i++) { > + usb_delay_ms(&sc->sc_bus, 1); > + hcr = EOREAD4(sc, EHCI_USBCMD) & EHCI_CMD_HCRESET; > + if (!hcr) > + return (USBD_NORMAL_COMPLETION); > + } > + printf("%s: reset timeout\n", device_get_nameunit(sc->sc_bus.bdev)); > + return (USBD_IOERROR); > +} The patch doesn't fix the issue on my laptop, which identifies the USB controller as: uhub0: on usb0 By putting more printfs I see that it gets to the line "eec = pci_read_config" in ehci_pci_givecontroller and then appears to stop - I've got a printf at the end of ehci_pci_givecontroller that never gets displayed, and the printf at the top of the for loop only gets displayed once. -- Bruce Cran