diff options
author | Alan Stern <stern@rowland.harvard.edu> | 2005-10-23 19:38:56 -0700 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2005-10-28 16:47:50 -0700 |
commit | b876aef7f890d8c59a45b78858a36cf60fddf522 (patch) | |
tree | c8211d093fc0ab4ec04d3adaf8388253aa73d0bf /drivers/usb/storage/transport.c | |
parent | 423e489d704d05c6e8c2927fb1854db85914912a (diff) | |
download | blackbird-op-linux-b876aef7f890d8c59a45b78858a36cf60fddf522.tar.gz blackbird-op-linux-b876aef7f890d8c59a45b78858a36cf60fddf522.zip |
[PATCH] PATCH: usb-storage: move GetMaxLUN later in time
This patch is originally from Alan Stern (as557). It has been re-diffed
against a current tree, and I also corrected a minor merging error.
Some time ago we introduced a delay before device scanning, because many
devices do not like to receive SCSI commands right after enumeration.
Now it turns out there's a device that doesn't like to receive
Get-Max-LUN right after enumeration either. Accordingly this patch
delays the Get-Max-LUN request until the beginning of the scanning
procedure. This fixes Bugzilla entry #5010.
Three things are worth noting. First, I removed the locking code from
usb_stor_acquire_resources. It's not needed, because the locking is to
protect against disconnect events and acquire_resources is only called
during probe (so the disconnect routine can't be called). Second, I
initialized to 0 the buffer used for the Get-Max-LUN response. It's not
really necessary, but it will prevent random values from showing up in
the debugging log when the request fails. Third, I added a test against
the SINGLE_LUN flag. This will allow us to use the flag to indicate
Bulk-only devices that can't handle Get-Max-LUN.
Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Matthew Dharm <mdharm-usb@one-eyed-alien.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/usb/storage/transport.c')
-rw-r--r-- | drivers/usb/storage/transport.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/usb/storage/transport.c b/drivers/usb/storage/transport.c index c1ba5301ebfc..e89e945fc4a7 100644 --- a/drivers/usb/storage/transport.c +++ b/drivers/usb/storage/transport.c @@ -923,6 +923,7 @@ int usb_stor_Bulk_max_lun(struct us_data *us) int result; /* issue the command */ + us->iobuf[0] = 0; result = usb_stor_control_msg(us, us->recv_ctrl_pipe, US_BULK_GET_MAX_LUN, USB_DIR_IN | USB_TYPE_CLASS | |