Skip to content

Commit 3a5bd70

Browse files
Christoph Hellwigmartinkpetersen
authored andcommitted
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 <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
1 parent cd29660 commit 3a5bd70

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

drivers/scsi/dc395x.c

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3349,14 +3349,12 @@ static void srb_done(struct AdapterCtlBlk *acb, struct DeviceCtlBlk *dcb,
33493349
}
33503350
}
33513351

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-
33563352
ckc_only = 0;
33573353
/* Check Error Conditions */
33583354
ckc_e:
33593355

3356+
pci_unmap_srb(acb, srb);
3357+
33603358
if (cmd->cmnd[0] == INQUIRY) {
33613359
unsigned char *base = NULL;
33623360
struct ScsiInqData *ptr;
@@ -3408,7 +3406,6 @@ static void srb_done(struct AdapterCtlBlk *acb, struct DeviceCtlBlk *dcb,
34083406
} else {
34093407
dprintkl(KERN_ERR, "srb_done: ERROR! Completed cmd with tmp_srb\n");
34103408
}
3411-
pci_unmap_srb(acb, srb);
34123409

34133410
cmd->scsi_done(cmd);
34143411
waiting_process_next(acb);

0 commit comments

Comments
 (0)