UFSHCD_UIC_NL_ERROR = (1 << 3), /* Network layer error */
UFSHCD_UIC_TL_ERROR = (1 << 4), /* Transport Layer error */
UFSHCD_UIC_DME_ERROR = (1 << 5), /* DME error */
+ UFSHCD_UIC_DL_ERROR = (1 << 6), /* Data link layer error */
};
#define ufshcd_set_eh_in_progress(h) \
if (hba->vops && hba->vops->hibern8_notify)
hba->vops->hibern8_notify(hba, en, POST_CHANGE);
out:
+ hba->tcx_replay_timer_expired_cnt = 0;
+ hba->fcx_protection_timer_expired_cnt = 0;
+
return ret;
}
hba->uic_error |= UFSHCD_UIC_DL_TCx_REPLAY_ERROR;
}
+ if (reg & UIC_DATA_LINK_LAYER_ERROR_TCX_REP_TIMER_EXP)
+ hba->tcx_replay_timer_expired_cnt++;
+
+ if (reg & UIC_DATA_LINK_LAYER_ERROR_FCX_PRO_TIMER_EXP)
+ hba->fcx_protection_timer_expired_cnt++;
+
+ if (hba->tcx_replay_timer_expired_cnt >= 2 ||
+ hba->fcx_protection_timer_expired_cnt >= 2)
+ hba->uic_error |= UFSHCD_UIC_DL_ERROR;
+
/* UIC NL/TL/DME errors needs software retry */
reg = ufshcd_readl(hba, REG_UIC_ERROR_CODE_NETWORK_LAYER);
if (reg) {
u32 saved_uic_err;
struct ufs_stats ufs_stats;
+ u32 tcx_replay_timer_expired_cnt;
+ u32 fcx_protection_timer_expired_cnt;
+
/* Device management request data */
struct ufs_dev_cmd dev_cmd;
ktime_t last_dme_cmd_tstamp;