diff options
author | Stefan Richter <stefanr@s5r6.in-berlin.de> | 2007-02-04 14:54:57 -0500 |
---|---|---|
committer | Stefan Richter <stefanr@s5r6.in-berlin.de> | 2007-04-29 18:00:27 -0400 |
commit | 2446a79f4f0a5e88e5d8316dac407d66ac10f70d (patch) | |
tree | 9adb9c7816ef80c39b33d141efefc35803f17717 | |
parent | 0555659d63c285ceb7ead3115532e1b71b0f27a7 (diff) |
ieee1394: sbp2: optimize DMA direction of s/g tables
Unlike the name suggests, "cmd->scatter_gather_element" holds only the
s/g table, not the actual s/g elements. Since the table is only read
but never written by the device, DMA_BIDIRECTIONAL can be replaced by
DMA_TO_DEVICE which may be cheaper on some architectures.
Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
-rw-r--r-- | drivers/ieee1394/sbp2.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/drivers/ieee1394/sbp2.c b/drivers/ieee1394/sbp2.c index e15b5d7b9a02..cae3816e68db 100644 --- a/drivers/ieee1394/sbp2.c +++ b/drivers/ieee1394/sbp2.c | |||
@@ -489,7 +489,7 @@ static int sbp2util_create_command_orb_pool(struct sbp2_lu *lu) | |||
489 | cmd->sge_dma = dma_map_single(hi->host->device.parent, | 489 | cmd->sge_dma = dma_map_single(hi->host->device.parent, |
490 | &cmd->scatter_gather_element, | 490 | &cmd->scatter_gather_element, |
491 | sizeof(cmd->scatter_gather_element), | 491 | sizeof(cmd->scatter_gather_element), |
492 | DMA_BIDIRECTIONAL); | 492 | DMA_TO_DEVICE); |
493 | INIT_LIST_HEAD(&cmd->list); | 493 | INIT_LIST_HEAD(&cmd->list); |
494 | list_add_tail(&cmd->list, &lu->cmd_orb_completed); | 494 | list_add_tail(&cmd->list, &lu->cmd_orb_completed); |
495 | } | 495 | } |
@@ -514,7 +514,7 @@ static void sbp2util_remove_command_orb_pool(struct sbp2_lu *lu) | |||
514 | DMA_TO_DEVICE); | 514 | DMA_TO_DEVICE); |
515 | dma_unmap_single(host->device.parent, cmd->sge_dma, | 515 | dma_unmap_single(host->device.parent, cmd->sge_dma, |
516 | sizeof(cmd->scatter_gather_element), | 516 | sizeof(cmd->scatter_gather_element), |
517 | DMA_BIDIRECTIONAL); | 517 | DMA_TO_DEVICE); |
518 | kfree(cmd); | 518 | kfree(cmd); |
519 | } | 519 | } |
520 | spin_unlock_irqrestore(&lu->cmd_orb_lock, flags); | 520 | spin_unlock_irqrestore(&lu->cmd_orb_lock, flags); |
@@ -1633,7 +1633,7 @@ static void sbp2_link_orb_command(struct sbp2_lu *lu, | |||
1633 | DMA_TO_DEVICE); | 1633 | DMA_TO_DEVICE); |
1634 | dma_sync_single_for_device(hi->host->device.parent, cmd->sge_dma, | 1634 | dma_sync_single_for_device(hi->host->device.parent, cmd->sge_dma, |
1635 | sizeof(cmd->scatter_gather_element), | 1635 | sizeof(cmd->scatter_gather_element), |
1636 | DMA_BIDIRECTIONAL); | 1636 | DMA_TO_DEVICE); |
1637 | 1637 | ||
1638 | /* check to see if there are any previous orbs to use */ | 1638 | /* check to see if there are any previous orbs to use */ |
1639 | spin_lock_irqsave(&lu->cmd_orb_lock, flags); | 1639 | spin_lock_irqsave(&lu->cmd_orb_lock, flags); |
@@ -1799,7 +1799,7 @@ static int sbp2_handle_status_write(struct hpsb_host *host, int nodeid, | |||
1799 | DMA_TO_DEVICE); | 1799 | DMA_TO_DEVICE); |
1800 | dma_sync_single_for_cpu(hi->host->device.parent, cmd->sge_dma, | 1800 | dma_sync_single_for_cpu(hi->host->device.parent, cmd->sge_dma, |
1801 | sizeof(cmd->scatter_gather_element), | 1801 | sizeof(cmd->scatter_gather_element), |
1802 | DMA_BIDIRECTIONAL); | 1802 | DMA_TO_DEVICE); |
1803 | /* Grab SCSI command pointers and check status. */ | 1803 | /* Grab SCSI command pointers and check status. */ |
1804 | /* | 1804 | /* |
1805 | * FIXME: If the src field in the status is 1, the ORB DMA must | 1805 | * FIXME: If the src field in the status is 1, the ORB DMA must |
@@ -1931,7 +1931,7 @@ static void sbp2scsi_complete_all_commands(struct sbp2_lu *lu, u32 status) | |||
1931 | DMA_TO_DEVICE); | 1931 | DMA_TO_DEVICE); |
1932 | dma_sync_single_for_cpu(hi->host->device.parent, cmd->sge_dma, | 1932 | dma_sync_single_for_cpu(hi->host->device.parent, cmd->sge_dma, |
1933 | sizeof(cmd->scatter_gather_element), | 1933 | sizeof(cmd->scatter_gather_element), |
1934 | DMA_BIDIRECTIONAL); | 1934 | DMA_TO_DEVICE); |
1935 | sbp2util_mark_command_completed(lu, cmd); | 1935 | sbp2util_mark_command_completed(lu, cmd); |
1936 | if (cmd->Current_SCpnt) { | 1936 | if (cmd->Current_SCpnt) { |
1937 | cmd->Current_SCpnt->result = status << 16; | 1937 | cmd->Current_SCpnt->result = status << 16; |
@@ -2062,7 +2062,7 @@ static int sbp2scsi_abort(struct scsi_cmnd *SCpnt) | |||
2062 | dma_sync_single_for_cpu(hi->host->device.parent, | 2062 | dma_sync_single_for_cpu(hi->host->device.parent, |
2063 | cmd->sge_dma, | 2063 | cmd->sge_dma, |
2064 | sizeof(cmd->scatter_gather_element), | 2064 | sizeof(cmd->scatter_gather_element), |
2065 | DMA_BIDIRECTIONAL); | 2065 | DMA_TO_DEVICE); |
2066 | sbp2util_mark_command_completed(lu, cmd); | 2066 | sbp2util_mark_command_completed(lu, cmd); |
2067 | if (cmd->Current_SCpnt) { | 2067 | if (cmd->Current_SCpnt) { |
2068 | cmd->Current_SCpnt->result = DID_ABORT << 16; | 2068 | cmd->Current_SCpnt->result = DID_ABORT << 16; |