aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/host
diff options
context:
space:
mode:
authorAlan Stern <stern@rowland.harvard.edu>2012-07-11 11:21:43 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2012-07-16 19:50:13 -0400
commit2f5bb665ba7a14c5842fa2e1cde2be039843a2a2 (patch)
tree32a40c6858e39a56377b2964be5f90cda47bb801 /drivers/usb/host
parent99ac5b1e9536f142461681fa6143a947d66b4279 (diff)
USB: EHCI: add pointer to end of async-unlink list
This patch (as1570) adds a pointer for the end of ehci-hcd's async-unlink list. The list (which is actually a queue) is singly linked, so having a pointer to its end makes adding new entries easier -- there's no longer any need to scan through the whole list. In principle it could be changed to a standard doubly-linked list. It turns out that doing so actually makes the code less clear, so I'm leaving it as is. Signed-off-by: Alan Stern <stern@rowland.harvard.edu> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/usb/host')
-rw-r--r--drivers/usb/host/ehci-hcd.c9
-rw-r--r--drivers/usb/host/ehci-q.c2
-rw-r--r--drivers/usb/host/ehci.h1
3 files changed, 5 insertions, 7 deletions
diff --git a/drivers/usb/host/ehci-hcd.c b/drivers/usb/host/ehci-hcd.c
index efee426a2465..8b75e4279a47 100644
--- a/drivers/usb/host/ehci-hcd.c
+++ b/drivers/usb/host/ehci-hcd.c
@@ -1041,14 +1041,9 @@ static void unlink_async (struct ehci_hcd *ehci, struct ehci_qh *qh)
1041 1041
1042 /* defer till later if busy */ 1042 /* defer till later if busy */
1043 if (ehci->async_unlink) { 1043 if (ehci->async_unlink) {
1044 struct ehci_qh *last;
1045
1046 for (last = ehci->async_unlink;
1047 last->unlink_next;
1048 last = last->unlink_next)
1049 continue;
1050 qh->qh_state = QH_STATE_UNLINK_WAIT; 1044 qh->qh_state = QH_STATE_UNLINK_WAIT;
1051 last->unlink_next = qh; 1045 ehci->async_unlink_last->unlink_next = qh;
1046 ehci->async_unlink_last = qh;
1052 1047
1053 /* start IAA cycle */ 1048 /* start IAA cycle */
1054 } else 1049 } else
diff --git a/drivers/usb/host/ehci-q.c b/drivers/usb/host/ehci-q.c
index 8e80cde8c35e..5193612c96ea 100644
--- a/drivers/usb/host/ehci-q.c
+++ b/drivers/usb/host/ehci-q.c
@@ -1227,6 +1227,8 @@ static void start_unlink_async (struct ehci_hcd *ehci, struct ehci_qh *qh)
1227 1227
1228 qh->qh_state = QH_STATE_UNLINK; 1228 qh->qh_state = QH_STATE_UNLINK;
1229 ehci->async_unlink = qh; 1229 ehci->async_unlink = qh;
1230 if (!qh->unlink_next)
1231 ehci->async_unlink_last = qh;
1230 1232
1231 prev = ehci->async; 1233 prev = ehci->async;
1232 while (prev->qh_next.qh != qh) 1234 while (prev->qh_next.qh != qh)
diff --git a/drivers/usb/host/ehci.h b/drivers/usb/host/ehci.h
index 3c6c07c0956a..475f23e10bbf 100644
--- a/drivers/usb/host/ehci.h
+++ b/drivers/usb/host/ehci.h
@@ -82,6 +82,7 @@ struct ehci_hcd { /* one per controller */
82 struct ehci_qh *async; 82 struct ehci_qh *async;
83 struct ehci_qh *dummy; /* For AMD quirk use */ 83 struct ehci_qh *dummy; /* For AMD quirk use */
84 struct ehci_qh *async_unlink; 84 struct ehci_qh *async_unlink;
85 struct ehci_qh *async_unlink_last;
85 struct ehci_qh *qh_scan_next; 86 struct ehci_qh *qh_scan_next;
86 unsigned scanning : 1; 87 unsigned scanning : 1;
87 88