]> www.infradead.org Git - nvme.git/commitdiff
DAC960: don't use block layer bounce buffers
authorChristoph Hellwig <hch@lst.de>
Wed, 9 May 2018 13:59:43 +0000 (15:59 +0200)
committerJens Axboe <axboe@kernel.dk>
Fri, 11 May 2018 21:07:54 +0000 (15:07 -0600)
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>
drivers/block/DAC960.c
drivers/block/DAC960.h

index f781eff7d23eacf803c764e980e8cc325402e8a6..c9ba48519d0f5a82477963a6e0f27f3fa274b389 100644 (file)
@@ -1179,7 +1179,6 @@ static bool DAC960_V1_EnableMemoryMailboxInterface(DAC960_Controller_T
 
   if (pci_set_dma_mask(Controller->PCIDevice, DMA_BIT_MASK(32)))
        return DAC960_Failure(Controller, "DMA mask out of range");
-  Controller->BounceBufferLimit = DMA_BIT_MASK(32);
 
   if ((hw_type == DAC960_PD_Controller) || (hw_type == DAC960_P_Controller)) {
     CommandMailboxesSize =  0;
@@ -1380,11 +1379,8 @@ static bool DAC960_V2_EnableMemoryMailboxInterface(DAC960_Controller_T
   dma_addr_t   CommandMailboxDMA;
   DAC960_V2_CommandStatus_T CommandStatus;
 
-       if (!pci_set_dma_mask(Controller->PCIDevice, DMA_BIT_MASK(64)))
-               Controller->BounceBufferLimit = DMA_BIT_MASK(64);
-       else if (!pci_set_dma_mask(Controller->PCIDevice, DMA_BIT_MASK(32)))
-               Controller->BounceBufferLimit = DMA_BIT_MASK(32);
-       else
+       if (pci_set_dma_mask(Controller->PCIDevice, DMA_BIT_MASK(64)) &&
+           pci_set_dma_mask(Controller->PCIDevice, DMA_BIT_MASK(32)))
                return DAC960_Failure(Controller, "DMA mask out of range");
 
   /* 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)
                continue;
        }
        Controller->RequestQueue[n] = RequestQueue;
-       blk_queue_bounce_limit(RequestQueue, Controller->BounceBufferLimit);
        RequestQueue->queuedata = Controller;
        blk_queue_max_segments(RequestQueue, Controller->DriverScatterGatherLimit);
        blk_queue_max_hw_sectors(RequestQueue, Controller->MaxBlocksPerCommand);
index 21aff470d26846bb5e0ea0150f938f4755da6ca8..1439e651928b2043a52239cccdd29dc58be99ded 100644 (file)
@@ -2295,7 +2295,6 @@ typedef struct DAC960_Controller
   unsigned short MaxBlocksPerCommand;
   unsigned short ControllerScatterGatherLimit;
   unsigned short DriverScatterGatherLimit;
-  u64          BounceBufferLimit;
   unsigned int CombinedStatusBufferLength;
   unsigned int InitialStatusLength;
   unsigned int CurrentStatusLength;