summaryrefslogtreecommitdiffstats
path: root/drivers/scsi/scsi_lib.c
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2019-01-16 17:12:15 +0100
committerMartin K. Petersen <martin.petersen@oracle.com>2019-01-22 20:40:59 -0500
commita8cf59a6692c9c55a5a10257de97919fae6edef8 (patch)
tree053ce64df252111bc86cf10f34c22ab042f082ca /drivers/scsi/scsi_lib.c
parent9e8f1c79831424d30c0e3df068be7f4a244157c9 (diff)
downloadlinux-a8cf59a6692c9c55a5a10257de97919fae6edef8.tar.gz
linux-a8cf59a6692c9c55a5a10257de97919fae6edef8.tar.bz2
linux-a8cf59a6692c9c55a5a10257de97919fae6edef8.zip
scsi: communicate max segment size to the DMA mapping code
When a host driver sets a maximum segment size we should not only propagate that setting to the block layer, which can merge segments, but also to the DMA mapping layer which can merge segments as well. Fixes: 50c2e9107f ("scsi: introduce a max_segment_size host_template parameters") Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Diffstat (limited to 'drivers/scsi/scsi_lib.c')
-rw-r--r--drivers/scsi/scsi_lib.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/scsi/scsi_lib.c b/drivers/scsi/scsi_lib.c
index b13cc9288ba0..6d65ac584eba 100644
--- a/drivers/scsi/scsi_lib.c
+++ b/drivers/scsi/scsi_lib.c
@@ -1842,8 +1842,8 @@ void __scsi_init_queue(struct Scsi_Host *shost, struct request_queue *q)
blk_queue_segment_boundary(q, shost->dma_boundary);
dma_set_seg_boundary(dev, shost->dma_boundary);
- blk_queue_max_segment_size(q,
- min(shost->max_segment_size, dma_get_max_seg_size(dev)));
+ blk_queue_max_segment_size(q, shost->max_segment_size);
+ dma_set_max_seg_size(dev, shost->max_segment_size);
/*
* Set a reasonable default alignment: The larger of 32-byte (dword),