diff options
Diffstat (limited to 'drivers/usb/host/uhci-debug.c')
-rw-r--r-- | drivers/usb/host/uhci-debug.c | 48 |
1 files changed, 43 insertions, 5 deletions
diff --git a/drivers/usb/host/uhci-debug.c b/drivers/usb/host/uhci-debug.c index e345f15b7d87..b40bc1ac9b8c 100644 --- a/drivers/usb/host/uhci-debug.c +++ b/drivers/usb/host/uhci-debug.c | |||
@@ -347,6 +347,7 @@ static int uhci_sprint_schedule(struct uhci_hcd *uhci, char *buf, int len) | |||
347 | struct uhci_qh *qh; | 347 | struct uhci_qh *qh; |
348 | struct uhci_td *td; | 348 | struct uhci_td *td; |
349 | struct list_head *tmp, *head; | 349 | struct list_head *tmp, *head; |
350 | int nframes, nerrs; | ||
350 | 351 | ||
351 | out += uhci_show_root_hub_state(uhci, out, len - (out - buf)); | 352 | out += uhci_show_root_hub_state(uhci, out, len - (out - buf)); |
352 | out += sprintf(out, "HC status\n"); | 353 | out += sprintf(out, "HC status\n"); |
@@ -355,23 +356,60 @@ static int uhci_sprint_schedule(struct uhci_hcd *uhci, char *buf, int len) | |||
355 | return out - buf; | 356 | return out - buf; |
356 | 357 | ||
357 | out += sprintf(out, "Frame List\n"); | 358 | out += sprintf(out, "Frame List\n"); |
359 | nframes = 10; | ||
360 | nerrs = 0; | ||
358 | for (i = 0; i < UHCI_NUMFRAMES; ++i) { | 361 | for (i = 0; i < UHCI_NUMFRAMES; ++i) { |
362 | __le32 link, qh_dma; | ||
363 | |||
364 | j = 0; | ||
359 | td = uhci->frame_cpu[i]; | 365 | td = uhci->frame_cpu[i]; |
366 | link = uhci->frame[i]; | ||
360 | if (!td) | 367 | if (!td) |
361 | continue; | 368 | goto check_link; |
362 | 369 | ||
363 | out += sprintf(out, "- Frame %d\n", i); \ | 370 | if (nframes > 0) { |
364 | if (td->dma_handle != (dma_addr_t)uhci->frame[i]) | 371 | out += sprintf(out, "- Frame %d -> (%08x)\n", |
365 | out += sprintf(out, " frame list does not match td->dma_handle!\n"); | 372 | i, le32_to_cpu(link)); |
373 | j = 1; | ||
374 | } | ||
366 | 375 | ||
367 | head = &td->fl_list; | 376 | head = &td->fl_list; |
368 | tmp = head; | 377 | tmp = head; |
369 | do { | 378 | do { |
370 | td = list_entry(tmp, struct uhci_td, fl_list); | 379 | td = list_entry(tmp, struct uhci_td, fl_list); |
371 | tmp = tmp->next; | 380 | tmp = tmp->next; |
372 | out += uhci_show_td(td, out, len - (out - buf), 4); | 381 | if (cpu_to_le32(td->dma_handle) != link) { |
382 | if (nframes > 0) | ||
383 | out += sprintf(out, " link does " | ||
384 | "not match list entry!\n"); | ||
385 | else | ||
386 | ++nerrs; | ||
387 | } | ||
388 | if (nframes > 0) | ||
389 | out += uhci_show_td(td, out, | ||
390 | len - (out - buf), 4); | ||
391 | link = td->link; | ||
373 | } while (tmp != head); | 392 | } while (tmp != head); |
393 | |||
394 | check_link: | ||
395 | qh_dma = uhci_frame_skel_link(uhci, i); | ||
396 | if (link != qh_dma) { | ||
397 | if (nframes > 0) { | ||
398 | if (!j) { | ||
399 | out += sprintf(out, | ||
400 | "- Frame %d -> (%08x)\n", | ||
401 | i, le32_to_cpu(link)); | ||
402 | j = 1; | ||
403 | } | ||
404 | out += sprintf(out, " link does not match " | ||
405 | "QH (%08x)!\n", le32_to_cpu(qh_dma)); | ||
406 | } else | ||
407 | ++nerrs; | ||
408 | } | ||
409 | nframes -= j; | ||
374 | } | 410 | } |
411 | if (nerrs > 0) | ||
412 | out += sprintf(out, "Skipped %d bad links\n", nerrs); | ||
375 | 413 | ||
376 | out += sprintf(out, "Skeleton QHs\n"); | 414 | out += sprintf(out, "Skeleton QHs\n"); |
377 | 415 | ||