aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/host/uhci-debug.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/usb/host/uhci-debug.c')
-rw-r--r--drivers/usb/host/uhci-debug.c71
1 files changed, 62 insertions, 9 deletions
diff --git a/drivers/usb/host/uhci-debug.c b/drivers/usb/host/uhci-debug.c
index e345f15b7d87..5d6c06bc4524 100644
--- a/drivers/usb/host/uhci-debug.c
+++ b/drivers/usb/host/uhci-debug.c
@@ -168,9 +168,13 @@ static int uhci_show_qh(struct uhci_qh *qh, char *buf, int len, int space)
168 space, "", qh, qtype, 168 space, "", qh, qtype,
169 le32_to_cpu(qh->link), le32_to_cpu(element)); 169 le32_to_cpu(qh->link), le32_to_cpu(element));
170 if (qh->type == USB_ENDPOINT_XFER_ISOC) 170 if (qh->type == USB_ENDPOINT_XFER_ISOC)
171 out += sprintf(out, "%*s period %d frame %x desc [%p]\n", 171 out += sprintf(out, "%*s period %d phase %d load %d us, "
172 space, "", qh->period, qh->iso_frame, 172 "frame %x desc [%p]\n",
173 qh->iso_packet_desc); 173 space, "", qh->period, qh->phase, qh->load,
174 qh->iso_frame, qh->iso_packet_desc);
175 else if (qh->type == USB_ENDPOINT_XFER_INT)
176 out += sprintf(out, "%*s period %d phase %d load %d us\n",
177 space, "", qh->period, qh->phase, qh->load);
174 178
175 if (element & UHCI_PTR_QH) 179 if (element & UHCI_PTR_QH)
176 out += sprintf(out, "%*s Element points to QH (bug?)\n", space, ""); 180 out += sprintf(out, "%*s Element points to QH (bug?)\n", space, "");
@@ -208,7 +212,7 @@ static int uhci_show_qh(struct uhci_qh *qh, char *buf, int len, int space)
208 space, "", nurbs); 212 space, "", nurbs);
209 } 213 }
210 214
211 if (qh->udev) { 215 if (qh->dummy_td) {
212 out += sprintf(out, "%*s Dummy TD\n", space, ""); 216 out += sprintf(out, "%*s Dummy TD\n", space, "");
213 out += uhci_show_td(qh->dummy_td, out, len - (out - buf), 0); 217 out += uhci_show_td(qh->dummy_td, out, len - (out - buf), 0);
214 } 218 }
@@ -347,31 +351,80 @@ static int uhci_sprint_schedule(struct uhci_hcd *uhci, char *buf, int len)
347 struct uhci_qh *qh; 351 struct uhci_qh *qh;
348 struct uhci_td *td; 352 struct uhci_td *td;
349 struct list_head *tmp, *head; 353 struct list_head *tmp, *head;
354 int nframes, nerrs;
350 355
351 out += uhci_show_root_hub_state(uhci, out, len - (out - buf)); 356 out += uhci_show_root_hub_state(uhci, out, len - (out - buf));
352 out += sprintf(out, "HC status\n"); 357 out += sprintf(out, "HC status\n");
353 out += uhci_show_status(uhci, out, len - (out - buf)); 358 out += uhci_show_status(uhci, out, len - (out - buf));
359
360 out += sprintf(out, "Periodic load table\n");
361 for (i = 0; i < MAX_PHASE; ++i) {
362 out += sprintf(out, "\t%d", uhci->load[i]);
363 if (i % 8 == 7)
364 *out++ = '\n';
365 }
366 out += sprintf(out, "Total: %d, #INT: %d, #ISO: %d\n",
367 uhci->total_load,
368 uhci_to_hcd(uhci)->self.bandwidth_int_reqs,
369 uhci_to_hcd(uhci)->self.bandwidth_isoc_reqs);
354 if (debug <= 1) 370 if (debug <= 1)
355 return out - buf; 371 return out - buf;
356 372
357 out += sprintf(out, "Frame List\n"); 373 out += sprintf(out, "Frame List\n");
374 nframes = 10;
375 nerrs = 0;
358 for (i = 0; i < UHCI_NUMFRAMES; ++i) { 376 for (i = 0; i < UHCI_NUMFRAMES; ++i) {
377 __le32 link, qh_dma;
378
379 j = 0;
359 td = uhci->frame_cpu[i]; 380 td = uhci->frame_cpu[i];
381 link = uhci->frame[i];
360 if (!td) 382 if (!td)
361 continue; 383 goto check_link;
362 384
363 out += sprintf(out, "- Frame %d\n", i); \ 385 if (nframes > 0) {
364 if (td->dma_handle != (dma_addr_t)uhci->frame[i]) 386 out += sprintf(out, "- Frame %d -> (%08x)\n",
365 out += sprintf(out, " frame list does not match td->dma_handle!\n"); 387 i, le32_to_cpu(link));
388 j = 1;
389 }
366 390
367 head = &td->fl_list; 391 head = &td->fl_list;
368 tmp = head; 392 tmp = head;
369 do { 393 do {
370 td = list_entry(tmp, struct uhci_td, fl_list); 394 td = list_entry(tmp, struct uhci_td, fl_list);
371 tmp = tmp->next; 395 tmp = tmp->next;
372 out += uhci_show_td(td, out, len - (out - buf), 4); 396 if (cpu_to_le32(td->dma_handle) != link) {
397 if (nframes > 0)
398 out += sprintf(out, " link does "
399 "not match list entry!\n");
400 else
401 ++nerrs;
402 }
403 if (nframes > 0)
404 out += uhci_show_td(td, out,
405 len - (out - buf), 4);
406 link = td->link;
373 } while (tmp != head); 407 } while (tmp != head);
408
409check_link:
410 qh_dma = uhci_frame_skel_link(uhci, i);
411 if (link != qh_dma) {
412 if (nframes > 0) {
413 if (!j) {
414 out += sprintf(out,
415 "- Frame %d -> (%08x)\n",
416 i, le32_to_cpu(link));
417 j = 1;
418 }
419 out += sprintf(out, " link does not match "
420 "QH (%08x)!\n", le32_to_cpu(qh_dma));
421 } else
422 ++nerrs;
423 }
424 nframes -= j;
374 } 425 }
426 if (nerrs > 0)
427 out += sprintf(out, "Skipped %d bad links\n", nerrs);
375 428
376 out += sprintf(out, "Skeleton QHs\n"); 429 out += sprintf(out, "Skeleton QHs\n");
377 430