summaryrefslogtreecommitdiffstats
path: root/drivers/scsi/dc395x.c
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2018-10-11 16:17:14 +0200
committerMartin K. Petersen <martin.petersen@oracle.com>2018-10-18 03:34:20 +0200
commit3a5bd7021184dec2946f2a4d7a8943f8a5713e52 (patch)
treebcb0d7509dc78b4d8adc8688ba9437975a368304 /drivers/scsi/dc395x.c
parentscsi: dc395x: simplify list handling (diff)
downloadlinux-3a5bd7021184dec2946f2a4d7a8943f8a5713e52.tar.xz
linux-3a5bd7021184dec2946f2a4d7a8943f8a5713e52.zip
scsi: dc395x: fix dma API usage in srb_done
We can't just transfer ownership to the CPU and then unmap, as this will break with swiotlb. Instead unmap the command and sense buffer a little earlier in the I/O completion handler and get rid of the pci_dma_sync_sg_for_cpu call entirely. Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Diffstat (limited to 'drivers/scsi/dc395x.c')
-rw-r--r--drivers/scsi/dc395x.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/drivers/scsi/dc395x.c b/drivers/scsi/dc395x.c
index 8705730b2e5a..8d7a26a33951 100644
--- a/drivers/scsi/dc395x.c
+++ b/drivers/scsi/dc395x.c
@@ -3349,14 +3349,12 @@ static void srb_done(struct AdapterCtlBlk *acb, struct DeviceCtlBlk *dcb,
}
}
- if (dir != PCI_DMA_NONE && scsi_sg_count(cmd))
- pci_dma_sync_sg_for_cpu(acb->dev, scsi_sglist(cmd),
- scsi_sg_count(cmd), dir);
-
ckc_only = 0;
/* Check Error Conditions */
ckc_e:
+ pci_unmap_srb(acb, srb);
+
if (cmd->cmnd[0] == INQUIRY) {
unsigned char *base = NULL;
struct ScsiInqData *ptr;
@@ -3408,7 +3406,6 @@ static void srb_done(struct AdapterCtlBlk *acb, struct DeviceCtlBlk *dcb,
} else {
dprintkl(KERN_ERR, "srb_done: ERROR! Completed cmd with tmp_srb\n");
}
- pci_unmap_srb(acb, srb);
cmd->scsi_done(cmd);
waiting_process_next(acb);