usb-storage: implement autosuspend

This patch (as930) implements autosuspend for usb-storage.  It is
adapted from a patch by Oliver Neukum.  Autosuspend is allowed except
during LUN scanning, resets, and command execution.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
This commit is contained in:
Alan Stern
2007-07-06 14:24:27 -04:00
committed by Greg Kroah-Hartman
부모 b0e2a705bf
커밋 8dfe4b1486
2개의 변경된 파일29개의 추가작업 그리고 11개의 파일을 삭제

파일 보기

@@ -285,10 +285,15 @@ static int device_reset(struct scsi_cmnd *srb)
US_DEBUGP("%s called\n", __FUNCTION__);
/* lock the device pointers and do the reset */
mutex_lock(&(us->dev_mutex));
result = us->transport_reset(us);
mutex_unlock(&us->dev_mutex);
result = usb_autopm_get_interface(us->pusb_intf);
if (result == 0) {
/* lock the device pointers and do the reset */
mutex_lock(&(us->dev_mutex));
result = us->transport_reset(us);
mutex_unlock(&us->dev_mutex);
usb_autopm_put_interface(us->pusb_intf);
}
return result < 0 ? FAILED : SUCCESS;
}