aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <mchehab@s-opensource.com>2017-04-05 09:23:09 -0400
committerJonathan Corbet <corbet@lwn.net>2017-04-11 16:40:12 -0400
commit32a3bebce9d09598d4f4c5afca929a2ce148b8c4 (patch)
treea0ac3c5bddc53cc9a21575274a9711a29b4af796
parent76f650f077f3edd7001c89da44eade2449e8f495 (diff)
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: Mauro Carvalho Chehab <mchehab@s-opensource.com> Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: Jonathan Corbet <corbet@lwn.net>
-rw-r--r--Documentation/driver-api/usb/index.rst1
-rw-r--r--Documentation/driver-api/usb/persist.rst (renamed from Documentation/usb/persist.txt)22
2 files changed, 14 insertions, 9 deletions
diff --git a/Documentation/driver-api/usb/index.rst b/Documentation/driver-api/usb/index.rst
index 43f0a8b72b11..3f08cb5d5feb 100644
--- a/Documentation/driver-api/usb/index.rst
+++ b/Documentation/driver-api/usb/index.rst
@@ -12,6 +12,7 @@ Linux USB API
12 dma 12 dma
13 power-management 13 power-management
14 hotplug 14 hotplug
15 persist
15 error-codes 16 error-codes
16 writing_usb_driver 17 writing_usb_driver
17 writing_musb_glue_layer 18 writing_musb_glue_layer
diff --git a/Documentation/usb/persist.txt b/Documentation/driver-api/usb/persist.rst
index 35d70eda9ad6..ea1b43f0559e 100644
--- a/Documentation/usb/persist.txt
+++ b/Documentation/driver-api/usb/persist.rst
@@ -1,11 +1,12 @@
1 USB device persistence during system suspend 1USB device persistence during system suspend
2~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2 3
3 Alan Stern <stern@rowland.harvard.edu> 4:Author: Alan Stern <stern@rowland.harvard.edu>
5:Date: September 2, 2006 (Updated February 25, 2008)
4 6
5 September 2, 2006 (Updated February 25, 2008)
6 7
7 8What is the problem?
8 What is the problem? 9====================
9 10
10According to the USB specification, when a USB bus is suspended the 11According to the USB specification, when a USB bus is suspended the
11bus must continue to supply suspend current (around 1-5 mA). This 12bus must continue to supply suspend current (around 1-5 mA). This
@@ -63,7 +64,8 @@ suspended -- but it will crash as soon as it wakes up, which isn't
63much better.) 64much better.)
64 65
65 66
66 What is the solution? 67What is the solution?
68=====================
67 69
68The kernel includes a feature called USB-persist. It tries to work 70The kernel includes a feature called USB-persist. It tries to work
69around these issues by allowing the core USB device data structures to 71around these issues by allowing the core USB device data structures to
@@ -99,7 +101,7 @@ now a good and happy place.
99 101
100Note that the "USB-persist" feature will be applied only to those 102Note that the "USB-persist" feature will be applied only to those
101devices for which it is enabled. You can enable the feature by doing 103devices for which it is enabled. You can enable the feature by doing
102(as root): 104(as root)::
103 105
104 echo 1 >/sys/bus/usb/devices/.../power/persist 106 echo 1 >/sys/bus/usb/devices/.../power/persist
105 107
@@ -110,7 +112,8 @@ doesn't even exist, so you only have to worry about setting it for
110devices where it really matters. 112devices where it really matters.
111 113
112 114
113 Is this the best solution? 115Is this the best solution?
116==========================
114 117
115Perhaps not. Arguably, keeping track of mounted filesystems and 118Perhaps not. Arguably, keeping track of mounted filesystems and
116memory mappings across device disconnects should be handled by a 119memory mappings across device disconnects should be handled by a
@@ -130,7 +133,8 @@ just mass-storage devices. It might turn out to be equally useful for
130other device types, such as network interfaces. 133other device types, such as network interfaces.
131 134
132 135
133 WARNING: USB-persist can be dangerous!! 136WARNING: USB-persist can be dangerous!!
137=======================================
134 138
135When recovering an interrupted power session the kernel does its best 139When recovering an interrupted power session the kernel does its best
136to make sure the USB device hasn't been changed; that is, the same 140to make sure the USB device hasn't been changed; that is, the same