xhci: Always use usb_hcd in URB instead of converting xhci_hcd.
[pandora-kernel.git] / drivers / usb / host / xhci.c
index 34cf4e1..a95108c 100644 (file)
@@ -93,9 +93,8 @@ void xhci_quiesce(struct xhci_hcd *xhci)
  *
  * Disable any IRQs and clear the run/stop bit.
  * HC will complete any current and actively pipelined transactions, and
- * should halt within 16 microframes of the run/stop bit being cleared.
+ * should halt within 16 ms of the run/stop bit being cleared.
  * Read HC Halted bit in the status register to see when the HC is finished.
- * XXX: shouldn't we set HC_STATE_HALT here somewhere?
  */
 int xhci_halt(struct xhci_hcd *xhci)
 {
@@ -134,7 +133,7 @@ int xhci_start(struct xhci_hcd *xhci)
 }
 
 /*
- * Reset a halted HC, and set the internal HC state to HC_STATE_HALT.
+ * Reset a halted HC.
  *
  * This resets pipelines, timers, counters, state machines, etc.
  * Transactions will be terminated immediately, and operational registers
@@ -156,8 +155,6 @@ int xhci_reset(struct xhci_hcd *xhci)
        command = xhci_readl(xhci, &xhci->op_regs->command);
        command |= CMD_RESET;
        xhci_writel(xhci, command, &xhci->op_regs->command);
-       /* XXX: Why does EHCI set this here?  Shouldn't other code do this? */
-       xhci_to_hcd(xhci)->state = HC_STATE_HALT;
 
        ret = handshake(xhci, &xhci->op_regs->command,
                        CMD_RESET, 0, 250 * 1000);
@@ -350,7 +347,6 @@ void xhci_event_ring_work(unsigned long arg)
 
        temp = xhci_readl(xhci, &xhci->ir_set->irq_pending);
        xhci_dbg(xhci, "ir_set 0 pending = 0x%x\n", temp);
-       xhci_dbg(xhci, "No-op commands handled = %d\n", xhci->noops_handled);
        xhci_dbg(xhci, "HC error bitmask = 0x%x\n", xhci->error_bitmask);
        xhci->error_bitmask = 0;
        xhci_dbg(xhci, "Event ring:\n");
@@ -370,10 +366,6 @@ void xhci_event_ring_work(unsigned long arg)
                        xhci_dbg_ep_rings(xhci, i, j, &xhci->devs[i]->eps[j]);
                }
        }
-
-       if (xhci->noops_submitted != NUM_TEST_NOOPS)
-               if (xhci_setup_one_noop(xhci))
-                       xhci_ring_cmd_db(xhci);
        spin_unlock_irqrestore(&xhci->lock, flags);
 
        if (!xhci->zombie)
@@ -402,7 +394,6 @@ int xhci_run(struct usb_hcd *hcd)
        u32 ret;
        struct xhci_hcd *xhci = hcd_to_xhci(hcd);
        struct pci_dev  *pdev = to_pci_dev(xhci_to_hcd(xhci)->self.controller);
-       void (*doorbell)(struct xhci_hcd *) = NULL;
 
        hcd->uses_new_polling = 1;
 
@@ -461,7 +452,6 @@ int xhci_run(struct usb_hcd *hcd)
        xhci_writel(xhci, temp, &xhci->ir_set->irq_control);
 
        /* Set the HCD state before we enable the irqs */
-       hcd->state = HC_STATE_RUNNING;
        temp = xhci_readl(xhci, &xhci->op_regs->command);
        temp |= (CMD_EIE);
        xhci_dbg(xhci, "// Enable interrupts, cmd = 0x%x.\n",
@@ -475,8 +465,6 @@ int xhci_run(struct usb_hcd *hcd)
                        &xhci->ir_set->irq_pending);
        xhci_print_ir_set(xhci, xhci->ir_set, 0);
 
-       if (NUM_TEST_NOOPS > 0)
-               doorbell = xhci_setup_one_noop(xhci);
        if (xhci->quirks & XHCI_NEC_HOST)
                xhci_queue_vendor_command(xhci, 0, 0, 0,
                                TRB_TYPE(TRB_NEC_GET_FW));
@@ -486,8 +474,6 @@ int xhci_run(struct usb_hcd *hcd)
                return -ENODEV;
        }
 
-       if (doorbell)
-               (*doorbell)(xhci);
        if (xhci->quirks & XHCI_NEC_HOST)
                xhci_ring_cmd_db(xhci);
 
@@ -706,9 +692,8 @@ int xhci_resume(struct xhci_hcd *xhci, bool hibernated)
 {
        u32                     command, temp = 0;
        struct usb_hcd          *hcd = xhci_to_hcd(xhci);
-       int     old_state, retval;
+       int                     retval;
 
-       old_state = hcd->state;
        if (time_before(jiffies, xhci->next_statechange))
                msleep(100);
 
@@ -792,10 +777,6 @@ int xhci_resume(struct xhci_hcd *xhci, bool hibernated)
         */
 
        set_bit(HCD_FLAG_HW_ACCESSIBLE, &hcd->flags);
-       if (!hibernated)
-               hcd->state = old_state;
-       else
-               hcd->state = HC_STATE_SUSPENDED;
 
        spin_unlock_irq(&xhci->lock);
        return 0;
@@ -1173,7 +1154,7 @@ int xhci_urb_dequeue(struct usb_hcd *hcd, struct urb *urb, int status)
 
                usb_hcd_unlink_urb_from_ep(hcd, urb);
                spin_unlock_irqrestore(&xhci->lock, flags);
-               usb_hcd_giveback_urb(xhci_to_hcd(xhci), urb, -ESHUTDOWN);
+               usb_hcd_giveback_urb(hcd, urb, -ESHUTDOWN);
                xhci_urb_free_priv(xhci, urb_priv);
                return ret;
        }