Commit 32a3bebc authored by Mauro Carvalho Chehab's avatar Mauro Carvalho Chehab Committed by Jonathan Corbet
Browse files

usb/persist.txt: convert to ReST and add to driver-api book



This document describe some USB core features. Add it to the
driver-api book.

Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@s-opensource.com>
Acked-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: default avatarJonathan Corbet <corbet@lwn.net>
parent 76f650f0
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -12,6 +12,7 @@ Linux USB API
   dma
   power-management
   hotplug
   persist
   error-codes
   writing_usb_driver
   writing_musb_glue_layer
+13 −9
Original line number Diff line number Diff line
USB device persistence during system suspend
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

		   Alan Stern <stern@rowland.harvard.edu>

		September 2, 2006 (Updated February 25, 2008)
:Author: Alan Stern <stern@rowland.harvard.edu>
:Date: September 2, 2006 (Updated February 25, 2008)


What is the problem?
====================

According to the USB specification, when a USB bus is suspended the
bus must continue to supply suspend current (around 1-5 mA).  This
@@ -64,6 +65,7 @@ much better.)


What is the solution?
=====================

The kernel includes a feature called USB-persist.  It tries to work
around these issues by allowing the core USB device data structures to
@@ -99,7 +101,7 @@ now a good and happy place.

Note that the "USB-persist" feature will be applied only to those
devices for which it is enabled.  You can enable the feature by doing
(as root):
(as root)::

	echo 1 >/sys/bus/usb/devices/.../power/persist

@@ -111,6 +113,7 @@ devices where it really matters.


Is this the best solution?
==========================

Perhaps not.  Arguably, keeping track of mounted filesystems and
memory mappings across device disconnects should be handled by a
@@ -131,6 +134,7 @@ other device types, such as network interfaces.


WARNING: USB-persist can be dangerous!!
=======================================

When recovering an interrupted power session the kernel does its best
to make sure the USB device hasn't been changed; that is, the same