Merge to Fedora kernel-2.6.7-1.492
[linux-2.6.git] / drivers / usb / host / ohci-hcd.c
index 690e2be..d13e98e 100644 (file)
@@ -229,7 +229,7 @@ static int ohci_urb_enqueue (
        if (urb->status != -EINPROGRESS) {
                spin_unlock (&urb->lock);
                urb->hcpriv = urb_priv;
-               finish_urb (ohci, urb, 0);
+               finish_urb (ohci, urb, NULL);
                retval = 0;
                goto fail;
        }
@@ -340,14 +340,18 @@ rescan:
                goto done;
 
        if (!HCD_IS_RUNNING (ohci->hcd.state)) {
+sanitize:
                ed->state = ED_IDLE;
-               finish_unlinks (ohci, 0, 0);
+               finish_unlinks (ohci, 0, NULL);
        }
 
        switch (ed->state) {
        case ED_UNLINK:         /* wait for hw to finish? */
                /* major IRQ delivery trouble loses INTR_SF too... */
-               WARN_ON (limit-- == 0);
+               if (limit-- == 0) {
+                       ohci_warn (ohci, "IRQ INTR_SF lossage\n");
+                       goto sanitize;
+               }
                spin_unlock_irqrestore (&ohci->lock, flags);
                set_current_state (TASK_UNINTERRUPTIBLE);
                schedule_timeout (1);
@@ -369,7 +373,7 @@ rescan:
                td_free (ohci, ed->dummy);
                break;
        }
-       dev->ep [epnum] = 0;
+       dev->ep [epnum] = NULL;
 done:
        spin_unlock_irqrestore (&ohci->lock, flags);
        return;
@@ -671,6 +675,8 @@ static void ohci_stop (struct usb_hcd *hcd)
        flush_scheduled_work();
        if (HCD_IS_RUNNING(ohci->hcd.state))
                hc_reset (ohci);
+       else
+               writel (OHCI_INTR_MIE, &ohci->regs->intrdisable);
        
        remove_debug_files (ohci);
        ohci_mem_cleanup (ohci);
@@ -728,7 +734,7 @@ static int hc_restart (struct ohci_hcd *ohci)
                        ed_deschedule (ohci, ed);
 
                        ed->ed_next = ohci->ed_rm_list;
-                       ed->ed_prev = 0;
+                       ed->ed_prev = NULL;
                        ohci->ed_rm_list = ed;
                        /* FALLTHROUGH */
                case ED_UNLINK:
@@ -742,7 +748,7 @@ static int hc_restart (struct ohci_hcd *ohci)
                urb->status = -ESHUTDOWN;
                spin_unlock (&urb->lock);
        }
-       finish_unlinks (ohci, 0, 0);
+       finish_unlinks (ohci, 0, NULL);
        spin_unlock_irq(&ohci->lock);
 
        /* paranoia, in case that didn't work: */