scsi: ufs: core: Set the residual byte count
Subsystems (2)
Bart Van Assche
reviewerPATCH 2/2 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
[ ... ]
--- drivers/ufs/core/ufshcd.c | 3 +++ 1 file changed, 3 insertions(+)
drivers/ufs/core/ufshcd.c +3 -0
@@ -5238,6 +5238,9 @@ ufshcd_transfer_rsp_status(struct ufs_hba *hba, struct ufshcd_lrb *lrbp,int scsi_status;enum utp_ocs ocs; +scsi_set_resid (lrbp->cmd, +be32_to_cpu (lrbp->ucd_rsp_ptr->sr.residual_transfer_count)); +/* overall command status of utrd */ ocs =ufshcd_get_tr_ocs (lrbp, cqe);
Quoted 9 lines · Bart Van Assche
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[ ... ]
Should this be a fix for stable?
Quoted 20 lines
Signed-off-by Bart Van Assche <[email protected]>--- drivers/ufs/core/ufshcd.c | 3 +++ 1 file changed, 3 insertions(+)drivers/ufs/core/ufshcd.c +3
-0@@ -5238,6 +5238,9 @@ ufshcd_transfer_rsp_status(struct ufs_hba *hba, struct ufshcd_lrb *lrbp,int scsi_status;enum utp_ocs ocs; +scsi_set_resid (lrbp->cmd, +be32_to_cpu (lrbp->ucd_rsp_ptr->sr.residual_transfer_count)); +/* overall command status of utrd */ ocs =ufshcd_get_tr_ocs (lrbp, cqe);
Bart Van Assche
reviewerQuoted 6 lines · Adrian Hunter
Quoted 5 lines · Bart Van Assche
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:
Quoted 6 lines
Quoted 4 lines
[ 1.937750] cmd 0x12: len = 255; resid = 241 [ ... ] [ 1.993400] cmd 0xa0: len = 4096; resid = 4048[ ... ]
Should this be a fix for stable?
Hi Adrian,
I have considered to add "Cc: stable" to this patch. I have not done this because I'm not sure that all UFS devices implement the residual count correctly.
Thanks,
Bart.
Quoted 11 lines
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 <[email protected]>
Quoted 18 lines
--- drivers/ufs/core/ufshcd.c | 3 +++ 1 file changed, 3 insertions(+)drivers/ufs/core/ufshcd.c +3
-0@@ -5238,6 +5238,9 @@ ufshcd_transfer_rsp_status(struct ufs_hba *hba,struct ufshcd_lrb *lrbp, int scsi_status;enum utp_ocs ocs; +scsi_set_resid (lrbp->cmd, +be32_to_cpu (lrbp->ucd_rsp_ptr->sr.residual_transfer_count)); +/* overall command status of utrd */ ocs =ufshcd_get_tr_ocs (lrbp, cqe);
Martin K. Petersen
AppliedBart,
Quoted 4 lines
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:
Applied to 6.4/scsi-staging, thanks!
Signature · 1 line
Martin K. Petersen Oracle Linux Engineering