scsi: target: cxgbit: Unmap DMA buffer before calling target_execute_cmd()
authorVarun Prakash <varun@chelsio.com>
Wed, 14 Apr 2021 12:39:09 +0000 (18:09 +0530)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 14 Jul 2021 14:56:53 +0000 (16:56 +0200)
commit2a7c96c2e238820a5268769b6fef50a24eb574ce
tree5c3050fecb9c5cd520c455cfe2daa2db4f834991
parente2e615e6317bf610159bab4eb8fa9b4d9ec2c010
scsi: target: cxgbit: Unmap DMA buffer before calling target_execute_cmd()

commit 6ecdafaec79d4b3388a5b017245f23a0ff9d852d upstream.

Instead of calling dma_unmap_sg() after completing WRITE I/O, call
dma_unmap_sg() before calling target_execute_cmd() to sync the DMA buffer.

Link: https://lore.kernel.org/r/1618403949-3443-1-git-send-email-varun@chelsio.com
Cc: <stable@vger.kernel.org> # 5.4+
Signed-off-by: Varun Prakash <varun@chelsio.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/target/iscsi/cxgbit/cxgbit_ddp.c
drivers/target/iscsi/cxgbit/cxgbit_target.c