Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 167576
b: refs/heads/master
c: b8430e1
h: refs/heads/master
v: v3
  • Loading branch information
Benjamin Herrenschmidt authored and Greg Kroah-Hartman committed Oct 14, 2009
1 parent 188ccea commit 9e0bf6f
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 2 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: 36f21329d217016f0f212f0752ae595b4a76754d
refs/heads/master: b8430e1b82b7e514d76a88eb70a7d8831d50df1e
17 changes: 16 additions & 1 deletion trunk/drivers/usb/storage/transport.c
Original file line number Diff line number Diff line change
Expand Up @@ -696,7 +696,7 @@ void usb_stor_invoke_transport(struct scsi_cmnd *srb, struct us_data *us)
/* device supports and needs bigger sense buffer */
if (us->fflags & US_FL_SANE_SENSE)
sense_size = ~0;

Retry_Sense:
US_DEBUGP("Issuing auto-REQUEST_SENSE\n");

scsi_eh_prep_cmnd(srb, &ses, NULL, 0, sense_size);
Expand All @@ -720,6 +720,21 @@ void usb_stor_invoke_transport(struct scsi_cmnd *srb, struct us_data *us)
srb->result = DID_ABORT << 16;
goto Handle_Errors;
}

/* Some devices claim to support larger sense but fail when
* trying to request it. When a transport failure happens
* using US_FS_SANE_SENSE, we always retry with a standard
* (small) sense request. This fixes some USB GSM modems
*/
if (temp_result == USB_STOR_TRANSPORT_FAILED &&
(us->fflags & US_FL_SANE_SENSE) &&
sense_size != US_SENSE_SIZE) {
US_DEBUGP("-- auto-sense failure, retry small sense\n");
sense_size = US_SENSE_SIZE;
goto Retry_Sense;
}

/* Other failures */
if (temp_result != USB_STOR_TRANSPORT_GOOD) {
US_DEBUGP("-- auto-sense failure\n");

Expand Down

0 comments on commit 9e0bf6f

Please sign in to comment.