aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/usb')
-rw-r--r--drivers/usb/host/ehci-dbg.c16
-rw-r--r--drivers/usb/host/ehci-hcd.c25
-rw-r--r--drivers/usb/host/ehci-hub.c2
-rw-r--r--drivers/usb/host/ehci-q.c22
-rw-r--r--drivers/usb/host/ehci.h10
5 files changed, 38 insertions, 37 deletions
diff --git a/drivers/usb/host/ehci-dbg.c b/drivers/usb/host/ehci-dbg.c
index 97338abff296..76120957d60a 100644
--- a/drivers/usb/host/ehci-dbg.c
+++ b/drivers/usb/host/ehci-dbg.c
@@ -538,12 +538,13 @@ static ssize_t fill_async_buffer(struct debug_buffer *buf)
538 spin_lock_irqsave (&ehci->lock, flags); 538 spin_lock_irqsave (&ehci->lock, flags);
539 for (qh = ehci->async->qh_next.qh; size > 0 && qh; qh = qh->qh_next.qh) 539 for (qh = ehci->async->qh_next.qh; size > 0 && qh; qh = qh->qh_next.qh)
540 qh_lines (ehci, qh, &next, &size); 540 qh_lines (ehci, qh, &next, &size);
541 if (ehci->reclaim && size > 0) { 541 if (ehci->async_unlink && size > 0) {
542 temp = scnprintf (next, size, "\nreclaim =\n"); 542 temp = scnprintf(next, size, "\nunlink =\n");
543 size -= temp; 543 size -= temp;
544 next += temp; 544 next += temp;
545 545
546 for (qh = ehci->reclaim; size > 0 && qh; qh = qh->reclaim) 546 for (qh = ehci->async_unlink; size > 0 && qh;
547 qh = qh->unlink_next)
547 qh_lines (ehci, qh, &next, &size); 548 qh_lines (ehci, qh, &next, &size);
548 } 549 }
549 spin_unlock_irqrestore (&ehci->lock, flags); 550 spin_unlock_irqrestore (&ehci->lock, flags);
@@ -841,16 +842,17 @@ static ssize_t fill_registers_buffer(struct debug_buffer *buf)
841 } 842 }
842 } 843 }
843 844
844 if (ehci->reclaim) { 845 if (ehci->async_unlink) {
845 temp = scnprintf(next, size, "reclaim qh %p\n", ehci->reclaim); 846 temp = scnprintf(next, size, "async unlink qh %p\n",
847 ehci->async_unlink);
846 size -= temp; 848 size -= temp;
847 next += temp; 849 next += temp;
848 } 850 }
849 851
850#ifdef EHCI_STATS 852#ifdef EHCI_STATS
851 temp = scnprintf (next, size, 853 temp = scnprintf (next, size,
852 "irq normal %ld err %ld reclaim %ld (lost %ld)\n", 854 "irq normal %ld err %ld iaa %ld (lost %ld)\n",
853 ehci->stats.normal, ehci->stats.error, ehci->stats.reclaim, 855 ehci->stats.normal, ehci->stats.error, ehci->stats.iaa,
854 ehci->stats.lost_iaa); 856 ehci->stats.lost_iaa);
855 size -= temp; 857 size -= temp;
856 next += temp; 858 next += temp;
diff --git a/drivers/usb/host/ehci-hcd.c b/drivers/usb/host/ehci-hcd.c
index cdb15769468a..efee426a2465 100644
--- a/drivers/usb/host/ehci-hcd.c
+++ b/drivers/usb/host/ehci-hcd.c
@@ -403,7 +403,7 @@ static void ehci_iaa_watchdog(unsigned long param)
403 * (a) SMP races against real IAA firing and retriggering, and 403 * (a) SMP races against real IAA firing and retriggering, and
404 * (b) clean HC shutdown, when IAA watchdog was pending. 404 * (b) clean HC shutdown, when IAA watchdog was pending.
405 */ 405 */
406 if (ehci->reclaim 406 if (ehci->async_unlink
407 && !timer_pending(&ehci->iaa_watchdog) 407 && !timer_pending(&ehci->iaa_watchdog)
408 && ehci->rh_state == EHCI_RH_RUNNING) { 408 && ehci->rh_state == EHCI_RH_RUNNING) {
409 u32 cmd, status; 409 u32 cmd, status;
@@ -583,8 +583,8 @@ static void ehci_stop (struct usb_hcd *hcd)
583 usb_amd_dev_put(); 583 usb_amd_dev_put();
584 584
585#ifdef EHCI_STATS 585#ifdef EHCI_STATS
586 ehci_dbg (ehci, "irq normal %ld err %ld reclaim %ld (lost %ld)\n", 586 ehci_dbg(ehci, "irq normal %ld err %ld iaa %ld (lost %ld)\n",
587 ehci->stats.normal, ehci->stats.error, ehci->stats.reclaim, 587 ehci->stats.normal, ehci->stats.error, ehci->stats.iaa,
588 ehci->stats.lost_iaa); 588 ehci->stats.lost_iaa);
589 ehci_dbg (ehci, "complete %ld unlink %ld\n", 589 ehci_dbg (ehci, "complete %ld unlink %ld\n",
590 ehci->stats.complete, ehci->stats.unlink); 590 ehci->stats.complete, ehci->stats.unlink);
@@ -651,7 +651,6 @@ static int ehci_init(struct usb_hcd *hcd)
651 else // N microframes cached 651 else // N microframes cached
652 ehci->i_thresh = 2 + HCC_ISOC_THRES(hcc_params); 652 ehci->i_thresh = 2 + HCC_ISOC_THRES(hcc_params);
653 653
654 ehci->reclaim = NULL;
655 ehci->next_uframe = -1; 654 ehci->next_uframe = -1;
656 ehci->clock_frame = -1; 655 ehci->clock_frame = -1;
657 656
@@ -896,11 +895,11 @@ static irqreturn_t ehci_irq (struct usb_hcd *hcd)
896 /* guard against (alleged) silicon errata */ 895 /* guard against (alleged) silicon errata */
897 if (cmd & CMD_IAAD) 896 if (cmd & CMD_IAAD)
898 ehci_dbg(ehci, "IAA with IAAD still set?\n"); 897 ehci_dbg(ehci, "IAA with IAAD still set?\n");
899 if (ehci->reclaim) { 898 if (ehci->async_unlink) {
900 COUNT(ehci->stats.reclaim); 899 COUNT(ehci->stats.iaa);
901 end_unlink_async(ehci); 900 end_unlink_async(ehci);
902 } else 901 } else
903 ehci_dbg(ehci, "IAA with nothing to reclaim?\n"); 902 ehci_dbg(ehci, "IAA with nothing unlinked?\n");
904 } 903 }
905 904
906 /* remote wakeup [4.3.1] */ 905 /* remote wakeup [4.3.1] */
@@ -1027,7 +1026,7 @@ static int ehci_urb_enqueue (
1027static void unlink_async (struct ehci_hcd *ehci, struct ehci_qh *qh) 1026static void unlink_async (struct ehci_hcd *ehci, struct ehci_qh *qh)
1028{ 1027{
1029 /* failfast */ 1028 /* failfast */
1030 if (ehci->rh_state != EHCI_RH_RUNNING && ehci->reclaim) 1029 if (ehci->rh_state != EHCI_RH_RUNNING && ehci->async_unlink)
1031 end_unlink_async(ehci); 1030 end_unlink_async(ehci);
1032 1031
1033 /* If the QH isn't linked then there's nothing we can do 1032 /* If the QH isn't linked then there's nothing we can do
@@ -1041,15 +1040,15 @@ static void unlink_async (struct ehci_hcd *ehci, struct ehci_qh *qh)
1041 } 1040 }
1042 1041
1043 /* defer till later if busy */ 1042 /* defer till later if busy */
1044 if (ehci->reclaim) { 1043 if (ehci->async_unlink) {
1045 struct ehci_qh *last; 1044 struct ehci_qh *last;
1046 1045
1047 for (last = ehci->reclaim; 1046 for (last = ehci->async_unlink;
1048 last->reclaim; 1047 last->unlink_next;
1049 last = last->reclaim) 1048 last = last->unlink_next)
1050 continue; 1049 continue;
1051 qh->qh_state = QH_STATE_UNLINK_WAIT; 1050 qh->qh_state = QH_STATE_UNLINK_WAIT;
1052 last->reclaim = qh; 1051 last->unlink_next = qh;
1053 1052
1054 /* start IAA cycle */ 1053 /* start IAA cycle */
1055 } else 1054 } else
diff --git a/drivers/usb/host/ehci-hub.c b/drivers/usb/host/ehci-hub.c
index 1daaa96f527d..77d3324b4b28 100644
--- a/drivers/usb/host/ehci-hub.c
+++ b/drivers/usb/host/ehci-hub.c
@@ -301,7 +301,7 @@ static int ehci_bus_suspend (struct usb_hcd *hcd)
301 ehci_halt (ehci); 301 ehci_halt (ehci);
302 ehci->rh_state = EHCI_RH_SUSPENDED; 302 ehci->rh_state = EHCI_RH_SUSPENDED;
303 303
304 if (ehci->reclaim) 304 if (ehci->async_unlink)
305 end_unlink_async(ehci); 305 end_unlink_async(ehci);
306 306
307 /* allow remote wakeup */ 307 /* allow remote wakeup */
diff --git a/drivers/usb/host/ehci-q.c b/drivers/usb/host/ehci-q.c
index 156504787711..8e80cde8c35e 100644
--- a/drivers/usb/host/ehci-q.c
+++ b/drivers/usb/host/ehci-q.c
@@ -1153,11 +1153,11 @@ submit_async (
1153 1153
1154/*-------------------------------------------------------------------------*/ 1154/*-------------------------------------------------------------------------*/
1155 1155
1156/* the async qh for the qtds being reclaimed are now unlinked from the HC */ 1156/* the async qh for the qtds being unlinked are now gone from the HC */
1157 1157
1158static void end_unlink_async (struct ehci_hcd *ehci) 1158static void end_unlink_async (struct ehci_hcd *ehci)
1159{ 1159{
1160 struct ehci_qh *qh = ehci->reclaim; 1160 struct ehci_qh *qh = ehci->async_unlink;
1161 struct ehci_qh *next; 1161 struct ehci_qh *next;
1162 1162
1163 iaa_watchdog_done(ehci); 1163 iaa_watchdog_done(ehci);
@@ -1167,9 +1167,9 @@ static void end_unlink_async (struct ehci_hcd *ehci)
1167 qh->qh_next.qh = NULL; 1167 qh->qh_next.qh = NULL;
1168 1168
1169 /* other unlink(s) may be pending (in QH_STATE_UNLINK_WAIT) */ 1169 /* other unlink(s) may be pending (in QH_STATE_UNLINK_WAIT) */
1170 next = qh->reclaim; 1170 next = qh->unlink_next;
1171 ehci->reclaim = next; 1171 ehci->async_unlink = next;
1172 qh->reclaim = NULL; 1172 qh->unlink_next = NULL;
1173 1173
1174 qh_completions (ehci, qh); 1174 qh_completions (ehci, qh);
1175 1175
@@ -1185,7 +1185,7 @@ static void end_unlink_async (struct ehci_hcd *ehci)
1185 } 1185 }
1186 1186
1187 if (next) { 1187 if (next) {
1188 ehci->reclaim = NULL; 1188 ehci->async_unlink = NULL;
1189 start_unlink_async (ehci, next); 1189 start_unlink_async (ehci, next);
1190 } 1190 }
1191 1191
@@ -1203,7 +1203,7 @@ static void start_unlink_async (struct ehci_hcd *ehci, struct ehci_qh *qh)
1203 1203
1204#ifdef DEBUG 1204#ifdef DEBUG
1205 assert_spin_locked(&ehci->lock); 1205 assert_spin_locked(&ehci->lock);
1206 if (ehci->reclaim 1206 if (ehci->async_unlink
1207 || (qh->qh_state != QH_STATE_LINKED 1207 || (qh->qh_state != QH_STATE_LINKED
1208 && qh->qh_state != QH_STATE_UNLINK_WAIT) 1208 && qh->qh_state != QH_STATE_UNLINK_WAIT)
1209 ) 1209 )
@@ -1214,7 +1214,7 @@ static void start_unlink_async (struct ehci_hcd *ehci, struct ehci_qh *qh)
1214 if (unlikely (qh == ehci->async)) { 1214 if (unlikely (qh == ehci->async)) {
1215 /* can't get here without STS_ASS set */ 1215 /* can't get here without STS_ASS set */
1216 if (ehci->rh_state != EHCI_RH_HALTED 1216 if (ehci->rh_state != EHCI_RH_HALTED
1217 && !ehci->reclaim) { 1217 && !ehci->async_unlink) {
1218 /* ... and CMD_IAAD clear */ 1218 /* ... and CMD_IAAD clear */
1219 ehci->command &= ~CMD_ASE; 1219 ehci->command &= ~CMD_ASE;
1220 ehci_writel(ehci, ehci->command, &ehci->regs->command); 1220 ehci_writel(ehci, ehci->command, &ehci->regs->command);
@@ -1226,7 +1226,7 @@ static void start_unlink_async (struct ehci_hcd *ehci, struct ehci_qh *qh)
1226 } 1226 }
1227 1227
1228 qh->qh_state = QH_STATE_UNLINK; 1228 qh->qh_state = QH_STATE_UNLINK;
1229 ehci->reclaim = qh; 1229 ehci->async_unlink = qh;
1230 1230
1231 prev = ehci->async; 1231 prev = ehci->async;
1232 while (prev->qh_next.qh != qh) 1232 while (prev->qh_next.qh != qh)
@@ -1240,7 +1240,7 @@ static void start_unlink_async (struct ehci_hcd *ehci, struct ehci_qh *qh)
1240 1240
1241 /* If the controller isn't running, we don't have to wait for it */ 1241 /* If the controller isn't running, we don't have to wait for it */
1242 if (unlikely(ehci->rh_state != EHCI_RH_RUNNING)) { 1242 if (unlikely(ehci->rh_state != EHCI_RH_RUNNING)) {
1243 /* if (unlikely (qh->reclaim != 0)) 1243 /* if (unlikely (qh->unlink_next != 0))
1244 * this will recurse, probably not much 1244 * this will recurse, probably not much
1245 */ 1245 */
1246 end_unlink_async (ehci); 1246 end_unlink_async (ehci);
@@ -1295,7 +1295,7 @@ static void scan_async (struct ehci_hcd *ehci)
1295 */ 1295 */
1296 if (list_empty(&qh->qtd_list) 1296 if (list_empty(&qh->qtd_list)
1297 && qh->qh_state == QH_STATE_LINKED) { 1297 && qh->qh_state == QH_STATE_LINKED) {
1298 if (!ehci->reclaim && (stopped || 1298 if (!ehci->async_unlink && (stopped ||
1299 time_after_eq(jiffies, qh->unlink_time))) 1299 time_after_eq(jiffies, qh->unlink_time)))
1300 start_unlink_async(ehci, qh); 1300 start_unlink_async(ehci, qh);
1301 else 1301 else
diff --git a/drivers/usb/host/ehci.h b/drivers/usb/host/ehci.h
index 195449db1b18..3c6c07c0956a 100644
--- a/drivers/usb/host/ehci.h
+++ b/drivers/usb/host/ehci.h
@@ -42,7 +42,7 @@ struct ehci_stats {
42 /* irq usage */ 42 /* irq usage */
43 unsigned long normal; 43 unsigned long normal;
44 unsigned long error; 44 unsigned long error;
45 unsigned long reclaim; 45 unsigned long iaa;
46 unsigned long lost_iaa; 46 unsigned long lost_iaa;
47 47
48 /* termination of urbs from core */ 48 /* termination of urbs from core */
@@ -51,7 +51,7 @@ struct ehci_stats {
51}; 51};
52 52
53/* ehci_hcd->lock guards shared data against other CPUs: 53/* ehci_hcd->lock guards shared data against other CPUs:
54 * ehci_hcd: async, reclaim, periodic (and shadow), ... 54 * ehci_hcd: async, unlink, periodic (and shadow), ...
55 * usb_host_endpoint: hcpriv 55 * usb_host_endpoint: hcpriv
56 * ehci_qh: qh_next, qtd_list 56 * ehci_qh: qh_next, qtd_list
57 * ehci_qtd: qtd_list 57 * ehci_qtd: qtd_list
@@ -81,7 +81,7 @@ struct ehci_hcd { /* one per controller */
81 /* async schedule support */ 81 /* async schedule support */
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 *reclaim; 84 struct ehci_qh *async_unlink;
85 struct ehci_qh *qh_scan_next; 85 struct ehci_qh *qh_scan_next;
86 unsigned scanning : 1; 86 unsigned scanning : 1;
87 87
@@ -354,7 +354,7 @@ struct ehci_qh {
354 union ehci_shadow qh_next; /* ptr to qh; or periodic */ 354 union ehci_shadow qh_next; /* ptr to qh; or periodic */
355 struct list_head qtd_list; /* sw qtd list */ 355 struct list_head qtd_list; /* sw qtd list */
356 struct ehci_qtd *dummy; 356 struct ehci_qtd *dummy;
357 struct ehci_qh *reclaim; /* next to reclaim */ 357 struct ehci_qh *unlink_next; /* next on unlink list */
358 358
359 unsigned long unlink_time; 359 unsigned long unlink_time;
360 unsigned stamp; 360 unsigned stamp;
@@ -364,7 +364,7 @@ struct ehci_qh {
364#define QH_STATE_LINKED 1 /* HC sees this */ 364#define QH_STATE_LINKED 1 /* HC sees this */
365#define QH_STATE_UNLINK 2 /* HC may still see this */ 365#define QH_STATE_UNLINK 2 /* HC may still see this */
366#define QH_STATE_IDLE 3 /* HC doesn't see this */ 366#define QH_STATE_IDLE 3 /* HC doesn't see this */
367#define QH_STATE_UNLINK_WAIT 4 /* LINKED and on reclaim q */ 367#define QH_STATE_UNLINK_WAIT 4 /* LINKED and on unlink q */
368#define QH_STATE_COMPLETING 5 /* don't touch token.HALT */ 368#define QH_STATE_COMPLETING 5 /* don't touch token.HALT */
369 369
370 u8 xacterrs; /* XactErr retry counter */ 370 u8 xacterrs; /* XactErr retry counter */