diff options
author | Alan Stern <stern@rowland.harvard.edu> | 2007-05-04 17:52:20 +0200 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2007-07-13 01:29:47 +0200 |
commit | 0458d5b4c9cc4ca0f62625d0144ddc4b4bc97a3c (patch) | |
tree | 8b1fcb4f063ef4aa6f2e3cd41a60d986a1e432d4 /drivers/usb/storage/usb.c | |
parent | usbmon: Add class for binary interface (diff) | |
download | linux-0458d5b4c9cc4ca0f62625d0144ddc4b4bc97a3c.tar.xz linux-0458d5b4c9cc4ca0f62625d0144ddc4b4bc97a3c.zip |
USB: add USB-Persist facility
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 <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/usb/storage/usb.c')
-rw-r--r-- | drivers/usb/storage/usb.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/drivers/usb/storage/usb.c b/drivers/usb/storage/usb.c index df5dc186aef5..be4cd8fe4ce6 100644 --- a/drivers/usb/storage/usb.c +++ b/drivers/usb/storage/usb.c @@ -236,7 +236,7 @@ static void storage_pre_reset(struct usb_interface *iface) mutex_lock(&us->dev_mutex); } -static void storage_post_reset(struct usb_interface *iface) +static void storage_post_reset(struct usb_interface *iface, int reset_resume) { struct us_data *us = usb_get_intfdata(iface); @@ -249,7 +249,11 @@ static void storage_post_reset(struct usb_interface *iface) /* FIXME: Notify the subdrivers that they need to reinitialize * the device */ - mutex_unlock(&us->dev_mutex); + + /* If this is a reset-resume then the pre_reset routine wasn't + * called, so we don't need to unlock the mutex. */ + if (!reset_resume) + mutex_unlock(&us->dev_mutex); } /* |