<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux/drivers/usb/core/generic.c, branch v2.6.30</title>
<subtitle>Linux kernel source tree</subtitle>
<id>https://git.amat.us/linux/atom/drivers/usb/core/generic.c?h=v2.6.30</id>
<link rel='self' href='https://git.amat.us/linux/atom/drivers/usb/core/generic.c?h=v2.6.30'/>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/'/>
<updated>2009-01-07T18:00:03Z</updated>
<entry>
<title>USB: Enhance usage of pm_message_t</title>
<updated>2009-01-07T18:00:03Z</updated>
<author>
<name>Alan Stern</name>
<email>stern@rowland.harvard.edu</email>
</author>
<published>2008-11-25T21:39:18Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=65bfd2967c906ca322a4bb69a285fe0de8916ac6'/>
<id>urn:sha1:65bfd2967c906ca322a4bb69a285fe0de8916ac6</id>
<content type='text'>
This patch (as1177) modifies the USB core suspend and resume
routines.  The resume functions now will take a pm_message_t argument,
so they will know what sort of resume is occurring.  The new argument
is also passed to the port suspend/resume and bus suspend/resume
routines (although they don't use it for anything but debugging).

In addition, special pm_message_t values are used for user-initiated,
device-initiated (i.e., remote wakeup), and automatic suspend/resume.
By testing these values, drivers can tell whether or not a particular
suspend was an autosuspend.  Unfortunately, they can't do the same for
resumes -- not until the pm_message_t argument is also passed to the
drivers' resume methods.  That will require a bigger change.

IMO, the whole Power Management framework should have been set up this
way in the first place.

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: fix possible deadlock involving sysfs attributes</title>
<updated>2008-05-29T20:59:03Z</updated>
<author>
<name>Alan Stern</name>
<email>stern@rowland.harvard.edu</email>
</author>
<published>2008-05-20T20:37:34Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=e16362a0c8d90e9adbfe477acbe32b021823fb22'/>
<id>urn:sha1:e16362a0c8d90e9adbfe477acbe32b021823fb22</id>
<content type='text'>
There is a potential deadlock when the usb_generic driver is unbound
from a device.  The problem is that generic_disconnect() is called
with the device lock held, and it removes a bunch of device attributes
from sysfs.  If a user task happens to be running an attribute method
at the time, the removal will block until the method returns.  But at
least one of the attribute methods (the store routine for power/level)
needs to acquire the device lock!

This patch (as1093) eliminates the deadlock by moving the calls to
create and remove the sysfs attributes from the usb_generic driver
into usb_new_device() and usb_disconnect(), where they can be invoked
without holding the device lock.

Besides, the other sysfs attributes are created when the device is
registered and removed when the device is unregistered.  So it seems
only fitting for the extra attributes to be created and removed at the
same time.

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: move decision to ignore FREEZE events</title>
<updated>2007-10-12T21:55:26Z</updated>
<author>
<name>Alan Stern</name>
<email>stern@rowland.harvard.edu</email>
</author>
<published>2007-09-10T15:31:43Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=5ad4f71e2f19a06f738463da1f09ea7fda3a3db2'/>
<id>urn:sha1:5ad4f71e2f19a06f738463da1f09ea7fda3a3db2</id>
<content type='text'>
This patch (as987) changes the way FREEZE and PRETHAW suspend events
are handled in usbcore.  The decision about whether or not to ignore
them for non-root devices is pushed down into the USB-device driver,
instead of being made in the core code.

This is appropriate, since devices exported to a virtualized guest or
over a network may indeed need to handle these types of suspend, even
though normal devices don't.

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: rename choose_configuration</title>
<updated>2007-10-12T21:55:08Z</updated>
<author>
<name>Greg Kroah-Hartman</name>
<email>gregkh@suse.de</email>
</author>
<published>2007-08-03T04:44:27Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=b5ea060f1e19c6a3f409d3472c723da4517547b8'/>
<id>urn:sha1:b5ea060f1e19c6a3f409d3472c723da4517547b8</id>
<content type='text'>
As it is global, give it a usb specific name in the global namespace.

Cc: Inaky Perez-Gonzalez &lt;inaky@linux.intel.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;

</content>
</entry>
<entry>
<title>usb: introduce usb_authorize/deauthorize()</title>
<updated>2007-10-12T21:55:07Z</updated>
<author>
<name>Inaky Perez-Gonzalez</name>
<email>inaky@linux.intel.com</email>
</author>
<published>2007-08-01T03:34:06Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=93993a0a3e528357ae4b9b0eb82fd4b428ebbf64'/>
<id>urn:sha1:93993a0a3e528357ae4b9b0eb82fd4b428ebbf64</id>
<content type='text'>
These USB API functions will do the full authorization/deauthorization
to be used for a device. When authorized we effectively allow a
configuration to be set. Reverse that when deauthorized.

Effectively this means that we have to clean all the configuration
descriptors on deauthorize and reload them when we authorized. We could
do without throwing them out for wired devices, but for wireless, we can
read them only after authenticating, and thus, when authorizing an
authenticated device we would need to read them. So to simplify, always
release them on deauthorize(), re-read them on authorize().

Also fix leak reported by Ragner Magalhaes; in usb_deauthorize_device(),
bNumConfigurations was being set to zero before the for loop, and thus
the different raw descriptors where never being freed.

Signed-off-by: Inaky Perez-Gonzalez &lt;inaky@linux.intel.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;

</content>
</entry>
<entry>
<title>usb: usb_generic_probe() obeys authorization</title>
<updated>2007-10-12T21:55:07Z</updated>
<author>
<name>Inaky Perez-Gonzalez</name>
<email>inaky@linux.intel.com</email>
</author>
<published>2007-08-01T03:34:04Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=f8a374648b58e5cfa14447eca866aed14a4fbfa8'/>
<id>urn:sha1:f8a374648b58e5cfa14447eca866aed14a4fbfa8</id>
<content type='text'>
If called and the device is not authorized to be used, then we won't
choose a configuration (as they are not a concept that exists for an
unauthorized device). However, the device is added to the system.

Signed-off-by: Inaky Perez-Gonzalez &lt;inaky@linux.intel.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;

</content>
</entry>
<entry>
<title>USB: unify reset_resume and normal resume</title>
<updated>2007-07-12T23:34:30Z</updated>
<author>
<name>Alan Stern</name>
<email>stern@rowland.harvard.edu</email>
</author>
<published>2007-05-30T19:38:58Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=54515fe528d8c6f9bfaf7d0b9fffb908deecad78'/>
<id>urn:sha1:54515fe528d8c6f9bfaf7d0b9fffb908deecad78</id>
<content type='text'>
This patch (as919) unifies the code paths used for normal resume and
for reset-resume.  Earlier I had failed to note a section in the USB
spec which requires the host to resume a suspended port before
resetting it if the attached device is enabled for remote wakeup.
Since the port has to be resumed anyway, we might as well reuse the
existing code.

The main changes are:

	usb_reset_suspended_device() is eliminated.

	usb_root_hub_lost_power() is moved down next to the
	hub_reset_resume() routine, to which it is logically
	related.

	finish_port_resume() does a port reset() if the device's
	reset_resume flag is set.

	usb_port_resume() doesn't check whether the port is initially
	enabled if this is a USB-Persist sort of resume.

	Code to perform the port reset is added to the resume pathway
	for the non-CONFIG_USB_SUSPEND case.

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: separate root and non-root suspend/resume</title>
<updated>2007-07-12T23:34:29Z</updated>
<author>
<name>Alan Stern</name>
<email>stern@rowland.harvard.edu</email>
</author>
<published>2007-05-30T19:34:36Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=686314cfbdac21c9019c0e04487b5d940db62406'/>
<id>urn:sha1:686314cfbdac21c9019c0e04487b5d940db62406</id>
<content type='text'>
This patch (as916) completes the separation of code paths for suspend
and resume of root hubs as opposed to non-root devices.  Root hubs
will be power-managed through their bus_suspend and bus_resume
methods, whereas normal devices will use usb_port_suspend() and
usb_port_resume().

Changes to the hcd_bus_{suspend,resume} routines mostly represent
motion of code that was already present elsewhere.  They include:

	Adding debugging log messages,

	Setting the device state appropriately, and

	Adding a resume recovery time delay.

Changes to the port-suspend and port-resume routines in hub.c include:

	Removal of checks for root devices (since they will never
	be triggered), and

	Removal of checks for NULL or invalid device pointers (these
	were left over from earlier kernel versions and aren't needed
	at all).

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: add USB-Persist facility</title>
<updated>2007-07-12T23:29:47Z</updated>
<author>
<name>Alan Stern</name>
<email>stern@rowland.harvard.edu</email>
</author>
<published>2007-05-04T15:52:20Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=0458d5b4c9cc4ca0f62625d0144ddc4b4bc97a3c'/>
<id>urn:sha1:0458d5b4c9cc4ca0f62625d0144ddc4b4bc97a3c</id>
<content type='text'>
This patch (as886) adds the controversial USB-persist facility,
allowing USB devices to persist across a power loss during system
suspend.

The facility is controlled by a new Kconfig option (with appropriate
warnings about the potential dangers); when the option is off the
behavior will remain the same as it is now.  But when the option is
on, people will be able to use suspend-to-disk and keep their USB
filesystems intact -- something particularly valuable for small
machines where the root filesystem is on a USB device!

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: move bus_suspend and bus_resume method calls</title>
<updated>2007-07-12T23:29:46Z</updated>
<author>
<name>Alan Stern</name>
<email>stern@rowland.harvard.edu</email>
</author>
<published>2007-05-04T15:51:54Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=b6f6436da0c6853eedad86f5075b139c1a3bcb5d'/>
<id>urn:sha1:b6f6436da0c6853eedad86f5075b139c1a3bcb5d</id>
<content type='text'>
This patch (as885) moves the root-hub bus_suspend() and bus_resume()
method calls from the hub driver's suspend and resume methods into the
usb_generic driver methods, where they make just as much sense.

Their old locations were not fully correct.  For example, in a kernel
compiled without CONFIG_USB_SUSPEND, if one were to do:

	echo -n 1-0:1.0 &gt;/sys/bus/usb/drivers/hub/unbind

to unbind the hub driver from a root hub, there would then be no way
to suspend that root hub.  Attempts to put the system to sleep would
fail; the USB controller driver would refuse to suspend because the
root hub was still active.

The patch also makes a very slight change in the way devices with no
driver are handled during suspend.  Rather than doing a standard USB
port-suspend directly, now the suspend routine in usb_generic is
called.  In practice this should never affect anyone.

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

</content>
</entry>
</feed>
