Re: [PATCH v2 01/11] scsi: ufs: core: Introduce a new ufshcd vops negotiate_pwr_mode()

From: Bean Huo

Date: Thu Mar 05 2026 - 16:11:13 EST


On Wed, 2026-03-04 at 05:53 -0800, Can Guo wrote:
> @@ -4747,6 +4745,22 @@ static int ufshcd_change_power_mode(struct ufs_hba
> *hba,
>         return ret;
>  }
>  
> +int ufshcd_change_power_mode(struct ufs_hba *hba,
> +                            struct ufs_pa_layer_attr *pwr_mode)
> +{
> +       int ret;
> +
> +       ufshcd_vops_pwr_change_notify(hba, PRE_CHANGE, pwr_mode);


ufshcd_change_power_mode() calls pwr_change_notify(PRE_CHANGE) but ignores its
return, this can continue with invalid vendor prep? I saw there is checkup
before, do you think adding check result?

> +
> +       ret = ufshcd_dme_change_power_mode(hba, pwr_mode);
> +
> +       if (!ret)
> +               ufshcd_vops_pwr_change_notify(hba, POST_CHANGE, pwr_mode);
> +
> +       return ret;
> +}
> +EXPORT_SYMBOL_GPL(ufshcd_change_power_mode);


Kind regards,
Bean