Skip to content

Commit 21e07db

Browse files
author
Christoph Hellwig
committed
scsi: reduce use of block bounce buffers
We can rely on the dma-mapping code to handle any DMA limits that is bigger than the ISA DMA mask for us (either using an iommu or swiotlb), so remove setting the block layer bounce limit for anything but the unchecked_isa_dma case, or the bouncing for highmem pages. Signed-off-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Jens Axboe <axboe@kernel.dk>
1 parent de7eab3 commit 21e07db

File tree

1 file changed

+2
-22
lines changed

1 file changed

+2
-22
lines changed

drivers/scsi/scsi_lib.c

Lines changed: 2 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -2149,27 +2149,6 @@ static int scsi_map_queues(struct blk_mq_tag_set *set)
21492149
return blk_mq_map_queues(set);
21502150
}
21512151

2152-
static u64 scsi_calculate_bounce_limit(struct Scsi_Host *shost)
2153-
{
2154-
struct device *host_dev;
2155-
u64 bounce_limit = 0xffffffff;
2156-
2157-
if (shost->unchecked_isa_dma)
2158-
return BLK_BOUNCE_ISA;
2159-
/*
2160-
* Platforms with virtual-DMA translation
2161-
* hardware have no practical limit.
2162-
*/
2163-
if (!PCI_DMA_BUS_IS_PHYS)
2164-
return BLK_BOUNCE_ANY;
2165-
2166-
host_dev = scsi_get_device(shost);
2167-
if (host_dev && host_dev->dma_mask)
2168-
bounce_limit = (u64)dma_max_pfn(host_dev) << PAGE_SHIFT;
2169-
2170-
return bounce_limit;
2171-
}
2172-
21732152
void __scsi_init_queue(struct Scsi_Host *shost, struct request_queue *q)
21742153
{
21752154
struct device *dev = shost->dma_dev;
@@ -2189,7 +2168,8 @@ void __scsi_init_queue(struct Scsi_Host *shost, struct request_queue *q)
21892168
}
21902169

21912170
blk_queue_max_hw_sectors(q, shost->max_sectors);
2192-
blk_queue_bounce_limit(q, scsi_calculate_bounce_limit(shost));
2171+
if (shost->unchecked_isa_dma)
2172+
blk_queue_bounce_limit(q, BLK_BOUNCE_ISA);
21932173
blk_queue_segment_boundary(q, shost->dma_boundary);
21942174
dma_set_seg_boundary(dev, shost->dma_boundary);
21952175

0 commit comments

Comments
 (0)