Index: ohci-au1xxx.c =================================================================== RCS file: /home/cvs/linux/drivers/usb/host/ohci-au1xxx.c,v retrieving revision 1.5 diff -u -r1.5 ohci-au1xxx.c --- ohci-au1xxx.c 3 Apr 2005 20:39:19 -0000 1.5 +++ ohci-au1xxx.c 6 May 2005 09:14:35 -0000 @@ -38,8 +38,10 @@ /*-------------------------------------------------------------------------*/ -static void au1xxx_start_hc(struct platform_device *dev) +static int au1xxx_start_hc(struct platform_device *dev) { + int count = 3000; + printk(KERN_DEBUG __FILE__ ": starting Au1xxx OHCI USB Controller\n"); @@ -51,11 +53,19 @@ /* wait for reset complete (read register twice; see au1500 errata) */ while (au_readl(USB_HOST_CONFIG), - !(au_readl(USB_HOST_CONFIG) & USBH_ENABLE_RD)) + !(au_readl(USB_HOST_CONFIG) & USBH_ENABLE_RD)) { udelay(1000); + if (--count == 0) { + printk(KERN_ERR __FILE__ + ": unable to reset USB host\n"); + return -EBUSY; + } + } printk(KERN_DEBUG __FILE__ ": Clock to USB host has been enabled \n"); + + return 0; } static void au1xxx_stop_hc(struct platform_device *dev) @@ -113,7 +123,11 @@ goto err2; } - au1xxx_start_hc(dev); + retval = au1xxx_start_hc(dev); + if (retval < 0) { + pr_debug("au1xxx start failed"); + goto err3; + } ohci_hcd_init(hcd_to_ohci(hcd)); retval = usb_add_hcd(hcd, dev->resource[1].start, SA_INTERRUPT); @@ -121,6 +135,7 @@ return retval; au1xxx_stop_hc(dev); + err3: iounmap(hcd->regs); err2: release_mem_region(hcd->rsrc_start, hcd->rsrc_len);