Skip to content

Commit cb38845

Browse files
bvanasschemartinkpetersen
authored andcommitted
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>
1 parent fb5ea4f commit cb38845

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

drivers/ufs/core/ufshcd.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5238,6 +5238,9 @@ ufshcd_transfer_rsp_status(struct ufs_hba *hba, struct ufshcd_lrb *lrbp,
52385238
int scsi_status;
52395239
enum utp_ocs ocs;
52405240

5241+
scsi_set_resid(lrbp->cmd,
5242+
be32_to_cpu(lrbp->ucd_rsp_ptr->sr.residual_transfer_count));
5243+
52415244
/* overall command status of utrd */
52425245
ocs = ufshcd_get_tr_ocs(lrbp, cqe);
52435246

0 commit comments

Comments
 (0)