Commit e95ec662 authored by Christoph Hellwig's avatar Christoph Hellwig Committed by Greg Kroah-Hartman

scsi: dc395x: fix dma API usage in srb_done

[ Upstream commit 3a5bd702 ]

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: default avatarChristoph Hellwig <hch@lst.de>
Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
parent 95655b10
...@@ -3447,14 +3447,12 @@ static void srb_done(struct AdapterCtlBlk *acb, struct DeviceCtlBlk *dcb, ...@@ -3447,14 +3447,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; ckc_only = 0;
/* Check Error Conditions */ /* Check Error Conditions */
ckc_e: ckc_e:
pci_unmap_srb(acb, srb);
if (cmd->cmnd[0] == INQUIRY) { if (cmd->cmnd[0] == INQUIRY) {
unsigned char *base = NULL; unsigned char *base = NULL;
struct ScsiInqData *ptr; struct ScsiInqData *ptr;
...@@ -3507,7 +3505,6 @@ static void srb_done(struct AdapterCtlBlk *acb, struct DeviceCtlBlk *dcb, ...@@ -3507,7 +3505,6 @@ static void srb_done(struct AdapterCtlBlk *acb, struct DeviceCtlBlk *dcb,
cmd, cmd->result); cmd, cmd->result);
srb_free_insert(acb, srb); srb_free_insert(acb, srb);
} }
pci_unmap_srb(acb, srb);
cmd->scsi_done(cmd); cmd->scsi_done(cmd);
waiting_process_next(acb); waiting_process_next(acb);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment