From: Martin K. Petersen Date: Thu, 21 Nov 2024 02:26:59 +0000 (-0500) Subject: Merge branch '6.12/scsi-fixes' into 6.13/scsi-staging X-Git-Tag: v6.13-rc1~81^2 X-Git-Url: https://git.kernel.dk/?a=commitdiff_plain;h=8e3b6345d113cc917e64b0349dc486b5d8f55e70;p=linux-block.git Merge branch '6.12/scsi-fixes' into 6.13/scsi-staging Pull in the fixes branch to resolve conflict in UFS core. Signed-off-by: Martin K. Petersen --- 8e3b6345d113cc917e64b0349dc486b5d8f55e70 diff --cc drivers/ufs/core/ufshcd.c index e338867bc96c,3b32803b7a68..8135a6dad7c6 --- a/drivers/ufs/core/ufshcd.c +++ b/drivers/ufs/core/ufshcd.c @@@ -8706,40 -8727,6 +8714,38 @@@ static void ufshcd_config_mcq(struct uf hba->nutrs); } +static int ufshcd_post_device_init(struct ufs_hba *hba) +{ + int ret; + + ufshcd_tune_unipro_params(hba); + + /* UFS device is also active now */ + ufshcd_set_ufs_dev_active(hba); + ufshcd_force_reset_auto_bkops(hba); + + ufshcd_set_timestamp_attr(hba); - schedule_delayed_work(&hba->ufs_rtc_update_work, - msecs_to_jiffies(UFS_RTC_UPDATE_INTERVAL_MS)); + + if (!hba->max_pwr_info.is_valid) + return 0; + + /* + * Set the right value to bRefClkFreq before attempting to + * switch to HS gears. + */ + if (hba->dev_ref_clk_freq != REF_CLK_FREQ_INVAL) + ufshcd_set_dev_ref_clk(hba); + /* Gear up to HS gear. */ + ret = ufshcd_config_pwr_mode(hba, &hba->max_pwr_info.info); + if (ret) { + dev_err(hba->dev, "%s: Failed setting power mode, err = %d\n", + __func__, ret); + return ret; + } + + return 0; +} + static int ufshcd_device_init(struct ufs_hba *hba, bool init_dev_params) { int ret;