Commit 2ad6cdc2 authored by Stephen M. Cameron's avatar Stephen M. Cameron Committed by Jens Axboe

cciss: fix scatter gather chain block dma direction kludge

cciss: fix scatter gather chain block dma direction kludge
The data direction for the chained block of scatter gather
elements should always be PCI_DMA_TODEVICE, but was mistakenly
set to the direction of the data transfer, then a kludge to
fix it was added, in which pci_dma_sync_single_for_device or
pci_dma_sync_single_for_cpu was called.  If the correct direction
is used in the first place, the kludge isn't needed.
Signed-off-by: default avatarStephen M. Cameron <scameron@beardog.cce.hp.com>
Signed-off-by: default avatarJens Axboe <jens.axboe@oracle.com>
parent dccc9b56
...@@ -1717,10 +1717,8 @@ static void cciss_softirq_done(struct request *rq) ...@@ -1717,10 +1717,8 @@ static void cciss_softirq_done(struct request *rq)
if (curr_sg[sg_index].Ext == CCISS_SG_CHAIN) { if (curr_sg[sg_index].Ext == CCISS_SG_CHAIN) {
temp64.val32.lower = cmd->SG[i].Addr.lower; temp64.val32.lower = cmd->SG[i].Addr.lower;
temp64.val32.upper = cmd->SG[i].Addr.upper; temp64.val32.upper = cmd->SG[i].Addr.upper;
pci_dma_sync_single_for_cpu(h->pdev, temp64.val,
cmd->SG[i].Len, ddir);
pci_unmap_single(h->pdev, temp64.val, pci_unmap_single(h->pdev, temp64.val,
cmd->SG[i].Len, ddir); cmd->SG[i].Len, PCI_DMA_TODEVICE);
/* Point to the next block */ /* Point to the next block */
curr_sg = h->cmd_sg_list[cmd->cmdindex]; curr_sg = h->cmd_sg_list[cmd->cmdindex];
sg_index = 0; sg_index = 0;
...@@ -3223,11 +3221,11 @@ static void do_cciss_request(struct request_queue *q) ...@@ -3223,11 +3221,11 @@ static void do_cciss_request(struct request_queue *q)
* block with address of next chain block. * block with address of next chain block.
*/ */
temp64.val = pci_map_single(h->pdev, temp64.val = pci_map_single(h->pdev,
h->cmd_sg_list[c->cmdindex], len, dir); h->cmd_sg_list[c->cmdindex], len,
PCI_DMA_TODEVICE);
dma_addr = temp64.val; dma_addr = temp64.val;
curr_sg[sg_index].Addr.lower = temp64.val32.lower; curr_sg[sg_index].Addr.lower = temp64.val32.lower;
curr_sg[sg_index].Addr.upper = temp64.val32.upper; curr_sg[sg_index].Addr.upper = temp64.val32.upper;
pci_dma_sync_single_for_device(h->pdev, dma_addr, len, dir);
} }
/* track how many SG entries we are using */ /* track how many SG entries we are using */
......
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