Commit 35ca8838 authored by Alan Stern's avatar Alan Stern Committed by Greg Kroah-Hartman

[PATCH] USB Storage: Revision of as202, Genesys quirk patch

In the slave_configure routine it's already too late for the host's
max_sector value to affect the scsi_device.  It's necessary to set the
queue value directly.  This revised patch takes care of that.
parent 794e227d
......@@ -64,8 +64,10 @@ static const char* host_info(struct Scsi_Host *host)
return "SCSI emulation for USB Mass Storage devices";
}
static int slave_configure (struct scsi_device *sdev)
static int slave_configure(struct scsi_device *sdev)
{
struct us_data *us = (struct us_data *) sdev->host->hostdata[0];
/* 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
......@@ -76,6 +78,16 @@ static int slave_configure (struct scsi_device *sdev)
* the end, scatter-gather buffers follow page boundaries. */
blk_queue_dma_alignment(sdev->request_queue, (512 - 1));
/* Devices using Genesys Logic chips cause a lot of trouble for
* high-speed transfers; they die unpredictably when given more
* than 64 KB of data at a time. If we detect such a device,
* reduce the maximum transfer size to 64 KB = 128 sectors. */
#define USB_VENDOR_ID_GENESYS 0x05e3 // Needs a standard location
if (us->pusb_dev->descriptor.idVendor == USB_VENDOR_ID_GENESYS &&
us->pusb_dev->speed == USB_SPEED_HIGH)
blk_queue_max_sectors(sdev->request_queue, 128);
/* this is to satisify the compiler, tho I don't think the
* return code is ever checked anywhere. */
return 0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment