diff options
| author | Greg Kroah-Hartman <gregkh@suse.de> | 2009-07-31 09:54:53 -0700 |
|---|---|---|
| committer | Greg Kroah-Hartman <gregkh@suse.de> | 2009-07-31 09:54:53 -0700 |
| commit | 2f6934c1a5b93267d2793111f6565a69a5bbb514 (patch) | |
| tree | c0d2ea497d54e80b428e56bd3ccf76d631653cf7 /usb.current | |
| parent | 6eef0a9c043e8c2cdef32d54a4b83d61981a9b50 (diff) | |
| download | patches-2f6934c1a5b93267d2793111f6565a69a5bbb514.tar.gz | |
more patches
Diffstat (limited to 'usb.current')
3 files changed, 193 insertions, 0 deletions
diff --git a/usb.current/usb-ehci-fix-counting-of-transaction-error-retries.patch b/usb.current/usb-ehci-fix-counting-of-transaction-error-retries.patch new file mode 100644 index 00000000000000..71b602e5edd794 --- /dev/null +++ b/usb.current/usb-ehci-fix-counting-of-transaction-error-retries.patch @@ -0,0 +1,70 @@ +From stern@rowland.harvard.edu Fri Jul 31 09:15:23 2009 +From: Alan Stern <stern@rowland.harvard.edu> +Date: Fri, 31 Jul 2009 10:41:40 -0400 (EDT) +Subject: USB: EHCI: fix counting of transaction error retries +To: Greg KH <greg@kroah.com> +Message-ID: <Pine.LNX.4.44L0.0907311040220.2956-100000@iolanthe.rowland.org> + + +This patch (as1274) simplifies the counting of transaction-error +retries. Now we will count up from 0 to QH_XACTERR_MAX instead of +down from QH_XACTERR_MAX to 0. + +The patch also fixes a small bug: qh->xacterr was not getting +initialized for interrupt endpoints. + +Signed-off-by: Alan Stern <stern@rowland.harvard.edu> +Tested-by: Matthijs Kooijman <matthijs@stdin.nl> +Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> + + +--- + drivers/usb/host/ehci-q.c | 9 ++++----- + drivers/usb/host/ehci-sched.c | 1 + + 2 files changed, 5 insertions(+), 5 deletions(-) + +--- a/drivers/usb/host/ehci-q.c ++++ b/drivers/usb/host/ehci-q.c +@@ -375,12 +375,11 @@ qh_completions (struct ehci_hcd *ehci, s + */ + if ((token & QTD_STS_XACT) && + QTD_CERR(token) == 0 && +- --qh->xacterrs > 0 && ++ ++qh->xacterrs < QH_XACTERR_MAX && + !urb->unlinked) { + ehci_dbg(ehci, + "detected XactErr len %zu/%zu retry %d\n", +- qtd->length - QTD_LENGTH(token), qtd->length, +- QH_XACTERR_MAX - qh->xacterrs); ++ qtd->length - QTD_LENGTH(token), qtd->length, qh->xacterrs); + + /* reset the token in the qtd and the + * qh overlay (which still contains +@@ -494,7 +493,7 @@ halt: + last = qtd; + + /* reinit the xacterr counter for the next qtd */ +- qh->xacterrs = QH_XACTERR_MAX; ++ qh->xacterrs = 0; + } + + /* last urb's completion might still need calling */ +@@ -941,7 +940,7 @@ static void qh_link_async (struct ehci_h + head->hw_next = dma; + + qh_get(qh); +- qh->xacterrs = QH_XACTERR_MAX; ++ qh->xacterrs = 0; + qh->qh_state = QH_STATE_LINKED; + /* qtd completions reported later by interrupt */ + } +--- a/drivers/usb/host/ehci-sched.c ++++ b/drivers/usb/host/ehci-sched.c +@@ -542,6 +542,7 @@ static int qh_link_periodic (struct ehci + } + } + qh->qh_state = QH_STATE_LINKED; ++ qh->xacterrs = 0; + qh_get (qh); + + /* update per-qh bandwidth for usbfs */ diff --git a/usb.current/usb-ehci-fix-two-new-bugs-related-to-clear-tt-buffer.patch b/usb.current/usb-ehci-fix-two-new-bugs-related-to-clear-tt-buffer.patch new file mode 100644 index 00000000000000..bfb34269b7632b --- /dev/null +++ b/usb.current/usb-ehci-fix-two-new-bugs-related-to-clear-tt-buffer.patch @@ -0,0 +1,90 @@ +From stern@rowland.harvard.edu Fri Jul 31 09:14:58 2009 +From: Alan Stern <stern@rowland.harvard.edu> +Date: Fri, 31 Jul 2009 10:40:22 -0400 (EDT) +Subject: USB: EHCI: fix two new bugs related to Clear-TT-Buffer +To: Greg KH <greg@kroah.com> +Cc: David Brownell <david-b@pacbell.net> +Message-ID: <Pine.LNX.4.44L0.0907311032160.2956-100000@iolanthe.rowland.org> + + +This patch (as1273) fixes two(!) bugs introduced by the new +Clear-TT-Buffer implementation in ehci-hcd. + + It is now possible for an idle QH to have some URBs on its + queue -- this will happen if a Clear-TT-Buffer is pending for + the QH's endpoint. Consequently we should not issue a warning + when someone tries to unlink an URB from an idle QH; instead + we should process the request immediately. + + The refcounts for QHs could get messed up, because + submit_async() would increment the refcount when calling + qh_link_async() and qh_link_async() would then refuse to link + the QH into the schedule if a Clear-TT-Buffer was pending. + Instead we should increment the refcount only when the QH + actually is added to the schedule. The current code tries to + be clever by leaving the refcount alone if an unlink is + immediately followed by a relink; the patch changes this to an + unconditional decrement and increment (although they occur in + the opposite order). + +Signed-off-by: Alan Stern <stern@rowland.harvard.edu> +CC: David Brownell <david-b@pacbell.net> +Tested-by: Manuel Lauss <manuel.lauss@gmail.com> +Tested-by: Matthijs Kooijman <matthijs@stdin.nl> +Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> + + + +--- + drivers/usb/host/ehci-hcd.c | 3 ++- + drivers/usb/host/ehci-q.c | 6 +++--- + 2 files changed, 5 insertions(+), 4 deletions(-) + +--- a/drivers/usb/host/ehci-hcd.c ++++ b/drivers/usb/host/ehci-hcd.c +@@ -903,7 +903,8 @@ static int ehci_urb_dequeue(struct usb_h + /* already started */ + break; + case QH_STATE_IDLE: +- WARN_ON(1); ++ /* QH might be waiting for a Clear-TT-Buffer */ ++ qh_completions(ehci, qh); + break; + } + break; +--- a/drivers/usb/host/ehci-q.c ++++ b/drivers/usb/host/ehci-q.c +@@ -940,6 +940,7 @@ static void qh_link_async (struct ehci_h + head->qh_next.qh = qh; + head->hw_next = dma; + ++ qh_get(qh); + qh->xacterrs = QH_XACTERR_MAX; + qh->qh_state = QH_STATE_LINKED; + /* qtd completions reported later by interrupt */ +@@ -1080,7 +1081,7 @@ submit_async ( + * the HC and TT handle it when the TT has a buffer ready. + */ + if (likely (qh->qh_state == QH_STATE_IDLE)) +- qh_link_async (ehci, qh_get (qh)); ++ qh_link_async(ehci, qh); + done: + spin_unlock_irqrestore (&ehci->lock, flags); + if (unlikely (qh == NULL)) +@@ -1115,8 +1116,6 @@ static void end_unlink_async (struct ehc + && HC_IS_RUNNING (ehci_to_hcd(ehci)->state)) + qh_link_async (ehci, qh); + else { +- qh_put (qh); // refcount from async list +- + /* it's not free to turn the async schedule on/off; leave it + * active but idle for a while once it empties. + */ +@@ -1124,6 +1123,7 @@ static void end_unlink_async (struct ehc + && ehci->async->qh_next.qh == NULL) + timer_action (ehci, TIMER_ASYNC_OFF); + } ++ qh_put(qh); /* refcount from async list */ + + if (next) { + ehci->reclaim = NULL; diff --git a/usb.current/usb-usbfs-fix-enoent-error-code-to-be-enodev.patch b/usb.current/usb-usbfs-fix-enoent-error-code-to-be-enodev.patch new file mode 100644 index 00000000000000..4399418208fc86 --- /dev/null +++ b/usb.current/usb-usbfs-fix-enoent-error-code-to-be-enodev.patch @@ -0,0 +1,33 @@ +From stern@rowland.harvard.edu Fri Jul 31 09:03:59 2009 +From: Alan Stern <stern@rowland.harvard.edu> +Date: Thu, 30 Jul 2009 15:28:14 -0400 (EDT) +Subject: USB: usbfs: fix -ENOENT error code to be -ENODEV +To: Greg KH <greg@kroah.com> +Cc: Kay Sievers <kay.sievers@vrfy.org> +Message-ID: <Pine.LNX.4.44L0.0907301527190.6087-100000@iolanthe.rowland.org> + + +This patch (as1272) changes the error code returned when an open call +for a USB device node fails to locate the corresponding device. The +appropriate error code is -ENODEV, not -ENOENT. + +Signed-off-by: Alan Stern <stern@rowland.harvard.edu> +CC: Kay Sievers <kay.sievers@vrfy.org> +Cc: stable <stable@kernel.org> +Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> + +--- + drivers/usb/core/devio.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/drivers/usb/core/devio.c ++++ b/drivers/usb/core/devio.c +@@ -595,7 +595,7 @@ static int usbdev_open(struct inode *ino + if (!ps) + goto out; + +- ret = -ENOENT; ++ ret = -ENODEV; + + /* usbdev device-node */ + if (imajor(inode) == USB_DEVICE_MAJOR) |
