linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Sven Joachim <svenjoac@gmx.de>
To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: linux-kernel@vger.kernel.org, stable@vger.kernel.org,
	Alan Stern <stern@rowland.harvard.edu>,
	Stephen Thirlwall <sdt@dr.com>
Subject: Re: [ 12/75] USB: EHCI: work around silicon bug in Intels EHCI controllers
Date: Tue, 19 Mar 2013 17:34:47 +0100	[thread overview]
Message-ID: <87mwtzjql4.fsf@turtle.gmx.de> (raw)
In-Reply-To: <20130318210511.127988921@linuxfoundation.org> (Greg Kroah-Hartman's message of "Mon, 18 Mar 2013 14:06:35 -0700")

On 2013-03-18 22:06 +0100, Greg Kroah-Hartman wrote:

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

This patch breaks resume from suspend on my system if the following
device is plugged in:

,----
| $ lsusb | head -n1
| Bus 005 Device 002: ID 07d1:3c03 D-Link System AirPlus G DWL-G122 Wireless Adapter(rev.C1) [Ralink RT2571W]
`----

The same problem exists in 3.9-rc3, FWIW.

Detailed lsusb output follows, I'll be happy to provide more information
if needed.

,----
| # lsusb -s 005: -v
| Bus 005 Device 002: ID 07d1:3c03 D-Link System AirPlus G DWL-G122 Wireless Adapter(rev.C1) [Ralink RT2571W]
| Device Descriptor:
|   bLength                18
|   bDescriptorType         1
|   bcdUSB               2.00
|   bDeviceClass            0 (Defined at Interface level)
|   bDeviceSubClass         0 
|   bDeviceProtocol         0 
|   bMaxPacketSize0        64
|   idVendor           0x07d1 D-Link System
|   idProduct          0x3c03 AirPlus G DWL-G122 Wireless Adapter(rev.C1) [Ralink RT2571W]
|   bcdDevice            0.01
|   iManufacturer           1 Ralink
|   iProduct                2 802.11 bg WLAN
|   iSerial                 0 
|   bNumConfigurations      1
|   Configuration Descriptor:
|     bLength                 9
|     bDescriptorType         2
|     wTotalLength           32
|     bNumInterfaces          1
|     bConfigurationValue     1
|     iConfiguration          0 
|     bmAttributes         0x80
|       (Bus Powered)
|     MaxPower              300mA
|     Interface Descriptor:
|       bLength                 9
|       bDescriptorType         4
|       bInterfaceNumber        0
|       bAlternateSetting       0
|       bNumEndpoints           2
|       bInterfaceClass       255 Vendor Specific Class
|       bInterfaceSubClass    255 Vendor Specific Subclass
|       bInterfaceProtocol    255 Vendor Specific Protocol
|       iInterface              0 
|       Endpoint Descriptor:
|         bLength                 7
|         bDescriptorType         5
|         bEndpointAddress     0x81  EP 1 IN
|         bmAttributes            2
|           Transfer Type            Bulk
|           Synch Type               None
|           Usage Type               Data
|         wMaxPacketSize     0x0200  1x 512 bytes
|         bInterval               0
|       Endpoint Descriptor:
|         bLength                 7
|         bDescriptorType         5
|         bEndpointAddress     0x01  EP 1 OUT
|         bmAttributes            2
|           Transfer Type            Bulk
|           Synch Type               None
|           Usage Type               Data
|         wMaxPacketSize     0x0200  1x 512 bytes
|         bInterval               0
| Device Qualifier (for other device speed):
|   bLength                10
|   bDescriptorType         6
|   bcdUSB               2.00
|   bDeviceClass            0 (Defined at Interface level)
|   bDeviceSubClass         0 
|   bDeviceProtocol         0 
|   bMaxPacketSize0        64
|   bNumConfigurations      1
| Device Status:     0x0000
|   (Bus Powered)
| 
| Bus 005 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
| Device Descriptor:
|   bLength                18
|   bDescriptorType         1
|   bcdUSB               2.00
|   bDeviceClass            9 Hub
|   bDeviceSubClass         0 Unused
|   bDeviceProtocol         0 Full speed (or root) hub
|   bMaxPacketSize0        64
|   idVendor           0x1d6b Linux Foundation
|   idProduct          0x0002 2.0 root hub
|   bcdDevice            3.08
|   iManufacturer           3 Linux 3.8.3-nouveau ehci_hcd
|   iProduct                2 EHCI Host Controller
|   iSerial                 1 0000:00:1d.7
|   bNumConfigurations      1
|   Configuration Descriptor:
|     bLength                 9
|     bDescriptorType         2
|     wTotalLength           25
|     bNumInterfaces          1
|     bConfigurationValue     1
|     iConfiguration          0 
|     bmAttributes         0xe0
|       Self Powered
|       Remote Wakeup
|     MaxPower                0mA
|     Interface Descriptor:
|       bLength                 9
|       bDescriptorType         4
|       bInterfaceNumber        0
|       bAlternateSetting       0
|       bNumEndpoints           1
|       bInterfaceClass         9 Hub
|       bInterfaceSubClass      0 Unused
|       bInterfaceProtocol      0 Full speed (or root) hub
|       iInterface              0 
|       Endpoint Descriptor:
|         bLength                 7
|         bDescriptorType         5
|         bEndpointAddress     0x81  EP 1 IN
|         bmAttributes            3
|           Transfer Type            Interrupt
|           Synch Type               None
|           Usage Type               Data
|         wMaxPacketSize     0x0004  1x 4 bytes
|         bInterval              12
| Hub Descriptor:
|   bLength              11
|   bDescriptorType      41
|   nNbrPorts             8
|   wHubCharacteristic 0x000a
|     No power switching (usb 1.0)
|     Per-port overcurrent protection
|   bPwrOn2PwrGood       10 * 2 milli seconds
|   bHubContrCurrent      0 milli Ampere
|   DeviceRemovable    0x00 0x00
|   PortPwrCtrlMask    0xff 0xff
|  Hub Port Status:
|    Port 1: 0000.0100 power
|    Port 2: 0000.0100 power
|    Port 3: 0000.0100 power
|    Port 4: 0000.0100 power
|    Port 5: 0000.0100 power
|    Port 6: 0000.0503 highspeed power enable connect
|    Port 7: 0000.0100 power
|    Port 8: 0000.0100 power
| Device Status:     0x0001
|   Self Powered
`----

Cheers,
       Sven


> From: Alan Stern <stern@rowland.harvard.edu>
>
> commit 6402c796d3b4205d3d7296157956c5100a05d7d6 upstream.
>
> This patch (as1660) works around a hardware problem present in some
> (if not all) Intel EHCI controllers.  After a QH has been unlinked
> from the async schedule and the corresponding IAA interrupt has
> occurred, the controller is not supposed access the QH and its qTDs.
> There certainly shouldn't be any more DMA writes to those structures.
> Nevertheless, Intel's controllers have been observed to perform a
> final writeback to the QH's overlay region and to the most recent qTD.
> For more information and a test program to determine whether this
> problem is present in a particular controller, see
>
> 	http://marc.info/?l=linux-usb&m=135492071812265&w=2
> 	http://marc.info/?l=linux-usb&m=136182570800963&w=2
>
> This patch works around the problem by always waiting for two IAA
> cycles when unlinking an async QH.  The extra IAA delay gives the
> controller time to perform its final writeback.
>
> Surprisingly enough, the effects of this silicon bug have gone
> undetected until quite recently.  More through luck than anything
> else, it hasn't caused any apparent problems.  However, it does
> interact badly with the path that follows this one, so it needs to be
> addressed.
>
> This is the first part of a fix for the regression reported at:
>
> 	https://bugs.launchpad.net/bugs/1088733
>
> Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
> Tested-by: Stephen Thirlwall <sdt@dr.com>
> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
>
> ---
>  drivers/usb/host/ehci-hcd.c |    6 ++----
>  drivers/usb/host/ehci-q.c   |   18 ++++++++++++++----
>  2 files changed, 16 insertions(+), 8 deletions(-)
>
> --- a/drivers/usb/host/ehci-hcd.c
> +++ b/drivers/usb/host/ehci-hcd.c
> @@ -748,11 +748,9 @@ static irqreturn_t ehci_irq (struct usb_
>  		/* guard against (alleged) silicon errata */
>  		if (cmd & CMD_IAAD)
>  			ehci_dbg(ehci, "IAA with IAAD still set?\n");
> -		if (ehci->async_iaa) {
> +		if (ehci->async_iaa)
>  			COUNT(ehci->stats.iaa);
> -			end_unlink_async(ehci);
> -		} else
> -			ehci_dbg(ehci, "IAA with nothing unlinked?\n");
> +		end_unlink_async(ehci);
>  	}
>  
>  	/* remote wakeup [4.3.1] */
> --- a/drivers/usb/host/ehci-q.c
> +++ b/drivers/usb/host/ehci-q.c
> @@ -1170,7 +1170,7 @@ static void single_unlink_async(struct e
>  	struct ehci_qh		*prev;
>  
>  	/* Add to the end of the list of QHs waiting for the next IAAD */
> -	qh->qh_state = QH_STATE_UNLINK;
> +	qh->qh_state = QH_STATE_UNLINK_WAIT;
>  	if (ehci->async_unlink)
>  		ehci->async_unlink_last->unlink_next = qh;
>  	else
> @@ -1213,9 +1213,19 @@ static void start_iaa_cycle(struct ehci_
>  
>  		/* Do only the first waiting QH (nVidia bug?) */
>  		qh = ehci->async_unlink;
> -		ehci->async_iaa = qh;
> -		ehci->async_unlink = qh->unlink_next;
> -		qh->unlink_next = NULL;
> +
> +		/*
> +		 * Intel (?) bug: The HC can write back the overlay region
> +		 * even after the IAA interrupt occurs.  In self-defense,
> +		 * always go through two IAA cycles for each QH.
> +		 */
> +		if (qh->qh_state == QH_STATE_UNLINK_WAIT) {
> +			qh->qh_state = QH_STATE_UNLINK;
> +		} else {
> +			ehci->async_iaa = qh;
> +			ehci->async_unlink = qh->unlink_next;
> +			qh->unlink_next = NULL;
> +		}
>  
>  		/* Make sure the unlinks are all visible to the hardware */
>  		wmb();

  reply	other threads:[~2013-03-19 16:34 UTC|newest]

Thread overview: 106+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-03-18 21:06 [ 00/75] 3.8.4-stable review Greg Kroah-Hartman
2013-03-18 21:06 ` [ 01/75] qcaux: add Franklin U600 Greg Kroah-Hartman
2013-03-18 21:06 ` [ 02/75] xen/pciback: Dont disable a PCI device that is already disabled Greg Kroah-Hartman
2013-03-18 21:06 ` [ 03/75] virtio: rng: disallow multiple device registrations, fixes crashes Greg Kroah-Hartman
2013-03-18 21:06 ` [ 04/75] USB: option: add Huawei E5331 Greg Kroah-Hartman
2013-03-18 21:06 ` [ 05/75] USB: cdc-wdm: fix buffer overflow Greg Kroah-Hartman
2013-03-18 21:06 ` [ 06/75] tools: usb: ffs-test: Fix build failure Greg Kroah-Hartman
2013-03-18 21:06 ` [ 07/75] usb: dwc3: core: dont forget to free coherent memory Greg Kroah-Hartman
2013-03-18 21:06 ` [ 08/75] usb: cp210x new Vendor/Device IDs Greg Kroah-Hartman
2013-03-18 21:06 ` [ 09/75] USB: added support for Cinterions products AH6 and PLS8 Greg Kroah-Hartman
2013-03-18 21:06 ` [ 10/75] usb: serial: Add Rigblaster Advantage to device table Greg Kroah-Hartman
2013-03-18 21:06 ` [ 11/75] USB: storage: fix Huawei mode switching regression Greg Kroah-Hartman
2013-03-18 21:06 ` [ 12/75] USB: EHCI: work around silicon bug in Intels EHCI controllers Greg Kroah-Hartman
2013-03-19 16:34   ` Sven Joachim [this message]
2013-03-19 18:17     ` Alan Stern
2013-03-19 18:43       ` Sven Joachim
2013-03-19 20:10         ` Alan Stern
2013-03-19 20:28           ` Sven Joachim
2013-03-19 21:00             ` Alan Stern
2013-03-19 21:44               ` Sven Joachim
2013-03-20 20:08                 ` Greg Kroah-Hartman
2013-03-20 20:14                   ` Sven Joachim
2013-03-20 20:28                     ` Greg Kroah-Hartman
2013-03-20 20:41                       ` Alan Stern
2013-03-20 22:28                         ` Greg Kroah-Hartman
2013-03-21 14:35                           ` Alan Stern
2013-03-19 18:03   ` Stephen Warren
2013-03-18 21:06 ` [ 13/75] USB: EHCI: dont check DMA values in QH overlays Greg Kroah-Hartman
2013-03-18 21:06 ` [ 14/75] staging: vt6656: Fix oops on resume from suspend Greg Kroah-Hartman
2013-03-18 21:06 ` [ 15/75] staging: comedi: dt9812: use CR_CHAN() for channel number Greg Kroah-Hartman
2013-03-18 21:06 ` [ 16/75] qcserial: bind to DM/DIAG port on Gobi 1K devices Greg Kroah-Hartman
2013-03-18 21:06 ` [ 17/75] signal: always clear sa_restorer on execve Greg Kroah-Hartman
2013-03-18 21:06 ` [ 18/75] ext3: Fix format string issues Greg Kroah-Hartman
2013-03-18 21:06 ` [ 19/75] tty/8250_pnp: serial port detection regression since v3.7 Greg Kroah-Hartman
2013-03-18 21:06 ` [ 20/75] serial: 8250: Keep 8250.<xxxx> module options functional after driver rename Greg Kroah-Hartman
2013-03-18 21:06 ` [ 21/75] serial: 8250_pci: add support for another kind of NetMos Technology PCI 9835 Multi-I/O Controller Greg Kroah-Hartman
2013-03-18 21:06 ` [ 22/75] tty: serial: fix typo "ARCH_S5P6450" Greg Kroah-Hartman
2013-03-18 21:06 ` [ 23/75] tty: serial: fix typo "SERIAL_S3C2412" Greg Kroah-Hartman
2013-03-18 21:06 ` [ 24/75] tty/serial: Add support for Altera serial port Greg Kroah-Hartman
2013-03-18 21:06 ` [ 25/75] TTY: disable debugging warning Greg Kroah-Hartman
2013-03-18 21:06 ` [ 26/75] TTY: do not reset masters packet mode Greg Kroah-Hartman
2013-03-18 21:06 ` [ 27/75] Fix 4 port and add support for 8 port Unknown PCI serial port cards Greg Kroah-Hartman
2013-03-18 21:06 ` [ 28/75] ARM: kirkwood: fix to retain gbe MAC addresses for DT kernels Greg Kroah-Hartman
2013-03-18 21:06 ` [ 29/75] perf,x86: fix kernel crash with PEBS/BTS after suspend/resume Greg Kroah-Hartman
2013-03-18 21:11   ` Stephane Eranian
2013-03-18 21:20     ` Greg Kroah-Hartman
2013-03-18 21:35       ` Stephane Eranian
2013-03-18 23:00         ` Greg Kroah-Hartman
2013-03-18 21:06 ` [ 30/75] ALSA: seq: Fix missing error handling in snd_seq_timer_open() Greg Kroah-Hartman
2013-03-18 21:06 ` [ 31/75] ARM: w1-gpio: fix erroneous gpio requests Greg Kroah-Hartman
2013-03-18 21:06 ` [ 32/75] hwmon: (pmbus/ltc2978) Fix temperature reporting Greg Kroah-Hartman
2013-03-18 21:06 ` [ 33/75] hwmon: (lineage-pem) Add missing terminating entry for pem_[input|fan]_attributes Greg Kroah-Hartman
2013-03-18 21:06 ` [ 34/75] w1-gpio: remove erroneous __exit and __exit_p() Greg Kroah-Hartman
2013-03-18 21:06 ` [ 35/75] w1: fix oops when w1_search is called from netlink connector Greg Kroah-Hartman
2013-03-18 21:06 ` [ 36/75] powerpc: Fix STAB initialization Greg Kroah-Hartman
2013-03-18 21:07 ` [ 37/75] powerpc: Fix cputable entry for 970MP rev 1.0 Greg Kroah-Hartman
2013-03-18 21:07 ` [ 38/75] powerpc: Make VSID_BITS* dependency explicit Greg Kroah-Hartman
2013-03-18 21:07 ` [ 39/75] powerpc: Update kernel VSID range Greg Kroah-Hartman
2013-03-18 21:07 ` [ 40/75] powerpc: Rename USER_ESID_BITS* to ESID_BITS* Greg Kroah-Hartman
2013-03-18 21:07 ` [ 41/75] ARM: davinci: edma: fix dmaengine induced null pointer dereference on da830 Greg Kroah-Hartman
2013-03-19 16:25   ` Luis Henriques
     [not found]   ` <f20a6d0dd7604c0fa6ed95604a8dfb35@DLEE70.ent.ti.com>
2013-03-19 17:27     ` Matt Porter
2013-03-19 18:25       ` Luis Henriques
2013-03-18 21:07 ` [ 42/75] selinux: use GFP_ATOMIC under spin_lock Greg Kroah-Hartman
2013-03-18 21:07 ` [ 43/75] perf,x86: fix wrmsr_on_cpu() warning on suspend/resume Greg Kroah-Hartman
2013-03-18 21:07 ` [ 44/75] perf,x86: fix link failure for non-Intel configs Greg Kroah-Hartman
2013-03-18 21:07 ` [ 45/75] s390: critical section cleanup vs. machine checks Greg Kroah-Hartman
2013-03-18 21:07 ` [ 46/75] s390/mm: fix flush_tlb_kernel_range() Greg Kroah-Hartman
2013-03-18 21:07 ` [ 47/75] btrfs: use rcu_barrier() to wait for bdev puts at unmount Greg Kroah-Hartman
2013-03-18 21:07 ` [ 48/75] mtd: nand: reintroduce NAND_NO_READRDY as NAND_NEED_READRDY Greg Kroah-Hartman
2013-03-18 21:07 ` [ 49/75] kbuild: fix make headers_check with make 3.80 Greg Kroah-Hartman
2013-03-18 21:07 ` [ 50/75] atmel_lcdfb: fix 16-bpp modes on older SOCs Greg Kroah-Hartman
2013-03-18 21:07 ` [ 51/75] net/mlx4_en: Initialize RFS filters lock and list in init_netdev Greg Kroah-Hartman
2013-03-18 21:07 ` [ 52/75] net/mlx4_en: Disable RFS when running in SRIOV mode Greg Kroah-Hartman
2013-03-18 21:07 ` [ 53/75] block: use i_size_write() in bd_set_size() Greg Kroah-Hartman
2013-03-18 21:07 ` [ 54/75] loopdev: fix a deadlock Greg Kroah-Hartman
2013-03-18 21:07 ` [ 55/75] loopdev: remove an user triggerable oops Greg Kroah-Hartman
2013-03-18 21:07 ` [ 56/75] net/sctp: Validate parameter size for SCTP_GET_ASSOC_STATS Greg Kroah-Hartman
2013-03-18 21:07 ` [ 57/75] l2tp: Restore socket refcount when sendmsg succeeds Greg Kroah-Hartman
2013-03-18 21:07 ` [ 58/75] atl1c: restore buffer state Greg Kroah-Hartman
2013-03-18 21:07 ` [ 59/75] rds: limit the size allocated by rds_message_alloc() Greg Kroah-Hartman
2013-03-18 21:07 ` [ 60/75] net: ipv6: Dont purge default router if accept_ra=2 Greg Kroah-Hartman
2013-03-18 21:07 ` [ 61/75] tcp: fix double-counted receiver RTT when leaving receiver fast path Greg Kroah-Hartman
2013-03-18 21:07 ` [ 62/75] tun: add a missing nf_reset() in tun_net_xmit() Greg Kroah-Hartman
2013-03-18 21:07 ` [ 63/75] vxlan: fix oops when delete netns containing vxlan Greg Kroah-Hartman
2013-03-18 21:07 ` [ 64/75] bonding: fire NETDEV_RELEASE event only on 0 slaves Greg Kroah-Hartman
2013-03-18 21:07 ` [ 65/75] team: unsyc the devices addresses when port is removed Greg Kroah-Hartman
2013-03-18 21:07 ` [ 66/75] macvlan: Set IFF_UNICAST_FLT flag to prevent unnecessary promisc mode Greg Kroah-Hartman
2013-03-18 21:07 ` [ 67/75] netlabel: correctly list all the static label mappings Greg Kroah-Hartman
2013-03-18 21:07 ` [ 68/75] bridging: fix rx_handlers return code Greg Kroah-Hartman
2013-03-18 21:07 ` [ 69/75] ipv6: stop multicast forwarding to process interface scoped addresses Greg Kroah-Hartman
2013-03-18 21:07 ` [ 70/75] bridge: fix mdb info leaks Greg Kroah-Hartman
2013-03-18 21:07 ` [ 71/75] rtnl: fix info leak on RTM_GETLINK request for VF devices Greg Kroah-Hartman
2013-03-18 21:07 ` [ 72/75] dcbnl: fix various netlink info leaks Greg Kroah-Hartman
2013-03-18 21:07 ` [ 73/75] 6lowpan: Fix endianness issue in is_addr_link_local() Greg Kroah-Hartman
2013-03-18 21:07 ` [ 74/75] Revert "drm/i915: enable irqs earlier when resuming" Greg Kroah-Hartman
2013-03-27 15:45   ` Ilya Tumaykin
2013-03-27 16:52     ` Daniel Vetter
2013-03-18 21:07 ` [ 75/75] Revert "drm/i915: reorder setup sequence to have irqs for output setup" Greg Kroah-Hartman
2013-03-19  0:51 ` [ 00/75] 3.8.4-stable review Shuah Khan
2013-03-19  0:57   ` Greg Kroah-Hartman
2013-03-19  1:09     ` Shuah Khan
2013-03-19  2:00       ` Greg Kroah-Hartman
2013-03-19  4:00         ` Shuah Khan
2013-03-19  4:07           ` Greg Kroah-Hartman
2013-03-19 15:51             ` Shuah Khan

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=87mwtzjql4.fsf@turtle.gmx.de \
    --to=svenjoac@gmx.de \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=sdt@dr.com \
    --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).