From: Stefan Richter <stefanr@s5r6.in-berlin.de>
To: linux1394-devel@lists.sourceforge.net
Cc: Ben Collins <bcollins@ubuntu.com>, linux-kernel@vger.kernel.org
Subject: [PATCH 2.6.18-rc1-mm2 3/6] ieee1394: sbp2: optimize DMA direction of command ORBs
Date: Sun, 23 Jul 2006 22:57:52 +0200 (CEST) [thread overview]
Message-ID: <tkrat.77f108a4473ed590@s5r6.in-berlin.de> (raw)
In-Reply-To: <tkrat.25e69df87688def6@s5r6.in-berlin.de>
Only the driver writes ORBs, the device just reads them. Therefore
PCI_DMA_BIDIRECTIONAL can be replaced by PCI_DMA_TODEVICE which may be
cheaper on some architectures.
Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
---
drivers/ieee1394/sbp2.c | 16 ++++++++--------
1 files changed, 8 insertions(+), 8 deletions(-)
TODO:
Convert sbp2 from PCI DMA to generic DMA mapping.
Index: linux/drivers/ieee1394/sbp2.c
===================================================================
--- linux.orig/drivers/ieee1394/sbp2.c 2006-07-23 10:16:57.000000000 +0200
+++ linux/drivers/ieee1394/sbp2.c 2006-07-23 10:19:29.000000000 +0200
@@ -492,7 +492,7 @@ static int sbp2util_create_command_orb_p
command->command_orb_dma =
pci_map_single(hi->host->pdev, &command->command_orb,
sizeof(struct sbp2_command_orb),
- PCI_DMA_BIDIRECTIONAL);
+ PCI_DMA_TODEVICE);
SBP2_DMA_ALLOC("single command orb DMA");
command->sge_dma =
pci_map_single(hi->host->pdev,
@@ -525,7 +525,7 @@ static void sbp2util_remove_command_orb_
/* Release our generic DMA's */
pci_unmap_single(host->pdev, command->command_orb_dma,
sizeof(struct sbp2_command_orb),
- PCI_DMA_BIDIRECTIONAL);
+ PCI_DMA_TODEVICE);
SBP2_DMA_FREE("single command orb DMA");
pci_unmap_single(host->pdev, command->sge_dma,
sizeof(command->scatter_gather_element),
@@ -1982,7 +1982,7 @@ static void sbp2_link_orb_command(struct
pci_dma_sync_single_for_device(hi->host->pdev, command->command_orb_dma,
sizeof(struct sbp2_command_orb),
- PCI_DMA_BIDIRECTIONAL);
+ PCI_DMA_TODEVICE);
pci_dma_sync_single_for_device(hi->host->pdev, command->sge_dma,
sizeof(command->scatter_gather_element),
PCI_DMA_BIDIRECTIONAL);
@@ -2012,14 +2012,14 @@ static void sbp2_link_orb_command(struct
*/
pci_dma_sync_single_for_cpu(hi->host->pdev, last_orb_dma,
sizeof(struct sbp2_command_orb),
- PCI_DMA_BIDIRECTIONAL);
+ PCI_DMA_TODEVICE);
last_orb->next_ORB_lo = cpu_to_be32(command->command_orb_dma);
wmb();
/* Tells hardware that this pointer is valid */
last_orb->next_ORB_hi = 0;
pci_dma_sync_single_for_device(hi->host->pdev, last_orb_dma,
sizeof(struct sbp2_command_orb),
- PCI_DMA_BIDIRECTIONAL);
+ PCI_DMA_TODEVICE);
addr += SBP2_DOORBELL_OFFSET;
data[0] = 0;
length = 4;
@@ -2176,7 +2176,7 @@ static int sbp2_handle_status_write(stru
SBP2_DEBUG("Found status for command ORB");
pci_dma_sync_single_for_cpu(hi->host->pdev, command->command_orb_dma,
sizeof(struct sbp2_command_orb),
- PCI_DMA_BIDIRECTIONAL);
+ PCI_DMA_TODEVICE);
pci_dma_sync_single_for_cpu(hi->host->pdev, command->sge_dma,
sizeof(command->scatter_gather_element),
PCI_DMA_BIDIRECTIONAL);
@@ -2365,7 +2365,7 @@ static void sbp2scsi_complete_all_comman
command = list_entry(lh, struct sbp2_command_info, list);
pci_dma_sync_single_for_cpu(hi->host->pdev, command->command_orb_dma,
sizeof(struct sbp2_command_orb),
- PCI_DMA_BIDIRECTIONAL);
+ PCI_DMA_TODEVICE);
pci_dma_sync_single_for_cpu(hi->host->pdev, command->sge_dma,
sizeof(command->scatter_gather_element),
PCI_DMA_BIDIRECTIONAL);
@@ -2548,7 +2548,7 @@ static int sbp2scsi_abort(struct scsi_cm
pci_dma_sync_single_for_cpu(hi->host->pdev,
command->command_orb_dma,
sizeof(struct sbp2_command_orb),
- PCI_DMA_BIDIRECTIONAL);
+ PCI_DMA_TODEVICE);
pci_dma_sync_single_for_cpu(hi->host->pdev,
command->sge_dma,
sizeof(command->scatter_gather_element),
next prev parent reply other threads:[~2006-07-23 20:59 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-07-23 20:53 [PATCH 2.6.18-rc1-mm2 0/6] ieee1394: sbp2: misc updates Stefan Richter
2006-07-23 20:55 ` [PATCH 2.6.18-rc1-mm2 1/6] ieee1394: sbp2: safer last_orb and next_ORB handling Stefan Richter
2006-07-23 20:56 ` [PATCH 2.6.18-rc1-mm2 2/6] ieee1394: sbp2: discard return value of sbp2_link_orb_command Stefan Richter
2006-07-23 20:57 ` Stefan Richter [this message]
2006-07-23 20:58 ` [PATCH 2.6.18-rc1-mm2 4/6] ieee1394: sbp2: safer initialization of status fifo Stefan Richter
2006-07-23 20:59 ` [PATCH 2.6.18-rc1-mm2 5/6] ieee1394: sbp2: more checks of status block Stefan Richter
2006-07-23 21:00 ` [PATCH 2.6.18-rc1-mm2 6/6] ieee1394: sbp2: convert sbp2util_down_timeout to waitqueue Stefan Richter
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=tkrat.77f108a4473ed590@s5r6.in-berlin.de \
--to=stefanr@s5r6.in-berlin.de \
--cc=bcollins@ubuntu.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux1394-devel@lists.sourceforge.net \
/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
all inboxes | Powered by JetHome®