diff options
author | Tony Battersby <tonyb@cybernetics.com> | 2007-10-30 11:44:35 -0400 |
---|---|---|
committer | Jeff Garzik <jeff@garzik.org> | 2007-11-03 08:46:54 -0400 |
commit | f8d8e5799b75cf7ad530d2bf2a42229bf7360526 (patch) | |
tree | f5094c82ca94ff1bdfbca4e7be69bfed7db5ccdd /drivers/ata/libata-core.c | |
parent | 03116d67e0973bb493fe9307e28973a24a272bcc (diff) |
libata: increase 128 KB / cmd limit for ATAPI tape drives
Commands sent to ATAPI tape drives via the SCSI generic (sg) driver are
limited in the amount of data that they can transfer by the max_sectors
value. The max_sectors value is currently calculated according to the
command set for disk drives, which doesn't apply to tape drives. The
default max_sectors value of 256 limits ATAPI tape drive commands to
128 KB. This patch against 2.6.24-rc1 increases the max_sectors value
for tape drives to 65535, which permits tape drive commands to transfer
just under 32 MB.
Tested with a SuperMicro PDSME motherboard, AHCI, and a Sony SDX-570V
SATA tape drive.
Note that some of the chipset drivers also set their own max_sectors
value, which may override the value set in libata-core. I don't have
any of these chipsets to test, so I didn't go messing with them. Also,
ATAPI devices other than tape drives may benefit from similar changes,
but I have only tape drives and disk drives to test.
Signed-off-by: Tony Battersby <tonyb@cybernetics.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
Diffstat (limited to 'drivers/ata/libata-core.c')
-rw-r--r-- | drivers/ata/libata-core.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c index 4dc6befa5760..24b3bd63621f 100644 --- a/drivers/ata/libata-core.c +++ b/drivers/ata/libata-core.c | |||
@@ -2304,6 +2304,10 @@ int ata_dev_configure(struct ata_device *dev) | |||
2304 | dev->max_sectors = ATA_MAX_SECTORS; | 2304 | dev->max_sectors = ATA_MAX_SECTORS; |
2305 | } | 2305 | } |
2306 | 2306 | ||
2307 | if ((dev->class == ATA_DEV_ATAPI) && | ||
2308 | (atapi_command_packet_set(id) == TYPE_TAPE)) | ||
2309 | dev->max_sectors = ATA_MAX_SECTORS_TAPE; | ||
2310 | |||
2307 | if (dev->horkage & ATA_HORKAGE_MAX_SEC_128) | 2311 | if (dev->horkage & ATA_HORKAGE_MAX_SEC_128) |
2308 | dev->max_sectors = min_t(unsigned int, ATA_MAX_SECTORS_128, | 2312 | dev->max_sectors = min_t(unsigned int, ATA_MAX_SECTORS_128, |
2309 | dev->max_sectors); | 2313 | dev->max_sectors); |