diff options
| author | Stephen M. Cameron <scameron@beardog.cce.hp.com> | 2010-02-26 17:01:32 -0500 |
|---|---|---|
| committer | Jens Axboe <jens.axboe@oracle.com> | 2010-02-28 13:42:31 -0500 |
| commit | 2ad6cdc20fbeea1e1744190c00cebb64e4b4c491 (patch) | |
| tree | 05a1b482b1e8132c805c3f768426fdc48af5019c | |
| parent | dccc9b563e455b91f7247b1ca6b0face40323538 (diff) | |
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: Stephen M. Cameron <scameron@beardog.cce.hp.com>
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
| -rw-r--r-- | drivers/block/cciss.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/drivers/block/cciss.c b/drivers/block/cciss.c index adc517c1381c..c0d794ce69c6 100644 --- a/drivers/block/cciss.c +++ b/drivers/block/cciss.c | |||
| @@ -1717,10 +1717,8 @@ static void cciss_softirq_done(struct request *rq) | |||
| 1717 | if (curr_sg[sg_index].Ext == CCISS_SG_CHAIN) { | 1717 | if (curr_sg[sg_index].Ext == CCISS_SG_CHAIN) { |
| 1718 | temp64.val32.lower = cmd->SG[i].Addr.lower; | 1718 | temp64.val32.lower = cmd->SG[i].Addr.lower; |
| 1719 | temp64.val32.upper = cmd->SG[i].Addr.upper; | 1719 | temp64.val32.upper = cmd->SG[i].Addr.upper; |
| 1720 | pci_dma_sync_single_for_cpu(h->pdev, temp64.val, | ||
| 1721 | cmd->SG[i].Len, ddir); | ||
| 1722 | pci_unmap_single(h->pdev, temp64.val, | 1720 | pci_unmap_single(h->pdev, temp64.val, |
| 1723 | cmd->SG[i].Len, ddir); | 1721 | cmd->SG[i].Len, PCI_DMA_TODEVICE); |
| 1724 | /* Point to the next block */ | 1722 | /* Point to the next block */ |
| 1725 | curr_sg = h->cmd_sg_list[cmd->cmdindex]; | 1723 | curr_sg = h->cmd_sg_list[cmd->cmdindex]; |
| 1726 | sg_index = 0; | 1724 | sg_index = 0; |
| @@ -3223,11 +3221,11 @@ static void do_cciss_request(struct request_queue *q) | |||
| 3223 | * block with address of next chain block. | 3221 | * block with address of next chain block. |
| 3224 | */ | 3222 | */ |
| 3225 | temp64.val = pci_map_single(h->pdev, | 3223 | temp64.val = pci_map_single(h->pdev, |
| 3226 | h->cmd_sg_list[c->cmdindex], len, dir); | 3224 | h->cmd_sg_list[c->cmdindex], len, |
| 3225 | PCI_DMA_TODEVICE); | ||
| 3227 | dma_addr = temp64.val; | 3226 | dma_addr = temp64.val; |
| 3228 | curr_sg[sg_index].Addr.lower = temp64.val32.lower; | 3227 | curr_sg[sg_index].Addr.lower = temp64.val32.lower; |
| 3229 | curr_sg[sg_index].Addr.upper = temp64.val32.upper; | 3228 | curr_sg[sg_index].Addr.upper = temp64.val32.upper; |
| 3230 | pci_dma_sync_single_for_device(h->pdev, dma_addr, len, dir); | ||
| 3231 | } | 3229 | } |
| 3232 | 3230 | ||
| 3233 | /* track how many SG entries we are using */ | 3231 | /* track how many SG entries we are using */ |
