aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStefan Richter <stefanr@s5r6.in-berlin.de>2006-07-23 16:57:00 -0400
committerStefan Richter <stefanr@s5r6.in-berlin.de>2006-09-17 13:29:11 -0400
commitd4018d7fa63d25f3e1ecf6949fca6b81a182231a (patch)
treeb9ef9048699ee71f0a37069702415051d15d946c
parent28212767e58402ea362edcb80b753d49bfd44d98 (diff)
ieee1394: sbp2: optimize DMA direction of command ORBs
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>
-rw-r--r--drivers/ieee1394/sbp2.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/drivers/ieee1394/sbp2.c b/drivers/ieee1394/sbp2.c
index 670a13981fd0..11595df8b75e 100644
--- a/drivers/ieee1394/sbp2.c
+++ b/drivers/ieee1394/sbp2.c
@@ -492,7 +492,7 @@ static int sbp2util_create_command_orb_pool(struct scsi_id_instance_data *scsi_i
492 command->command_orb_dma = 492 command->command_orb_dma =
493 pci_map_single(hi->host->pdev, &command->command_orb, 493 pci_map_single(hi->host->pdev, &command->command_orb,
494 sizeof(struct sbp2_command_orb), 494 sizeof(struct sbp2_command_orb),
495 PCI_DMA_BIDIRECTIONAL); 495 PCI_DMA_TODEVICE);
496 SBP2_DMA_ALLOC("single command orb DMA"); 496 SBP2_DMA_ALLOC("single command orb DMA");
497 command->sge_dma = 497 command->sge_dma =
498 pci_map_single(hi->host->pdev, 498 pci_map_single(hi->host->pdev,
@@ -525,7 +525,7 @@ static void sbp2util_remove_command_orb_pool(struct scsi_id_instance_data *scsi_
525 /* Release our generic DMA's */ 525 /* Release our generic DMA's */
526 pci_unmap_single(host->pdev, command->command_orb_dma, 526 pci_unmap_single(host->pdev, command->command_orb_dma,
527 sizeof(struct sbp2_command_orb), 527 sizeof(struct sbp2_command_orb),
528 PCI_DMA_BIDIRECTIONAL); 528 PCI_DMA_TODEVICE);
529 SBP2_DMA_FREE("single command orb DMA"); 529 SBP2_DMA_FREE("single command orb DMA");
530 pci_unmap_single(host->pdev, command->sge_dma, 530 pci_unmap_single(host->pdev, command->sge_dma,
531 sizeof(command->scatter_gather_element), 531 sizeof(command->scatter_gather_element),
@@ -1982,7 +1982,7 @@ static void sbp2_link_orb_command(struct scsi_id_instance_data *scsi_id,
1982 1982
1983 pci_dma_sync_single_for_device(hi->host->pdev, command->command_orb_dma, 1983 pci_dma_sync_single_for_device(hi->host->pdev, command->command_orb_dma,
1984 sizeof(struct sbp2_command_orb), 1984 sizeof(struct sbp2_command_orb),
1985 PCI_DMA_BIDIRECTIONAL); 1985 PCI_DMA_TODEVICE);
1986 pci_dma_sync_single_for_device(hi->host->pdev, command->sge_dma, 1986 pci_dma_sync_single_for_device(hi->host->pdev, command->sge_dma,
1987 sizeof(command->scatter_gather_element), 1987 sizeof(command->scatter_gather_element),
1988 PCI_DMA_BIDIRECTIONAL); 1988 PCI_DMA_BIDIRECTIONAL);
@@ -2012,14 +2012,14 @@ static void sbp2_link_orb_command(struct scsi_id_instance_data *scsi_id,
2012 */ 2012 */
2013 pci_dma_sync_single_for_cpu(hi->host->pdev, last_orb_dma, 2013 pci_dma_sync_single_for_cpu(hi->host->pdev, last_orb_dma,
2014 sizeof(struct sbp2_command_orb), 2014 sizeof(struct sbp2_command_orb),
2015 PCI_DMA_BIDIRECTIONAL); 2015 PCI_DMA_TODEVICE);
2016 last_orb->next_ORB_lo = cpu_to_be32(command->command_orb_dma); 2016 last_orb->next_ORB_lo = cpu_to_be32(command->command_orb_dma);
2017 wmb(); 2017 wmb();
2018 /* Tells hardware that this pointer is valid */ 2018 /* Tells hardware that this pointer is valid */
2019 last_orb->next_ORB_hi = 0; 2019 last_orb->next_ORB_hi = 0;
2020 pci_dma_sync_single_for_device(hi->host->pdev, last_orb_dma, 2020 pci_dma_sync_single_for_device(hi->host->pdev, last_orb_dma,
2021 sizeof(struct sbp2_command_orb), 2021 sizeof(struct sbp2_command_orb),
2022 PCI_DMA_BIDIRECTIONAL); 2022 PCI_DMA_TODEVICE);
2023 addr += SBP2_DOORBELL_OFFSET; 2023 addr += SBP2_DOORBELL_OFFSET;
2024 data[0] = 0; 2024 data[0] = 0;
2025 length = 4; 2025 length = 4;
@@ -2176,7 +2176,7 @@ static int sbp2_handle_status_write(struct hpsb_host *host, int nodeid, int dest
2176 SBP2_DEBUG("Found status for command ORB"); 2176 SBP2_DEBUG("Found status for command ORB");
2177 pci_dma_sync_single_for_cpu(hi->host->pdev, command->command_orb_dma, 2177 pci_dma_sync_single_for_cpu(hi->host->pdev, command->command_orb_dma,
2178 sizeof(struct sbp2_command_orb), 2178 sizeof(struct sbp2_command_orb),
2179 PCI_DMA_BIDIRECTIONAL); 2179 PCI_DMA_TODEVICE);
2180 pci_dma_sync_single_for_cpu(hi->host->pdev, command->sge_dma, 2180 pci_dma_sync_single_for_cpu(hi->host->pdev, command->sge_dma,
2181 sizeof(command->scatter_gather_element), 2181 sizeof(command->scatter_gather_element),
2182 PCI_DMA_BIDIRECTIONAL); 2182 PCI_DMA_BIDIRECTIONAL);
@@ -2365,7 +2365,7 @@ static void sbp2scsi_complete_all_commands(struct scsi_id_instance_data *scsi_id
2365 command = list_entry(lh, struct sbp2_command_info, list); 2365 command = list_entry(lh, struct sbp2_command_info, list);
2366 pci_dma_sync_single_for_cpu(hi->host->pdev, command->command_orb_dma, 2366 pci_dma_sync_single_for_cpu(hi->host->pdev, command->command_orb_dma,
2367 sizeof(struct sbp2_command_orb), 2367 sizeof(struct sbp2_command_orb),
2368 PCI_DMA_BIDIRECTIONAL); 2368 PCI_DMA_TODEVICE);
2369 pci_dma_sync_single_for_cpu(hi->host->pdev, command->sge_dma, 2369 pci_dma_sync_single_for_cpu(hi->host->pdev, command->sge_dma,
2370 sizeof(command->scatter_gather_element), 2370 sizeof(command->scatter_gather_element),
2371 PCI_DMA_BIDIRECTIONAL); 2371 PCI_DMA_BIDIRECTIONAL);
@@ -2548,7 +2548,7 @@ static int sbp2scsi_abort(struct scsi_cmnd *SCpnt)
2548 pci_dma_sync_single_for_cpu(hi->host->pdev, 2548 pci_dma_sync_single_for_cpu(hi->host->pdev,
2549 command->command_orb_dma, 2549 command->command_orb_dma,
2550 sizeof(struct sbp2_command_orb), 2550 sizeof(struct sbp2_command_orb),
2551 PCI_DMA_BIDIRECTIONAL); 2551 PCI_DMA_TODEVICE);
2552 pci_dma_sync_single_for_cpu(hi->host->pdev, 2552 pci_dma_sync_single_for_cpu(hi->host->pdev,
2553 command->sge_dma, 2553 command->sge_dma,
2554 sizeof(command->scatter_gather_element), 2554 sizeof(command->scatter_gather_element),