Commit dcc6993c authored by Jeff Garzik's avatar Jeff Garzik

[libata] limit S/G table size to 128 entries

Agreeing with Ben H's recommendation, I reduce the max-hw-segments
number to 128, to match max-phys-segments number.  This shouldn't
affect performance because 128*64K is far above the max transfer size
for most current IDE devices.  Even 128*4K is OK.
parent a2c14d8c
...@@ -89,7 +89,7 @@ static Scsi_Host_Template piix_sht = { ...@@ -89,7 +89,7 @@ static Scsi_Host_Template piix_sht = {
.eh_strategy_handler = ata_scsi_error, .eh_strategy_handler = ata_scsi_error,
.can_queue = ATA_DEF_QUEUE, .can_queue = ATA_DEF_QUEUE,
.this_id = ATA_SHT_THIS_ID, .this_id = ATA_SHT_THIS_ID,
.sg_tablesize = ATA_MAX_PRD, .sg_tablesize = LIBATA_MAX_PRD,
.max_sectors = ATA_MAX_SECTORS, .max_sectors = ATA_MAX_SECTORS,
.cmd_per_lun = ATA_SHT_CMD_PER_LUN, .cmd_per_lun = ATA_SHT_CMD_PER_LUN,
.emulated = ATA_SHT_EMULATED, .emulated = ATA_SHT_EMULATED,
......
...@@ -123,7 +123,7 @@ int ata_scsi_slave_config(struct scsi_device *sdev) ...@@ -123,7 +123,7 @@ int ata_scsi_slave_config(struct scsi_device *sdev)
{ {
sdev->use_10_for_rw = 1; sdev->use_10_for_rw = 1;
sdev->use_10_for_ms = 1; sdev->use_10_for_ms = 1;
blk_queue_max_phys_segments(sdev->request_queue, ATA_MAX_PRD / 2); blk_queue_max_phys_segments(sdev->request_queue, LIBATA_MAX_PRD);
return 0; /* scsi layer doesn't check return value, sigh */ return 0; /* scsi layer doesn't check return value, sigh */
} }
......
...@@ -187,7 +187,7 @@ static Scsi_Host_Template pdc_sata_sht = { ...@@ -187,7 +187,7 @@ static Scsi_Host_Template pdc_sata_sht = {
.eh_strategy_handler = ata_scsi_error, .eh_strategy_handler = ata_scsi_error,
.can_queue = ATA_DEF_QUEUE, .can_queue = ATA_DEF_QUEUE,
.this_id = ATA_SHT_THIS_ID, .this_id = ATA_SHT_THIS_ID,
.sg_tablesize = ATA_MAX_PRD, .sg_tablesize = LIBATA_MAX_PRD,
.max_sectors = ATA_MAX_SECTORS, .max_sectors = ATA_MAX_SECTORS,
.cmd_per_lun = ATA_SHT_CMD_PER_LUN, .cmd_per_lun = ATA_SHT_CMD_PER_LUN,
.emulated = ATA_SHT_EMULATED, .emulated = ATA_SHT_EMULATED,
......
...@@ -127,7 +127,7 @@ static Scsi_Host_Template sil_sht = { ...@@ -127,7 +127,7 @@ static Scsi_Host_Template sil_sht = {
.eh_strategy_handler = ata_scsi_error, .eh_strategy_handler = ata_scsi_error,
.can_queue = ATA_DEF_QUEUE, .can_queue = ATA_DEF_QUEUE,
.this_id = ATA_SHT_THIS_ID, .this_id = ATA_SHT_THIS_ID,
.sg_tablesize = ATA_MAX_PRD, .sg_tablesize = LIBATA_MAX_PRD,
.max_sectors = ATA_MAX_SECTORS, .max_sectors = ATA_MAX_SECTORS,
.cmd_per_lun = ATA_SHT_CMD_PER_LUN, .cmd_per_lun = ATA_SHT_CMD_PER_LUN,
.emulated = ATA_SHT_EMULATED, .emulated = ATA_SHT_EMULATED,
......
...@@ -222,7 +222,7 @@ static Scsi_Host_Template k2_sata_sht = { ...@@ -222,7 +222,7 @@ static Scsi_Host_Template k2_sata_sht = {
.eh_strategy_handler = ata_scsi_error, .eh_strategy_handler = ata_scsi_error,
.can_queue = ATA_DEF_QUEUE, .can_queue = ATA_DEF_QUEUE,
.this_id = ATA_SHT_THIS_ID, .this_id = ATA_SHT_THIS_ID,
.sg_tablesize = ATA_MAX_PRD, .sg_tablesize = LIBATA_MAX_PRD,
.max_sectors = ATA_MAX_SECTORS, .max_sectors = ATA_MAX_SECTORS,
.cmd_per_lun = ATA_SHT_CMD_PER_LUN, .cmd_per_lun = ATA_SHT_CMD_PER_LUN,
.emulated = ATA_SHT_EMULATED, .emulated = ATA_SHT_EMULATED,
......
...@@ -70,7 +70,7 @@ static Scsi_Host_Template svia_sht = { ...@@ -70,7 +70,7 @@ static Scsi_Host_Template svia_sht = {
.eh_strategy_handler = ata_scsi_error, .eh_strategy_handler = ata_scsi_error,
.can_queue = ATA_DEF_QUEUE, .can_queue = ATA_DEF_QUEUE,
.this_id = ATA_SHT_THIS_ID, .this_id = ATA_SHT_THIS_ID,
.sg_tablesize = ATA_MAX_PRD, .sg_tablesize = LIBATA_MAX_PRD,
.max_sectors = ATA_MAX_SECTORS, .max_sectors = ATA_MAX_SECTORS,
.cmd_per_lun = ATA_SHT_CMD_PER_LUN, .cmd_per_lun = ATA_SHT_CMD_PER_LUN,
.emulated = ATA_SHT_EMULATED, .emulated = ATA_SHT_EMULATED,
......
...@@ -70,6 +70,7 @@ ...@@ -70,6 +70,7 @@
enum { enum {
/* various global constants */ /* various global constants */
LIBATA_MAX_PRD = ATA_MAX_PRD / 2,
ATA_MAX_PORTS = 8, ATA_MAX_PORTS = 8,
ATA_DEF_QUEUE = 1, ATA_DEF_QUEUE = 1,
ATA_MAX_QUEUE = 1, ATA_MAX_QUEUE = 1,
......
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