<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux-toradex.git/drivers/usb/core/hub.c, branch v3.0.68</title>
<subtitle>Linux kernel for Apalis and Colibri modules</subtitle>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/'/>
<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.toradex.cn/cgit/linux-toradex.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.toradex.cn/cgit/linux-toradex.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.toradex.cn/cgit/linux-toradex.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>
<entry>
<title>usb: feed USB device information to the /dev/random driver</title>
<updated>2012-08-15T19:04:12+00:00</updated>
<author>
<name>Theodore Ts'o</name>
<email>tytso@mit.edu</email>
</author>
<published>2012-07-04T15:22:20+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=52d1114f461ad4d33d8bc38987b5991161712e96'/>
<id>52d1114f461ad4d33d8bc38987b5991161712e96</id>
<content type='text'>
commit b04b3156a20d395a7faa8eed98698d1e17a36000 upstream.

Send the USB device's serial, product, and manufacturer strings to the
/dev/random driver to help seed its pools.

Cc: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
Acked-by: Greg KH &lt;greg@kroah.com&gt;
Signed-off-by: "Theodore Ts'o" &lt;tytso@mit.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 b04b3156a20d395a7faa8eed98698d1e17a36000 upstream.

Send the USB device's serial, product, and manufacturer strings to the
/dev/random driver to help seed its pools.

Cc: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
Acked-by: Greg KH &lt;greg@kroah.com&gt;
Signed-off-by: "Theodore Ts'o" &lt;tytso@mit.edu&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</pre>
</div>
</content>
</entry>
<entry>
<title>USB: fix deadlock in bConfigurationValue attribute method</title>
<updated>2012-04-27T16:51:08+00:00</updated>
<author>
<name>Alan Stern</name>
<email>stern@rowland.harvard.edu</email>
</author>
<published>2012-04-17T19:22:39+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=5eb68e665cadf165741a04c695a71cff11e1d4f1'/>
<id>5eb68e665cadf165741a04c695a71cff11e1d4f1</id>
<content type='text'>
commit 8963c487a80b4688c9e68dcc504a90074aacc145 upstream.

This patch (as154) fixes a self-deadlock that occurs when userspace
writes to the bConfigurationValue sysfs attribute for a hub with
children.  The task tries to lock the bandwidth_mutex at a time when
it already owns the lock:

	The attribute's method calls usb_set_configuration(),
	which calls usb_disable_device() with the bandwidth_mutex
	held.

	usb_disable_device() unregisters the existing interfaces,
	which causes the hub driver to be unbound.

	The hub_disconnect() routine calls hub_quiesce(), which
	calls usb_disconnect() for each of the hub's children.

	usb_disconnect() attempts to acquire the bandwidth_mutex
	around a call to usb_disable_device().

The solution is to make usb_disable_device() acquire the mutex for
itself instead of requiring the caller to hold it.  Then the mutex can
cover only the bandwidth deallocation operation and not the region
where the interfaces are unregistered.

This has the potential to change system behavior slightly when a
config change races with another config or altsetting change.  Some of
the bandwidth released from the old config might get claimed by the
other config or altsetting, make it impossible to restore the old
config in case of a failure.  But since we don't try to recover from
config-change failures anyway, this doesn't matter.

[This should be marked for stable kernels that contain the commit
fccf4e86200b8f5edd9a65da26f150e32ba79808 "USB: Free bandwidth when
usb_disable_device is called."
That commit was marked for stable kernels as old as 2.6.32.]

Signed-off-by: Alan Stern &lt;stern@rowland.harvard.edu&gt;
Signed-off-by: Sarah Sharp &lt;sarah.a.sharp@linux.intel.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 8963c487a80b4688c9e68dcc504a90074aacc145 upstream.

This patch (as154) fixes a self-deadlock that occurs when userspace
writes to the bConfigurationValue sysfs attribute for a hub with
children.  The task tries to lock the bandwidth_mutex at a time when
it already owns the lock:

	The attribute's method calls usb_set_configuration(),
	which calls usb_disable_device() with the bandwidth_mutex
	held.

	usb_disable_device() unregisters the existing interfaces,
	which causes the hub driver to be unbound.

	The hub_disconnect() routine calls hub_quiesce(), which
	calls usb_disconnect() for each of the hub's children.

	usb_disconnect() attempts to acquire the bandwidth_mutex
	around a call to usb_disable_device().

The solution is to make usb_disable_device() acquire the mutex for
itself instead of requiring the caller to hold it.  Then the mutex can
cover only the bandwidth deallocation operation and not the region
where the interfaces are unregistered.

This has the potential to change system behavior slightly when a
config change races with another config or altsetting change.  Some of
the bandwidth released from the old config might get claimed by the
other config or altsetting, make it impossible to restore the old
config in case of a failure.  But since we don't try to recover from
config-change failures anyway, this doesn't matter.

[This should be marked for stable kernels that contain the commit
fccf4e86200b8f5edd9a65da26f150e32ba79808 "USB: Free bandwidth when
usb_disable_device is called."
That commit was marked for stable kernels as old as 2.6.32.]

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

</pre>
</div>
</content>
</entry>
<entry>
<title>USB: Set hub depth after USB3 hub reset</title>
<updated>2012-03-01T00:34:22+00:00</updated>
<author>
<name>Elric Fu</name>
<email>elricfu1@gmail.com</email>
</author>
<published>2012-02-18T05:32:27+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=ac29c0aeddba8f83dd73ec8a51c72f268c9b7b81'/>
<id>ac29c0aeddba8f83dd73ec8a51c72f268c9b7b81</id>
<content type='text'>
commit a45aa3b30583e7d54e7cf4fbcd0aa699348a6e5c upstream.

The superspeed device attached to a USB 3.0 hub(such as VIA's)
doesn't respond the address device command after resume. The
root cause is the superspeed hub will miss the Hub Depth value
that is used as an offset into the route string to locate the
bits it uses to determine the downstream port number after
reset, and all packets can't be routed to the device attached
to the superspeed hub.

Hub driver sends a Set Hub Depth request to the superspeed hub
except for USB 3.0 root hub when the hub is initialized and
doesn't send the request again after reset due to the resume
process. So moving the code that sends the Set Hub Depth request
to the superspeed hub from hub_configure() to hub_activate()
is to cover those situations include initialization and reset.

The patch should be backported to kernels as old as 2.6.39.

Signed-off-by: Elric Fu &lt;elricfu1@gmail.com&gt;
Signed-off-by: Sarah Sharp &lt;sarah.a.sharp@linux.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 a45aa3b30583e7d54e7cf4fbcd0aa699348a6e5c upstream.

The superspeed device attached to a USB 3.0 hub(such as VIA's)
doesn't respond the address device command after resume. The
root cause is the superspeed hub will miss the Hub Depth value
that is used as an offset into the route string to locate the
bits it uses to determine the downstream port number after
reset, and all packets can't be routed to the device attached
to the superspeed hub.

Hub driver sends a Set Hub Depth request to the superspeed hub
except for USB 3.0 root hub when the hub is initialized and
doesn't send the request again after reset due to the resume
process. So moving the code that sends the Set Hub Depth request
to the superspeed hub from hub_configure() to hub_activate()
is to cover those situations include initialization and reset.

The patch should be backported to kernels as old as 2.6.39.

Signed-off-by: Elric Fu &lt;elricfu1@gmail.com&gt;
Signed-off-by: Sarah Sharp &lt;sarah.a.sharp@linux.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>
<entry>
<title>usb, xhci: Clear warm reset change event during init</title>
<updated>2011-11-26T17:10:00+00:00</updated>
<author>
<name>Don Zickus</name>
<email>dzickus@redhat.com</email>
</author>
<published>2011-11-03T13:07:18+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=2e6f55fcd95ef6da9e095eb97cb70fe48be13882'/>
<id>2e6f55fcd95ef6da9e095eb97cb70fe48be13882</id>
<content type='text'>
commit 79c3dd8150fd5236d95766a9e662e3e932b462c9 upstream.

I noticed on my Panther Point system that I wasn't getting hotplug events
for my usb3.0 disk on a usb3 port.  I tracked it down to the fact that the
system had the warm reset change bit still set.  This seemed to block future
events from being received, including a hotplug event.

Clearing this bit during initialization allowed the hotplug event to be
received and the disk to be recognized correctly.

This patch should be backported to kernels as old as 2.6.39.

Signed-off-by: Don Zickus &lt;dzickus@redhat.com&gt;
Signed-off-by: Sarah Sharp &lt;sarah.a.sharp@linux.intel.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;

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

I noticed on my Panther Point system that I wasn't getting hotplug events
for my usb3.0 disk on a usb3 port.  I tracked it down to the fact that the
system had the warm reset change bit still set.  This seemed to block future
events from being received, including a hotplug event.

Clearing this bit during initialization allowed the hotplug event to be
received and the disk to be recognized correctly.

This patch should be backported to kernels as old as 2.6.39.

Signed-off-by: Don Zickus &lt;dzickus@redhat.com&gt;
Signed-off-by: Sarah Sharp &lt;sarah.a.sharp@linux.intel.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;

</pre>
</div>
</content>
</entry>
<entry>
<title>Merge branch 'for-usb-linus' of git+ssh://master.kernel.org/pub/scm/linux/kernel/git/sarah/xhci into usb-linus</title>
<updated>2011-06-27T20:36:47+00:00</updated>
<author>
<name>Greg Kroah-Hartman</name>
<email>gregkh@suse.de</email>
</author>
<published>2011-06-27T20:35:23+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=95a2424ff9221624c3944f3732f6cfacbb522ae4'/>
<id>95a2424ff9221624c3944f3732f6cfacbb522ae4</id>
<content type='text'>
* 'for-usb-linus' of git+ssh://master.kernel.org/pub/scm/linux/kernel/git/sarah/xhci:
  USB: Fix up URB error codes to reflect implementation.
  xhci: Always set urb-&gt;status to zero for isoc endpoints.
  xhci: Add reset on resume quirk for asrock p67 host
  xHCI 1.0: Incompatible Device Error
  xHCI 1.0: Force Stopped Event(FSE)
  xhci: Don't warn about zeroed bMaxBurst descriptor field.
  USB: Free bandwidth when usb_disable_device is called.
  xhci: Reject double add of active endpoints.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
* 'for-usb-linus' of git+ssh://master.kernel.org/pub/scm/linux/kernel/git/sarah/xhci:
  USB: Fix up URB error codes to reflect implementation.
  xhci: Always set urb-&gt;status to zero for isoc endpoints.
  xhci: Add reset on resume quirk for asrock p67 host
  xHCI 1.0: Incompatible Device Error
  xHCI 1.0: Force Stopped Event(FSE)
  xhci: Don't warn about zeroed bMaxBurst descriptor field.
  USB: Free bandwidth when usb_disable_device is called.
  xhci: Reject double add of active endpoints.
</pre>
</div>
</content>
</entry>
<entry>
<title>USB: don't let the hub driver prevent system sleep</title>
<updated>2011-06-16T00:44:56+00:00</updated>
<author>
<name>Alan Stern</name>
<email>stern@rowland.harvard.edu</email>
</author>
<published>2011-06-15T20:29:16+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=cbb330045e5df8f665ac60227ff898421fc8fb92'/>
<id>cbb330045e5df8f665ac60227ff898421fc8fb92</id>
<content type='text'>
This patch (as1465) continues implementation of the policy that errors
during suspend or hibernation should not prevent the system from going
to sleep.

In this case, failure to turn on the Suspend feature for a hub port
shouldn't be reported as an error.  There are situations where this
does actually occur (such as when the device plugged into that port
was disconnected in the recent past), and it turns out to be harmless.
There's no reason for it to prevent a system sleep.

Also, don't allow the hub driver to fail a system suspend if the
downstream ports aren't all suspended.  This is also harmless (and
should never happen, given the change mentioned above); printing a
warning message in the kernel log is all we really need to do.

Signed-off-by: Alan Stern &lt;stern@rowland.harvard.edu&gt;
CC: &lt;stable@kernel.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This patch (as1465) continues implementation of the policy that errors
during suspend or hibernation should not prevent the system from going
to sleep.

In this case, failure to turn on the Suspend feature for a hub port
shouldn't be reported as an error.  There are situations where this
does actually occur (such as when the device plugged into that port
was disconnected in the recent past), and it turns out to be harmless.
There's no reason for it to prevent a system sleep.

Also, don't allow the hub driver to fail a system suspend if the
downstream ports aren't all suspended.  This is also harmless (and
should never happen, given the change mentioned above); printing a
warning message in the kernel log is all we really need to do.

Signed-off-by: Alan Stern &lt;stern@rowland.harvard.edu&gt;
CC: &lt;stable@kernel.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>USB: Free bandwidth when usb_disable_device is called.</title>
<updated>2011-06-15T21:05:18+00:00</updated>
<author>
<name>Sarah Sharp</name>
<email>sarah.a.sharp@linux.intel.com</email>
</author>
<published>2011-06-06T06:22:22+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=fccf4e86200b8f5edd9a65da26f150e32ba79808'/>
<id>fccf4e86200b8f5edd9a65da26f150e32ba79808</id>
<content type='text'>
Tanya ran into an issue when trying to switch a UAS device from the BOT
configuration to the UAS configuration via the bConfigurationValue sysfs
file.  Before installing the UAS configuration, set_bConfigurationValue()
calls usb_disable_device().  That function is supposed to remove all host
controller resources associated with that device, but it leaves some state
in the xHCI host controller.

Commit 0791971ba8fbc44e4f476079f856335ed45e6324
	usb: allow drivers to use allocated bandwidth until unbound
added a call to usb_disable_device() in usb_set_configuration(), before
the xHCI bandwidth functions were invoked.  That commit fixed a bug, but
also introduced a bug that is triggered when a configured device is
switched to a new configuration.

usb_disable_device() goes through all the motions of unbinding the drivers
attached to active interfaces and removing the USB core structures
associated with those interfaces, but it doesn't actually remove the
endpoints from the internal xHCI host controller bandwidth structures.

When usb_disable_device() calls usb_disable_endpoint() with reset_hardware
set to true, the entries in udev-&gt;ep_out and udev-&gt;ep_in will be set to
NULL.  Usually, when the USB core installs a new configuration,
usb_hcd_alloc_bandwidth() will drop all non-NULL endpoints in udev-&gt;ep_out
and udev-&gt;ep_in before adding any new endpoints.  However, when the new
UAS configuration was added, all those entries were null, so none of the
old endpoints in the BOT configuration were dropped.

The xHCI driver blindly added the UAS configuration endpoints, and some of
the endpoint addresses overlapped with the old BOT configuration
endpoints.  This caused the xHCI host to reject the Configure Endpoint
command.  Now that the xHCI driver code is cleaned up to reject a
double-add of active endpoints, we need to fix the USB core to properly
drop old endpoints in usb_disable_device().

If the host controller driver needs bandwidth checking support, make
usb_disable_device() call usb_disable_endpoint() with
reset_hardware set to false, drop the endpoints from the xHCI host
controller, and then call usb_disable_endpoint() again with
reset_hardware set to true.

The first call to usb_disable_endpoint() will cancel any pending URBs and
wait on them to be freed in usb_hcd_disable_endpoint(), but will keep the
pointers in udev-&gt;ep_out and udev-&gt;ep in intact.  Then
usb_hcd_alloc_bandwidth() will use those pointers to know which endpoints
to drop.

The final call to usb_disable_endpoint() will do two things:

1. It will call usb_hcd_disable_endpoint() again, which should be harmless
since the ep-&gt;urb_list should be empty after the first call to
usb_disable_endpoint() returns.

2. It will set the entries in udev-&gt;ep_out and udev-&gt;ep in to NULL, and call
usb_hcd_disable_endpoint().  That call will have no effect, since the xHCI
driver doesn't set the endpoint_disable function pointer.

Note that usb_disable_device() will now need to be called with
hcd-&gt;bandwidth_mutex held.

This should be backported to kernels as old as 2.6.32.

Signed-off-by: Sarah Sharp &lt;sarah.a.sharp@linux.intel.com&gt;
Reported-by: Tanya Brokhman &lt;tlinder@codeaurora.org&gt;
Cc: ablay@codeaurora.org
Cc: Alan Stern &lt;stern@rowland.harvard.edu&gt;
Cc: stable@kernel.org
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Tanya ran into an issue when trying to switch a UAS device from the BOT
configuration to the UAS configuration via the bConfigurationValue sysfs
file.  Before installing the UAS configuration, set_bConfigurationValue()
calls usb_disable_device().  That function is supposed to remove all host
controller resources associated with that device, but it leaves some state
in the xHCI host controller.

Commit 0791971ba8fbc44e4f476079f856335ed45e6324
	usb: allow drivers to use allocated bandwidth until unbound
added a call to usb_disable_device() in usb_set_configuration(), before
the xHCI bandwidth functions were invoked.  That commit fixed a bug, but
also introduced a bug that is triggered when a configured device is
switched to a new configuration.

usb_disable_device() goes through all the motions of unbinding the drivers
attached to active interfaces and removing the USB core structures
associated with those interfaces, but it doesn't actually remove the
endpoints from the internal xHCI host controller bandwidth structures.

When usb_disable_device() calls usb_disable_endpoint() with reset_hardware
set to true, the entries in udev-&gt;ep_out and udev-&gt;ep_in will be set to
NULL.  Usually, when the USB core installs a new configuration,
usb_hcd_alloc_bandwidth() will drop all non-NULL endpoints in udev-&gt;ep_out
and udev-&gt;ep_in before adding any new endpoints.  However, when the new
UAS configuration was added, all those entries were null, so none of the
old endpoints in the BOT configuration were dropped.

The xHCI driver blindly added the UAS configuration endpoints, and some of
the endpoint addresses overlapped with the old BOT configuration
endpoints.  This caused the xHCI host to reject the Configure Endpoint
command.  Now that the xHCI driver code is cleaned up to reject a
double-add of active endpoints, we need to fix the USB core to properly
drop old endpoints in usb_disable_device().

If the host controller driver needs bandwidth checking support, make
usb_disable_device() call usb_disable_endpoint() with
reset_hardware set to false, drop the endpoints from the xHCI host
controller, and then call usb_disable_endpoint() again with
reset_hardware set to true.

The first call to usb_disable_endpoint() will cancel any pending URBs and
wait on them to be freed in usb_hcd_disable_endpoint(), but will keep the
pointers in udev-&gt;ep_out and udev-&gt;ep in intact.  Then
usb_hcd_alloc_bandwidth() will use those pointers to know which endpoints
to drop.

The final call to usb_disable_endpoint() will do two things:

1. It will call usb_hcd_disable_endpoint() again, which should be harmless
since the ep-&gt;urb_list should be empty after the first call to
usb_disable_endpoint() returns.

2. It will set the entries in udev-&gt;ep_out and udev-&gt;ep in to NULL, and call
usb_hcd_disable_endpoint().  That call will have no effect, since the xHCI
driver doesn't set the endpoint_disable function pointer.

Note that usb_disable_device() will now need to be called with
hcd-&gt;bandwidth_mutex held.

This should be backported to kernels as old as 2.6.32.

Signed-off-by: Sarah Sharp &lt;sarah.a.sharp@linux.intel.com&gt;
Reported-by: Tanya Brokhman &lt;tlinder@codeaurora.org&gt;
Cc: ablay@codeaurora.org
Cc: Alan Stern &lt;stern@rowland.harvard.edu&gt;
Cc: stable@kernel.org
</pre>
</div>
</content>
</entry>
</feed>
