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>
Sun, 1 Dec 2019 08:13:34 +0000 (09:13 +0100)
commit9d11d6cb2511aba2c616db2fcb8083ba2d7a49df
treeaefda9681cf87ceed75443302efcd6e68dc23d9c
parent92020724dd6a5bd902364c319fd42aad079fc40a
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