linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: linux-kernel@vger.kernel.org, stable@vger.kernel.org
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	alan@lxorguk.ukuu.org.uk, Alan Stern <stern@rowland.harvard.edu>,
	Oliver Neukum <oneukum@suse.de>
Subject: [ 18/27] USB: OHCI: workaround for hardware bug: retired TDs not added to the Done Queue
Date: Fri, 14 Dec 2012 15:01:31 -0800	[thread overview]
Message-ID: <20121214222255.428009233@linuxfoundation.org> (raw)
In-Reply-To: <20121214222251.229078963@linuxfoundation.org>

3.7-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Alan Stern <stern@rowland.harvard.edu>

commit 50ce5c0683aa83eb161624ea89daa5a9eee0c2ce upstream.

This patch (as1636) is a partial workaround for a hardware bug
affecting OHCI controllers by NVIDIA at least, maybe others too.  When
the controller retires a Transfer Descriptor, it is supposed to add
the TD onto the Done Queue.  But sometimes this doesn't happen, with
the result that ohci-hcd never realizes the corresponding transfer has
finished.  Symptoms can vary; a typical result is that USB audio stops
working after a while.

The patch works around the problem by recognizing that TDs are always
processed in order.  Therefore, if a later TD is found on the Done
Queue than all the earlier TDs for the same endpoint must be finished
as well.

Unfortunately this won't solve the problem in cases where the missing
TD is the last one in the endpoint's queue.  A complete fix would
require a signficant amount of change to the driver.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Tested-by: Oliver Neukum <oneukum@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 drivers/usb/host/ohci-q.c |   19 +++++++++++++++++++
 1 file changed, 19 insertions(+)

--- a/drivers/usb/host/ohci-q.c
+++ b/drivers/usb/host/ohci-q.c
@@ -1128,6 +1128,25 @@ dl_done_list (struct ohci_hcd *ohci)
 
 	while (td) {
 		struct td	*td_next = td->next_dl_td;
+		struct ed	*ed = td->ed;
+
+		/*
+		 * Some OHCI controllers (NVIDIA for sure, maybe others)
+		 * occasionally forget to add TDs to the done queue.  Since
+		 * TDs for a given endpoint are always processed in order,
+		 * if we find a TD on the donelist then all of its
+		 * predecessors must be finished as well.
+		 */
+		for (;;) {
+			struct td	*td2;
+
+			td2 = list_first_entry(&ed->td_list, struct td,
+					td_list);
+			if (td2 == td)
+				break;
+			takeback_td(ohci, td2);
+		}
+
 		takeback_td(ohci, td);
 		td = td_next;
 	}



  parent reply	other threads:[~2012-12-14 23:09 UTC|newest]

Thread overview: 35+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-12-14 23:01 [ 00/27] 3.7.1-stable review Greg Kroah-Hartman
2012-12-14 23:01 ` [ 01/27] mm: dmapool: use provided gfp flags for all dma_alloc_coherent() calls Greg Kroah-Hartman
2012-12-14 23:01 ` [ 02/27] clk: ux500: fix bit error Greg Kroah-Hartman
2012-12-14 23:01 ` [ 03/27] x86,AMD: Power driver support for AMDs family 16h processors Greg Kroah-Hartman
2012-12-14 23:01 ` [ 04/27] telephony: ijx: buffer overflow in ixj_write_cid() Greg Kroah-Hartman
2012-12-14 23:01 ` [ 05/27] ezusb: add dependency to USB Greg Kroah-Hartman
2012-12-14 23:01 ` [ 06/27] x86: hpet: Fix masking of MSI interrupts Greg Kroah-Hartman
2012-12-14 23:01 ` [ 07/27] USB: add new zte 3g-dongles pid to option.c Greg Kroah-Hartman
2012-12-14 23:01 ` [ 08/27] USB: option: blacklist network interface on Huawei E173 Greg Kroah-Hartman
2012-12-14 23:01 ` [ 09/27] USB: ftdi_sio: Add support for Newport AGILIS motor drivers Greg Kroah-Hartman
2012-12-14 23:01 ` [ 10/27] usb: ftdi_sio: fixup BeagleBone A5+ quirk Greg Kroah-Hartman
2012-12-14 23:01 ` [ 11/27] USB: cp210x: add Virtenio Preon32 device id Greg Kroah-Hartman
2012-12-14 23:01 ` [ 12/27] USB: mark uas driver as BROKEN Greg Kroah-Hartman
2012-12-14 23:01 ` [ 13/27] ACPI / battery: Correct battery capacity values on Thinkpads Greg Kroah-Hartman
2012-12-14 23:01 ` [ 14/27] ACPI / PM: Add Sony Vaio VPCEB1S1E to nonvs blacklist Greg Kroah-Hartman
2012-12-14 23:01 ` [ 15/27] ACPI / PNP: Do not crash due to stale pointer use during system resume Greg Kroah-Hartman
2012-12-14 23:01 ` [ 16/27] ACPI / video: ignore BIOS initial backlight value for HP Folio 13-2000 Greg Kroah-Hartman
2012-12-14 23:01 ` [ 17/27] ACPI / video: Add "Asus UL30VT" to ACPI video detect blacklist Greg Kroah-Hartman
2012-12-14 23:01 ` Greg Kroah-Hartman [this message]
2012-12-14 23:01 ` [ 19/27] xhci: Extend Fresco Logic MSI quirk Greg Kroah-Hartman
2012-12-14 23:01 ` [ 20/27] ftrace: Clear bits properly in reset_iter_read() Greg Kroah-Hartman
2012-12-14 23:01 ` [ 21/27] ring-buffer: Fix NULL pointer if rb_set_head_page() fails Greg Kroah-Hartman
2012-12-14 23:01 ` [ 22/27] ring-buffer: Fix race between integrity check and readers Greg Kroah-Hartman
2012-12-14 23:01 ` [ 23/27] cdc-acm: implement TIOCSSERIAL to avoid blocking close(2) Greg Kroah-Hartman
2012-12-14 23:01 ` [ 24/27] perf test: fix a build error on builtin-test Greg Kroah-Hartman
2012-12-14 23:01 ` [ 25/27] USB: EHCI: bugfix: urb->hcpriv should not be NULL Greg Kroah-Hartman
2012-12-14 23:01 ` [ 26/27] rcu: Fix batch-limit size problem Greg Kroah-Hartman
2012-12-14 23:01 ` [ 27/27] Staging: bcm: Add two products and remove an existing product Greg Kroah-Hartman
2012-12-15 14:22 ` [ 00/27] 3.7.1-stable review Shuah Khan
2012-12-15 20:47   ` Shuah Khan
2012-12-15 14:53 ` Satoru Takeuchi
2012-12-16 19:52 ` Nikola Ciprich
2012-12-17 22:07 ` Mariusz Kozlowski
2012-12-17 22:14   ` Greg Kroah-Hartman
2012-12-17 22:38     ` Mariusz Kozlowski

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20121214222255.428009233@linuxfoundation.org \
    --to=gregkh@linuxfoundation.org \
    --cc=alan@lxorguk.ukuu.org.uk \
    --cc=linux-kernel@vger.kernel.org \
    --cc=oneukum@suse.de \
    --cc=stable@vger.kernel.org \
    --cc=stern@rowland.harvard.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).