diff options
author | 3ware Inc <bunk@kernel.org> | 2008-07-14 21:09:24 +0300 |
---|---|---|
committer | Adrian Bunk <bunk@kernel.org> | 2008-07-14 21:09:24 +0300 |
commit | 797fbc12708d07601ac379c92bd1ba777d79d66c (patch) | |
tree | 2abacc4968376743e3f28900c50a3e7877a43ffa | |
parent | 89ebd169dd1e8be2c11c100c4decbffdcbd6466b (diff) | |
download | linux-rt-797fbc12708d07601ac379c92bd1ba777d79d66c.tar.gz |
3w-xxxx: Prevent data corruption
Use default DMA data direction to prevent data corruption
when using SWIOTLB with 4GB+ on EM64T.
http://www.3ware.com/KB/article.aspx?id=15243&cNode=6I1C6S
Acked-by: Jean Delvare <jdelvare@suse.de>
Signed-off-by: Adrian Bunk <bunk@kernel.org>
-rw-r--r-- | drivers/scsi/3w-xxxx.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/scsi/3w-xxxx.c b/drivers/scsi/3w-xxxx.c index e8e41e6eb42a..9cec86bc85f2 100644 --- a/drivers/scsi/3w-xxxx.c +++ b/drivers/scsi/3w-xxxx.c @@ -1286,7 +1286,7 @@ static int tw_map_scsi_sg_data(struct pci_dev *pdev, struct scsi_cmnd *cmd) if (cmd->use_sg == 0) return 0; - use_sg = pci_map_sg(pdev, cmd->buffer, cmd->use_sg, DMA_BIDIRECTIONAL); + use_sg = pci_map_sg(pdev, cmd->buffer, cmd->use_sg, cmd->sc_data_direction); if (use_sg == 0) { printk(KERN_WARNING "3w-xxxx: tw_map_scsi_sg_data(): pci_map_sg() failed.\n"); @@ -1308,7 +1308,7 @@ static u32 tw_map_scsi_single_data(struct pci_dev *pdev, struct scsi_cmnd *cmd) if (cmd->request_bufflen == 0) return 0; - mapping = pci_map_page(pdev, virt_to_page(cmd->request_buffer), offset_in_page(cmd->request_buffer), cmd->request_bufflen, DMA_BIDIRECTIONAL); + mapping = pci_map_page(pdev, virt_to_page(cmd->request_buffer), offset_in_page(cmd->request_buffer), cmd->request_bufflen, cmd->sc_data_direction); if (mapping == 0) { printk(KERN_WARNING "3w-xxxx: tw_map_scsi_single_data(): pci_map_page() failed.\n"); @@ -1327,10 +1327,10 @@ static void tw_unmap_scsi_data(struct pci_dev *pdev, struct scsi_cmnd *cmd) switch(cmd->SCp.phase) { case TW_PHASE_SINGLE: - pci_unmap_page(pdev, cmd->SCp.have_data_in, cmd->request_bufflen, DMA_BIDIRECTIONAL); + pci_unmap_page(pdev, cmd->SCp.have_data_in, cmd->request_bufflen, cmd->sc_data_direction); break; case TW_PHASE_SGLIST: - pci_unmap_sg(pdev, cmd->request_buffer, cmd->use_sg, DMA_BIDIRECTIONAL); + pci_unmap_sg(pdev, cmd->request_buffer, cmd->use_sg, cmd->sc_data_direction); break; } } /* End tw_unmap_scsi_data() */ |