scsi: ufs: core: Set the residual byte count
authorBart Van Assche <bvanassche@acm.org>
Tue, 14 Mar 2023 20:58:35 +0000 (13:58 -0700)
committerMartin K. Petersen <martin.petersen@oracle.com>
Fri, 17 Mar 2023 03:10:41 +0000 (23:10 -0400)
commitcb38845d90fc4ad905aecd36ed85a75764d0b5fb
tree2c65b36f5cb7b4b697e081d4d5bb94c6d5a1699e
parentfb5ea4f5202bcf2fd35c2ce49f73fe49fcbc6d41
scsi: ufs: core: Set the residual byte count

It is important for the SCSI core to know the residual byte count.  Hence,
extract the residual byte count from the UFS response and pass it to the
SCSI core. A few examples of the output of a debugging patch that has been
applied on top of this patch:

[    1.937750] cmd 0x12: len = 255; resid = 241
[ ... ]
[    1.993400] cmd 0xa0: len = 4096; resid = 4048
[ ... ]

Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Link: https://lore.kernel.org/r/20230314205844.313519-1-bvanassche@acm.org
Reviewed-by: Avri Altman <avri.altman@wdc.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/ufs/core/ufshcd.c