<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux/drivers/usb/core/driver.c, branch v4.5</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.5</id>
<link rel='self' href='https://git.shady.money/linux/atom?h=v4.5'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/'/>
<updated>2015-10-04T09:47:19Z</updated>
<entry>
<title>usb: core: driver: Use kmalloc_array</title>
<updated>2015-10-04T09:47:19Z</updated>
<author>
<name>Muhammad Falak R Wani</name>
<email>falakreyaz@gmail.com</email>
</author>
<published>2015-09-07T16:00:25Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=9766f2517e55338ab546891c4bfff6666ffacaea'/>
<id>urn:sha1:9766f2517e55338ab546891c4bfff6666ffacaea</id>
<content type='text'>
Use kmalloc_array instead of kmalloc to allocate memory for an array.
Also, remove the dev_warn for a memory leak, making the if check more
sleek.

Signed-off-by: Muhammad Falak R Wani &lt;falakreyaz@gmail.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>usb: interface authorization: Control interface probing and claiming</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:07Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=8d1f8573a33224dce9b6e3a5085a6857b7572c13'/>
<id>urn:sha1:8d1f8573a33224dce9b6e3a5085a6857b7572c13</id>
<content type='text'>
Driver probings and interface claims get rejected
if an interface is not 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: Control interface probing and claiming"</title>
<updated>2015-08-18T16:58:26Z</updated>
<author>
<name>Greg Kroah-Hartman</name>
<email>gregkh@linuxfoundation.org</email>
</author>
<published>2015-08-18T16:58:26Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=8c2ea97a3a4124628de2ed9a1f891c706788468a'/>
<id>urn:sha1:8c2ea97a3a4124628de2ed9a1f891c706788468a</id>
<content type='text'>
This reverts commit de7718bd9c4d3db96991a98c2a0cb38258a04e47 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: Control interface probing and claiming</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:52Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=de7718bd9c4d3db96991a98c2a0cb38258a04e47'/>
<id>urn:sha1:de7718bd9c4d3db96991a98c2a0cb38258a04e47</id>
<content type='text'>
Driver probings and interface claims get rejected
if an interface is not 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>usb: fix coding style issue</title>
<updated>2015-07-22T21:55:21Z</updated>
<author>
<name>Kris Borer</name>
<email>kborer@gmail.com</email>
</author>
<published>2015-06-16T17:24:53Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=79a02744bc5a2993d6c5b8dd1a790f7ea12f4e0b'/>
<id>urn:sha1:79a02744bc5a2993d6c5b8dd1a790f7ea12f4e0b</id>
<content type='text'>
Fixed coding style issue: newline after declaration

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: add flag for HCDs that can't receive wakeup requests (isp1760-hcd)</title>
<updated>2015-01-31T17:05:06Z</updated>
<author>
<name>Alan Stern</name>
<email>stern@rowland.harvard.edu</email>
</author>
<published>2015-01-29T20:05:04Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=074f9dd55f9cab1b82690ed7e44bcf38b9616ce0'/>
<id>urn:sha1:074f9dd55f9cab1b82690ed7e44bcf38b9616ce0</id>
<content type='text'>
Currently the USB stack assumes that all host controller drivers are
capable of receiving wakeup requests from downstream devices.
However, this isn't true for the isp1760-hcd driver, which means that
it isn't safe to do a runtime suspend of any device attached to a
root-hub port if the device requires wakeup.

This patch adds a "cant_recv_wakeups" flag to the usb_hcd structure
and sets the flag in isp1760-hcd.  The core is modified to prevent a
direct child of the root hub from being put into runtime suspend with
wakeup enabled if the flag is set.

Signed-off-by: Alan Stern &lt;stern@rowland.harvard.edu&gt;
Tested-by: Nicolas Pitre &lt;nico@linaro.org&gt;
CC: &lt;stable@vger.kernel.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;greg@kroah.com&gt;
</content>
</entry>
<entry>
<title>USB: don't cancel queued resets when unbinding drivers</title>
<updated>2015-01-25T12:54:17Z</updated>
<author>
<name>Alan Stern</name>
<email>stern@rowland.harvard.edu</email>
</author>
<published>2015-01-21T19:02:43Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=524134d422316a59d5464ccbc12036bbe90c5563'/>
<id>urn:sha1:524134d422316a59d5464ccbc12036bbe90c5563</id>
<content type='text'>
The USB stack provides a mechanism for drivers to request an
asynchronous device reset (usb_queue_reset_device()).  The mechanism
uses a work item (reset_ws) embedded in the usb_interface structure
used by the driver, and the reset is carried out by a work queue
routine.

The asynchronous reset can race with driver unbinding.  When this
happens, we try to cancel the queued reset before unbinding the
driver, on the theory that the driver won't care about any resets once
it is unbound.

However, thanks to the fact that lockdep now tracks work queue
accesses, this can provoke a lockdep warning in situations where the
device reset causes another interface's driver to be unbound; see

	http://marc.info/?l=linux-usb&amp;m=141893165203776&amp;w=2

for an example.  The reason is that the work routine for reset_ws in
one interface calls cancel_queued_work() for the reset_ws in another
interface.  Lockdep thinks this might lead to a work routine trying to
cancel itself.  The simplest solution is not to cancel queued resets
when unbinding drivers.

This means we now need to acquire a reference to the usb_interface
when queuing a reset_ws work item and to drop the reference when the
work routine finishes.  We also need to make sure that the
usb_interface structure doesn't outlive its parent usb_device; this
means acquiring and dropping a reference when the interface is created
and destroyed.

In addition, cancelling a queued reset can fail (if the device is in
the middle of an earlier reset), and this can cause usb_reset_device()
to try to rebind an interface that has been deallocated (see
http://marc.info/?l=linux-usb&amp;m=142175717016628&amp;w=2 for details).
Acquiring the extra references prevents this failure.

Signed-off-by: Alan Stern &lt;stern@rowland.harvard.edu&gt;
Reported-by: Russell King - ARM Linux &lt;linux@arm.linux.org.uk&gt;
Reported-by: Olivier Sobrie &lt;olivier@sobrie.be&gt;
Tested-by: Olivier Sobrie &lt;olivier@sobrie.be&gt;
Cc: stable &lt;stable@vger.kernel.org&gt; # 3.19
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: shutdown all URBs after controller death</title>
<updated>2014-07-17T23:59:27Z</updated>
<author>
<name>Alan Stern</name>
<email>stern@rowland.harvard.edu</email>
</author>
<published>2014-07-17T19:40:57Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=1299cff9fa39811cd1b3f1731527b062425f0541'/>
<id>urn:sha1:1299cff9fa39811cd1b3f1731527b062425f0541</id>
<content type='text'>
When a host controller dies, we don't need to wait for a driver to
time out.  We can shut down its URBs immediately.  Without this
change, we can end up waiting 30 seconds for a mass-storage transfer
to time out.

Signed-off-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: Avoid runtime suspend loops for HCDs that can't handle suspend/resume</title>
<updated>2014-05-23T19:06:00Z</updated>
<author>
<name>Alan Stern</name>
<email>stern@rowland.harvard.edu</email>
</author>
<published>2014-05-23T14:45:54Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=8ef42ddd9a53b73e6fc3934278710c27f80f324f'/>
<id>urn:sha1:8ef42ddd9a53b73e6fc3934278710c27f80f324f</id>
<content type='text'>
Not all host controller drivers have bus-suspend and bus-resume
methods.  When one doesn't, it will cause problems if runtime PM is
enabled in the kernel.  The PM core will attempt to suspend the
controller's root hub, the suspend will fail because there is no
bus-suspend routine, and a -EBUSY error code will be returned to the
PM core.  This will cause the suspend attempt to be repeated shortly
thereafter, in a never-ending loop.

Part of the problem is that the original error code -ENOENT gets
changed to -EBUSY in usb_runtime_suspend(), on the grounds that the PM
core will interpret -ENOENT as meaning that the root hub has gotten
into a runtime-PM error state.  While this change is appropriate for
real USB devices, it's not such a good idea for a root hub.  In fact,
considering the root hub to be in a runtime-PM error state would not
be far from the truth.  Therefore this patch updates
usb_runtime_suspend() so that it adjusts error codes only for
non-root-hub devices.

Furthermore, the patch attempts to prevent the problem from occurring
in the first place by not enabling runtime PM by default for root hubs
whose host controller driver doesn't have bus_suspend and bus_resume
methods.

Signed-off-by: Alan Stern &lt;stern@rowland.harvard.edu&gt;
Reported-by: Will Deacon &lt;will.deacon@arm.com&gt;
Tested-by: Will Deacon &lt;will.deacon@arm.com&gt;
CC: &lt;stable@vger.kernel.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
</feed>
