> 
>  static void ufshcd_wb_probe(struct ufs_hba *hba, u8 *desc_buf)
>  {
> +       if (!ufshcd_is_wb_allowed(hba))
> +               return;
> +
> +       if (hba->desc_size.dev_desc <=
> DEVICE_DESC_PARAM_EXT_UFS_FEATURE_SUP)
Should be 
DEVICE_DESC_PARAM_EXT_UFS_FEATURE_SUP + 4 

> +               goto wb_disabled;
> +
>         hba->dev_info.d_ext_ufs_feature_sup =
>                 get_unaligned_be32(desc_buf +
>                                    DEVICE_DESC_PARAM_EXT_UFS_FEATURE_SUP);


> 
>  static int ufs_get_device_desc(struct ufs_hba *hba)
> @@ -6862,10 +6890,6 @@ static int ufs_get_device_desc(struct ufs_hba
> *hba)
> 
>         model_index = desc_buf[DEVICE_DESC_PARAM_PRDCT_NAME];
> 
> -       /* Enable WB only for UFS-3.1 */
> -       if (dev_info->wspecversion >= 0x310)
> -               ufshcd_wb_probe(hba, desc_buf);
> -
>         err = ufshcd_read_string_desc(hba, model_index,
>                                       &dev_info->model, SD_ASCII_STD);
>         if (err < 0) {
> @@ -6874,6 +6898,16 @@ static int ufs_get_device_desc(struct ufs_hba
> *hba)
>                 goto out;
>         }
> 
> +       ufs_fixup_device_setup(hba);
I don't think you should "hide" ufs_fixup_device_setup inside 
ufs_get_device_desc.

Thanks,
Avri

Reply via email to