scsi: ufs: clear UTRD, UPIU req and rsp before new transfers
authorYaniv Gardi <ygardi@codeaurora.org>
Mon, 1 Feb 2016 13:02:37 +0000 (15:02 +0200)
committerMartin K. Petersen <martin.petersen@oracle.com>
Wed, 24 Feb 2016 02:27:02 +0000 (21:27 -0500)
commit52ac95fe06edd660a6414fd6aa3165c3437ac4be
tree39a730088bcec18e200c49e2d95d87ba7f87cb45
parent0c994c03c926d26ce48e6bbabbbe60366044fcae
scsi: ufs: clear UTRD, UPIU req and rsp before new transfers

Clear the UFS data structures before sending new request.

The SCSI command is sent to the device within the UFS UPIU request.
As part of the transfer UPIU preparation, the SCSI command is copied
to the UPIU structure according to the SCSI command size.
As different SCSI commands differ in size from each other, we need
to clear the whole SCSI command field to prevent sending uninitialized
data to the device.

The UPIU response doesn't always include the sense data and can differ
in size.
Hence, the UPIU response should also be cleared before the transfer.

Reviewed-by: Gilad Broner <gbroner@codeaurora.org>
Reviewed-by: Dolev Raviv <draviv@codeaurora.org>
Signed-off-by: Subhash Jadavani <subhashj@codeaurora.org>
Signed-off-by: Maya Erez <merez@codeaurora.org>
Signed-off-by: Yaniv Gardi <ygardi@codeaurora.org>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/scsi/ufs/ufshcd.c