Commit 65a803ab authored by James Bottomley's avatar James Bottomley

SCSI: Introduce dma_boundary parameter

From: Jens Axboe <axboe@suse.de>

The block layer includes the ability to avoid merging if the merged
segment would cross a particular boundary (by default, this boundary
is set to 4GB which is the PCI DAC requirement).

This patch makes the boundary tunable in SCSI for drivers that need
different ones (usually because of card constraints)
parent e15d50b3
......@@ -197,6 +197,14 @@ struct Scsi_Host *scsi_host_alloc(struct scsi_host_template *sht, int privsize)
else
shost->max_sectors = SCSI_DEFAULT_MAX_SECTORS;
/*
* assume a 4GB boundary, if not set
*/
if (sht->dma_boundary)
shost->dma_boundary = sht->dma_boundary;
else
shost->dma_boundary = 0xffffffff;
rval = scsi_setup_command_freelist(shost);
if (rval)
goto fail;
......
......@@ -1239,6 +1239,7 @@ struct request_queue *scsi_alloc_queue(struct scsi_device *sdev)
blk_queue_max_phys_segments(q, MAX_PHYS_SEGMENTS);
blk_queue_max_sectors(q, shost->max_sectors);
blk_queue_bounce_limit(q, scsi_calculate_bounce_limit(shost));
blk_queue_segment_boundary(q, shost->dma_boundary);
if (!shost->use_clustering)
clear_bit(QUEUE_FLAG_CLUSTER, &q->queue_flags);
......
......@@ -261,6 +261,12 @@ struct scsi_host_template {
*/
unsigned short max_sectors;
/*
* dma scatter gather segment boundary limit. a segment crossing this
* boundary will be split in two.
*/
unsigned long dma_boundary;
/*
* This specifies "machine infinity" for host templates which don't
* limit the transfer size. Note this limit represents an absolute
......@@ -410,6 +416,7 @@ struct Scsi_Host {
short cmd_per_lun;
short unsigned int sg_tablesize;
short unsigned int max_sectors;
unsigned long dma_boundary;
unsigned in_recovery:1;
unsigned unchecked_isa_dma: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