<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux/drivers/usb/core/sysfs.c, branch v4.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=v4.9</id>
<link rel='self' href='https://git.shady.money/linux/atom?h=v4.9'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/'/>
<updated>2016-02-03T21:29:12Z</updated>
<entry>
<title>usb: no locking for reading descriptors in sysfs</title>
<updated>2016-02-03T21:29:12Z</updated>
<author>
<name>Oliver Neukum</name>
<email>oneukum@suse.com</email>
</author>
<published>2016-01-21T14:18:48Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=b4a90d04ac79349799f65dfd7fa30b2aac6b2a4d'/>
<id>urn:sha1:b4a90d04ac79349799f65dfd7fa30b2aac6b2a4d</id>
<content type='text'>
Quting the relevant thread:

&gt; In fact, I suspect the locking added by the kernel 3.13 commit for
&gt; read_descriptors() is invalid because read_descriptors() performs no USB
&gt; activity; read_descriptors() just reads information from an allocated
&gt; memory structure. This structure is protected as the structure is
&gt; existing before and after the sysfs vfs descriptors entry is created or
&gt; destroyed.

You're right.  For some reason I thought that usb_deauthorize_device()
would destroy the rawdescriptor structures (as mentioned in that
commit's Changelog), but it doesn't.  The locking in read_descriptors()
is unnecessary.

&gt; The information is only written at the time of enumeration
&gt; and does not change. At least that is my understanding.
&gt;
&gt; It is noted that in our testing of kernel 3.8 on ARM, that sysfs
&gt; read_descriptors() was non-blocking because the kernel 3.13 comment was
&gt; not there.
&gt;
&gt; The pre-kernel 3.13 sysfs read_descriptors() seemed to work OK.
&gt;
&gt; Proposal:
&gt; =========
&gt;
&gt; Remove the usb_lock_device(udev) and usb_unlock_device(udev) from
&gt; devices/usb/core/sysfs.c in read_descriptors() that was added by the
&gt; kernel 3.13 commit
&gt; "232275a USB: fix substandard locking for the sysfs files"
&gt;
&gt; Any comments to this proposal ?

It seems okay to me.  Please submit a patch.

So this removes the locking making the point about -EINTR in
the first path moot.

Signed-off-by: Oliver Neukum &lt;oneukum@suse.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>usb: sysfs: make locking interruptible</title>
<updated>2016-02-03T21:29:12Z</updated>
<author>
<name>Oliver Neukum</name>
<email>oneukum@suse.com</email>
</author>
<published>2016-01-21T14:18:47Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=7dd9cba5bb90ffa9c60c1533b715dc91c5082cd9'/>
<id>urn:sha1:7dd9cba5bb90ffa9c60c1533b715dc91c5082cd9</id>
<content type='text'>
232275a USB: fix substandard locking for the sysfs files
introduced needed locking into sysfs operations on USB devices
It, however, uses uninterruptible sleep and if the error
handling is on extreme cases of sleep lengths of 10s of seconds
are possible. Unless we are removing the device we should use
interruptible sleep.

Signed-off-by: Oliver Neukum &lt;oneukum@suse.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>usb: show speed "10000" in sysfs for USB 3.1 SuperSpeedPlus devices</title>
<updated>2016-01-25T04:16:52Z</updated>
<author>
<name>Mathias Nyman</name>
<email>mathias.nyman@linux.intel.com</email>
</author>
<published>2015-12-10T07:59:27Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=b2316645ca5ea93eb8f637f57199fbbe88bee07d'/>
<id>urn:sha1:b2316645ca5ea93eb8f637f57199fbbe88bee07d</id>
<content type='text'>
The same way as SuperSpeed devices show "5000" as device speed we wan't to
show "10000" as the default speed for SuperSpeedPlus devices in sysfs.

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: core: lpm: fix usb3_hardware_lpm sysfs node</title>
<updated>2015-12-01T22:58:18Z</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://git.shady.money/linux/commit/?id=bf5ce5bf3cc7136fd7fe5e8999a580bc93a9c8f6'/>
<id>urn:sha1:bf5ce5bf3cc7136fd7fe5e8999a580bc93a9c8f6</id>
<content type='text'>
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").

Cc: stable@vger.kernel.org
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: interface authorization: SysFS part of USB interface authorization</title>
<updated>2015-09-22T19:08:40Z</updated>
<author>
<name>Stefan Koch</name>
<email>stefan.koch10@gmail.com</email>
</author>
<published>2015-08-25T19:10:09Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=310d2b4124c073a2057ef9d952d4d938e9b1dfd9'/>
<id>urn:sha1:310d2b4124c073a2057ef9d952d4d938e9b1dfd9</id>
<content type='text'>
This introduces an attribute for each interface to
authorize (1) or deauthorize (0) it:
/sys/bus/usb/devices/INTERFACE/authorized

Signed-off-by: Stefan Koch &lt;stefan.koch10@gmail.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>Revert "usb: interface authorization: SysFS part of USB interface authorization"</title>
<updated>2015-08-18T16:57:43Z</updated>
<author>
<name>Greg Kroah-Hartman</name>
<email>gregkh@linuxfoundation.org</email>
</author>
<published>2015-08-18T16:57:43Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=4d924d7a81627663720223b5c4330c18d8063fb6'/>
<id>urn:sha1:4d924d7a81627663720223b5c4330c18d8063fb6</id>
<content type='text'>
This reverts commit 187b3d75bbfba45a38b5d1d3656c0f11f6f6f2d0 as the
signed-off-by address is invalid.

Cc: Stefan Koch &lt;stefan.koch10@gmail.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>usb: interface authorization: SysFS part of USB interface authorization</title>
<updated>2015-08-14T23:55:54Z</updated>
<author>
<name>Stefan Koch</name>
<email>stefan.koch10@gmail.com</email>
</author>
<published>2015-08-08T09:32:54Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=187b3d75bbfba45a38b5d1d3656c0f11f6f6f2d0'/>
<id>urn:sha1:187b3d75bbfba45a38b5d1d3656c0f11f6f6f2d0</id>
<content type='text'>
This introduces an attribute for each interface to
authorize (1) or deauthorize (0) it:
/sys/bus/usb/devices/INTERFACE/authorized

Signed-off-by: Stefan Koch &lt;skoch@suse.de&gt;
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://git.shady.money/linux/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>
<entry>
<title>USB / PM: Drop CONFIG_PM_RUNTIME from the USB core</title>
<updated>2014-12-03T23:51:54Z</updated>
<author>
<name>Rafael J. Wysocki</name>
<email>rafael.j.wysocki@intel.com</email>
</author>
<published>2014-11-29T22:47:05Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=ceb6c9c862c86423f41c1e20ecf8d454f837f519'/>
<id>urn:sha1:ceb6c9c862c86423f41c1e20ecf8d454f837f519</id>
<content type='text'>
After commit b2b49ccbdd54 (PM: Kconfig: Set PM_RUNTIME if PM_SLEEP is
selected) PM_RUNTIME is always set if PM is set, so quite a few
depend on CONFIG_PM (or even dropped in some cases).

Replace CONFIG_PM_RUNTIME with CONFIG_PM in the USB core code
and documentation.

Signed-off-by: Rafael J. Wysocki &lt;rafael.j.wysocki@intel.com&gt;
Acked-by: Alan Stern &lt;stern@rowland.harvard.edu&gt;
Acked-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>USB: core: correct spelling mistakes in comments and warning</title>
<updated>2014-01-08T00:17:40Z</updated>
<author>
<name>Rahul Bedarkar</name>
<email>rahulbedarkar89@gmail.com</email>
</author>
<published>2014-01-04T05:54:41Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=025d44309f92bd5e3d1b2c7fab66836ab25b541b'/>
<id>urn:sha1:025d44309f92bd5e3d1b2c7fab66836ab25b541b</id>
<content type='text'>
Signed-off-by: Rahul Bedarkar &lt;rahulbedarkar89@gmail.com&gt;
Acked-by: Randy Dunlap &lt;rdunlap@infradead.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
</feed>
