From 9b9f631e788757f7e2ef7429142c754a904c5b1a Mon Sep 17 00:00:00 2001 From: David Brownell Date: Thu, 25 Mar 2004 00:06:44 -0800 Subject: [PATCH] [PATCH] USB: fix osdl bugid 2006 (timer init and fault paths) Need to initialize timers a bit earlier to handle certain initialization faults. OSDL bug 2006 Need to initialize some timers a bit earlier to clean up safely after very early init HCD failures. Those early init faults were needlessly mysterious since they didn't emit diagnostics except at HCD discretion. --- drivers/usb/core/hcd-pci.c | 5 ++++- drivers/usb/host/ehci-hcd.c | 8 ++++---- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/drivers/usb/core/hcd-pci.c b/drivers/usb/core/hcd-pci.c index adb9ac80a75db..7b9fab1440507 100644 --- a/drivers/usb/core/hcd-pci.c +++ b/drivers/usb/core/hcd-pci.c @@ -196,13 +196,16 @@ clean_3: hcd->self.op = &usb_hcd_operations; hcd->self.hcpriv = (void *) hcd; hcd->self.release = &hcd_pci_release; + init_timer (&hcd->rh_timer); INIT_LIST_HEAD (&hcd->dev_list); usb_register_bus (&hcd->self); - if ((retval = driver->start (hcd)) < 0) + if ((retval = driver->start (hcd)) < 0) { + dev_err (hcd->self.controller, "init error %d\n", retval); usb_hcd_pci_remove (dev); + } return retval; } diff --git a/drivers/usb/host/ehci-hcd.c b/drivers/usb/host/ehci-hcd.c index ad0084f2af501..75d6db2b05405 100644 --- a/drivers/usb/host/ehci-hcd.c +++ b/drivers/usb/host/ehci-hcd.c @@ -374,6 +374,10 @@ static int ehci_start (struct usb_hcd *hcd) u32 hcc_params; u8 tempbyte; + init_timer (&ehci->watchdog); + ehci->watchdog.function = ehci_watchdog; + ehci->watchdog.data = (unsigned long) ehci; + /* * hw default: 1K periodic list heads, one per frame. * periodic_size can shrink by USBCMD update if hcc_params allows. @@ -468,10 +472,6 @@ static int ehci_start (struct usb_hcd *hcd) /* set async sleep time = 10 us ... ? */ - init_timer (&ehci->watchdog); - ehci->watchdog.function = ehci_watchdog; - ehci->watchdog.data = (unsigned long) ehci; - /* wire up the root hub */ bus = hcd_to_bus (hcd); bus->root_hub = udev = usb_alloc_dev (NULL, bus, 0); -- 2.53.0