summaryrefslogtreecommitdiffstats
path: root/drivers/scsi
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2018-10-11 16:17:15 +0200
committerMartin K. Petersen <martin.petersen@oracle.com>2018-10-17 21:34:20 -0400
commit6c404a68bf83b4135a8a9aa1c388ebdf98e8ba7f (patch)
treeb9cc3f231ce5fe0167b39e1007f4f8af4a23754b /drivers/scsi
parent3a5bd7021184dec2946f2a4d7a8943f8a5713e52 (diff)
downloadlinux-6c404a68bf83b4135a8a9aa1c388ebdf98e8ba7f.tar.bz2
scsi: dc395x: fix DMA API usage in sg_update_list
We need to transfer device ownership to the CPU before we can manipulate the mapped data. Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Diffstat (limited to 'drivers/scsi')
-rw-r--r--drivers/scsi/dc395x.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/scsi/dc395x.c b/drivers/scsi/dc395x.c
index 8d7a26a33951..f3b65e5efe2b 100644
--- a/drivers/scsi/dc395x.c
+++ b/drivers/scsi/dc395x.c
@@ -1871,6 +1871,11 @@ static void sg_update_list(struct ScsiReqBlk *srb, u32 left)
xferred -= psge->length;
} else {
/* Partial SG entry done */
+ pci_dma_sync_single_for_cpu(srb->dcb->
+ acb->dev,
+ srb->sg_bus_addr,
+ SEGMENTX_LEN,
+ PCI_DMA_TODEVICE);
psge->length -= xferred;
psge->address += xferred;
srb->sg_index = idx;