Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 3712
b: refs/heads/master
c: 5203ad4
h: refs/heads/master
v: v3
  • Loading branch information
Matthew Dharm authored and Greg Kroah-Hartman committed Jun 27, 2005
1 parent 237f8c7 commit 9b52cf5
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 11 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 01205a0e60bb5a66d768b881fb8355981b912510
refs/heads/master: 5203ad441310a4c2abd4fb79015a6bdadc2a5a4f
19 changes: 9 additions & 10 deletions trunk/drivers/usb/storage/transport.c
Original file line number Diff line number Diff line change
Expand Up @@ -266,8 +266,9 @@ int usb_stor_clear_halt(struct us_data *us, unsigned int pipe)
NULL, 0, 3*HZ);

/* reset the endpoint toggle */
usb_settoggle(us->pusb_dev, usb_pipeendpoint(pipe),
usb_pipeout(pipe), 0);
if (result >= 0)
usb_settoggle(us->pusb_dev, usb_pipeendpoint(pipe),
usb_pipeout(pipe), 0);

US_DEBUGP("%s: result = %d\n", __FUNCTION__, result);
return result;
Expand Down Expand Up @@ -1124,7 +1125,7 @@ int usb_stor_Bulk_transport(struct scsi_cmnd *srb, struct us_data *us)
* It's handy that every transport mechanism uses the control endpoint for
* resets.
*
* Basically, we send a reset with a 20-second timeout, so we don't get
* Basically, we send a reset with a 5-second timeout, so we don't get
* jammed attempting to do the reset.
*/
static int usb_stor_reset_common(struct us_data *us,
Expand All @@ -1145,13 +1146,9 @@ static int usb_stor_reset_common(struct us_data *us,
clear_bit(US_FLIDX_ABORTING, &us->flags);
scsi_unlock(us_to_host(us));

/* A 20-second timeout may seem rather long, but a LaCie
* StudioDrive USB2 device takes 16+ seconds to get going
* following a powerup or USB attach event.
*/
result = usb_stor_control_msg(us, us->send_ctrl_pipe,
request, requesttype, value, index, data, size,
20*HZ);
5*HZ);
if (result < 0) {
US_DEBUGP("Soft reset failed: %d\n", result);
goto Done;
Expand All @@ -1173,8 +1170,10 @@ static int usb_stor_reset_common(struct us_data *us,
US_DEBUGP("Soft reset: clearing bulk-out endpoint halt\n");
result2 = usb_stor_clear_halt(us, us->send_bulk_pipe);

/* return a result code based on the result of the control message */
if (result < 0 || result2 < 0) {
/* return a result code based on the result of the clear-halts */
if (result >= 0)
result = result2;
if (result < 0) {
US_DEBUGP("Soft reset failed\n");
goto Done;
}
Expand Down

0 comments on commit 9b52cf5

Please sign in to comment.