Subject: uhci0: host controller halted
To: None <tech-kern@netbsd.org>
From: Iain Hibbert <plunky@rya-online.net>
List: tech-kern
Date: 01/26/2006 23:30:40
Hi,
   Am getting the above message printed sometimes on system shutdown after
I've been using a USB bluetooth device. Then the system just stops instead
of rebooting or powering down or whatever. I can enter ddb and get a
backtrace but not sure it gives any useful info

the first bit I guess is DDB itself so I didnt reproduce it properly and
the rest of it makes no sense to me.

wskbd stuff
pckbd stuff
Xintr_legacy1() ...
--
DDB lost frame
Xdoreti() at netbsd:Xdoreti
--
0x206:

I can only think this has to do with my USB driver as it never happens
otherwise (I use a USB mouse normally in the same socket), but I can't see
what it might be. Here is the detach routine (its in ubt.c from the diff
file at http://homepages.rya-online.net/plunky/netbt.html)

USB_DETACH(ubt)
{
	USB_DETACH_START(ubt, sc);
	int rv = 0;

	DPRINTF(("%s: sc=%p flags=%d\n", __func__, sc, flags));

	sc->sc_dying = 1;

	/* Abort all pipes.  Causes processes waiting for transfer to wake. */
	ubt_abortdealloc(sc);

	DPRINTFN(1, ("%s: waiting for bluetooth detach\n", __func__));
	hci_detach(&sc->sc_unit);
	DPRINTFN(1, ("%s: bluetooth detach complete\n", __func__));

	usbd_add_drv_event(USB_EVENT_DRIVER_DETACH, sc->sc_udev,
			   USBDEV(sc->sc_dev));

	DPRINTFN(1, ("%s: driver detached\n", __func__));

	return (rv);
}


The only thing I thought it might be was that I took out the sc_refcnt
stuff and usb_detach_wait()/usb_detach_wakeup() to make sure everything
was gone. I did this with the best of intentions, since all the transfers
are asyncrhonous and the callback routines exit right away if the status
given was not normal - ie, my thought was that the detach routine doesnt
need to wait for them, there will be no conflict.

Does anybody know anything about usb and why I would get that message and
a hang?

thanks,
iain