Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 104631
b: refs/heads/master
c: f756cbd
h: refs/heads/master
i:
  104629: 930e6c7
  104627: a7611a9
  104623: 500a753
v: v3
  • Loading branch information
Alan Stern authored and Greg Kroah-Hartman committed Jul 21, 2008
1 parent a4be9e8 commit c12c66d
Show file tree
Hide file tree
Showing 2 changed files with 16 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: 86c57edf60f5c98adb496880f56cd0e5a3423153
refs/heads/master: f756cbd458ab71c996a069cb3928fb1e2d7cd9cc
25 changes: 15 additions & 10 deletions trunk/drivers/usb/storage/scsiglue.c
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,6 @@ static const char* host_info(struct Scsi_Host *host)
static int slave_alloc (struct scsi_device *sdev)
{
struct us_data *us = host_to_us(sdev->host);
struct usb_host_endpoint *bulk_in_ep;

/*
* Set the INQUIRY transfer length to 36. We don't use any of
Expand All @@ -80,16 +79,22 @@ static int slave_alloc (struct scsi_device *sdev)
*/
sdev->inquiry_len = 36;

/* Scatter-gather buffers (all but the last) must have a length
* divisible by the bulk maxpacket size. Otherwise a data packet
* would end up being short, causing a premature end to the data
* transfer. We'll use the maxpacket value of the bulk-IN pipe
* to set the SCSI device queue's DMA alignment mask.
/* USB has unusual DMA-alignment requirements: Although the
* starting address of each scatter-gather element doesn't matter,
* the length of each element except the last must be divisible
* by the Bulk maxpacket value. There's currently no way to
* express this by block-layer constraints, so we'll cop out
* and simply require addresses to be aligned at 512-byte
* boundaries. This is okay since most block I/O involves
* hardware sectors that are multiples of 512 bytes in length,
* and since host controllers up through USB 2.0 have maxpacket
* values no larger than 512.
*
* But it doesn't suffice for Wireless USB, where Bulk maxpacket
* values can be as large as 2048. To make that work properly
* will require changes to the block layer.
*/
bulk_in_ep = us->pusb_dev->ep_in[usb_pipeendpoint(us->recv_bulk_pipe)];
blk_queue_update_dma_alignment(sdev->request_queue,
le16_to_cpu(bulk_in_ep->desc.wMaxPacketSize) - 1);
/* wMaxPacketSize must be a power of 2 */
blk_queue_update_dma_alignment(sdev->request_queue, (512 - 1));

/*
* The UFI spec treates the Peripheral Qualifier bits in an
Expand Down

0 comments on commit c12c66d

Please sign in to comment.