summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2018-05-09 09:59:43 -0400
committerJens Axboe <axboe@kernel.dk>2018-05-11 17:07:54 -0400
commit00f0a51f0b211d40fa1dda09355a68928edc556c (patch)
tree710aa8d26ed78b527ec4f0c6b8b452bfde41ab77
parent5c26e05039cce3e73c9ffa7290c7f181b851e0df (diff)
DAC960: don't use block layer bounce buffers
DAC960 just sets the block bounce limit to the dma mask, which means that the iommu or swiotlb already take care of the bounce buffering, and the block bouncing can be removed. Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de> Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Jens Axboe <axboe@kernel.dk>
-rw-r--r--drivers/block/DAC960.c9
-rw-r--r--drivers/block/DAC960.h1
2 files changed, 2 insertions, 8 deletions
diff --git a/drivers/block/DAC960.c b/drivers/block/DAC960.c
index f781eff7d23e..c9ba48519d0f 100644
--- a/drivers/block/DAC960.c
+++ b/drivers/block/DAC960.c
@@ -1179,7 +1179,6 @@ static bool DAC960_V1_EnableMemoryMailboxInterface(DAC960_Controller_T
1179 1179
1180 if (pci_set_dma_mask(Controller->PCIDevice, DMA_BIT_MASK(32))) 1180 if (pci_set_dma_mask(Controller->PCIDevice, DMA_BIT_MASK(32)))
1181 return DAC960_Failure(Controller, "DMA mask out of range"); 1181 return DAC960_Failure(Controller, "DMA mask out of range");
1182 Controller->BounceBufferLimit = DMA_BIT_MASK(32);
1183 1182
1184 if ((hw_type == DAC960_PD_Controller) || (hw_type == DAC960_P_Controller)) { 1183 if ((hw_type == DAC960_PD_Controller) || (hw_type == DAC960_P_Controller)) {
1185 CommandMailboxesSize = 0; 1184 CommandMailboxesSize = 0;
@@ -1380,11 +1379,8 @@ static bool DAC960_V2_EnableMemoryMailboxInterface(DAC960_Controller_T
1380 dma_addr_t CommandMailboxDMA; 1379 dma_addr_t CommandMailboxDMA;
1381 DAC960_V2_CommandStatus_T CommandStatus; 1380 DAC960_V2_CommandStatus_T CommandStatus;
1382 1381
1383 if (!pci_set_dma_mask(Controller->PCIDevice, DMA_BIT_MASK(64))) 1382 if (pci_set_dma_mask(Controller->PCIDevice, DMA_BIT_MASK(64)) &&
1384 Controller->BounceBufferLimit = DMA_BIT_MASK(64); 1383 pci_set_dma_mask(Controller->PCIDevice, DMA_BIT_MASK(32)))
1385 else if (!pci_set_dma_mask(Controller->PCIDevice, DMA_BIT_MASK(32)))
1386 Controller->BounceBufferLimit = DMA_BIT_MASK(32);
1387 else
1388 return DAC960_Failure(Controller, "DMA mask out of range"); 1384 return DAC960_Failure(Controller, "DMA mask out of range");
1389 1385
1390 /* This is a temporary dma mapping, used only in the scope of this function */ 1386 /* This is a temporary dma mapping, used only in the scope of this function */
@@ -2540,7 +2536,6 @@ static bool DAC960_RegisterBlockDevice(DAC960_Controller_T *Controller)
2540 continue; 2536 continue;
2541 } 2537 }
2542 Controller->RequestQueue[n] = RequestQueue; 2538 Controller->RequestQueue[n] = RequestQueue;
2543 blk_queue_bounce_limit(RequestQueue, Controller->BounceBufferLimit);
2544 RequestQueue->queuedata = Controller; 2539 RequestQueue->queuedata = Controller;
2545 blk_queue_max_segments(RequestQueue, Controller->DriverScatterGatherLimit); 2540 blk_queue_max_segments(RequestQueue, Controller->DriverScatterGatherLimit);
2546 blk_queue_max_hw_sectors(RequestQueue, Controller->MaxBlocksPerCommand); 2541 blk_queue_max_hw_sectors(RequestQueue, Controller->MaxBlocksPerCommand);
diff --git a/drivers/block/DAC960.h b/drivers/block/DAC960.h
index 21aff470d268..1439e651928b 100644
--- a/drivers/block/DAC960.h
+++ b/drivers/block/DAC960.h
@@ -2295,7 +2295,6 @@ typedef struct DAC960_Controller
2295 unsigned short MaxBlocksPerCommand; 2295 unsigned short MaxBlocksPerCommand;
2296 unsigned short ControllerScatterGatherLimit; 2296 unsigned short ControllerScatterGatherLimit;
2297 unsigned short DriverScatterGatherLimit; 2297 unsigned short DriverScatterGatherLimit;
2298 u64 BounceBufferLimit;
2299 unsigned int CombinedStatusBufferLength; 2298 unsigned int CombinedStatusBufferLength;
2300 unsigned int InitialStatusLength; 2299 unsigned int InitialStatusLength;
2301 unsigned int CurrentStatusLength; 2300 unsigned int CurrentStatusLength;