<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux-stable.git/drivers/usb/core, branch v3.0.99</title>
<subtitle>Linux kernel stable tree</subtitle>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/'/>
<entry>
<title>usb/core/devio.c: Don't reject control message to endpoint with wrong direction bit</title>
<updated>2013-10-05T14:00:39+00:00</updated>
<author>
<name>Kurt Garloff</name>
<email>kurt@garloff.de</email>
</author>
<published>2013-09-24T12:13:48+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=0c61d8a1d51e6f701ee17af5fa33bdeefaa02b75'/>
<id>0c61d8a1d51e6f701ee17af5fa33bdeefaa02b75</id>
<content type='text'>
commit 831abf76643555a99b80a3b54adfa7e4fa0a3259 upstream.

Trying to read data from the Pegasus Technologies NoteTaker (0e20:0101)
[1] with the Windows App (EasyNote) works natively but fails when
Windows is running under KVM (and the USB device handed to KVM).

The reason is a USB control message
 usb 4-2.2: control urb: bRequestType=22 bRequest=09 wValue=0200 wIndex=0001 wLength=0008
This goes to endpoint address 0x01 (wIndex); however, endpoint address
0x01 does not exist. There is an endpoint 0x81 though (same number,
but other direction); the app may have meant that endpoint instead.

The kernel thus rejects the IO and thus we see the failure.

Apparently, Linux is more strict here than Windows ... we can't change
the Win app easily, so that's a problem.

It seems that the Win app/driver is buggy here and the driver does not
behave fully according to the USB HID class spec that it claims to
belong to.  The device seems to happily deal with that though (and
seems to not really care about this value much).

So the question is whether the Linux kernel should filter here.
Rejecting has the risk that somewhat non-compliant userspace apps/
drivers (most likely in a virtual machine) are prevented from working.
Not rejecting has the risk of confusing an overly sensitive device with
such a transfer. Given the fact that Windows does not filter it makes
this risk rather small though.

The patch makes the kernel more tolerant: If the endpoint address in
wIndex does not exist, but an endpoint with toggled direction bit does,
it will let the transfer through. (It does NOT change the message.)

With attached patch, the app in Windows in KVM works.
 usb 4-2.2: check_ctrlrecip: process 13073 (qemu-kvm) requesting ep 01 but needs 81

I suspect this will mostly affect apps in virtual environments; as on
Linux the apps would have been adapted to the stricter handling of the
kernel. I have done that for mine[2].

[1] http://www.pegatech.com/
[2] https://sourceforge.net/projects/notetakerpen/

Signed-off-by: Kurt Garloff &lt;kurt@garloff.de&gt;
Acked-by: Alan Stern &lt;stern@rowland.harvard.edu&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
commit 831abf76643555a99b80a3b54adfa7e4fa0a3259 upstream.

Trying to read data from the Pegasus Technologies NoteTaker (0e20:0101)
[1] with the Windows App (EasyNote) works natively but fails when
Windows is running under KVM (and the USB device handed to KVM).

The reason is a USB control message
 usb 4-2.2: control urb: bRequestType=22 bRequest=09 wValue=0200 wIndex=0001 wLength=0008
This goes to endpoint address 0x01 (wIndex); however, endpoint address
0x01 does not exist. There is an endpoint 0x81 though (same number,
but other direction); the app may have meant that endpoint instead.

The kernel thus rejects the IO and thus we see the failure.

Apparently, Linux is more strict here than Windows ... we can't change
the Win app easily, so that's a problem.

It seems that the Win app/driver is buggy here and the driver does not
behave fully according to the USB HID class spec that it claims to
belong to.  The device seems to happily deal with that though (and
seems to not really care about this value much).

So the question is whether the Linux kernel should filter here.
Rejecting has the risk that somewhat non-compliant userspace apps/
drivers (most likely in a virtual machine) are prevented from working.
Not rejecting has the risk of confusing an overly sensitive device with
such a transfer. Given the fact that Windows does not filter it makes
this risk rather small though.

The patch makes the kernel more tolerant: If the endpoint address in
wIndex does not exist, but an endpoint with toggled direction bit does,
it will let the transfer through. (It does NOT change the message.)

With attached patch, the app in Windows in KVM works.
 usb 4-2.2: check_ctrlrecip: process 13073 (qemu-kvm) requesting ep 01 but needs 81

I suspect this will mostly affect apps in virtual environments; as on
Linux the apps would have been adapted to the stricter handling of the
kernel. I have done that for mine[2].

[1] http://www.pegatech.com/
[2] https://sourceforge.net/projects/notetakerpen/

Signed-off-by: Kurt Garloff &lt;kurt@garloff.de&gt;
Acked-by: Alan Stern &lt;stern@rowland.harvard.edu&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</pre>
</div>
</content>
</entry>
<entry>
<title>usb: config-&gt;desc.bLength may not exceed amount of data returned by the device</title>
<updated>2013-09-26T23:52:47+00:00</updated>
<author>
<name>Hans de Goede</name>
<email>hdegoede@redhat.com</email>
</author>
<published>2013-08-03T14:37:48+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=ff819a0c7f12179d197aa06841087964dd2be7d3'/>
<id>ff819a0c7f12179d197aa06841087964dd2be7d3</id>
<content type='text'>
commit b4f17a488ae2e09bfcf95c0e0b4219c246f1116a upstream.

While reading the config parsing code I noticed this check is missing, without
this check config-&gt;desc.wTotalLength can end up with a value larger then the
dev-&gt;rawdescriptors length for the config, and when userspace then tries to
get the rawdescriptors bad things may happen.

Signed-off-by: Hans de Goede &lt;hdegoede@redhat.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
commit b4f17a488ae2e09bfcf95c0e0b4219c246f1116a upstream.

While reading the config parsing code I noticed this check is missing, without
this check config-&gt;desc.wTotalLength can end up with a value larger then the
dev-&gt;rawdescriptors length for the config, and when userspace then tries to
get the rawdescriptors bad things may happen.

Signed-off-by: Hans de Goede &lt;hdegoede@redhat.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</pre>
</div>
</content>
</entry>
<entry>
<title>usb: add two quirky touchscreen</title>
<updated>2013-08-20T15:21:01+00:00</updated>
<author>
<name>Oliver Neukum</name>
<email>oneukum@suse.de</email>
</author>
<published>2013-08-14T09:01:46+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=fc1cabf00e9fd2fbfaf4d4df246f53138ccf3a0d'/>
<id>fc1cabf00e9fd2fbfaf4d4df246f53138ccf3a0d</id>
<content type='text'>
commit 304ab4ab079a8ed03ce39f1d274964a532db036b upstream.

These devices tend to become unresponsive after S3

Signed-off-by: Oliver Neukum &lt;oneukum@suse.de&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
commit 304ab4ab079a8ed03ce39f1d274964a532db036b upstream.

These devices tend to become unresponsive after S3

Signed-off-by: Oliver Neukum &lt;oneukum@suse.de&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</pre>
</div>
</content>
</entry>
<entry>
<title>usb: Clear both buffers when clearing a control transfer TT buffer.</title>
<updated>2013-08-04T07:43:34+00:00</updated>
<author>
<name>William Gulland</name>
<email>wgulland@google.com</email>
</author>
<published>2013-06-27T23:10:20+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=94c3bbaf01202674a406d075429513e321a5b236'/>
<id>94c3bbaf01202674a406d075429513e321a5b236</id>
<content type='text'>
commit 2c7b871b9102c497ba8f972aa5d38532f05b654d upstream.

Control transfers have both IN and OUT (or SETUP) packets, so when
clearing TT buffers for a control transfer it's necessary to send
two HUB_CLEAR_TT_BUFFER requests to the hub.

Signed-off-by: William Gulland &lt;wgulland@google.com&gt;
Acked-by: Alan Stern &lt;stern@rowland.harvard.edu&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
commit 2c7b871b9102c497ba8f972aa5d38532f05b654d upstream.

Control transfers have both IN and OUT (or SETUP) packets, so when
clearing TT buffers for a control transfer it's necessary to send
two HUB_CLEAR_TT_BUFFER requests to the hub.

Signed-off-by: William Gulland &lt;wgulland@google.com&gt;
Acked-by: Alan Stern &lt;stern@rowland.harvard.edu&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</pre>
</div>
</content>
</entry>
<entry>
<title>USB: reset resume quirk needed by a hub</title>
<updated>2013-06-07T19:46:35+00:00</updated>
<author>
<name>Oliver Neukum</name>
<email>oliver@neukum.org</email>
</author>
<published>2013-04-30T08:18:04+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=ea4950c9faa2a5d1019d74ff559374a56fdad8a2'/>
<id>ea4950c9faa2a5d1019d74ff559374a56fdad8a2</id>
<content type='text'>
commit bac6b03275184c912ad0818c9a0a736847804dca upstream.

Werner Fink has reported problems with this hub.

Signed-off-by: Oliver Neukum &lt;oliver@neukum.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
commit bac6b03275184c912ad0818c9a0a736847804dca upstream.

Werner Fink has reported problems with this hub.

Signed-off-by: Oliver Neukum &lt;oliver@neukum.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</pre>
</div>
</content>
</entry>
<entry>
<title>usbfs: Always allow ctrl requests with USB_RECIP_ENDPOINT on the ctrl ep</title>
<updated>2013-05-08T02:57:21+00:00</updated>
<author>
<name>Hans de Goede</name>
<email>hdegoede@redhat.com</email>
</author>
<published>2013-04-16T09:08:33+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=60306774f3716df189a69d226d2a59fcf57b4aa9'/>
<id>60306774f3716df189a69d226d2a59fcf57b4aa9</id>
<content type='text'>
commit 1361bf4b9f9ef45e628a5b89e0fd9bedfdcb7104 upstream.

When usbfs receives a ctrl-request from userspace it calls check_ctrlrecip,
which for a request with USB_RECIP_ENDPOINT tries to map this to an interface
to see if this interface is claimed, except for ctrl-requests with a type of
USB_TYPE_VENDOR.

When trying to use this device: http://www.akaipro.com/eiepro
redirected to a Windows vm running on qemu on top of Linux.

The windows driver makes a ctrl-req with USB_TYPE_CLASS and
USB_RECIP_ENDPOINT with index 0, and the mapping of the endpoint (0) to
the interface fails since ep 0 is the ctrl endpoint and thus never is
part of an interface.

This patch fixes this ctrl-req failing by skipping the checkintf call for
USB_RECIP_ENDPOINT ctrl-reqs on the ctrl endpoint.

Reported-by: Dave Stikkolorum &lt;d.r.stikkolorum@hhs.nl&gt;
Tested-by: Dave Stikkolorum &lt;d.r.stikkolorum@hhs.nl&gt;
Signed-off-by: Hans de Goede &lt;hdegoede@redhat.com&gt;
Acked-by: Alan Stern &lt;stern@rowland.harvard.edu&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
commit 1361bf4b9f9ef45e628a5b89e0fd9bedfdcb7104 upstream.

When usbfs receives a ctrl-request from userspace it calls check_ctrlrecip,
which for a request with USB_RECIP_ENDPOINT tries to map this to an interface
to see if this interface is claimed, except for ctrl-requests with a type of
USB_TYPE_VENDOR.

When trying to use this device: http://www.akaipro.com/eiepro
redirected to a Windows vm running on qemu on top of Linux.

The windows driver makes a ctrl-req with USB_TYPE_CLASS and
USB_RECIP_ENDPOINT with index 0, and the mapping of the endpoint (0) to
the interface fails since ep 0 is the ctrl endpoint and thus never is
part of an interface.

This patch fixes this ctrl-req failing by skipping the checkintf call for
USB_RECIP_ENDPOINT ctrl-reqs on the ctrl endpoint.

Reported-by: Dave Stikkolorum &lt;d.r.stikkolorum@hhs.nl&gt;
Tested-by: Dave Stikkolorum &lt;d.r.stikkolorum@hhs.nl&gt;
Signed-off-by: Hans de Goede &lt;hdegoede@redhat.com&gt;
Acked-by: Alan Stern &lt;stern@rowland.harvard.edu&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</pre>
</div>
</content>
</entry>
<entry>
<title>USB: fix endpoint-disabling for failed config changes</title>
<updated>2013-01-21T19:44:59+00:00</updated>
<author>
<name>Alan Stern</name>
<email>stern@rowland.harvard.edu</email>
</author>
<published>2012-11-07T15:31:30+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=b436f48a31692bc41b9d049dec23cf55714d70d5'/>
<id>b436f48a31692bc41b9d049dec23cf55714d70d5</id>
<content type='text'>
commit 36caff5d795429c572443894e8789c2150dd796b upstream.

This patch (as1631) fixes a bug that shows up when a config change
fails for a device under an xHCI controller.  The controller needs to
be told to disable the endpoints that have been enabled for the new
config.  The existing code does this, but before storing the
information about which endpoints were enabled!  As a result, any
second attempt to install the new config is doomed to fail because
xhci-hcd will refuse to enable an endpoint that is already enabled.

The patch optimistically initializes the new endpoints' device
structures before asking the device to switch to the new config.  If
the request fails then the endpoint information is already stored, so
we can use usb_hcd_alloc_bandwidth() to disable the endpoints with no
trouble.  The rest of the error path is slightly more complex now; we
have to disable the new interfaces and call put_device() rather than
simply deallocating them.

Signed-off-by: Alan Stern &lt;stern@rowland.harvard.edu&gt;
Reported-and-tested-by: Matthias Schniedermeyer &lt;ms@citd.de&gt;
CC: Sarah Sharp &lt;sarah.a.sharp@linux.intel.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
Signed-off-by: CAI Qian &lt;caiqian@redhat.com&gt;

</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
commit 36caff5d795429c572443894e8789c2150dd796b upstream.

This patch (as1631) fixes a bug that shows up when a config change
fails for a device under an xHCI controller.  The controller needs to
be told to disable the endpoints that have been enabled for the new
config.  The existing code does this, but before storing the
information about which endpoints were enabled!  As a result, any
second attempt to install the new config is doomed to fail because
xhci-hcd will refuse to enable an endpoint that is already enabled.

The patch optimistically initializes the new endpoints' device
structures before asking the device to switch to the new config.  If
the request fails then the endpoint information is already stored, so
we can use usb_hcd_alloc_bandwidth() to disable the endpoints with no
trouble.  The rest of the error path is slightly more complex now; we
have to disable the new interfaces and call put_device() rather than
simply deallocating them.

Signed-off-by: Alan Stern &lt;stern@rowland.harvard.edu&gt;
Reported-and-tested-by: Matthias Schniedermeyer &lt;ms@citd.de&gt;
CC: Sarah Sharp &lt;sarah.a.sharp@linux.intel.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
Signed-off-by: CAI Qian &lt;caiqian@redhat.com&gt;

</pre>
</div>
</content>
</entry>
<entry>
<title>USB: hub: handle claim of enabled remote wakeup after reset</title>
<updated>2013-01-17T16:44:12+00:00</updated>
<author>
<name>Oliver Neukum</name>
<email>oliver@neukum.org</email>
</author>
<published>2012-11-29T14:05:57+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=b30765e89105c321ed5a5259dc6b05752cbc8137'/>
<id>b30765e89105c321ed5a5259dc6b05752cbc8137</id>
<content type='text'>
commit 07e72b95f5038cc82304b9a4a2eb7f9fc391ea68 upstream.

Some touchscreens have buggy firmware which claims
remote wakeup to be enabled after a reset. They nevertheless
crash if the feature is cleared by the host.
Add a check for reset resume before checking for
an enabled remote wakeup feature. On compliant
devices the feature must be cleared after a reset anyway.

Signed-off-by: Oliver Neukum &lt;oneukum@suse.de&gt;
Acked-by: Alan Stern &lt;stern@rowland.harvard.edu&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
commit 07e72b95f5038cc82304b9a4a2eb7f9fc391ea68 upstream.

Some touchscreens have buggy firmware which claims
remote wakeup to be enabled after a reset. They nevertheless
crash if the feature is cleared by the host.
Add a check for reset resume before checking for
an enabled remote wakeup feature. On compliant
devices the feature must be cleared after a reset anyway.

Signed-off-by: Oliver Neukum &lt;oneukum@suse.de&gt;
Acked-by: Alan Stern &lt;stern@rowland.harvard.edu&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</pre>
</div>
</content>
</entry>
<entry>
<title>USB: Increase reset timeout.</title>
<updated>2013-01-17T16:44:12+00:00</updated>
<author>
<name>Sarah Sharp</name>
<email>sarah.a.sharp@linux.intel.com</email>
</author>
<published>2012-11-15T01:16:52+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=e16e202710af9cc74b01c60ea1e338e3e954e6ed'/>
<id>e16e202710af9cc74b01c60ea1e338e3e954e6ed</id>
<content type='text'>
commit 77c7f072c87fa951e9a74805febf26466f31170c upstream.

John's NEC 0.96 xHCI host controller needs a longer timeout for a warm
reset to complete.  The logs show it takes 650ms to complete the warm
reset, so extend the hub reset timeout to 800ms to be on the safe side.

This commit should be backported to kernels as old as 3.2, that contain
the commit 75d7cf72ab9fa01dc70877aa5c68e8ef477229dc "usbcore: refine
warm reset logic".

Signed-off-by: Sarah Sharp &lt;sarah.a.sharp@linux.intel.com&gt;
Acked-by: Alan Stern &lt;stern@rowland.harvard.edu&gt;
Reported-by: John Covici &lt;covici@ccs.covici.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
commit 77c7f072c87fa951e9a74805febf26466f31170c upstream.

John's NEC 0.96 xHCI host controller needs a longer timeout for a warm
reset to complete.  The logs show it takes 650ms to complete the warm
reset, so extend the hub reset timeout to 800ms to be on the safe side.

This commit should be backported to kernels as old as 3.2, that contain
the commit 75d7cf72ab9fa01dc70877aa5c68e8ef477229dc "usbcore: refine
warm reset logic".

Signed-off-by: Sarah Sharp &lt;sarah.a.sharp@linux.intel.com&gt;
Acked-by: Alan Stern &lt;stern@rowland.harvard.edu&gt;
Reported-by: John Covici &lt;covici@ccs.covici.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</pre>
</div>
</content>
</entry>
<entry>
<title>usb hub: send clear_tt_buffer_complete events when canceling TT clear work</title>
<updated>2012-10-31T16:51:35+00:00</updated>
<author>
<name>Octavian Purdila</name>
<email>octavian.purdila@intel.com</email>
</author>
<published>2012-10-01T19:21:12+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=974ee86a47395138c0def2639686d02e4a8af34c'/>
<id>974ee86a47395138c0def2639686d02e4a8af34c</id>
<content type='text'>
commit 3b6054da68f9b0d5ed6a7ed0f42a79e61904352c upstream.

There is a race condition in the USB hub code with regard to handling
TT clear requests that can get the HCD driver in a deadlock. Usually
when an TT clear request is scheduled it will be executed immediately:

&lt;7&gt;[    6.077583] usb 2-1.3: unlink qh1-0e01/f4d4db00 start 0 [1/2 us]
&lt;3&gt;[    6.078041] usb 2-1: clear tt buffer port 3, a3 ep2 t04048d82
&lt;7&gt;[    6.078299] hub_tt_work:731
&lt;7&gt;[    9.309089] usb 2-1.5: link qh1-0e01/f4d506c0 start 0 [1/2 us]
&lt;7&gt;[    9.324526] ehci_hcd 0000:00:1d.0: reused qh f4d4db00 schedule
&lt;7&gt;[    9.324539] usb 2-1.3: link qh1-0e01/f4d4db00 start 0 [1/2 us]
&lt;7&gt;[    9.341530] usb 1-1.1: link qh4-0e01/f397aec0 start 2 [1/2 us]
&lt;7&gt;[   10.116159] usb 2-1.3: unlink qh1-0e01/f4d4db00 start 0 [1/2 us]
&lt;3&gt;[   10.116459] usb 2-1: clear tt buffer port 3, a3 ep2 t04048d82
&lt;7&gt;[   10.116537] hub_tt_work:731

However, if a suspend operation is triggered before hub_tt_work is
scheduled, hub_quiesce will cancel the work without notifying the HCD
driver:

&lt;3&gt;[   35.033941] usb 2-1: clear tt buffer port 3, a3 ep2 t04048d80
&lt;5&gt;[   35.034022] sd 0:0:0:0: [sda] Stopping disk
&lt;7&gt;[   35.034039] hub 2-1:1.0: hub_suspend
&lt;7&gt;[   35.034067] usb 2-1: unlink qh256-0001/f3b1ab00 start 1 [1/0 us]
&lt;7&gt;[   35.035085] hub 1-0:1.0: hub_suspend
&lt;7&gt;[   35.035102] usb usb1: bus suspend, wakeup 0
&lt;7&gt;[   35.035106] ehci_hcd 0000:00:1a.0: suspend root hub
&lt;7&gt;[   35.035298] hub 2-0:1.0: hub_suspend
&lt;7&gt;[   35.035313] usb usb2: bus suspend, wakeup 0
&lt;7&gt;[   35.035315] ehci_hcd 0000:00:1d.0: suspend root hub
&lt;6&gt;[   35.250017] PM: suspend of devices complete after 216.979 msecs
&lt;6&gt;[   35.250822] PM: late suspend of devices complete after 0.799 msecs
&lt;7&gt;[   35.252343] ehci_hcd 0000:00:1d.0: wakeup: 1
&lt;7&gt;[   35.262923] ehci_hcd 0000:00:1d.0: --&gt; PCI D3hot
&lt;7&gt;[   35.263302] ehci_hcd 0000:00:1a.0: wakeup: 1
&lt;7&gt;[   35.273912] ehci_hcd 0000:00:1a.0: --&gt; PCI D3hot
&lt;6&gt;[   35.274254] PM: noirq suspend of devices complete after 23.442 msecs
&lt;6&gt;[   35.274975] ACPI: Preparing to enter system sleep state S3
&lt;6&gt;[   35.292666] PM: Saving platform NVS memory
&lt;7&gt;[   35.295030] Disabling non-boot CPUs ...
&lt;6&gt;[   35.297351] CPU 1 is now offline
&lt;6&gt;[   35.300345] CPU 2 is now offline
&lt;6&gt;[   35.303929] CPU 3 is now offline
&lt;7&gt;[   35.303931] lockdep: fixing up alternatives.
&lt;6&gt;[   35.304825] Extended CMOS year: 2000

When the device will resume the EHCI driver will get stuck in
ehci_endpoint_disable waiting for the tt_clearing flag to reset:

&lt;0&gt;[   47.610967] usb 2-1.3: **** DPM device timeout ****
&lt;7&gt;[   47.610972]  f2f11c60 00000092 f2f11c0c c10624a5 00000003 f4c6e880 c1c8a4c0 c1c8a4c0
&lt;7&gt;[   47.610983]  15c55698 0000000b f56b34c0 f2a45b70 f4c6e880 00000082 f2a4602c f2f11c30
&lt;7&gt;[   47.610993]  c10787f8 f4cac000 f2a45b70 00000000 f4cac010 f2f11c58 00000046 00000001
&lt;7&gt;[   47.611004] Call Trace:
&lt;7&gt;[   47.611006]  [&lt;c10624a5&gt;] ? sched_clock_cpu+0xf5/0x160
&lt;7&gt;[   47.611019]  [&lt;c10787f8&gt;] ? lock_release_holdtime.part.22+0x88/0xf0
&lt;7&gt;[   47.611026]  [&lt;c103ed46&gt;] ? lock_timer_base.isra.35+0x26/0x50
&lt;7&gt;[   47.611034]  [&lt;c17592d3&gt;] ? schedule_timeout+0x133/0x290
&lt;7&gt;[   47.611044]  [&lt;c175b43e&gt;] schedule+0x1e/0x50
&lt;7&gt;[   47.611051]  [&lt;c17592d8&gt;] schedule_timeout+0x138/0x290
&lt;7&gt;[   47.611057]  [&lt;c10624a5&gt;] ? sched_clock_cpu+0xf5/0x160
&lt;7&gt;[   47.611063]  [&lt;c103e560&gt;] ? usleep_range+0x40/0x40
&lt;7&gt;[   47.611070]  [&lt;c1759445&gt;] schedule_timeout_uninterruptible+0x15/0x20
&lt;7&gt;[   47.611077]  [&lt;c14935f4&gt;] ehci_endpoint_disable+0x64/0x160
&lt;7&gt;[   47.611084]  [&lt;c147d1ee&gt;] ? usb_hcd_flush_endpoint+0x10e/0x1d0
&lt;7&gt;[   47.611092]  [&lt;c1165663&gt;] ? sysfs_add_file+0x13/0x20
&lt;7&gt;[   47.611100]  [&lt;c147d5a9&gt;] usb_hcd_disable_endpoint+0x29/0x40
&lt;7&gt;[   47.611107]  [&lt;c147fafc&gt;] usb_disable_endpoint+0x5c/0x80
&lt;7&gt;[   47.611111]  [&lt;c147fb57&gt;] usb_disable_interface+0x37/0x50
&lt;7&gt;[   47.611116]  [&lt;c1477650&gt;] usb_reset_and_verify_device+0x4b0/0x640
&lt;7&gt;[   47.611122]  [&lt;c1474665&gt;] ? hub_port_status+0xb5/0x100
&lt;7&gt;[   47.611129]  [&lt;c147a975&gt;] usb_port_resume+0xd5/0x220
&lt;7&gt;[   47.611136]  [&lt;c148877f&gt;] generic_resume+0xf/0x30
&lt;7&gt;[   47.611142]  [&lt;c14821a3&gt;] usb_resume+0x133/0x180
&lt;7&gt;[   47.611147]  [&lt;c1473b10&gt;] ? usb_dev_thaw+0x10/0x10
&lt;7&gt;[   47.611152]  [&lt;c1473b1d&gt;] usb_dev_resume+0xd/0x10
&lt;7&gt;[   47.611157]  [&lt;c13baa60&gt;] dpm_run_callback+0x40/0xb0
&lt;7&gt;[   47.611164]  [&lt;c13bdb03&gt;] ? pm_runtime_enable+0x43/0x70
&lt;7&gt;[   47.611171]  [&lt;c13bafc6&gt;] device_resume+0x1a6/0x2c0
&lt;7&gt;[   47.611177]  [&lt;c13ba940&gt;] ? dpm_show_time+0xe0/0xe0
&lt;7&gt;[   47.611183]  [&lt;c13bb0f9&gt;] async_resume+0x19/0x40
&lt;7&gt;[   47.611189]  [&lt;c10580c4&gt;] async_run_entry_fn+0x64/0x160
&lt;7&gt;[   47.611196]  [&lt;c104a244&gt;] ? process_one_work+0x104/0x480
&lt;7&gt;[   47.611203]  [&lt;c104a24c&gt;] ? process_one_work+0x10c/0x480
&lt;7&gt;[   47.611209]  [&lt;c104a2c0&gt;] process_one_work+0x180/0x480
&lt;7&gt;[   47.611215]  [&lt;c104a244&gt;] ? process_one_work+0x104/0x480
&lt;7&gt;[   47.611220]  [&lt;c1058060&gt;] ? async_schedule+0x10/0x10
&lt;7&gt;[   47.611226]  [&lt;c104c15c&gt;] worker_thread+0x11c/0x2f0
&lt;7&gt;[   47.611233]  [&lt;c104c040&gt;] ? manage_workers.isra.27+0x1f0/0x1f0
&lt;7&gt;[   47.611239]  [&lt;c10507f8&gt;] kthread+0x78/0x80
&lt;7&gt;[   47.611244]  [&lt;c1750000&gt;] ? timer_cpu_notify+0xd6/0x20d
&lt;7&gt;[   47.611253]  [&lt;c1050780&gt;] ? __init_kthread_worker+0x60/0x60
&lt;7&gt;[   47.611258]  [&lt;c176357e&gt;] kernel_thread_helper+0x6/0xd
&lt;7&gt;[   47.611283] ------------[ cut here ]------------

This patch changes hub_quiesce behavior to flush the TT clear work
instead of canceling it, to make sure that no TT clear request remains
uncompleted before suspend.

Signed-off-by: Octavian Purdila &lt;octavian.purdila@intel.com&gt;
Acked-by: Alan Stern &lt;stern@rowland.harvard.edu&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
commit 3b6054da68f9b0d5ed6a7ed0f42a79e61904352c upstream.

There is a race condition in the USB hub code with regard to handling
TT clear requests that can get the HCD driver in a deadlock. Usually
when an TT clear request is scheduled it will be executed immediately:

&lt;7&gt;[    6.077583] usb 2-1.3: unlink qh1-0e01/f4d4db00 start 0 [1/2 us]
&lt;3&gt;[    6.078041] usb 2-1: clear tt buffer port 3, a3 ep2 t04048d82
&lt;7&gt;[    6.078299] hub_tt_work:731
&lt;7&gt;[    9.309089] usb 2-1.5: link qh1-0e01/f4d506c0 start 0 [1/2 us]
&lt;7&gt;[    9.324526] ehci_hcd 0000:00:1d.0: reused qh f4d4db00 schedule
&lt;7&gt;[    9.324539] usb 2-1.3: link qh1-0e01/f4d4db00 start 0 [1/2 us]
&lt;7&gt;[    9.341530] usb 1-1.1: link qh4-0e01/f397aec0 start 2 [1/2 us]
&lt;7&gt;[   10.116159] usb 2-1.3: unlink qh1-0e01/f4d4db00 start 0 [1/2 us]
&lt;3&gt;[   10.116459] usb 2-1: clear tt buffer port 3, a3 ep2 t04048d82
&lt;7&gt;[   10.116537] hub_tt_work:731

However, if a suspend operation is triggered before hub_tt_work is
scheduled, hub_quiesce will cancel the work without notifying the HCD
driver:

&lt;3&gt;[   35.033941] usb 2-1: clear tt buffer port 3, a3 ep2 t04048d80
&lt;5&gt;[   35.034022] sd 0:0:0:0: [sda] Stopping disk
&lt;7&gt;[   35.034039] hub 2-1:1.0: hub_suspend
&lt;7&gt;[   35.034067] usb 2-1: unlink qh256-0001/f3b1ab00 start 1 [1/0 us]
&lt;7&gt;[   35.035085] hub 1-0:1.0: hub_suspend
&lt;7&gt;[   35.035102] usb usb1: bus suspend, wakeup 0
&lt;7&gt;[   35.035106] ehci_hcd 0000:00:1a.0: suspend root hub
&lt;7&gt;[   35.035298] hub 2-0:1.0: hub_suspend
&lt;7&gt;[   35.035313] usb usb2: bus suspend, wakeup 0
&lt;7&gt;[   35.035315] ehci_hcd 0000:00:1d.0: suspend root hub
&lt;6&gt;[   35.250017] PM: suspend of devices complete after 216.979 msecs
&lt;6&gt;[   35.250822] PM: late suspend of devices complete after 0.799 msecs
&lt;7&gt;[   35.252343] ehci_hcd 0000:00:1d.0: wakeup: 1
&lt;7&gt;[   35.262923] ehci_hcd 0000:00:1d.0: --&gt; PCI D3hot
&lt;7&gt;[   35.263302] ehci_hcd 0000:00:1a.0: wakeup: 1
&lt;7&gt;[   35.273912] ehci_hcd 0000:00:1a.0: --&gt; PCI D3hot
&lt;6&gt;[   35.274254] PM: noirq suspend of devices complete after 23.442 msecs
&lt;6&gt;[   35.274975] ACPI: Preparing to enter system sleep state S3
&lt;6&gt;[   35.292666] PM: Saving platform NVS memory
&lt;7&gt;[   35.295030] Disabling non-boot CPUs ...
&lt;6&gt;[   35.297351] CPU 1 is now offline
&lt;6&gt;[   35.300345] CPU 2 is now offline
&lt;6&gt;[   35.303929] CPU 3 is now offline
&lt;7&gt;[   35.303931] lockdep: fixing up alternatives.
&lt;6&gt;[   35.304825] Extended CMOS year: 2000

When the device will resume the EHCI driver will get stuck in
ehci_endpoint_disable waiting for the tt_clearing flag to reset:

&lt;0&gt;[   47.610967] usb 2-1.3: **** DPM device timeout ****
&lt;7&gt;[   47.610972]  f2f11c60 00000092 f2f11c0c c10624a5 00000003 f4c6e880 c1c8a4c0 c1c8a4c0
&lt;7&gt;[   47.610983]  15c55698 0000000b f56b34c0 f2a45b70 f4c6e880 00000082 f2a4602c f2f11c30
&lt;7&gt;[   47.610993]  c10787f8 f4cac000 f2a45b70 00000000 f4cac010 f2f11c58 00000046 00000001
&lt;7&gt;[   47.611004] Call Trace:
&lt;7&gt;[   47.611006]  [&lt;c10624a5&gt;] ? sched_clock_cpu+0xf5/0x160
&lt;7&gt;[   47.611019]  [&lt;c10787f8&gt;] ? lock_release_holdtime.part.22+0x88/0xf0
&lt;7&gt;[   47.611026]  [&lt;c103ed46&gt;] ? lock_timer_base.isra.35+0x26/0x50
&lt;7&gt;[   47.611034]  [&lt;c17592d3&gt;] ? schedule_timeout+0x133/0x290
&lt;7&gt;[   47.611044]  [&lt;c175b43e&gt;] schedule+0x1e/0x50
&lt;7&gt;[   47.611051]  [&lt;c17592d8&gt;] schedule_timeout+0x138/0x290
&lt;7&gt;[   47.611057]  [&lt;c10624a5&gt;] ? sched_clock_cpu+0xf5/0x160
&lt;7&gt;[   47.611063]  [&lt;c103e560&gt;] ? usleep_range+0x40/0x40
&lt;7&gt;[   47.611070]  [&lt;c1759445&gt;] schedule_timeout_uninterruptible+0x15/0x20
&lt;7&gt;[   47.611077]  [&lt;c14935f4&gt;] ehci_endpoint_disable+0x64/0x160
&lt;7&gt;[   47.611084]  [&lt;c147d1ee&gt;] ? usb_hcd_flush_endpoint+0x10e/0x1d0
&lt;7&gt;[   47.611092]  [&lt;c1165663&gt;] ? sysfs_add_file+0x13/0x20
&lt;7&gt;[   47.611100]  [&lt;c147d5a9&gt;] usb_hcd_disable_endpoint+0x29/0x40
&lt;7&gt;[   47.611107]  [&lt;c147fafc&gt;] usb_disable_endpoint+0x5c/0x80
&lt;7&gt;[   47.611111]  [&lt;c147fb57&gt;] usb_disable_interface+0x37/0x50
&lt;7&gt;[   47.611116]  [&lt;c1477650&gt;] usb_reset_and_verify_device+0x4b0/0x640
&lt;7&gt;[   47.611122]  [&lt;c1474665&gt;] ? hub_port_status+0xb5/0x100
&lt;7&gt;[   47.611129]  [&lt;c147a975&gt;] usb_port_resume+0xd5/0x220
&lt;7&gt;[   47.611136]  [&lt;c148877f&gt;] generic_resume+0xf/0x30
&lt;7&gt;[   47.611142]  [&lt;c14821a3&gt;] usb_resume+0x133/0x180
&lt;7&gt;[   47.611147]  [&lt;c1473b10&gt;] ? usb_dev_thaw+0x10/0x10
&lt;7&gt;[   47.611152]  [&lt;c1473b1d&gt;] usb_dev_resume+0xd/0x10
&lt;7&gt;[   47.611157]  [&lt;c13baa60&gt;] dpm_run_callback+0x40/0xb0
&lt;7&gt;[   47.611164]  [&lt;c13bdb03&gt;] ? pm_runtime_enable+0x43/0x70
&lt;7&gt;[   47.611171]  [&lt;c13bafc6&gt;] device_resume+0x1a6/0x2c0
&lt;7&gt;[   47.611177]  [&lt;c13ba940&gt;] ? dpm_show_time+0xe0/0xe0
&lt;7&gt;[   47.611183]  [&lt;c13bb0f9&gt;] async_resume+0x19/0x40
&lt;7&gt;[   47.611189]  [&lt;c10580c4&gt;] async_run_entry_fn+0x64/0x160
&lt;7&gt;[   47.611196]  [&lt;c104a244&gt;] ? process_one_work+0x104/0x480
&lt;7&gt;[   47.611203]  [&lt;c104a24c&gt;] ? process_one_work+0x10c/0x480
&lt;7&gt;[   47.611209]  [&lt;c104a2c0&gt;] process_one_work+0x180/0x480
&lt;7&gt;[   47.611215]  [&lt;c104a244&gt;] ? process_one_work+0x104/0x480
&lt;7&gt;[   47.611220]  [&lt;c1058060&gt;] ? async_schedule+0x10/0x10
&lt;7&gt;[   47.611226]  [&lt;c104c15c&gt;] worker_thread+0x11c/0x2f0
&lt;7&gt;[   47.611233]  [&lt;c104c040&gt;] ? manage_workers.isra.27+0x1f0/0x1f0
&lt;7&gt;[   47.611239]  [&lt;c10507f8&gt;] kthread+0x78/0x80
&lt;7&gt;[   47.611244]  [&lt;c1750000&gt;] ? timer_cpu_notify+0xd6/0x20d
&lt;7&gt;[   47.611253]  [&lt;c1050780&gt;] ? __init_kthread_worker+0x60/0x60
&lt;7&gt;[   47.611258]  [&lt;c176357e&gt;] kernel_thread_helper+0x6/0xd
&lt;7&gt;[   47.611283] ------------[ cut here ]------------

This patch changes hub_quiesce behavior to flush the TT clear work
instead of canceling it, to make sure that no TT clear request remains
uncompleted before suspend.

Signed-off-by: Octavian Purdila &lt;octavian.purdila@intel.com&gt;
Acked-by: Alan Stern &lt;stern@rowland.harvard.edu&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</pre>
</div>
</content>
</entry>
</feed>
