<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel.git/drivers/usb/core/message.c, branch linux-2.6.34.y</title>
<subtitle>Hosts the 0x221E linux distro kernel.
</subtitle>
<id>https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-2.6.34.y</id>
<link rel='self' href='https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-2.6.34.y'/>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/'/>
<updated>2011-01-06T23:08:25Z</updated>
<entry>
<title>USB: disable endpoints after unbinding interfaces, not before</title>
<updated>2011-01-06T23:08:25Z</updated>
<author>
<name>Alan Stern</name>
</author>
<published>2010-09-30T19:16:23Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=374c5bb65bf098fbb368a74767c2d0134addf631'/>
<id>urn:sha1:374c5bb65bf098fbb368a74767c2d0134addf631</id>
<content type='text'>
commit 80f0cf3947889014d3a3dc0ad60fb87cfda4b12a upstream.

This patch (as1430) fixes a bug in usbcore.  When a device
configuration change occurs or a device is removed, the endpoints for
the old config should be completely disabled.  However it turns out
they aren't; this is because usb_unbind_interface() calls
usb_enable_interface() or usb_set_interface() to put interfaces back
in altsetting 0, which re-enables the interfaces' endpoints.

As a result, when a device goes through a config change or is
unconfigured, the ep_in[] and ep_out[] arrays may be left holding old
pointers to usb_host_endpoint structures.  If the device is
deauthorized these structures get freed, and the stale pointers cause
errors when the the device is eventually unplugged.

The solution is to disable the endpoints after unbinding the
interfaces instead of before.  This isn't as large a change as it
sounds, since usb_unbind_interface() disables all the interface's
endpoints anyway before calling the driver's disconnect routine,
unless the driver claims to support "soft" unbind.

This fixes Bugzilla #19192.  Thanks to "Tom" Lei Ming for diagnosing
the underlying cause of the problem.

Signed-off-by: Alan Stern &lt;stern@rowland.harvard.edu&gt;
Tested-by: Carsten Sommer &lt;carsten_sommer@ymail.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;
Signed-off-by: Paul Gortmaker &lt;paul.gortmaker@windriver.com&gt;
</content>
</entry>
<entry>
<title>USB: fix bug in initialization of interface minor numbers</title>
<updated>2011-01-06T23:08:07Z</updated>
<author>
<name>Alan Stern</name>
</author>
<published>2010-09-21T19:01:53Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=0ae4cdf56fa6b9fb2c98083e54f77a19ca4717f4'/>
<id>urn:sha1:0ae4cdf56fa6b9fb2c98083e54f77a19ca4717f4</id>
<content type='text'>
commit 0026e00523a85b90a92a93ddf6660939ecef3e54 upstream.

Recent changes in the usbhid layer exposed a bug in usbcore.  If
CONFIG_USB_DYNAMIC_MINORS is enabled then an interface may be assigned
a minor number of 0.  However interfaces that aren't registered as USB
class devices also have their minor number set to 0, during
initialization.  As a result usb_find_interface() may return the
wrong interface, leading to a crash.

This patch (as1418) fixes the problem by initializing every
interface's minor number to -1.  It also cleans up the
usb_register_dev() function, which besides being somewhat awkwardly
written, does not unwind completely on all its error paths.

Signed-off-by: Alan Stern &lt;stern@rowland.harvard.edu&gt;
Tested-by: Philip J. Turmel &lt;philip@turmel.org&gt;
Tested-by: Gabriel Craciunescu &lt;nix.or.die@googlemail.com&gt;
Tested-by: Alex Riesen &lt;raa.lkml@gmail.com&gt;
Tested-by: Matthias Bayer &lt;jackdachef@gmail.com&gt;
CC: Jiri Kosina &lt;jkosina@suse.cz&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;
Signed-off-by: Paul Gortmaker &lt;paul.gortmaker@windriver.com&gt;
</content>
</entry>
<entry>
<title>USB: fix usbmon and DMA mapping for scatter-gather URBs</title>
<updated>2010-07-05T18:22:07Z</updated>
<author>
<name>Alan Stern</name>
</author>
<published>2010-04-02T17:27:28Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=4a8b98282f192abc27f1c18dc81ed2e59929e168'/>
<id>urn:sha1:4a8b98282f192abc27f1c18dc81ed2e59929e168</id>
<content type='text'>
commit ff9c895f07d36193c75533bda8193bde8ca99d02 upstream.

This patch (as1368) fixes a rather obscure bug in usbmon: When tracing
URBs sent by the scatter-gather library, it accesses the data buffers
while they are still mapped for DMA.

The solution is to move the mapping and unmapping out of the s-g
library and into the usual place in hcd.c.  This requires the addition
of new URB flag bits to describe the kind of mapping needed, since we
have to call dma_map_sg() if the HCD supports native scatter-gather
operation and dma_map_page() if it doesn't.  The nice thing about
having the new flags is that they simplify the testing for unmapping.

The patch removes the only caller of usb_buffer_[un]map_sg(), so those
functions are #if'ed out.  A later patch will remove them entirely.

As a result of this change, urb-&gt;sg will be set in situations where
it wasn't set previously.  Hence the xhci and whci drivers are
adjusted to test urb-&gt;num_sgs instead, which retains its original
meaning and is nonzero only when the HCD has to handle a scatterlist.

Finally, even when a submission error occurs we don't want to hand
URBs to usbmon before they are unmapped.  The submission path is
rearranged so that map_urb_for_dma() is called only for non-root-hub
URBs and unmap_urb_for_dma() is called immediately after a submission
error.  This simplifies the error handling.

Signed-off-by: Alan Stern &lt;stern@rowland.harvard.edu&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;

</content>
</entry>
<entry>
<title>USB: don't read past config-&gt;interface[] if usb_control_msg() fails in usb_reset_configuration()</title>
<updated>2010-03-02T22:55:10Z</updated>
<author>
<name>Roel Kluin</name>
</author>
<published>2010-02-18T01:36:23Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=e4a3d94658b5760fc947d7f7185c57db47ca362a'/>
<id>urn:sha1:e4a3d94658b5760fc947d7f7185c57db47ca362a</id>
<content type='text'>
While looping over the interfaces, if usb_hcd_alloc_bandwidth() fails it calls
hcd-&gt;driver-&gt;reset_bandwidth(), so there was no need to reinstate the interface
again.

If no break occurred, the index equals config-&gt;desc.bNumInterfaces. A
subsequent usb_control_msg() failure resulted in a read from
config-&gt;interface[config-&gt;desc.bNumInterfaces] at label reset_old_alts.

In either case the last interface should be skipped.

Signed-off-by: Roel Kluin &lt;roel.kluin@gmail.com&gt;
Acked-by: Alan Stern &lt;stern@rowland.harvard.edu&gt;
Acked-by: Sarah Sharp &lt;sarah.a.sharp@linux.intel.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;

</content>
</entry>
<entry>
<title>USB: trivial: missing newline in usb core warning message</title>
<updated>2010-03-02T22:54:36Z</updated>
<author>
<name>Thadeu Lima de Souza Cascardo</name>
</author>
<published>2010-01-17T21:24:03Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=385f690bc058ba2555640740a1957826a40e4615'/>
<id>urn:sha1:385f690bc058ba2555640740a1957826a40e4615</id>
<content type='text'>
Signed-off-by: Thadeu Lima de Souza Cascardo &lt;cascardo@holoscopio.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;

</content>
</entry>
<entry>
<title>USB: convert to the runtime PM framework</title>
<updated>2010-03-02T22:54:12Z</updated>
<author>
<name>Alan Stern</name>
</author>
<published>2010-01-08T17:57:28Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=9bbdf1e0afe771ca7650f9f476769310bee9d8f3'/>
<id>urn:sha1:9bbdf1e0afe771ca7650f9f476769310bee9d8f3</id>
<content type='text'>
This patch (as1329) converts the USB stack over to the PM core's
runtime PM framework.  This involves numerous changes throughout
usbcore, especially to hub.c and driver.c.  Perhaps the most notable
change is that CONFIG_USB_SUSPEND now depends on CONFIG_PM_RUNTIME
instead of CONFIG_PM.

Several fields in the usb_device and usb_interface structures are no
longer needed.  Some code which used to depend on CONFIG_USB_PM now
depends on CONFIG_USB_SUSPEND (requiring some rearrangement of header
files).

The only visible change in behavior should be that following a system
sleep (resume from RAM or resume from hibernation), autosuspended USB
devices will be resumed just like everything else.  They won't remain
suspended.  But if they aren't in use then they will naturally
autosuspend again in a few seconds.

Signed-off-by: Alan Stern &lt;stern@rowland.harvard.edu&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;

</content>
</entry>
<entry>
<title>PM: Allow USB devices to suspend/resume asynchronously</title>
<updated>2010-02-26T19:39:12Z</updated>
<author>
<name>Rafael J. Wysocki</name>
</author>
<published>2010-02-08T18:18:16Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=927bc9165d3cd01054b472f9b25d91a8707209c8'/>
<id>urn:sha1:927bc9165d3cd01054b472f9b25d91a8707209c8</id>
<content type='text'>
Set power.async_suspend for USB devices, endpoints and interfaces,
allowing them to be suspended and resumed asynchronously during
system sleep transitions.

The power.async_suspend flag is also set for devices that don't have
suspend or resume callbacks, because otherwise they would make the
main suspend/resume thread wait for their "asynchronous" children
(during suspend) or parents (during resume), effectively negating the
possible gains from executing these devices' suspend and resume
callbacks asynchronously.

Signed-off-by: Rafael J. Wysocki &lt;rjw@sisk.pl&gt;
</content>
</entry>
<entry>
<title>USB: Don't use GFP_KERNEL while we cannot reset a storage device</title>
<updated>2010-01-20T23:24:34Z</updated>
<author>
<name>Oliver Neukum</name>
</author>
<published>2010-01-12T11:32:50Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=acbe2febe71abb2360b008e9ab3ee5c44169f78c'/>
<id>urn:sha1:acbe2febe71abb2360b008e9ab3ee5c44169f78c</id>
<content type='text'>
Memory allocations with GFP_KERNEL can cause IO to a storage
device which can fail resulting in a need to reset the device.
Therefore GFP_KERNEL cannot be safely used between usb_lock_device()
and usb_unlock_device(). Replace by GFP_NOIO.

Signed-off-by: Oliver Neukum &lt;oliver@neukum.org&gt;
Cc: stable &lt;stable@kernel.org&gt;
Cc: Alan Stern &lt;stern@rowland.harvard.edu&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;

</content>
</entry>
<entry>
<title>USB: core: message: fix sparse warning</title>
<updated>2009-12-11T19:55:28Z</updated>
<author>
<name>Felipe Balbi</name>
</author>
<published>2009-12-04T13:47:44Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=09e81f3df43af16ea58261059fe779920fde430d'/>
<id>urn:sha1:09e81f3df43af16ea58261059fe779920fde430d</id>
<content type='text'>
Fix the following sparse warning:

drivers/usb/core/message.c:1583:6: warning: symbol '__usb_queue_reset_device' was not declared. Should it be static?

Signed-off-by: Felipe Balbi &lt;felipe.balbi@nokia.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;

</content>
</entry>
<entry>
<title>USB: Check bandwidth when switching alt settings.</title>
<updated>2009-12-11T19:55:27Z</updated>
<author>
<name>Sarah Sharp</name>
</author>
<published>2009-12-03T17:44:36Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=3f0479e00a3fca9590ae8d9edc4e9c47b7fa0610'/>
<id>urn:sha1:3f0479e00a3fca9590ae8d9edc4e9c47b7fa0610</id>
<content type='text'>
Make the USB core check the bandwidth when switching from one
interface alternate setting to another.  Also check the bandwidth
when resetting a configuration (so that alt setting 0 is used).  If
this check fails, the device's state is unchanged.  If the device
refuses the new alt setting, re-instate the old alt setting in the
host controller hardware.

If a USB device doesn't have an alternate interface setting 0, install
the first alt setting in its descriptors when a new configuration is
requested, or the device is reset.

Add a mutex per root hub to protect bandwidth operations:
adding/reseting/changing configurations, and changing alternate interface
settings.  We want to ensure that the xHCI host controller and the USB
device are set up for the same configurations and alternate settings.
There are two (possibly three) steps to do this:

 1. The host controller needs to check that bandwidth is available for a
    different setting, by issuing and waiting for a configure endpoint
    command.
 2. Once that returns successfully, a control message is sent to the
    device.
 3. If that fails, the host controller must be notified through another
    configure endpoint command.

The mutex is used to make these three operations seem atomic, to prevent
another driver from using more bandwidth for a different device while
we're in the middle of these operations.

While we're touching the bandwidth code, rename usb_hcd_check_bandwidth()
to usb_hcd_alloc_bandwidth().  This function does more than just check
that the bandwidth change won't exceed the bus bandwidth; it actually
changes the bandwidth configuration in the xHCI host controller.

Signed-off-by: Sarah Sharp &lt;sarah.a.sharp@linux.intel.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;
</content>
</entry>
</feed>
