Skip to content

Commit 5064636

Browse files
Yaniv GardiChristoph Hellwig
authored andcommitted
ufs: fix power info after link start-up
After link start-up power mode will always be PWM G1. This is not reflected in the pwr_info struct which will keep the previous values. Since ufshcd_change_power_mode() tries to avoid unnecessary power mode change if the requested power mode and current power mode are same, power mode change won't execute again after driver initialization. This patch solves the problem by setting pwr_info to PWM G1 after link start-up. Signed-off-by: Yaniv Gardi <[email protected]> Signed-off-by: Dolev Raviv <[email protected]> Reviewed-by: Maya Erez <[email protected]> Signed-off-by: Christoph Hellwig <[email protected]>
1 parent 7c48bfd commit 5064636

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

drivers/scsi/ufs/ufshcd.c

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2246,6 +2246,22 @@ static int ufshcd_uic_hibern8_exit(struct ufs_hba *hba)
22462246
return ret;
22472247
}
22482248

2249+
/**
2250+
* ufshcd_init_pwr_info - setting the POR (power on reset)
2251+
* values in hba power info
2252+
* @hba: per-adapter instance
2253+
*/
2254+
static void ufshcd_init_pwr_info(struct ufs_hba *hba)
2255+
{
2256+
hba->pwr_info.gear_rx = UFS_PWM_G1;
2257+
hba->pwr_info.gear_tx = UFS_PWM_G1;
2258+
hba->pwr_info.lane_rx = 1;
2259+
hba->pwr_info.lane_tx = 1;
2260+
hba->pwr_info.pwr_rx = SLOWAUTO_MODE;
2261+
hba->pwr_info.pwr_tx = SLOWAUTO_MODE;
2262+
hba->pwr_info.hs_rate = 0;
2263+
}
2264+
22492265
/**
22502266
* ufshcd_get_max_pwr_mode - reads the max power mode negotiated with device
22512267
* @hba: per-adapter instance
@@ -4118,6 +4134,8 @@ static int ufshcd_probe_hba(struct ufs_hba *hba)
41184134
if (ret)
41194135
goto out;
41204136

4137+
ufshcd_init_pwr_info(hba);
4138+
41214139
/* UniPro link is active now */
41224140
ufshcd_set_link_active(hba);
41234141

0 commit comments

Comments
 (0)