Re: [PATCH v1] scsi: ufs: core: introduce override_cqe_ocs
From: Bean Huo
Date: Mon Aug 12 2024 - 11:41:56 EST
On Mon, 2024-08-12 at 16:01 +0900, Kiwoong Kim wrote:
> UFSHCI defines OCS values but doesn't specify what exact
> conditions raise them. E.g. when some commands are nullified
> or cleaned up, Exynos host reposts OCS_ABORT. Even if
> an OEM wants to issue them again, not fail, current UFS driver
> fails them because it set command result to DID_ABORT.
>
> So I think it needs another callback to replace the original OCS
> value with the value that works the way you want.
>
I'm not clear on OCS was initiated by UFSHCI, but could you explain why
it can't be altered within UFSHCI?
> Signed-off-by: Kiwoong Kim <kwmad.kim@xxxxxxxxxxx>
> ---
> drivers/ufs/core/ufshcd-priv.h | 9 +++++++++
> drivers/ufs/core/ufshcd.c | 4 +++-
> include/ufs/ufshcd.h | 1 +
> 3 files changed, 13 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/ufs/core/ufshcd-priv.h
> b/drivers/ufs/core/ufshcd-priv.h
> index ce36154..4dec6eb 100644
> --- a/drivers/ufs/core/ufshcd-priv.h
> +++ b/drivers/ufs/core/ufshcd-priv.h
> @@ -275,6 +275,15 @@ static inline int
> ufshcd_mcq_vops_config_esi(struct ufs_hba *hba)
> return -EOPNOTSUPP;
> }
>
> +static inline enum utp_ocs ufshcd_vops_override_cqe_ocs(struct
> ufs_hba *hba,
> + enum utp_ocs
> ocs)
> +{
> + if (hba->vops && hba->vops->override_cqe_ocs)
> + return hba->vops->override_cqe_ocs(hba);
it is useless until you should introudce an usage case.
Kind regards,
Bean