Re: [PATCH v2 2/7] scsi: ufs: ufs-qcom: Setup host power mode during init

Can Guo
2023-11-08T08:07:32Z

Hi Mani,

On 11/8/2023 1:07 PM, Manivannan Sadhasivam wrote:
> On Mon, Nov 06, 2023 at 08:46:08PM -0800, Can Guo wrote:
>> From: Can Guo <quic_cang@quicinc.com>
>>
>> Setup host power mode and its limitations during UFS host driver init to
>> avoid repetitive work during every power mode change.
>>
>> Co-developed-by: Bao D. Nguyen <quic_nguyenb@quicinc.com>
>> Signed-off-by: Bao D. Nguyen <quic_nguyenb@quicinc.com>
>> Signed-off-by: Can Guo <quic_cang@quicinc.com>
>> ---
>> drivers/ufs/host/ufs-qcom.c | 22 ++++++++++++++--------
>> drivers/ufs/host/ufs-qcom.h | 1 +
>> 2 files changed, 15 insertions(+), 8 deletions(-)
>>
>> diff --git a/drivers/ufs/host/ufs-qcom.c b/drivers/ufs/host/ufs-qcom.c
>> index aee66a3..cc0eb37 100644
>> --- a/drivers/ufs/host/ufs-qcom.c
>> +++ b/drivers/ufs/host/ufs-qcom.c
>> @@ -898,7 +898,7 @@ static int ufs_qcom_pwr_change_notify(struct ufs_hba *hba,
>> struct ufs_pa_layer_attr *dev_req_params)
>> {
>> struct ufs_qcom_host *host = ufshcd_get_variant(hba);
>> - struct ufs_host_params host_params;
>> + struct ufs_host_params *host_params = &host->host_params;
>> int ret = 0;
>>
>> if (!dev_req_params) {
>> @@ -908,13 +908,7 @@ static int ufs_qcom_pwr_change_notify(struct ufs_hba *hba,
>>
>> switch (status) {
>> case PRE_CHANGE:
>> - ufshcd_init_host_param(&host_params);
>> - host_params.hs_rate = UFS_QCOM_LIMIT_HS_RATE;
>
> As Andrew spotted, this gets removed without explanation. So, I'd also suggest
> doing it in a separate patch.
>
> - Mani
Sure, will do

Thanks,

Can Guo.