]> git.karo-electronics.de Git - karo-tx-linux.git/commit
usb/uas: one only one status URB/host on stream-less connection
authorSebastian Andrzej Siewior <bigeasy@linutronix.de>
Tue, 20 Dec 2011 13:50:26 +0000 (14:50 +0100)
committerSebastian Andrzej Siewior <bigeasy@linutronix.de>
Thu, 22 Dec 2011 10:28:19 +0000 (11:28 +0100)
commitceb3f91fd53c9fbd7b292fc2754ba4efffeeeedb
tree84d7287caec1f614495d176dd146aae301d21f07
parent22188f4a933c6e86ac67f52028895c795896492e
usb/uas: one only one status URB/host on stream-less connection

The status/sense URB is allocated on per-command basis. A read/write
looks the following way on a stream-less connection:

- send cmd tag X, queue status
- receive status, oh it is a read for tag X. queue status & read
- receive read
- receive status, oh I'm done for tag X. Cool call complete and free
  status urb.

This block repeats itself 1:1 for further commands and looks great so
far. Lets take a look now what happens if we do allow multiple commands:

- send cmd tag X, queue statusX (belongs to the command with the X tag)
- send cmd tag Y, queue statusY (belongs to the command with the Y tag)
- receive statusX, oh it is a read for tag X. queue statusX & a read
- receive read
- receive statusY, oh I'm done for tag X. Cool call complete and free statusY.
- receive statusX, oh it is a read for tag Y. queue statusY & before we
  queue the read the the following message can be observed:
  |sd 0:0:0:0: [sda] sense urb submission failure
  followed by a second attempt with the same result.

In order to address this problem we will use only one status URB for
each scsi host in case we don't have stream support (as suggested by
Matthew). This URB is requeued until the device removed. Nothing changes
on stream based endpoints.

Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
drivers/usb/storage/uas.c