aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/host
diff options
context:
space:
mode:
authorSarah Sharp <sarah.a.sharp@linux.intel.com>2010-10-26 14:22:02 -0400
committerSarah Sharp <sarah.a.sharp@linux.intel.com>2011-03-13 21:07:13 -0400
commit214f76f7d9198ddd090bd927a4bcd49391bfcd36 (patch)
tree23caeedac25f87f12662850e861dc994b21420c9 /drivers/usb/host
parentaa1b13efb7cfa9f7bf4942c1e858463e335c9500 (diff)
xhci: Always use usb_hcd in URB instead of converting xhci_hcd.
Make sure to call into the USB core's link, unlink, and giveback URB functions with the usb_hcd pointer found by using urb->dev->bus. This will avoid confusion later, when the xHCI driver will deal with URBs from two separate buses (the USB 3.0 roothub and the faked USB 2.0 roothub). Assume xhci_urb_dequeue() will be called with the proper usb_hcd. Signed-off-by: Sarah Sharp <sarah.a.sharp@linux.intel.com>
Diffstat (limited to 'drivers/usb/host')
-rw-r--r--drivers/usb/host/xhci-ring.c9
-rw-r--r--drivers/usb/host/xhci.c2
2 files changed, 6 insertions, 5 deletions
diff --git a/drivers/usb/host/xhci-ring.c b/drivers/usb/host/xhci-ring.c
index 6bca2526d54a..9e2b26c3da40 100644
--- a/drivers/usb/host/xhci-ring.c
+++ b/drivers/usb/host/xhci-ring.c
@@ -594,13 +594,14 @@ static inline void xhci_stop_watchdog_timer_in_irq(struct xhci_hcd *xhci,
594static void xhci_giveback_urb_in_irq(struct xhci_hcd *xhci, 594static void xhci_giveback_urb_in_irq(struct xhci_hcd *xhci,
595 struct xhci_td *cur_td, int status, char *adjective) 595 struct xhci_td *cur_td, int status, char *adjective)
596{ 596{
597 struct usb_hcd *hcd = xhci_to_hcd(xhci); 597 struct usb_hcd *hcd;
598 struct urb *urb; 598 struct urb *urb;
599 struct urb_priv *urb_priv; 599 struct urb_priv *urb_priv;
600 600
601 urb = cur_td->urb; 601 urb = cur_td->urb;
602 urb_priv = urb->hcpriv; 602 urb_priv = urb->hcpriv;
603 urb_priv->td_cnt++; 603 urb_priv->td_cnt++;
604 hcd = bus_to_hcd(urb->dev->bus);
604 605
605 /* Only giveback urb when this is the last td in urb */ 606 /* Only giveback urb when this is the last td in urb */
606 if (urb_priv->td_cnt == urb_priv->length) { 607 if (urb_priv->td_cnt == urb_priv->length) {
@@ -1982,12 +1983,12 @@ cleanup:
1982 trb_comp_code != COMP_BABBLE)) 1983 trb_comp_code != COMP_BABBLE))
1983 xhci_urb_free_priv(xhci, urb_priv); 1984 xhci_urb_free_priv(xhci, urb_priv);
1984 1985
1985 usb_hcd_unlink_urb_from_ep(xhci_to_hcd(xhci), urb); 1986 usb_hcd_unlink_urb_from_ep(bus_to_hcd(urb->dev->bus), urb);
1986 xhci_dbg(xhci, "Giveback URB %p, len = %d, " 1987 xhci_dbg(xhci, "Giveback URB %p, len = %d, "
1987 "status = %d\n", 1988 "status = %d\n",
1988 urb, urb->actual_length, status); 1989 urb, urb->actual_length, status);
1989 spin_unlock(&xhci->lock); 1990 spin_unlock(&xhci->lock);
1990 usb_hcd_giveback_urb(xhci_to_hcd(xhci), urb, status); 1991 usb_hcd_giveback_urb(bus_to_hcd(urb->dev->bus), urb, status);
1991 spin_lock(&xhci->lock); 1992 spin_lock(&xhci->lock);
1992 } 1993 }
1993 1994
@@ -2323,7 +2324,7 @@ static int prepare_transfer(struct xhci_hcd *xhci,
2323 INIT_LIST_HEAD(&td->cancelled_td_list); 2324 INIT_LIST_HEAD(&td->cancelled_td_list);
2324 2325
2325 if (td_index == 0) { 2326 if (td_index == 0) {
2326 ret = usb_hcd_link_urb_to_ep(xhci_to_hcd(xhci), urb); 2327 ret = usb_hcd_link_urb_to_ep(bus_to_hcd(urb->dev->bus), urb);
2327 if (unlikely(ret)) { 2328 if (unlikely(ret)) {
2328 xhci_urb_free_priv(xhci, urb_priv); 2329 xhci_urb_free_priv(xhci, urb_priv);
2329 urb->hcpriv = NULL; 2330 urb->hcpriv = NULL;
diff --git a/drivers/usb/host/xhci.c b/drivers/usb/host/xhci.c
index 883b4c402c6a..a95108cba7d4 100644
--- a/drivers/usb/host/xhci.c
+++ b/drivers/usb/host/xhci.c
@@ -1154,7 +1154,7 @@ int xhci_urb_dequeue(struct usb_hcd *hcd, struct urb *urb, int status)
1154 1154
1155 usb_hcd_unlink_urb_from_ep(hcd, urb); 1155 usb_hcd_unlink_urb_from_ep(hcd, urb);
1156 spin_unlock_irqrestore(&xhci->lock, flags); 1156 spin_unlock_irqrestore(&xhci->lock, flags);
1157 usb_hcd_giveback_urb(xhci_to_hcd(xhci), urb, -ESHUTDOWN); 1157 usb_hcd_giveback_urb(hcd, urb, -ESHUTDOWN);
1158 xhci_urb_free_priv(xhci, urb_priv); 1158 xhci_urb_free_priv(xhci, urb_priv);
1159 return ret; 1159 return ret;
1160 } 1160 }