<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel/drivers/usb/core/hub.c, branch linux-4.3.y</title>
<subtitle>Hosts the 0x221E linux distro kernel.</subtitle>
<id>https://universe.0xinfinity.dev/distro/kernel/atom?h=linux-4.3.y</id>
<link rel='self' href='https://universe.0xinfinity.dev/distro/kernel/atom?h=linux-4.3.y'/>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/'/>
<updated>2016-02-19T22:28:33Z</updated>
<entry>
<title>usb: hub: do not clear BOS field during reset device</title>
<updated>2016-02-19T22:28:33Z</updated>
<author>
<name>Du, Changbin</name>
<email>changbin.du@intel.com</email>
</author>
<published>2016-01-18T13:02:42Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=9932571e08f36fdb83d8a29de5a6b6aeae6dbfb8'/>
<id>urn:sha1:9932571e08f36fdb83d8a29de5a6b6aeae6dbfb8</id>
<content type='text'>
commit d8f00cd685f5c8e0def8593e520a7fef12c22407 upstream.

In function usb_reset_and_verify_device, the old BOS descriptor may
still be used before allocating a new one. (usb_unlocked_disable_lpm
function uses it under the situation that it fails to disable lpm.)
So we cannot set the udev-&gt;bos to NULL before that, just keep what it
was. It will be overwrite when allocating a new one.

Crash log:
BUG: unable to handle kernel NULL pointer dereference at
0000000000000010
IP: [&lt;ffffffff8171f98d&gt;] usb_enable_link_state+0x2d/0x2f0
Call Trace:
[&lt;ffffffff8171ed5b&gt;] ? usb_set_lpm_timeout+0x12b/0x140
[&lt;ffffffff8171fcd1&gt;] usb_enable_lpm+0x81/0xa0
[&lt;ffffffff8171fdd8&gt;] usb_disable_lpm+0xa8/0xc0
[&lt;ffffffff8171fe1c&gt;] usb_unlocked_disable_lpm+0x2c/0x50
[&lt;ffffffff81723933&gt;] usb_reset_and_verify_device+0xc3/0x710
[&lt;ffffffff8172c4ed&gt;] ? usb_sg_wait+0x13d/0x190
[&lt;ffffffff81724743&gt;] usb_reset_device+0x133/0x280
[&lt;ffffffff8179ccd1&gt;] usb_stor_port_reset+0x61/0x70
[&lt;ffffffff8179cd68&gt;] usb_stor_invoke_transport+0x88/0x520

Signed-off-by: Du, Changbin &lt;changbin.du@intel.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>usb: core: lpm: fix usb3_hardware_lpm sysfs node</title>
<updated>2016-01-31T19:25:49Z</updated>
<author>
<name>Lu Baolu</name>
<email>baolu.lu@linux.intel.com</email>
</author>
<published>2015-11-14T08:26:32Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=d905f125456a06ec755e075e10f80ee5e30ddb70'/>
<id>urn:sha1:d905f125456a06ec755e075e10f80ee5e30ddb70</id>
<content type='text'>
commit bf5ce5bf3cc7136fd7fe5e8999a580bc93a9c8f6 upstream.

Commit 655fe4effe0f ("usbcore: add sysfs support to xHCI usb3
hardware LPM") introduced usb3_hardware_lpm sysfs node. This
doesn't show the correct status of USB3 U1 and U2 LPM status.

This patch fixes this by replacing usb3_hardware_lpm with two
nodes, usb3_hardware_lpm_u1 (for U1) and usb3_hardware_lpm_u2
(for U2), and recording the U1/U2 LPM status in right places.

This patch should be back-ported to kernels as old as 4.3,
that contains Commit 655fe4effe0f ("usbcore: add sysfs support
to xHCI usb3 hardware LPM").

Signed-off-by: Lu Baolu &lt;baolu.lu@linux.intel.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>USB: fix invalid memory access in hub_activate()</title>
<updated>2016-01-31T19:25:49Z</updated>
<author>
<name>Alan Stern</name>
<email>stern@rowland.harvard.edu</email>
</author>
<published>2015-12-16T18:32:38Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=28fb0f5b4fa9b9e201b2c6d781382601b60feee3'/>
<id>urn:sha1:28fb0f5b4fa9b9e201b2c6d781382601b60feee3</id>
<content type='text'>
commit e50293ef9775c5f1cf3fcc093037dd6a8c5684ea upstream.

Commit 8520f38099cc ("USB: change hub initialization sleeps to
delayed_work") changed the hub_activate() routine to make part of it
run in a workqueue.  However, the commit failed to take a reference to
the usb_hub structure or to lock the hub interface while doing so.  As
a result, if a hub is plugged in and quickly unplugged before the work
routine can run, the routine will try to access memory that has been
deallocated.  Or, if the hub is unplugged while the routine is
running, the memory may be deallocated while it is in active use.

This patch fixes the problem by taking a reference to the usb_hub at
the start of hub_activate() and releasing it at the end (when the work
is finished), and by locking the hub interface while the work routine
is running.  It also adds a check at the start of the routine to see
if the hub has already been disconnected, in which nothing should be
done.

Signed-off-by: Alan Stern &lt;stern@rowland.harvard.edu&gt;
Reported-by: Alexandru Cornea &lt;alexandru.cornea@intel.com&gt;
Tested-by: Alexandru Cornea &lt;alexandru.cornea@intel.com&gt;
Fixes: 8520f38099cc ("USB: change hub initialization sleeps to delayed_work")
CC: &lt;stable@vger.kernel.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>usb: core : hub: Fix BOS 'NULL pointer' kernel panic</title>
<updated>2016-01-23T04:55:43Z</updated>
<author>
<name>Hans Yang</name>
<email>hansy@nvidia.com</email>
</author>
<published>2015-12-01T08:54:59Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=fe039de47d464867faf54dc79b299c56b3f891fa'/>
<id>urn:sha1:fe039de47d464867faf54dc79b299c56b3f891fa</id>
<content type='text'>
commit 464ad8c43a9ead98c2b0eaed86bea727f2ad106e upstream.

When a USB 3.0 mass storage device is disconnected in transporting
state, storage device driver may handle it as a transport error and
reset the device by invoking usb_reset_and_verify_device()
and following could happen:

in usb_reset_and_verify_device():
   udev-&gt;bos = NULL;

For U1/U2 enabled devices, driver will disable LPM, and in some
conditions:
   from usb_unlocked_disable_lpm()
    --&gt; usb_disable_lpm()
    --&gt; usb_enable_lpm()
        udev-&gt;bos-&gt;ss_cap-&gt;bU1devExitLat;

And it causes 'NULL pointer' and 'kernel panic':

[  157.976257] Unable to handle kernel NULL pointer dereference
at virtual address 00000010
...
[  158.026400] PC is at usb_enable_link_state+0x34/0x2e0
[  158.031442] LR is at usb_enable_lpm+0x98/0xac
...
[  158.137368] [&lt;ffffffc0006a1cac&gt;] usb_enable_link_state+0x34/0x2e0
[  158.143451] [&lt;ffffffc0006a1fec&gt;] usb_enable_lpm+0x94/0xac
[  158.148840] [&lt;ffffffc0006a20e8&gt;] usb_disable_lpm+0xa8/0xb4
...
[  158.214954] Kernel panic - not syncing: Fatal exception

This commit moves 'udev-&gt;bos = NULL' behind usb_unlocked_disable_lpm()
to prevent from NULL pointer access.

Issue can be reproduced by following setup:
1) A SS pen drive behind a SS hub connected to the host.
2) Transporting data between the pen drive and the host.
3) Abruptly disconnect hub and pen drive from host.
4) With a chance it crashes.

Signed-off-by: Hans Yang &lt;hansy@nvidia.com&gt;
Acked-by: Alan Stern &lt;stern@rowland.harvard.edu&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>USB: add quirk for devices with broken LPM</title>
<updated>2016-01-23T04:55:42Z</updated>
<author>
<name>Alan Stern</name>
<email>stern@rowland.harvard.edu</email>
</author>
<published>2015-12-10T20:27:21Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=23076dcc4a6945801361544d2f127cf26ec011eb'/>
<id>urn:sha1:23076dcc4a6945801361544d2f127cf26ec011eb</id>
<content type='text'>
commit ad87e03213b552a5c33d5e1e7a19a73768397010 upstream.

Some USB device / host controller combinations seem to have problems
with Link Power Management.  For example, Steinar found that his xHCI
controller wouldn't handle bandwidth calculations correctly for two
video cards simultaneously when LPM was enabled, even though the bus
had plenty of bandwidth available.

This patch introduces a new quirk flag for devices that should remain
disabled for LPM, and creates quirk entries for Steinar's devices.

Signed-off-by: Alan Stern &lt;stern@rowland.harvard.edu&gt;
Reported-by: Steinar H. Gunderson &lt;sgunderson@bigfoot.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>usb: core: hub: Removed some warnings generated by checkpatch.pl</title>
<updated>2015-08-14T23:57:43Z</updated>
<author>
<name>Chase Metzger</name>
<email>chasemetzger15@gmail.com</email>
</author>
<published>2015-08-12T04:34:37Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=17248569499eae54b314fb05c4ff19fd47c9e99b'/>
<id>urn:sha1:17248569499eae54b314fb05c4ff19fd47c9e99b</id>
<content type='text'>
Removed some checkpatch.pl warnings saying there was an unwanted space between
function names and their arguments.

Signed-off-by: Chase Metzger &lt;chasemetzger15@gmail.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>usb: hub: remove assignment from if condition</title>
<updated>2015-08-14T23:54:02Z</updated>
<author>
<name>Kris Borer</name>
<email>kborer@gmail.com</email>
</author>
<published>2015-08-11T15:12:45Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=088a3daeadf6f4123f54d5208b0ec7cbbfc8853f'/>
<id>urn:sha1:088a3daeadf6f4123f54d5208b0ec7cbbfc8853f</id>
<content type='text'>
Fix one occurrence of the checkpatch.pl error:

ERROR: do not use assignment in if condition

The semantic patch that makes this change is:

// &lt;smpl&gt;
@@
identifier i;
expression E, E2, E3;
statement S1, S2;
binary operator b;
@@

+ i = E;
  if (
- (i = E)
+ i
  b
  ... &amp;&amp; E2 &amp;&amp; E3 ) S1 else S2
// &lt;/smpl&gt;

Signed-off-by: Kris Borer &lt;kborer@gmail.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>usb: core: hub.c: Removed some warnings generated by checkpatch.pl</title>
<updated>2015-08-08T22:17:17Z</updated>
<author>
<name>Chase Metzger</name>
<email>chasemetzger15@gmail.com</email>
</author>
<published>2015-08-08T08:03:34Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=166b8639f52ebeec1bfbe966239530a83040c428'/>
<id>urn:sha1:166b8639f52ebeec1bfbe966239530a83040c428</id>
<content type='text'>
Removed some checkpatch.pl warnings saying there was an unwanted space between
function names and their arguments.

Signed-off-by: Chase Metzger &lt;chasemetzger15@gmail.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>Merge 4.2-rc4 into usb-next</title>
<updated>2015-07-27T18:15:16Z</updated>
<author>
<name>Greg Kroah-Hartman</name>
<email>gregkh@linuxfoundation.org</email>
</author>
<published>2015-07-27T18:15:16Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=722b262c966a388a1f8bfcdd100cd19c4ce59ab9'/>
<id>urn:sha1:722b262c966a388a1f8bfcdd100cd19c4ce59ab9</id>
<content type='text'>
We want the USB fixes that went into that release in this branch as
well.

Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>usbcore: add sysfs support to xHCI usb3 hardware LPM</title>
<updated>2015-07-22T22:45:03Z</updated>
<author>
<name>Kevin Strasser</name>
<email>kevin.strasser@linux.intel.com</email>
</author>
<published>2015-06-16T17:35:30Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=655fe4effe0f1f40e4f6ca6b3cc64a7fe0032183'/>
<id>urn:sha1:655fe4effe0f1f40e4f6ca6b3cc64a7fe0032183</id>
<content type='text'>
Add a sysfs node to make it easier to verify if LPM is supported and being
enabled for USB 3.0 devices.

Signed-off-by: Kevin Strasser &lt;kevin.strasser@linux.intel.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
</feed>
