diff options
Diffstat (limited to 'drivers/usb/host/ehci-dbg.c')
-rw-r--r-- | drivers/usb/host/ehci-dbg.c | 43 |
1 files changed, 24 insertions, 19 deletions
diff --git a/drivers/usb/host/ehci-dbg.c b/drivers/usb/host/ehci-dbg.c index 1104caa0803b..874d2000bf92 100644 --- a/drivers/usb/host/ehci-dbg.c +++ b/drivers/usb/host/ehci-dbg.c | |||
@@ -134,10 +134,11 @@ dbg_qtd (const char *label, struct ehci_hcd *ehci, struct ehci_qtd *qtd) | |||
134 | static void __maybe_unused | 134 | static void __maybe_unused |
135 | dbg_qh (const char *label, struct ehci_hcd *ehci, struct ehci_qh *qh) | 135 | dbg_qh (const char *label, struct ehci_hcd *ehci, struct ehci_qh *qh) |
136 | { | 136 | { |
137 | struct ehci_qh_hw *hw = qh->hw; | ||
138 | |||
137 | ehci_dbg (ehci, "%s qh %p n%08x info %x %x qtd %x\n", label, | 139 | ehci_dbg (ehci, "%s qh %p n%08x info %x %x qtd %x\n", label, |
138 | qh, qh->hw_next, qh->hw_info1, qh->hw_info2, | 140 | qh, hw->hw_next, hw->hw_info1, hw->hw_info2, hw->hw_current); |
139 | qh->hw_current); | 141 | dbg_qtd("overlay", ehci, (struct ehci_qtd *) &hw->hw_qtd_next); |
140 | dbg_qtd ("overlay", ehci, (struct ehci_qtd *) &qh->hw_qtd_next); | ||
141 | } | 142 | } |
142 | 143 | ||
143 | static void __maybe_unused | 144 | static void __maybe_unused |
@@ -400,31 +401,32 @@ static void qh_lines ( | |||
400 | char *next = *nextp; | 401 | char *next = *nextp; |
401 | char mark; | 402 | char mark; |
402 | __le32 list_end = EHCI_LIST_END(ehci); | 403 | __le32 list_end = EHCI_LIST_END(ehci); |
404 | struct ehci_qh_hw *hw = qh->hw; | ||
403 | 405 | ||
404 | if (qh->hw_qtd_next == list_end) /* NEC does this */ | 406 | if (hw->hw_qtd_next == list_end) /* NEC does this */ |
405 | mark = '@'; | 407 | mark = '@'; |
406 | else | 408 | else |
407 | mark = token_mark(ehci, qh->hw_token); | 409 | mark = token_mark(ehci, hw->hw_token); |
408 | if (mark == '/') { /* qh_alt_next controls qh advance? */ | 410 | if (mark == '/') { /* qh_alt_next controls qh advance? */ |
409 | if ((qh->hw_alt_next & QTD_MASK(ehci)) | 411 | if ((hw->hw_alt_next & QTD_MASK(ehci)) |
410 | == ehci->async->hw_alt_next) | 412 | == ehci->async->hw->hw_alt_next) |
411 | mark = '#'; /* blocked */ | 413 | mark = '#'; /* blocked */ |
412 | else if (qh->hw_alt_next == list_end) | 414 | else if (hw->hw_alt_next == list_end) |
413 | mark = '.'; /* use hw_qtd_next */ | 415 | mark = '.'; /* use hw_qtd_next */ |
414 | /* else alt_next points to some other qtd */ | 416 | /* else alt_next points to some other qtd */ |
415 | } | 417 | } |
416 | scratch = hc32_to_cpup(ehci, &qh->hw_info1); | 418 | scratch = hc32_to_cpup(ehci, &hw->hw_info1); |
417 | hw_curr = (mark == '*') ? hc32_to_cpup(ehci, &qh->hw_current) : 0; | 419 | hw_curr = (mark == '*') ? hc32_to_cpup(ehci, &hw->hw_current) : 0; |
418 | temp = scnprintf (next, size, | 420 | temp = scnprintf (next, size, |
419 | "qh/%p dev%d %cs ep%d %08x %08x (%08x%c %s nak%d)", | 421 | "qh/%p dev%d %cs ep%d %08x %08x (%08x%c %s nak%d)", |
420 | qh, scratch & 0x007f, | 422 | qh, scratch & 0x007f, |
421 | speed_char (scratch), | 423 | speed_char (scratch), |
422 | (scratch >> 8) & 0x000f, | 424 | (scratch >> 8) & 0x000f, |
423 | scratch, hc32_to_cpup(ehci, &qh->hw_info2), | 425 | scratch, hc32_to_cpup(ehci, &hw->hw_info2), |
424 | hc32_to_cpup(ehci, &qh->hw_token), mark, | 426 | hc32_to_cpup(ehci, &hw->hw_token), mark, |
425 | (cpu_to_hc32(ehci, QTD_TOGGLE) & qh->hw_token) | 427 | (cpu_to_hc32(ehci, QTD_TOGGLE) & hw->hw_token) |
426 | ? "data1" : "data0", | 428 | ? "data1" : "data0", |
427 | (hc32_to_cpup(ehci, &qh->hw_alt_next) >> 1) & 0x0f); | 429 | (hc32_to_cpup(ehci, &hw->hw_alt_next) >> 1) & 0x0f); |
428 | size -= temp; | 430 | size -= temp; |
429 | next += temp; | 431 | next += temp; |
430 | 432 | ||
@@ -435,10 +437,10 @@ static void qh_lines ( | |||
435 | mark = ' '; | 437 | mark = ' '; |
436 | if (hw_curr == td->qtd_dma) | 438 | if (hw_curr == td->qtd_dma) |
437 | mark = '*'; | 439 | mark = '*'; |
438 | else if (qh->hw_qtd_next == cpu_to_hc32(ehci, td->qtd_dma)) | 440 | else if (hw->hw_qtd_next == cpu_to_hc32(ehci, td->qtd_dma)) |
439 | mark = '+'; | 441 | mark = '+'; |
440 | else if (QTD_LENGTH (scratch)) { | 442 | else if (QTD_LENGTH (scratch)) { |
441 | if (td->hw_alt_next == ehci->async->hw_alt_next) | 443 | if (td->hw_alt_next == ehci->async->hw->hw_alt_next) |
442 | mark = '#'; | 444 | mark = '#'; |
443 | else if (td->hw_alt_next != list_end) | 445 | else if (td->hw_alt_next != list_end) |
444 | mark = '/'; | 446 | mark = '/'; |
@@ -550,12 +552,15 @@ static ssize_t fill_periodic_buffer(struct debug_buffer *buf) | |||
550 | next += temp; | 552 | next += temp; |
551 | 553 | ||
552 | do { | 554 | do { |
555 | struct ehci_qh_hw *hw; | ||
556 | |||
553 | switch (hc32_to_cpu(ehci, tag)) { | 557 | switch (hc32_to_cpu(ehci, tag)) { |
554 | case Q_TYPE_QH: | 558 | case Q_TYPE_QH: |
559 | hw = p.qh->hw; | ||
555 | temp = scnprintf (next, size, " qh%d-%04x/%p", | 560 | temp = scnprintf (next, size, " qh%d-%04x/%p", |
556 | p.qh->period, | 561 | p.qh->period, |
557 | hc32_to_cpup(ehci, | 562 | hc32_to_cpup(ehci, |
558 | &p.qh->hw_info2) | 563 | &hw->hw_info2) |
559 | /* uframe masks */ | 564 | /* uframe masks */ |
560 | & (QH_CMASK | QH_SMASK), | 565 | & (QH_CMASK | QH_SMASK), |
561 | p.qh); | 566 | p.qh); |
@@ -576,7 +581,7 @@ static ssize_t fill_periodic_buffer(struct debug_buffer *buf) | |||
576 | /* show more info the first time around */ | 581 | /* show more info the first time around */ |
577 | if (temp == seen_count) { | 582 | if (temp == seen_count) { |
578 | u32 scratch = hc32_to_cpup(ehci, | 583 | u32 scratch = hc32_to_cpup(ehci, |
579 | &p.qh->hw_info1); | 584 | &hw->hw_info1); |
580 | struct ehci_qtd *qtd; | 585 | struct ehci_qtd *qtd; |
581 | char *type = ""; | 586 | char *type = ""; |
582 | 587 | ||
@@ -609,7 +614,7 @@ static ssize_t fill_periodic_buffer(struct debug_buffer *buf) | |||
609 | } else | 614 | } else |
610 | temp = 0; | 615 | temp = 0; |
611 | if (p.qh) { | 616 | if (p.qh) { |
612 | tag = Q_NEXT_TYPE(ehci, p.qh->hw_next); | 617 | tag = Q_NEXT_TYPE(ehci, hw->hw_next); |
613 | p = p.qh->qh_next; | 618 | p = p.qh->qh_next; |
614 | } | 619 | } |
615 | break; | 620 | break; |