From: "Stephen M. Cameron" <scameron@beardog.cce.hp.com>
To: axboe@kernel.dk, akpm@linux-foundation.org, james.bottomley@suse.de
Cc: linux-kernel@vger.kernel.org, mikem@beardog.cce.hp.com,
linux-scsi@vger.kernel.org, brace@beardog.cce.hp.com
Subject: [PATCH 5/9] cciss: fix scatter gather chain block dma direction kludge
Date: Fri, 26 Feb 2010 16:01:32 -0600 [thread overview]
Message-ID: <20100226220132.11979.3861.stgit@beardog.cce.hp.com> (raw)
In-Reply-To: <20100226220023.11979.4999.stgit@beardog.cce.hp.com>
From: Stephen M. Cameron <scameron@beardog.cce.hp.com>
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>
---
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, dir);
+ h->cmd_sg_list[c->cmdindex], len,
+ PCI_DMA_TODEVICE);
dma_addr = temp64.val;
curr_sg[sg_index].Addr.lower = temp64.val32.lower;
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 */
next prev parent reply other threads:[~2010-02-26 22:01 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-02-26 22:01 [PATCH 0/9] cciss driver SCSI updates Stephen M. Cameron
2010-02-26 22:01 ` [PATCH 1/9] cciss: clarify command list padding calculation Stephen M. Cameron
2010-02-26 22:01 ` [PATCH 2/9] cciss: detect bad alignment of scsi commands at build time Stephen M. Cameron
2010-02-26 22:01 ` [PATCH 3/9] cciss: factor out scatter gather chain block allocation and freeing Stephen M. Cameron
2010-02-26 22:01 ` [PATCH 4/9] cciss: simplify scatter gather code Stephen M. Cameron
2010-02-26 22:01 ` Stephen M. Cameron [this message]
2010-02-26 22:01 ` [PATCH 6/9] cciss: factor out scatter gather chain block mapping code Stephen M. Cameron
2010-02-26 22:01 ` [PATCH 7/9] cciss: do not use void pointer for scsi hba data Stephen M. Cameron
2010-02-26 22:01 ` [PATCH 8/9] cciss: eliminate unnecessary pointer use in cciss scsi code Stephen M. Cameron
2010-02-26 22:01 ` [PATCH 9/9] cciss: Fix problem with scatter gather elements in the scsi half of the driver Stephen M. Cameron
2010-02-28 18:43 ` [PATCH 0/9] cciss driver SCSI updates Jens Axboe
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20100226220132.11979.3861.stgit@beardog.cce.hp.com \
--to=scameron@beardog.cce.hp.com \
--cc=akpm@linux-foundation.org \
--cc=axboe@kernel.dk \
--cc=brace@beardog.cce.hp.com \
--cc=james.bottomley@suse.de \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-scsi@vger.kernel.org \
--cc=mikem@beardog.cce.hp.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox