@@ -5405,7 +5405,8 @@ ufshcd_transfer_rsp_status(struct ufs_hba *hba, struct ufshcd_lrb *lrbp,
}
break;
case OCS_ABORTED:
- if (lrbp->abort_initiated_by == UFS_ERR_HANDLER)
+ if ((lrbp->abort_initiated_by == UFS_ERR_HANDLER) ||
+ (!hba->mcq_enabled && (hba->quirks & UFSHCD_QUIRK_OCS_ABORTED)))
result |= DID_REQUEUE << 16;
else
result |= DID_ABORT << 16;
@@ -1021,6 +1021,7 @@ static int ufs_mtk_init(struct ufs_hba *hba)
hba->quirks |= UFSHCI_QUIRK_SKIP_MANUAL_WB_FLUSH_CTRL;
hba->quirks |= UFSHCD_QUIRK_MCQ_BROKEN_INTR;
hba->quirks |= UFSHCD_QUIRK_MCQ_BROKEN_RTC;
+ hba->quirks |= UFSHCD_QUIRK_OCS_ABORTED;
hba->vps->wb_flush_threshold = UFS_WB_BUF_REMAIN_PERCENT(80);
if (host->caps & UFS_MTK_CAP_DISABLE_AH8)
@@ -692,6 +692,12 @@ enum ufshcd_quirks {
* single doorbell mode.
*/
UFSHCD_QUIRK_BROKEN_LSDBS_CAP = 1 << 25,
+
+ /*
+ * Some host controllers set OCS_ABORTED after UTRLCLR (SDB mode),
+ * this quirk is set to treat OCS: ABORTED as INVALID_OCS_VALUE
+ */
+ UFSHCD_QUIRK_OCS_ABORTED = 1 << 26,
};
enum ufshcd_caps {