diff options
author | Christoph Hellwig <hch@lst.de> | 2018-10-11 10:17:14 -0400 |
---|---|---|
committer | Martin K. Petersen <martin.petersen@oracle.com> | 2018-10-17 21:34:20 -0400 |
commit | 3a5bd7021184dec2946f2a4d7a8943f8a5713e52 (patch) | |
tree | bcb0d7509dc78b4d8adc8688ba9437975a368304 | |
parent | cd29660dc8675ec235db23e38435fad833158e1c (diff) |
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>
-rw-r--r-- | drivers/scsi/dc395x.c | 7 |
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, | |||
3349 | } | 3349 | } |
3350 | } | 3350 | } |
3351 | 3351 | ||
3352 | if (dir != PCI_DMA_NONE && scsi_sg_count(cmd)) | ||
3353 | pci_dma_sync_sg_for_cpu(acb->dev, scsi_sglist(cmd), | ||
3354 | scsi_sg_count(cmd), dir); | ||
3355 | |||
3356 | ckc_only = 0; | 3352 | ckc_only = 0; |
3357 | /* Check Error Conditions */ | 3353 | /* Check Error Conditions */ |
3358 | ckc_e: | 3354 | ckc_e: |
3359 | 3355 | ||
3356 | pci_unmap_srb(acb, srb); | ||
3357 | |||
3360 | if (cmd->cmnd[0] == INQUIRY) { | 3358 | if (cmd->cmnd[0] == INQUIRY) { |
3361 | unsigned char *base = NULL; | 3359 | unsigned char *base = NULL; |
3362 | struct ScsiInqData *ptr; | 3360 | struct ScsiInqData *ptr; |
@@ -3408,7 +3406,6 @@ static void srb_done(struct AdapterCtlBlk *acb, struct DeviceCtlBlk *dcb, | |||
3408 | } else { | 3406 | } else { |
3409 | dprintkl(KERN_ERR, "srb_done: ERROR! Completed cmd with tmp_srb\n"); | 3407 | dprintkl(KERN_ERR, "srb_done: ERROR! Completed cmd with tmp_srb\n"); |
3410 | } | 3408 | } |
3411 | pci_unmap_srb(acb, srb); | ||
3412 | 3409 | ||
3413 | cmd->scsi_done(cmd); | 3410 | cmd->scsi_done(cmd); |
3414 | waiting_process_next(acb); | 3411 | waiting_process_next(acb); |