diff options
author | Alan Stern <stern@rowland.harvard.edu> | 2007-03-19 15:31:42 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2007-03-26 17:17:48 -0400 |
commit | e009f1b202219c62ea7e277adbb953d703dac983 (patch) | |
tree | f4eddb5808258c2b1f7504b4866a65c8a0a8434e /drivers/usb/host/uhci-debug.c | |
parent | e0f2e3a06be513352cb4955313ed7e55909acd84 (diff) |
UHCI: Fix problem caused by lack of terminating QH
This patch (as871) fixes a problem introduced by an earlier change.
It turns out that some systems really do need to have a terminating
skeleton QH present whenever FSBR is on. I don't know any way to tell
which systems do need it and which don't; the easiest answer is to
have it there always.
This fixes the NumLock-hang bug reported by Jiri Slaby.
Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/usb/host/uhci-debug.c')
-rw-r--r-- | drivers/usb/host/uhci-debug.c | 26 |
1 files changed, 15 insertions, 11 deletions
diff --git a/drivers/usb/host/uhci-debug.c b/drivers/usb/host/uhci-debug.c index 8d24d3dc0a61..1497371583b9 100644 --- a/drivers/usb/host/uhci-debug.c +++ b/drivers/usb/host/uhci-debug.c | |||
@@ -145,7 +145,8 @@ static int uhci_show_urbp(struct urb_priv *urbp, char *buf, int len, int space) | |||
145 | return out - buf; | 145 | return out - buf; |
146 | } | 146 | } |
147 | 147 | ||
148 | static int uhci_show_qh(struct uhci_qh *qh, char *buf, int len, int space) | 148 | static int uhci_show_qh(struct uhci_hcd *uhci, |
149 | struct uhci_qh *qh, char *buf, int len, int space) | ||
149 | { | 150 | { |
150 | char *out = buf; | 151 | char *out = buf; |
151 | int i, nurbs; | 152 | int i, nurbs; |
@@ -190,6 +191,9 @@ static int uhci_show_qh(struct uhci_qh *qh, char *buf, int len, int space) | |||
190 | 191 | ||
191 | if (list_empty(&qh->queue)) { | 192 | if (list_empty(&qh->queue)) { |
192 | out += sprintf(out, "%*s queue is empty\n", space, ""); | 193 | out += sprintf(out, "%*s queue is empty\n", space, ""); |
194 | if (qh == uhci->skel_async_qh) | ||
195 | out += uhci_show_td(uhci->term_td, out, | ||
196 | len - (out - buf), 0); | ||
193 | } else { | 197 | } else { |
194 | struct urb_priv *urbp = list_entry(qh->queue.next, | 198 | struct urb_priv *urbp = list_entry(qh->queue.next, |
195 | struct urb_priv, node); | 199 | struct urb_priv, node); |
@@ -343,6 +347,7 @@ static int uhci_sprint_schedule(struct uhci_hcd *uhci, char *buf, int len) | |||
343 | struct list_head *tmp, *head; | 347 | struct list_head *tmp, *head; |
344 | int nframes, nerrs; | 348 | int nframes, nerrs; |
345 | __le32 link; | 349 | __le32 link; |
350 | __le32 fsbr_link; | ||
346 | 351 | ||
347 | static const char * const qh_names[] = { | 352 | static const char * const qh_names[] = { |
348 | "unlink", "iso", "int128", "int64", "int32", "int16", | 353 | "unlink", "iso", "int128", "int64", "int32", "int16", |
@@ -424,21 +429,22 @@ check_link: | |||
424 | 429 | ||
425 | out += sprintf(out, "Skeleton QHs\n"); | 430 | out += sprintf(out, "Skeleton QHs\n"); |
426 | 431 | ||
432 | fsbr_link = 0; | ||
427 | for (i = 0; i < UHCI_NUM_SKELQH; ++i) { | 433 | for (i = 0; i < UHCI_NUM_SKELQH; ++i) { |
428 | int cnt = 0; | 434 | int cnt = 0; |
429 | __le32 fsbr_link = 0; | ||
430 | 435 | ||
431 | qh = uhci->skelqh[i]; | 436 | qh = uhci->skelqh[i]; |
432 | out += sprintf(out, "- skel_%s_qh\n", qh_names[i]); \ | 437 | out += sprintf(out, "- skel_%s_qh\n", qh_names[i]); \ |
433 | out += uhci_show_qh(qh, out, len - (out - buf), 4); | 438 | out += uhci_show_qh(uhci, qh, out, len - (out - buf), 4); |
434 | 439 | ||
435 | /* Last QH is the Terminating QH, it's different */ | 440 | /* Last QH is the Terminating QH, it's different */ |
436 | if (i == SKEL_TERM) { | 441 | if (i == SKEL_TERM) { |
437 | if (qh_element(qh) != LINK_TO_TD(uhci->term_td)) | 442 | if (qh_element(qh) != LINK_TO_TD(uhci->term_td)) |
438 | out += sprintf(out, " skel_term_qh element is not set to term_td!\n"); | 443 | out += sprintf(out, " skel_term_qh element is not set to term_td!\n"); |
439 | if (link == LINK_TO_QH(uhci->skel_term_qh)) | 444 | link = fsbr_link; |
440 | goto check_qh_link; | 445 | if (!link) |
441 | continue; | 446 | link = LINK_TO_QH(uhci->skel_term_qh); |
447 | goto check_qh_link; | ||
442 | } | 448 | } |
443 | 449 | ||
444 | head = &qh->node; | 450 | head = &qh->node; |
@@ -448,7 +454,7 @@ check_link: | |||
448 | qh = list_entry(tmp, struct uhci_qh, node); | 454 | qh = list_entry(tmp, struct uhci_qh, node); |
449 | tmp = tmp->next; | 455 | tmp = tmp->next; |
450 | if (++cnt <= 10) | 456 | if (++cnt <= 10) |
451 | out += uhci_show_qh(qh, out, | 457 | out += uhci_show_qh(uhci, qh, out, |
452 | len - (out - buf), 4); | 458 | len - (out - buf), 4); |
453 | if (!fsbr_link && qh->skel >= SKEL_FSBR) | 459 | if (!fsbr_link && qh->skel >= SKEL_FSBR) |
454 | fsbr_link = LINK_TO_QH(qh); | 460 | fsbr_link = LINK_TO_QH(qh); |
@@ -463,8 +469,6 @@ check_link: | |||
463 | link = LINK_TO_QH(uhci->skel_async_qh); | 469 | link = LINK_TO_QH(uhci->skel_async_qh); |
464 | else if (!uhci->fsbr_is_on) | 470 | else if (!uhci->fsbr_is_on) |
465 | ; | 471 | ; |
466 | else if (fsbr_link) | ||
467 | link = fsbr_link; | ||
468 | else | 472 | else |
469 | link = LINK_TO_QH(uhci->skel_term_qh); | 473 | link = LINK_TO_QH(uhci->skel_term_qh); |
470 | check_qh_link: | 474 | check_qh_link: |
@@ -573,8 +577,8 @@ static const struct file_operations uhci_debug_operations = { | |||
573 | static inline void lprintk(char *buf) | 577 | static inline void lprintk(char *buf) |
574 | {} | 578 | {} |
575 | 579 | ||
576 | static inline int uhci_show_qh(struct uhci_qh *qh, char *buf, | 580 | static inline int uhci_show_qh(struct uhci_hcd *uhci, |
577 | int len, int space) | 581 | struct uhci_qh *qh, char *buf, int len, int space) |
578 | { | 582 | { |
579 | return 0; | 583 | return 0; |
580 | } | 584 | } |