Date: Sun, 12 Aug 2007 01:22:51 +0100 From: bruce@cran.org.uk To: Don Lewis <truckman@FreeBSD.org> Cc: current@FreeBSD.org Subject: Re: RE: Reboot on "shutdown -r" hangs after final "uptime ..." string Message-ID: <20070812002251.GA19278@muon.bluestop.org> In-Reply-To: <200708101505.l7AF53jG043973@gw.catspoiler.org> References: <46BC1418.9070008@cran.org.uk> <200708101505.l7AF53jG043973@gw.catspoiler.org>
next in thread | previous in thread | raw e-mail | index | archive | help
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: <ATI EHCI root hub, class 9/0, rev 2.00/1.00, addr 1> 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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20070812002251.GA19278>
