cciss: fix scatter gather chain block dma direction kludge

Previous thread: ASoC: Add WM8994 CODEC driver by Linux Kernel Mailing List on Monday, March 1, 2010 - 11:01 am. (1 message)

Next thread: ASoC: Set codec->dev for AC97 devices by Linux Kernel Mailing List on Monday, March 1, 2010 - 11:01 am. (1 message)
From: Linux Kernel Mailing List
Date: Monday, March 1, 2010 - 11:02 am

Gitweb:     http://git.kernel.org/linus/2ad6cdc20fbeea1e1744190c00cebb64e4b4c491
Commit:     2ad6cdc20fbeea1e1744190c00cebb64e4b4c491
Parent:     dccc9b563e455b91f7247b1ca6b0face40323538
Author:     Stephen M. Cameron <scameron@beardog.cce.hp.com>
AuthorDate: Fri Feb 26 16:01:32 2010 -0600
Committer:  Jens Axboe <jens.axboe@oracle.com>
CommitDate: Sun Feb 28 19:42:31 2010 +0100

    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>
---
 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 adc517c..c0d794c 100644
--- a/drivers/block/cciss.c
+++ b/drivers/block/cciss.c
@@ -1717,10 +1717,8 @@ static void cciss_softirq_done(struct request *rq)
 		if (curr_sg[sg_index].Ext == CCISS_SG_CHAIN) {
 			temp64.val32.lower = cmd->SG[i].Addr.lower;
 			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,
-						cmd->SG[i].Len, ddir);
+				cmd->SG[i].Len, PCI_DMA_TODEVICE);
 			/* Point to the next block */
 			curr_sg = h->cmd_sg_list[cmd->cmdindex];
 			sg_index = 0;
@@ -3223,11 +3221,11 @@ static void do_cciss_request(struct request_queue *q)
 		 * block with address of next chain block.
 		 */
 		temp64.val = pci_map_single(h->pdev,
-					h->cmd_sg_list[c->cmdindex], len, ...
Previous thread: ASoC: Add WM8994 CODEC driver by Linux Kernel Mailing List on Monday, March 1, 2010 - 11:01 am. (1 message)

Next thread: ASoC: Set codec->dev for AC97 devices by Linux Kernel Mailing List on Monday, March 1, 2010 - 11:01 am. (1 message)