Re: RE: Reboot on "shutdown -r" hangs after final "uptime ..." string

From: <bruce_at_cran.org.uk>
Date: Sun, 12 Aug 2007 01:22:51 +0100
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
Received on Sat Aug 11 2007 - 22:26:46 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:39:16 UTC