<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux/drivers/usb/host, branch v4.2</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/
</subtitle>
<id>https://git.shady.money/linux/atom?h=v4.2</id>
<link rel='self' href='https://git.shady.money/linux/atom?h=v4.2'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/'/>
<updated>2015-08-03T21:41:48Z</updated>
<entry>
<title>drivers/usb: Delete XHCI command timer if necessary</title>
<updated>2015-08-03T21:41:48Z</updated>
<author>
<name>Gavin Shan</name>
<email>gwshan@linux.vnet.ibm.com</email>
</author>
<published>2015-08-03T13:07:49Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=ffe5adcb7661d94e952d6b5ed7f493cb4ef0c7bc'/>
<id>urn:sha1:ffe5adcb7661d94e952d6b5ed7f493cb4ef0c7bc</id>
<content type='text'>
When xhci_mem_cleanup() is called, it's possible that the command
timer isn't initialized and scheduled. For those cases, to delete
the command timer causes soft-lockup as below stack dump shows.

The patch avoids deleting the command timer if it's not scheduled
with the help of timer_pending().

NMI watchdog: BUG: soft lockup - CPU#40 stuck for 23s! [kworker/40:1:8140]
      :
NIP [c000000000150b30] lock_timer_base.isra.34+0x90/0xa0
LR [c000000000150c24] try_to_del_timer_sync+0x34/0xa0
Call Trace:
[c000000f67c975e0] [c0000000015b84f8] mon_ops+0x0/0x8 (unreliable)
[c000000f67c97620] [c000000000150c24] try_to_del_timer_sync+0x34/0xa0
[c000000f67c97660] [c000000000150cf0] del_timer_sync+0x60/0x80
[c000000f67c97690] [c00000000070ac0c] xhci_mem_cleanup+0x5c/0x5e0
[c000000f67c97740] [c00000000070c2e8] xhci_mem_init+0x1158/0x13b0
[c000000f67c97860] [c000000000700978] xhci_init+0x88/0x110
[c000000f67c978e0] [c000000000701644] xhci_gen_setup+0x2b4/0x590
[c000000f67c97970] [c0000000006d4410] xhci_pci_setup+0x40/0x190
[c000000f67c979f0] [c0000000006b1af8] usb_add_hcd+0x418/0xba0
[c000000f67c97ab0] [c0000000006cb15c] usb_hcd_pci_probe+0x1dc/0x5c0
[c000000f67c97b50] [c0000000006d3ba4] xhci_pci_probe+0x64/0x1f0
[c000000f67c97ba0] [c0000000004fe9ac] local_pci_probe+0x6c/0x130
[c000000f67c97c30] [c0000000000e5ce8] work_for_cpu_fn+0x38/0x60
[c000000f67c97c60] [c0000000000eacb8] process_one_work+0x198/0x470
[c000000f67c97cf0] [c0000000000eb6ac] worker_thread+0x37c/0x5a0
[c000000f67c97d80] [c0000000000f2730] kthread+0x110/0x130
[c000000f67c97e30] [c000000000009660] ret_from_kernel_thread+0x5c/0x7c

Cc: &lt;stable@vger.kernel.org&gt;
Reported-by: Priya M. A &lt;priyama2@in.ibm.com&gt;
Signed-off-by: Gavin Shan &lt;gwshan@linux.vnet.ibm.com&gt;
Signed-off-by: Mathias Nyman &lt;mathias.nyman@linux.intel.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>xhci: fix off by one error in TRB DMA address boundary check</title>
<updated>2015-08-03T21:41:48Z</updated>
<author>
<name>Mathias Nyman</name>
<email>mathias.nyman@linux.intel.com</email>
</author>
<published>2015-08-03T13:07:48Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=7895086afde2a05fa24a0e410d8e6b75ca7c8fdd'/>
<id>urn:sha1:7895086afde2a05fa24a0e410d8e6b75ca7c8fdd</id>
<content type='text'>
We need to check that a TRB is part of the current segment
before calculating its DMA address.

Previously a ring segment didn't use a full memory page, and every
new ring segment got a new memory page, so the off by one
error in checking the upper bound was never seen.

Now that we use a full memory page, 256 TRBs (4096 bytes), the off by one
didn't catch the case when a TRB was the first element of the next segment.

This is triggered if the virtual memory pages for a ring segment are
next to each in increasing order where the ring buffer wraps around and
causes errors like:

[  106.398223] xhci_hcd 0000:00:14.0: ERROR Transfer event TRB DMA ptr not part of current TD ep_index 0 comp_code 1
[  106.398230] xhci_hcd 0000:00:14.0: Looking for event-dma fffd3000 trb-start fffd4fd0 trb-end fffd5000 seg-start fffd4000 seg-end fffd4ff0

The trb-end address is one outside the end-seg address.

Cc: &lt;stable@vger.kernel.org&gt;
Tested-by: Arkadiusz Miśkiewicz &lt;arekm@maven.pl&gt;
Signed-off-by: Mathias Nyman &lt;mathias.nyman@linux.intel.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>USB: OHCI: fix bad #define in ohci-tmio.c</title>
<updated>2015-07-22T21:49:42Z</updated>
<author>
<name>Alan Stern</name>
<email>stern@rowland.harvard.edu</email>
</author>
<published>2015-07-08T16:14:56Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=1209544d8a2a6084f58625ca66f5cd77580df53f'/>
<id>urn:sha1:1209544d8a2a6084f58625ca66f5cd77580df53f</id>
<content type='text'>
An incorrect definition of CCR_PM_USBPW3 in ohci-tmio.c is a perennial
source of invalid diagnoses from static scanners, such as in
&lt;http://marc.info/?l=linux-usb&amp;m=143634574527641&amp;w=2&gt;.  This patch
fixes the definition.

Signed-off-by: Alan Stern &lt;stern@rowland.harvard.edu&gt;
Reported-by: David Binderman &lt;dcb314@hotmail.com&gt;
CC: Dmitry Eremin-Solenikov &lt;dbaryshkov@gmail.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>USB: OHCI: Fix race between ED unlink and URB submission</title>
<updated>2015-07-22T21:46:50Z</updated>
<author>
<name>Alan Stern</name>
<email>stern@rowland.harvard.edu</email>
</author>
<published>2015-06-30T15:25:54Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=7d8021c967648accd1b78e5e1ddaad655cd2c61f'/>
<id>urn:sha1:7d8021c967648accd1b78e5e1ddaad655cd2c61f</id>
<content type='text'>
This patch fixes a bug introduced by commit 977dcfdc6031 ("USB: OHCI:
don't lose track of EDs when a controller dies").  The commit changed
ed_state from ED_UNLINK to ED_IDLE too early, before finish_urb() had
been called.  The user-visible consequence is that the driver
occasionally crashes or locks up when an URB is submitted while
another URB for the same endpoint is being unlinked.

This patch moves the ED state change later, to the right place.  The
drawback is that now we may unnecessarily execute some instructions
multiple times when a controller dies.  Since controllers dying is an
exceptional occurrence, a little wasted time won't matter.

Signed-off-by: Alan Stern &lt;stern@rowland.harvard.edu&gt;
Reported-by: Heiko Przybyl &lt;lil_tux@web.de&gt;
Tested-by: Heiko Przybyl &lt;lil_tux@web.de&gt;
Fixes: 977dcfdc60311e7aa571cabf6f39c36dde13339e
CC: &lt;stable@vger.kernel.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>xhci: do not report PLC when link is in internal resume state</title>
<updated>2015-07-22T21:19:37Z</updated>
<author>
<name>Zhuang Jin Can</name>
<email>jin.can.zhuang@intel.com</email>
</author>
<published>2015-07-21T14:20:31Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=aca3a0489ac019b58cf32794d5362bb284cb9b94'/>
<id>urn:sha1:aca3a0489ac019b58cf32794d5362bb284cb9b94</id>
<content type='text'>
Port link change with port in resume state should not be
reported to usbcore, as this is an internal state to be
handled by xhci driver. Reporting PLC to usbcore may
cause usbcore clearing PLC first and port change event irq
won't be generated.

Cc: &lt;stable@vger.kernel.org&gt;
Signed-off-by: Zhuang Jin Can &lt;jin.can.zhuang@intel.com&gt;
Signed-off-by: Mathias Nyman &lt;mathias.nyman@linux.intel.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>xhci: prevent bus_suspend if SS port resuming in phase 1</title>
<updated>2015-07-22T21:19:37Z</updated>
<author>
<name>Zhuang Jin Can</name>
<email>jin.can.zhuang@intel.com</email>
</author>
<published>2015-07-21T14:20:30Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=fac4271d1126c45ceaceb7f4a336317b771eb121'/>
<id>urn:sha1:fac4271d1126c45ceaceb7f4a336317b771eb121</id>
<content type='text'>
When the link is just waken, it's in Resume state, and driver sets PLS to
U0. This refers to Phase 1. Phase 2 refers to when the link has completed
the transition from Resume state to U0.

With the fix of xhci: report U3 when link is in resume state, it also
exposes an issue that usb3 roothub and controller can suspend right
after phase 1, and this causes a hard hang in controller.

To fix the issue, we need to prevent usb3 bus suspend if any port is
resuming in phase 1.

[merge separate USB2 and USB3 port resume checking to one -Mathias]
Cc: &lt;stable@vger.kernel.org&gt;
Signed-off-by: Zhuang Jin Can &lt;jin.can.zhuang@intel.com&gt;
Signed-off-by: Mathias Nyman &lt;mathias.nyman@linux.intel.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>xhci: report U3 when link is in resume state</title>
<updated>2015-07-22T21:19:36Z</updated>
<author>
<name>Zhuang Jin Can</name>
<email>jin.can.zhuang@intel.com</email>
</author>
<published>2015-07-21T14:20:29Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=243292a2ad3dc365849b820a64868927168894ac'/>
<id>urn:sha1:243292a2ad3dc365849b820a64868927168894ac</id>
<content type='text'>
xhci_hub_report_usb3_link_state() returns pls as U0 when the link
is in resume state, and this causes usb core to think the link is in
U0 while actually it's in resume state. When usb core transfers
control request on the link, it fails with TRB error as the link
is not ready for transfer.

To fix the issue, report U3 when the link is in resume state, thus
usb core knows the link it's not ready for transfer.

Cc: &lt;stable@vger.kernel.org&gt;
Signed-off-by: Zhuang Jin Can &lt;jin.can.zhuang@intel.com&gt;
Signed-off-by: Mathias Nyman &lt;mathias.nyman@linux.intel.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>xhci: Calculate old endpoints correctly on device reset</title>
<updated>2015-07-22T21:19:36Z</updated>
<author>
<name>Brian Campbell</name>
<email>bacam@z273.org.uk</email>
</author>
<published>2015-07-21T14:20:28Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=326124a027abc9a7f43f72dc94f6f0f7a55b02b3'/>
<id>urn:sha1:326124a027abc9a7f43f72dc94f6f0f7a55b02b3</id>
<content type='text'>
When resetting a device the number of active TTs may need to be
corrected by xhci_update_tt_active_eps, but the number of old active
endpoints supplied to it was always zero, so the number of TTs and the
bandwidth reserved for them was not updated, and could rise
unnecessarily.

This affected systems using Intel's Patherpoint chipset, which rely on
software bandwidth checking.  For example, a Lenovo X230 would lose the
ability to use ports on the docking station after enough suspend/resume
cycles because the bandwidth calculated would rise with every cycle when
a suitable device is attached.

The correct number of active endpoints is calculated in the same way as
in xhci_reserve_bandwidth.

Cc: &lt;stable@vger.kernel.org&gt;
Signed-off-by: Brian Campbell &lt;bacam@z273.org.uk&gt;
Signed-off-by: Mathias Nyman &lt;mathias.nyman@linux.intel.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>usb: xhci: Bugfix for NULL pointer deference in xhci_endpoint_init() function</title>
<updated>2015-07-22T21:19:36Z</updated>
<author>
<name>AMAN DEEP</name>
<email>aman.deep@samsung.com</email>
</author>
<published>2015-07-21T14:20:27Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=3496810663922617d4b706ef2780c279252ddd6a'/>
<id>urn:sha1:3496810663922617d4b706ef2780c279252ddd6a</id>
<content type='text'>
virt_dev-&gt;num_cached_rings counts on freed ring and is not updated
correctly. In xhci_free_or_cache_endpoint_ring() function, the free ring
is added into cache and then num_rings_cache is incremented as below:
		virt_dev-&gt;ring_cache[rings_cached] =
			virt_dev-&gt;eps[ep_index].ring;
		virt_dev-&gt;num_rings_cached++;
here, free ring pointer is added to a current index and then
index is incremented.
So current index always points to empty location in the ring cache.
For getting available free ring, current index should be decremented
first and then corresponding ring buffer value should be taken from ring
cache.

But In function xhci_endpoint_init(), the num_rings_cached index is
accessed before decrement.
		virt_dev-&gt;eps[ep_index].new_ring =
			virt_dev-&gt;ring_cache[virt_dev-&gt;num_rings_cached];
		virt_dev-&gt;ring_cache[virt_dev-&gt;num_rings_cached] = NULL;
		virt_dev-&gt;num_rings_cached--;
This is bug in manipulating the index of ring cache.
And it should be as below:
		virt_dev-&gt;num_rings_cached--;
		virt_dev-&gt;eps[ep_index].new_ring =
			virt_dev-&gt;ring_cache[virt_dev-&gt;num_rings_cached];
		virt_dev-&gt;ring_cache[virt_dev-&gt;num_rings_cached] = NULL;

Cc: &lt;stable@vger.kernel.org&gt;
Signed-off-by: Aman Deep &lt;aman.deep@samsung.com&gt;
Signed-off-by: Mathias Nyman &lt;mathias.nyman@linux.intel.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>xhci: Workaround to get D3 working in Intel xHCI</title>
<updated>2015-07-22T21:19:36Z</updated>
<author>
<name>Rajmohan Mani</name>
<email>rajmohan.mani@intel.com</email>
</author>
<published>2015-07-21T14:20:26Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=abce329c27b315cfc01be1a305ee976ee13ed4cf'/>
<id>urn:sha1:abce329c27b315cfc01be1a305ee976ee13ed4cf</id>
<content type='text'>
The xHCI in Intel CherryView / Braswell Platform requires
a driver workaround to get xHCI D3 working. Without this
workaround, xHCI might not enter D3.

Workaround is to configure SSIC PORT as "unused" before D3
entry and "used" after D3 exit. This is done through a
vendor specific register (PORT2_SSIC_CONFIG_REG2 at offset
0x883c), in xhci suspend / resume callbacks.

Verified xHCI D3 works fine in CherryView / Braswell platform.

Signed-off-by: Rajmohan Mani &lt;rajmohan.mani@intel.com&gt;
Signed-off-by: Mathias Nyman &lt;mathias.nyman@linux.intel.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
</feed>
