<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux/drivers/usb/host, branch v3.9</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=v3.9</id>
<link rel='self' href='https://git.shady.money/linux/atom?h=v3.9'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/'/>
<updated>2013-03-26T21:14:54Z</updated>
<entry>
<title>Merge tag 'for-usb-linus-2013-03-26' of git://git.kernel.org/pub/scm/linux/kernel/git/sarah/xhci into usb-linus</title>
<updated>2013-03-26T21:14:54Z</updated>
<author>
<name>Greg Kroah-Hartman</name>
<email>gregkh@linuxfoundation.org</email>
</author>
<published>2013-03-26T21:14:54Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=d78658d45eef74f18d78bc49801f90a0c50fbea0'/>
<id>urn:sha1:d78658d45eef74f18d78bc49801f90a0c50fbea0</id>
<content type='text'>
Misc xHCI fixes for 3.9

Hi Greg,

Here's a couple of fixes for the xHCI driver.  Three patches are nothing
major: build warning fix, macro field width fix, and removing some
unnecessary log spam.

The only interesting thing here is Tianyu's two patches to fix the USB
port connection type discovery, for the USB port power off mechanism.
This adds new USB host API, but as discussed, it's necessary to avoid
powering off the wrong USB port.  It's not marked for backport to stable
kernels, since the sysfs mechanism to manually power off a port didn't
go in until 3.9.

I've smoke tested these, including system suspend, USB device suspend,
and rocking out in my cube with a pair of USB headphones.  They look
fine to me.

Hibernate is currently broken on my system, due to some nouveau MMIO
read faults.  I'll report that separately.

Sarah Sharp
</content>
</entry>
<entry>
<title>USB: EHCI: fix bug in iTD/siTD DMA pool allocation</title>
<updated>2013-03-25T20:59:04Z</updated>
<author>
<name>Soeren Moch</name>
<email>smoch@web.de</email>
</author>
<published>2013-03-22T16:16:52Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=85ecd0322b9a1a9f451d9150e9460ab42fd17219'/>
<id>urn:sha1:85ecd0322b9a1a9f451d9150e9460ab42fd17219</id>
<content type='text'>
[Description written by Alan Stern]

Soeren tracked down a very difficult bug in ehci-hcd's DMA pool
management of iTD and siTD structures.  Some background: ehci-hcd
gives each isochronous endpoint its own set of active and free itd's
(or sitd's for full-speed devices).  When a new itd is needed, it is
taken from the head of the free list, if possible.  However, itd's
must not be used twice in a single frame because the hardware
continues to access the data structure for the entire duration of a
frame.  Therefore if the itd at the head of the free list has its
"frame" member equal to the current value of ehci-&gt;now_frame, it
cannot be reused and instead a new itd is allocated from the DMA pool.
The entries on the free list are not released back to the pool until
the endpoint is no longer in use.

The bug arises from the fact that sometimes an itd can be moved back
onto the free list before itd-&gt;frame has been set properly.  In
Soeren's case, this happened because ehci-hcd can allocate one more
itd than it actually needs for an URB; the extra itd may or may not be
required depending on how the transfer aligns with a frame boundary.
For example, an URB with 8 isochronous packets will cause two itd's to
be allocated.  If the URB is scheduled to start in microframe 3 of
frame N then it will require both itds: one for microframes 3 - 7 of
frame N and one for microframes 0 - 2 of frame N+1.  But if the URB
had been scheduled to start in microframe 0 then it would require only
the first itd, which could cover microframes 0 - 7 of frame N.  The
second itd would be returned to the end of the free list.

The itd allocation routine initializes the entire structure to 0, so
the extra itd ends up on the free list with itd-&gt;frame set to 0
instead of a meaningful value.  After a while the itd reaches the head
of the list, and occasionally this happens when ehci-&gt;now_frame is
equal to 0.  Then, even though it would be okay to reuse this itd, the
driver thinks it must get another itd from the DMA pool.

For as long as the isochronous endpoint remains in use, this flaw in
the mechanism causes more and more itd's to be taken slowly from the
DMA pool.  Since none are released back, the pool eventually becomes
exhausted.

This reuslts in memory allocation failures, which typically show up
during a long-running audio stream.  Video might suffer the same
effect.

The fix is very simple.  To prevent allocations from the pool when
they aren't needed, make sure that itd's sent back to the free list
prematurely have itd-&gt;frame set to an invalid value which can never be
equal to ehci-&gt;now_frame.

This should be applied to -stable kernels going back to 3.6.

Signed-off-by: Soeren Moch &lt;smoch@web.de&gt;
Signed-off-by: Alan Stern &lt;stern@rowland.harvard.edu&gt;
Cc: stable &lt;stable@vger.kernel.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>xhci: Don't warn on empty ring for suspended devices.</title>
<updated>2013-03-25T17:39:19Z</updated>
<author>
<name>Sarah Sharp</name>
<email>sarah.a.sharp@linux.intel.com</email>
</author>
<published>2013-03-18T17:19:51Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=a83d6755814e4614ba77e15d82796af0f695c6b8'/>
<id>urn:sha1:a83d6755814e4614ba77e15d82796af0f695c6b8</id>
<content type='text'>
When a device attached to the roothub is suspended, the endpoint rings
are stopped.  The host may generate a completion event with the
completion code set to 'Stopped' or 'Stopped Invalid' when the ring is
halted.  The current xHCI code prints a warning in that case, which can
be really annoying if the USB device is coming into and out of suspend.

Remove the unnecessary warning.

Signed-off-by: Sarah Sharp &lt;sarah.a.sharp@linux.intel.com&gt;
Tested-by: Stephen Hemminger &lt;stephen@networkplumber.org&gt;
</content>
</entry>
<entry>
<title>usb: xhci: Fix TRB transfer length macro used for Event TRB.</title>
<updated>2013-03-25T17:39:18Z</updated>
<author>
<name>Vivek Gautam</name>
<email>gautam.vivek@samsung.com</email>
</author>
<published>2013-03-21T06:36:48Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=1c11a172cb30492f5f6a82c6e118fdcd9946c34f'/>
<id>urn:sha1:1c11a172cb30492f5f6a82c6e118fdcd9946c34f</id>
<content type='text'>
Use proper macro while extracting TRB transfer length from
Transfer event TRBs. Adding a macro EVENT_TRB_LEN (bits 0:23)
for the same, and use it instead of TRB_LEN (bits 0:16) in
case of event TRBs.

This patch should be backported to kernels as old as 2.6.31, that
contain the commit b10de142119a676552df3f0d2e3a9d647036c26a "USB: xhci:
Bulk transfer support".  This patch will have issues applying to older
kernels.

Signed-off-by: Vivek gautam &lt;gautam.vivek@samsung.com&gt;
Signed-off-by: Sarah Sharp &lt;sarah.a.sharp@linux.intel.com&gt;
Cc: stable@vger.kernel.org
</content>
</entry>
<entry>
<title>usb: add find_raw_port_number callback to struct hc_driver()</title>
<updated>2013-03-25T17:39:17Z</updated>
<author>
<name>Lan Tianyu</name>
<email>tianyu.lan@intel.com</email>
</author>
<published>2013-03-19T08:48:12Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=3f5eb14135ba9d97ba4b8514fc7ef5e0dac2abf4'/>
<id>urn:sha1:3f5eb14135ba9d97ba4b8514fc7ef5e0dac2abf4</id>
<content type='text'>
xhci driver divides the root hub into two logical hubs which work
respectively for usb 2.0 and usb 3.0 devices. They are independent
devices in the usb core. But in the ACPI table, it's one device node
and all usb2.0 and usb3.0 ports are under it. Binding usb port with
its acpi node needs the raw port number which is reflected in the xhci
extended capabilities table. This patch is to add find_raw_port_number
callback to struct hc_driver(), fill it with xhci_find_raw_port_number()
which will return raw port number and add a wrap usb_hcd_find_raw_port_number().

Otherwise, refactor xhci_find_real_port_number(). Using
xhci_find_raw_port_number() to get real index in the HW port status
registers instead of scanning through the xHCI roothub port array.
This can help to speed up.

All addresses in xhci-&gt;usb2_ports and xhci-&gt;usb3_ports array are
kown good ports and don't include following bad ports in the extended
capabilities talbe.
     (1) root port that doesn't have an entry
     (2) root port with unknown speed
     (3) root port that is listed twice and with different speeds.

So xhci_find_raw_port_number() will only return port num of good ones
and never touch bad ports above.

Signed-off-by: Lan Tianyu &lt;tianyu.lan@intel.com&gt;
Signed-off-by: Sarah Sharp &lt;sarah.a.sharp@linux.intel.com&gt;
</content>
</entry>
<entry>
<title>usb: xhci: fix build warning</title>
<updated>2013-03-25T17:39:16Z</updated>
<author>
<name>Peter Chen</name>
<email>peter.chen@freescale.com</email>
</author>
<published>2013-03-20T01:30:00Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=09ce0c0c8a99651cace20958278476ee3f31678c'/>
<id>urn:sha1:09ce0c0c8a99651cace20958278476ee3f31678c</id>
<content type='text'>
/home/b29397/work/code/git/linus/linux-2.6/drivers/usb/host/xhci-ring.c: In function ‘handle_port_status’:
/home/b29397/work/code/git/linus/linux-2.6/drivers/usb/host/xhci-ring.c:1580: warning: ‘hcd’ may be used uninitialized in this function

Signed-off-by: Peter Chen &lt;peter.chen@freescale.com&gt;
Signed-off-by: Sarah Sharp &lt;sarah.a.sharp@linux.intel.com&gt;
</content>
</entry>
<entry>
<title>USB: EHCI: fix regression in QH unlinking</title>
<updated>2013-03-20T23:17:22Z</updated>
<author>
<name>Alan Stern</name>
<email>stern@rowland.harvard.edu</email>
</author>
<published>2013-03-20T19:07:26Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=d714aaf649460cbfd5e82e75520baa856b4fa0a0'/>
<id>urn:sha1:d714aaf649460cbfd5e82e75520baa856b4fa0a0</id>
<content type='text'>
This patch (as1670) fixes a regression caused by commit
6402c796d3b4205d3d7296157956c5100a05d7d6 (USB: EHCI: work around
silicon bug in Intel's EHCI controllers).  The workaround goes through
two IAA cycles for each QH being unlinked.  During the first cycle,
the QH is not added to the async_iaa list (because it isn't fully gone
from the hardware yet), which means that list will be empty.

Unfortunately, I forgot to update the IAA watchdog timer routine.  It
thinks that an empty async_iaa list means the timer expiration was an
error, which isn't true any more.  This problem didn't show up during
initial testing because the controllers being tested all had working
IAA interrupts.  But not all controllers do, and when the watchdog
timer expires, the empty-list check prevents the second IAA cycle from
starting.  As a result, URB unlinks never complete.  The check needs
to be removed.

Among the symptoms of the regression are processes stuck in D wait
states and hangs during system shutdown.

Signed-off-by: Alan Stern &lt;stern@rowland.harvard.edu&gt;
Reported-and-tested-by: Stephen Warren &lt;swarren@wwwdotorg.org&gt;
Reported-and-tested-by: Sven Joachim &lt;svenjoac@gmx.de&gt;
Reported-by: Andreas Bombe &lt;aeb@debian.org&gt;
Cc: stable &lt;stable@vger.kernel.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>USB: xhci - fix bit definitions for IMAN register</title>
<updated>2013-03-18T15:25:13Z</updated>
<author>
<name>Dmitry Torokhov</name>
<email>dtor@vmware.com</email>
</author>
<published>2013-02-25T18:56:01Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=f8264340e694604863255cc0276491d17c402390'/>
<id>urn:sha1:f8264340e694604863255cc0276491d17c402390</id>
<content type='text'>
According to XHCI specification (5.5.2.1) the IP is bit 0 and IE is bit 1
of IMAN register. Previously their definitions were reversed.

Even though there are no ill effects being observed from the swapped
definitions (because IMAN_IP is RW1C and in legacy PCI case we come in
with it already set to 1 so it was clearing itself even though we were
setting IMAN_IE instead of IMAN_IP), we should still correct the values.

This patch should be backported to kernels as old as 2.6.36, that
contain the commit 4e833c0b87a30798e67f06120cecebef6ee9644c "xhci: don't
re-enable IE constantly".

Signed-off-by: Dmitry Torokhov &lt;dtor@vmware.com&gt;
Signed-off-by: Sarah Sharp &lt;sarah.a.sharp@linux.intel.com&gt;
Cc: stable@vger.kernel.org
</content>
</entry>
<entry>
<title>USB: EHCI: fix regression during bus resume</title>
<updated>2013-03-15T19:07:53Z</updated>
<author>
<name>Alan Stern</name>
<email>stern@rowland.harvard.edu</email>
</author>
<published>2013-03-15T18:40:26Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=2a40f324541ee61c22146214349c2ce9f5c30bcf'/>
<id>urn:sha1:2a40f324541ee61c22146214349c2ce9f5c30bcf</id>
<content type='text'>
This patch (as1663) fixes a regression caused by commit
6e0c3339a6f19d748f16091d0a05adeb1e1f822b (USB: EHCI: unlink one async
QH at a time).  In order to avoid keeping multiple QHs in an unusable
intermediate state, that commit changed unlink_empty_async() so that
it unlinks only one empty QH at a time.

However, when the EHCI root hub is suspended, _all_ async QHs need to
be unlinked.  ehci_bus_suspend() used to do this by calling
unlink_empty_async(), but now this only unlinks one of the QHs, not
all of them.

The symptom is that when the root hub is resumed, USB communications
don't work for some period of time.  This is because ehci-hcd doesn't
realize it needs to restart the async schedule; it assumes that
because some QHs are already on the schedule, the schedule must be
running.

The easiest way to fix the problem is add a new function that unlinks
all the async QHs when the root hub is suspended.

This patch should be applied to all kernels that have the 6e0c3339a6f1
commit.

Signed-off-by: Alan Stern &lt;stern@rowland.harvard.edu&gt;
Reported-and-tested-by: Adrian Bassett &lt;adrian.bassett@hotmail.co.uk&gt;
Cc: stable &lt;stable@vger.kernel.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>USB: xhci: correctly enable interrupts</title>
<updated>2013-03-15T19:07:53Z</updated>
<author>
<name>Hannes Reinecke</name>
<email>hare@suse.de</email>
</author>
<published>2013-03-04T16:14:43Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=00eed9c814cb8f281be6f0f5d8f45025dc0a97eb'/>
<id>urn:sha1:00eed9c814cb8f281be6f0f5d8f45025dc0a97eb</id>
<content type='text'>
xhci has its own interrupt enabling routine, which will try to
use MSI-X/MSI if present. So the usb core shouldn't try to enable
legacy interrupts; on some machines the xhci legacy IRQ setting
is invalid.

v3: Be careful to not break XHCI_BROKEN_MSI workaround (by trenn)

Cc: Bjorn Helgaas &lt;bhelgaas@google.com&gt;
Cc: Oliver Neukum &lt;oneukum@suse.de&gt;
Cc: Thomas Renninger &lt;trenn@suse.de&gt;
Cc: Yinghai Lu &lt;yinghai@kernel.org&gt;
Cc: Frederik Himpe &lt;fhimpe@vub.ac.be&gt;
Cc: David Haerdeman &lt;david@hardeman.nu&gt;
Cc: Alan Stern &lt;stern@rowland.harvard.edu&gt;
Acked-by: Sarah Sharp &lt;sarah.a.sharp@linux.intel.com&gt;
Reviewed-by: Thomas Renninger &lt;trenn@suse.de&gt;
Signed-off-by: Hannes Reinecke &lt;hare@suse.de&gt;
Cc: stable &lt;stable@vger.kernel.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
</feed>
