Lines Matching +full:usb +full:- +full:a

1 .. _usb-persist:
3 USB device persistence during system suspend
13 According to the USB specification, when a USB bus is suspended the
14 bus must continue to supply suspend current (around 1-5 mA). This
16 detect connect-change events (devices being plugged in or unplugged).
19 If a USB device's power session is interrupted then the system is
20 required to behave as though the device has been unplugged. It's a
23 device is still attached or perhaps it was removed and a different
26 By default, Linux behaves according to the spec. If a USB host
27 controller loses power during a system suspend, then when the system
33 If the kernel wants to believe that your USB keyboard was unplugged
34 while the system was asleep and a new keyboard was plugged in when the
38 Unfortunately problems _can_ arise, particularly with mass-storage
40 been unplugged while the system was suspended. If you had a mounted
41 filesystem on the device, you're out of luck -- everything in that
47 interrupts a power session will have the same effect. For example,
50 firmware (i.e., the BIOS) resets the motherboard's USB host
52 it's as though you had unplugged all the USB devices. Yes, it's
56 On many systems the USB host controllers will get reset after a
57 suspend-to-RAM. On almost all systems, no suspend current is
58 available during hibernation (also known as swsusp or suspend-to-disk).
62 In practice, people are forced to unmount any filesystems on a USB
63 device before suspending. If the root filesystem is on a USB device,
65 suspended -- but it will crash as soon as it wakes up, which isn't
72 The kernel includes a feature called USB-persist. It tries to work
73 around these issues by allowing the core USB device data structures to
74 persist across a power-session disruption.
76 It works like this. If the kernel sees that a USB host controller is
78 reset or otherwise had lost power) then it applies a persistence check
79 to each of the USB devices below that controller for which the
81 can't work once the power session is gone. Instead it issues a USB
82 port reset and then re-enumerates the device. (This is exactly the
83 same thing that happens whenever a USB device is reset.) If the
84 re-enumeration shows that the device now attached to that port has the
91 but a USB device was unplugged and then replugged, or if a USB device
92 fails to carry out a normal resume.
97 behaves as though the old device had been unplugged and a new device
100 The end result is that the USB device remains available and usable.
102 now a good and happy place.
104 Note that the "USB-persist" feature will be applied only to those
108 echo 1 >/sys/bus/usb/devices/.../power/persist
121 memory mappings across device disconnects should be handled by a
122 centralized Logical Volume Manager. Such a solution would allow you
123 to plug in a USB flash device, create a persistent volume associated
126 it would be more far-reaching than USB-persist.
128 On the other hand, writing a persistent volume manager would be a big
130 solution is much quicker and easier -- and it exists now, a giant
133 Furthermore, the USB-persist feature applies to _all_ USB devices, not
134 just mass-storage devices. It might turn out to be equally useful for
138 WARNING: USB-persist can be dangerous!!
142 to make sure the USB device hasn't been changed; that is, the same
146 If you replace one USB device with another of the same type (same
153 Furthermore it's quite possible to leave a USB device exactly the same
154 while changing its media. If you replace the flash memory card in a
155 USB card reader while the system is asleep, the kernel will have no
170 at all. The USB-persist feature can be extremely useful. Make the