diff options
Diffstat (limited to 'drivers/usb/core')
-rw-r--r-- | drivers/usb/core/Kconfig | 16 | ||||
-rw-r--r-- | drivers/usb/core/quirks.c | 16 |
2 files changed, 21 insertions, 11 deletions
diff --git a/drivers/usb/core/Kconfig b/drivers/usb/core/Kconfig index 175701a2dae4..7b7305e3abc8 100644 --- a/drivers/usb/core/Kconfig +++ b/drivers/usb/core/Kconfig | |||
@@ -27,6 +27,22 @@ config USB_ANNOUNCE_NEW_DEVICES | |||
27 | comment "Miscellaneous USB options" | 27 | comment "Miscellaneous USB options" |
28 | depends on USB | 28 | depends on USB |
29 | 29 | ||
30 | config USB_DEFAULT_PERSIST | ||
31 | bool "Enable USB persist by default" | ||
32 | depends on USB | ||
33 | default y | ||
34 | help | ||
35 | Say N here if you don't want USB power session persistance | ||
36 | enabled by default. If you say N it will make suspended USB | ||
37 | devices that lose power get reenumerated as if they had been | ||
38 | unplugged, causing any mounted filesystems to be lost. The | ||
39 | persist feature can still be enabled for individual devices | ||
40 | through the power/persist sysfs node. See | ||
41 | Documentation/usb/persist.txt for more info. | ||
42 | |||
43 | If you have any questions about this, say Y here, only say N | ||
44 | if you know exactly what you are doing. | ||
45 | |||
30 | config USB_DYNAMIC_MINORS | 46 | config USB_DYNAMIC_MINORS |
31 | bool "Dynamic USB minor allocation" | 47 | bool "Dynamic USB minor allocation" |
32 | depends on USB | 48 | depends on USB |
diff --git a/drivers/usb/core/quirks.c b/drivers/usb/core/quirks.c index 3113c1d71442..ab5638d9c707 100644 --- a/drivers/usb/core/quirks.c +++ b/drivers/usb/core/quirks.c | |||
@@ -201,20 +201,14 @@ void usb_detect_quirks(struct usb_device *udev) | |||
201 | dev_dbg(&udev->dev, "USB quirks for this device: %x\n", | 201 | dev_dbg(&udev->dev, "USB quirks for this device: %x\n", |
202 | udev->quirks); | 202 | udev->quirks); |
203 | 203 | ||
204 | /* For the present, all devices default to USB-PERSIST enabled */ | 204 | #ifdef CONFIG_USB_DEFAULT_PERSIST |
205 | #if 0 /* was: #ifdef CONFIG_PM */ | 205 | if (!(udev->quirks & USB_QUIRK_RESET)) |
206 | /* Hubs are automatically enabled for USB-PERSIST */ | ||
207 | if (udev->descriptor.bDeviceClass == USB_CLASS_HUB) | ||
208 | udev->persist_enabled = 1; | 206 | udev->persist_enabled = 1; |
209 | |||
210 | #else | 207 | #else |
211 | /* In the absence of PM, we can safely enable USB-PERSIST | 208 | /* Hubs are automatically enabled for USB-PERSIST */ |
212 | * for all devices. It will affect things like hub resets | 209 | if (udev->descriptor.bDeviceClass == USB_CLASS_HUB) |
213 | * and EMF-related port disables. | ||
214 | */ | ||
215 | if (!(udev->quirks & USB_QUIRK_RESET)) | ||
216 | udev->persist_enabled = 1; | 210 | udev->persist_enabled = 1; |
217 | #endif /* CONFIG_PM */ | 211 | #endif /* CONFIG_USB_DEFAULT_PERSIST */ |
218 | } | 212 | } |
219 | 213 | ||
220 | void usb_detect_interface_quirks(struct usb_device *udev) | 214 | void usb_detect_interface_quirks(struct usb_device *udev) |