scsi: dc395x: fix dma API usage in srb_done
authorChristoph Hellwig <hch@lst.de>
Thu, 11 Oct 2018 14:17:14 +0000 (16:17 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 28 Nov 2019 17:25:42 +0000 (18:25 +0100)
commit738fd69851a1519d3b339e6fcb9b117bac3da080
tree83b3aeba31eaf244b02a63942920f358990876cb
parent2b4c4bde8b6eeba938f490bfdbcd36af2539e6be
scsi: dc395x: fix dma API usage in srb_done

[ Upstream commit 3a5bd7021184dec2946f2a4d7a8943f8a5713e52 ]

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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/scsi/dc395x.c