On 11/20/24 1:55 AM, peter.wang@xxxxxxxxxxxx wrote:
@@ -4682,6 +4679,10 @@ int ufshcd_config_pwr_mode(struct ufs_hba *hba,
ret = ufshcd_change_power_mode(hba, &final_params);
+ if (!ret)
+ ufshcd_vops_pwr_change_notify(hba, POST_CHANGE, NULL,
+ &final_params);
+
return ret;
}
EXPORT_SYMBOL_GPL(ufshcd_config_pwr_mode);
This patch causes the wrong power parameters to be passed to the
POST_CHANGE callback. I think that &final_params should be changed into
&hba->pwr_info above.
Additionally, this patch includes a subtle but important behavior
change. Without this patch, POST_CHANGE callback invocations can
influence the power settings that are copied into hba->pwr_info. With
this patch applied that is no longer possible. This behavior should not
break any UFS host driver as far as I can tell.
Please explain in the comment block above struct ufs_hba_variant_ops
that PRE_CHANGE invocations of the pwr_change_notify callback are
allowed to modify the power attribute arguments while POST_CHANGE
invocations must not modify the power attribute arguments.
Thanks,
Bart.