--- linux-2.6.x-custom/drivers/usb/host/uhci-hcd.c.orig 2003-12-01 19:27:55.473667736 +0100 +++ linux-2.6.x-custom/drivers/usb/host/uhci-hcd.c 2003-12-01 19:30:05.675873992 +0100 @@ -2128,7 +2128,7 @@ } } -static void start_hc(struct uhci_hcd *uhci) +static int start_hc(struct uhci_hcd *uhci) { unsigned int io_addr = uhci->io_addr; int timeout = 1000; @@ -2143,7 +2143,7 @@ while (inw(io_addr + USBCMD) & USBCMD_HCRESET) { if (!--timeout) { printk(KERN_ERR "uhci: USBCMD_HCRESET timed out!\n"); - break; + return -ETIMEDOUT; } } @@ -2161,6 +2161,8 @@ outw(USBCMD_RS | USBCMD_CF | USBCMD_MAXP, io_addr + USBCMD); uhci->hcd.state = USB_STATE_RUNNING; + + return 0; } /* @@ -2414,7 +2416,11 @@ uhci->fl->frame[i] = cpu_to_le32(uhci->skelqh[7 - irq]->dma_handle); } - start_hc(uhci); + if (start_hc(uhci) == -ETIMEDOUT) { + init_stall_timer(hcd); + retval = -ENODEV; + goto err_alloc_skelqh; + } init_stall_timer(hcd);