Commit 9b9f631e authored by David Brownell's avatar David Brownell Committed by Greg Kroah-Hartman

[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.
parent ff256570
...@@ -196,13 +196,16 @@ int usb_hcd_pci_probe (struct pci_dev *dev, const struct pci_device_id *id) ...@@ -196,13 +196,16 @@ int usb_hcd_pci_probe (struct pci_dev *dev, const struct pci_device_id *id)
hcd->self.op = &usb_hcd_operations; hcd->self.op = &usb_hcd_operations;
hcd->self.hcpriv = (void *) hcd; hcd->self.hcpriv = (void *) hcd;
hcd->self.release = &hcd_pci_release; hcd->self.release = &hcd_pci_release;
init_timer (&hcd->rh_timer);
INIT_LIST_HEAD (&hcd->dev_list); INIT_LIST_HEAD (&hcd->dev_list);
usb_register_bus (&hcd->self); 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); usb_hcd_pci_remove (dev);
}
return retval; return retval;
} }
......
...@@ -374,6 +374,10 @@ static int ehci_start (struct usb_hcd *hcd) ...@@ -374,6 +374,10 @@ static int ehci_start (struct usb_hcd *hcd)
u32 hcc_params; u32 hcc_params;
u8 tempbyte; 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. * hw default: 1K periodic list heads, one per frame.
* periodic_size can shrink by USBCMD update if hcc_params allows. * periodic_size can shrink by USBCMD update if hcc_params allows.
...@@ -468,10 +472,6 @@ static int ehci_start (struct usb_hcd *hcd) ...@@ -468,10 +472,6 @@ static int ehci_start (struct usb_hcd *hcd)
/* set async sleep time = 10 us ... ? */ /* 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 */ /* wire up the root hub */
bus = hcd_to_bus (hcd); bus = hcd_to_bus (hcd);
bus->root_hub = udev = usb_alloc_dev (NULL, bus, 0); bus->root_hub = udev = usb_alloc_dev (NULL, bus, 0);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment