<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel.git/drivers/usb/core/hcd.c, branch linux-3.13.y</title>
<subtitle>Hosts the 0x221E linux distro kernel.
</subtitle>
<id>https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-3.13.y</id>
<link rel='self' href='https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-3.13.y'/>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/'/>
<updated>2014-02-22T21:34:56Z</updated>
<entry>
<title>Revert "usbcore: set lpm_capable field for LPM capable root hubs"</title>
<updated>2014-02-22T21:34:56Z</updated>
<author>
<name>Sarah Sharp</name>
</author>
<published>2014-01-22T21:35:02Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=99c7d0aa458cd6c01eba46826259f6eabfc6b28a'/>
<id>urn:sha1:99c7d0aa458cd6c01eba46826259f6eabfc6b28a</id>
<content type='text'>
commit 140e3026a57ab7d830dab2f2c57796c222db0ea9 upstream.

Commit 9df89d85b407690afa46ddfbccc80bec6869971d "usbcore: set
lpm_capable field for LPM capable root hubs" was created under the
assumption that all USB host controllers should have USB 3.0 Link PM
enabled for all devices under the hosts.

Unfortunately, that's not the case.  The xHCI driver relies on knowledge
of the host hardware scheduler to calculate the LPM U1/U2 timeout
values, and it only sets lpm_capable to one for Intel host controllers
(that have the XHCI_LPM_SUPPORT quirk set).

When LPM is enabled for some Fresco Logic hosts, it causes failures with
a AgeStar 3UBT USB 3.0 hard drive dock:

Jan 11 13:59:03 sg-laptop kernel: usb 3-1: new SuperSpeed USB device number 2 using xhci_hcd
Jan 11 13:59:03 sg-laptop kernel: usb 3-1: Set SEL for device-initiated U1 failed.
Jan 11 13:59:08 sg-laptop kernel: usb 3-1: Set SEL for device-initiated U2 failed.
Jan 11 13:59:08 sg-laptop kernel: usb-storage 3-1:1.0: USB Mass Storage device detected
Jan 11 13:59:08 sg-laptop mtp-probe[613]: checking bus 3, device 2: "/sys/devices/pci0000:00/0000:00:1c.3/0000:04:00.0/usb3/3-1"
Jan 11 13:59:08 sg-laptop mtp-probe[613]: bus: 3, device: 2 was not an MTP device
Jan 11 13:59:08 sg-laptop kernel: scsi6 : usb-storage 3-1:1.0
Jan 11 13:59:13 sg-laptop kernel: usb 3-1: Set SEL for device-initiated U1 failed.
Jan 11 13:59:18 sg-laptop kernel: usb 3-1: Set SEL for device-initiated U2 failed.
Jan 11 13:59:18 sg-laptop kernel: usbcore: registered new interface driver usb-storage
Jan 11 13:59:40 sg-laptop kernel: usb 3-1: reset SuperSpeed USB device number 2 using xhci_hcd
Jan 11 13:59:41 sg-laptop kernel: usb 3-1: device descriptor read/8, error -71
Jan 11 13:59:41 sg-laptop kernel: usb 3-1: reset SuperSpeed USB device number 2 using xhci_hcd
Jan 11 13:59:46 sg-laptop kernel: usb 3-1: device descriptor read/8, error -110
Jan 11 13:59:46 sg-laptop kernel: scsi 6:0:0:0: Device offlined - not ready after error recovery
Jan 11 13:59:46 sg-laptop kernel: usb 3-1: USB disconnect, device number 2

lspci for the affected host:

04:00.0 0c03: 1b73:1000 (rev 04) (prog-if 30 [XHCI])
        Subsystem: 1043:1039
        Control: I/O+ Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B- DisINTx-
        Status: Cap+ 66MHz- UDF- FastB2B- ParErr- DEVSEL=fast &gt;TAbort- &lt;TAbort- &lt;MAbort- &gt;SERR- &lt;PERR- INTx-
        Latency: 0, Cache Line Size: 64 bytes
        Interrupt: pin A routed to IRQ 19
        Region 0: Memory at dd200000 (32-bit, non-prefetchable) [size=64K]
        Capabilities: [50] Power Management version 3
                Flags: PMEClk- DSI- D1- D2- AuxCurrent=0mA PME(D0+,D1-,D2-,D3hot+,D3cold-)
                Status: D0 NoSoftRst- PME-Enable- DSel=0 DScale=0 PME-
        Capabilities: [68] MSI: Enable- Count=1/1 Maskable- 64bit+
                Address: 0000000000000000  Data: 0000
        Capabilities: [80] Express (v1) Endpoint, MSI 00
                DevCap: MaxPayload 128 bytes, PhantFunc 0, Latency L0s &lt;2us, L1 &lt;32us
                        ExtTag- AttnBtn- AttnInd- PwrInd- RBE+ FLReset-
                DevCtl: Report errors: Correctable- Non-Fatal- Fatal- Unsupported-
                        RlxdOrd+ ExtTag- PhantFunc- AuxPwr- NoSnoop+
                        MaxPayload 128 bytes, MaxReadReq 512 bytes
                DevSta: CorrErr- UncorrErr- FatalErr- UnsuppReq- AuxPwr- TransPend-
                LnkCap: Port #0, Speed 2.5GT/s, Width x1, ASPM L0s L1, Latency L0 unlimited, L1 unlimited
                        ClockPM- Surprise- LLActRep- BwNot-
                LnkCtl: ASPM Disabled; RCB 64 bytes Disabled- Retrain- CommClk+
                        ExtSynch- ClockPM- AutWidDis- BWInt- AutBWInt-
                LnkSta: Speed 2.5GT/s, Width x1, TrErr- Train- SlotClk+ DLActive- BWMgmt- ABWMgmt-
        Kernel driver in use: xhci_hcd
        Kernel modules: xhci_hcd

The commit was backported to stable kernels, and will need to be
reverted there as well.

Signed-off-by: Sarah Sharp &lt;sarah.a.sharp@intel.com&gt;
Reported-by: Sergey Galanov &lt;sergey.e.galanov@gmail.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>usb/hcd: remove unnecessary local_irq_save</title>
<updated>2013-10-14T18:09:12Z</updated>
<author>
<name>Michael Opdenacker</name>
</author>
<published>2013-10-13T07:14:19Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=88ed9fd50e573fee332ca1e07641102b59f743fe'/>
<id>urn:sha1:88ed9fd50e573fee332ca1e07641102b59f743fe</id>
<content type='text'>
Remove the use of local_irq_save() and IRQF_DISABLED, no longer needed since
interrupt handlers are always run with interrupts disabled on the
current CPU.

Tested successfully with 3.12.0-rc4 on my PC. Didn't find
any issue because of this change.

Signed-off-by: Michael Opdenacker &lt;michael.opdenacker@free-electrons.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>drivers: usb: core: hcd.c: converted busmap from struct to bitmap</title>
<updated>2013-10-11T23:58:01Z</updated>
<author>
<name>Matthias Beyer</name>
</author>
<published>2013-10-05T21:09:15Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=059239adfe577866115cd5270eba40e3cac33f8a'/>
<id>urn:sha1:059239adfe577866115cd5270eba40e3cac33f8a</id>
<content type='text'>
The DECLARE_BITMAP macro should be used for declaring this bitmap.
This commit converts the busmap from a struct to a simple (static)
bitmap, using the DECLARE_BITMAP macro from linux/types.h.

Please review, as I'm new to kernel development, I don't know if this
has any hidden side effects!

Suggested by joe@perches.com

Signed-off-by: Matthias Beyer &lt;mail@beyermatthias.de&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>usb-anchor: Delay usb_wait_anchor_empty_timeout wake up till completion is done</title>
<updated>2013-10-11T23:33:58Z</updated>
<author>
<name>Hans de Goede</name>
</author>
<published>2013-10-09T15:01:41Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=6ec4147e7bdbde168f5bce30de5984aa4f971b22'/>
<id>urn:sha1:6ec4147e7bdbde168f5bce30de5984aa4f971b22</id>
<content type='text'>
usb_wait_anchor_empty_timeout() should wait till the completion handler
has run. Both the zd1211rw driver and the uas driver (in its task mgmt) depend
on the completion handler having completed when usb_wait_anchor_empty_timeout()
returns, as they read state set by the completion handler after an
usb_wait_anchor_empty_timeout() call.

But __usb_hcd_giveback_urb() calls usb_unanchor_urb before calling the
completion handler. This is necessary as the completion handler may
re-submit and re-anchor the urb. But this introduces a race where the state
these drivers want to read has not been set yet by the completion handler
(this race is easily triggered with the uas task mgmt code).

I've considered adding an anchor_count to struct urb, which would be
incremented on anchor and decremented on unanchor, and then only actually
do the anchor / unanchor on 0 -&gt; 1 and 1 -&gt; 0 transtions, combined with
moving the unanchor call in hcd_giveback_urb to after calling the completion
handler. But this will only work if urb's are only re-anchored to the same
anchor as they were anchored to before the completion handler ran.

And at least one driver re-anchors to another anchor from the completion
handler (rtlwifi).

So I have come up with this patch instead, which adds the ability to
suspend wakeups of usb_wait_anchor_empty_timeout() waiters to the usb_anchor
functionality, and uses this in __usb_hcd_giveback_urb() to delay wake-ups
until the completion handler has run.

Signed-off-by: Hans de Goede &lt;hdegoede@redhat.com&gt;
Acked-by: Oliver Neukum &lt;oliver@neukum.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>drivers: usb: core: hcd: if-else-braces fixed</title>
<updated>2013-10-06T01:00:08Z</updated>
<author>
<name>Matthias Beyer</name>
</author>
<published>2013-10-05T16:02:10Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=d1ddb0a6bb665dce10314bb5b9960e197e814820'/>
<id>urn:sha1:d1ddb0a6bb665dce10314bb5b9960e197e814820</id>
<content type='text'>
Put else keyword on same line as closing brace from if statement, added
{ } braces as the styleguide says.

Signed-off-by: Matthias Beyer &lt;mail@beyermatthias.de&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>drivers: usb: core: hcd: removed braces for return statements</title>
<updated>2013-10-06T01:00:08Z</updated>
<author>
<name>Matthias Beyer</name>
</author>
<published>2013-10-05T16:02:09Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=070104966cde138627fea8257ef278f7a0d1379b'/>
<id>urn:sha1:070104966cde138627fea8257ef278f7a0d1379b</id>
<content type='text'>
Signed-off-by: Matthias Beyer &lt;mail@beyermatthias.de&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>drivers: usb: core: hcd: replaced C99 // comments</title>
<updated>2013-10-06T01:00:08Z</updated>
<author>
<name>Matthias Beyer</name>
</author>
<published>2013-10-05T16:02:08Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=048cb21c37a917b4872de9cd004cbf017a65b362'/>
<id>urn:sha1:048cb21c37a917b4872de9cd004cbf017a65b362</id>
<content type='text'>
Signed-off-by: Matthias Beyer &lt;mail@beyermatthias.de&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>drivers: usb: core: hcd: Whitespace fixes</title>
<updated>2013-10-06T01:00:08Z</updated>
<author>
<name>Matthias Beyer</name>
</author>
<published>2013-10-05T16:02:07Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=14557359cad5d18ae18f8e9b01639022557ff71b'/>
<id>urn:sha1:14557359cad5d18ae18f8e9b01639022557ff71b</id>
<content type='text'>
including
- spaces to tabs
- removing spaces before array indexing (foo [] to foo[])
- adding spaces around unary operator (foo? 1 : 0 to foo ? 1 : 0)
- removed trailing whitespace

Signed-off-by: Matthias Beyer &lt;mail@beyermatthias.de&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>drivers: usb: core: hcd: moved asterix to variable</title>
<updated>2013-10-06T01:00:08Z</updated>
<author>
<name>Matthias Beyer</name>
</author>
<published>2013-10-05T16:02:06Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=842c19600728dc2561f06553e442031fc68c1882'/>
<id>urn:sha1:842c19600728dc2561f06553e442031fc68c1882</id>
<content type='text'>
instead of type

Signed-off-by: Matthias Beyer &lt;mail@beyermatthias.de&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>usbcore: set lpm_capable field for LPM capable root hubs</title>
<updated>2013-09-17T16:49:24Z</updated>
<author>
<name>Xenia Ragiadakou</name>
</author>
<published>2013-08-31T15:09:12Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=9df89d85b407690afa46ddfbccc80bec6869971d'/>
<id>urn:sha1:9df89d85b407690afa46ddfbccc80bec6869971d</id>
<content type='text'>
This patch sets the lpm_capable field for root hubs with LPM capabilities.

Signed-off-by: Xenia Ragiadakou &lt;burzalodowa@gmail.com&gt;
Reported-by: Martin MOKREJS &lt;mmokrejs@gmail.com&gt;
Suggested-by: Alan Stern &lt;stern@rowland.harvard.edu&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
</feed>
