@@ -5307,6 +5307,7 @@ ufshcd_transfer_rsp_status(struct ufs_hba *hba, struct ufshcd_lrb *lrbp,
enum utp_ocs ocs;
u8 upiu_flags;
u32 resid;
+ u8 eec;
upiu_flags = lrbp->ucd_rsp_ptr->header.flags;
resid = be32_to_cpu(lrbp->ucd_rsp_ptr->sr.residual_transfer_count);
@@ -5371,7 +5372,12 @@ ufshcd_transfer_rsp_status(struct ufs_hba *hba, struct ufshcd_lrb *lrbp,
}
break;
case OCS_ABORTED:
- result |= DID_ABORT << 16;
+ if (cqe) {
+ eec = le32_to_cpu(cqe->status) & MASK_EEC;
+ result |= eec ? (DID_ABORT << 16) : (DID_REQUEUE << 16);
+ } else {
+ result |= DID_ABORT << 16;
+ }
break;
case OCS_INVALID_COMMAND_STATUS:
result |= DID_REQUEUE << 16;
@@ -465,6 +465,7 @@ enum utp_ocs {
enum {
MASK_OCS = 0x0F,
+ MASK_EEC = 0xF0,
};
/* The maximum length of the data byte count field in the PRDT is 256KB */
In MCQ mode, the case where OCS is updated to aborted is as follows 1. when abort processing is completed 2. When a duplicate command occurs In case of 1 situation, cmd should be re-request. So in the case of cmd whose abort processing is completed in MCQ mode, the ufs driver needs to update to scsi with DID_REQUEUE. v1->v2: change the method of determinging mcq and legacy mode. check cqe value for checking mcq mode Signed-off-by: SEO HOYOUNG <hy50.seo@samsung.com> --- drivers/ufs/core/ufshcd.c | 8 +++++++- include/ufs/ufshci.h | 1 + 2 files changed, 8 insertions(+), 1 deletion(-)