aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/ufs
diff options
context:
space:
mode:
authorYaniv Gardi <ygardi@codeaurora.org>2014-10-23 06:25:13 -0400
committerChristoph Hellwig <hch@lst.de>2014-11-20 11:01:32 -0500
commit5064636c759628caee3b855048be25a9a33cc8ad (patch)
tree0ea2421bf0ffda40b1498380bc1ab7db09c0a429 /drivers/scsi/ufs
parent7c48bfd038e570cd12b33d6ab13316f3a0b0d1a7 (diff)
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 <ygardi@codeaurora.org> Signed-off-by: Dolev Raviv <draviv@codeaurora.org> Reviewed-by: Maya Erez <merez@codeaurora.org> Signed-off-by: Christoph Hellwig <hch@lst.de>
Diffstat (limited to 'drivers/scsi/ufs')
-rw-r--r--drivers/scsi/ufs/ufshcd.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/drivers/scsi/ufs/ufshcd.c b/drivers/scsi/ufs/ufshcd.c
index 59b654467d48..77a4e38020ed 100644
--- a/drivers/scsi/ufs/ufshcd.c
+++ b/drivers/scsi/ufs/ufshcd.c
@@ -2246,6 +2246,22 @@ static int ufshcd_uic_hibern8_exit(struct ufs_hba *hba)
2246 return ret; 2246 return ret;
2247} 2247}
2248 2248
2249 /**
2250 * ufshcd_init_pwr_info - setting the POR (power on reset)
2251 * values in hba power info
2252 * @hba: per-adapter instance
2253 */
2254static 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
2249/** 2265/**
2250 * ufshcd_get_max_pwr_mode - reads the max power mode negotiated with device 2266 * ufshcd_get_max_pwr_mode - reads the max power mode negotiated with device
2251 * @hba: per-adapter instance 2267 * @hba: per-adapter instance
@@ -4118,6 +4134,8 @@ static int ufshcd_probe_hba(struct ufs_hba *hba)
4118 if (ret) 4134 if (ret)
4119 goto out; 4135 goto out;
4120 4136
4137 ufshcd_init_pwr_info(hba);
4138
4121 /* UniPro link is active now */ 4139 /* UniPro link is active now */
4122 ufshcd_set_link_active(hba); 4140 ufshcd_set_link_active(hba);
4123 4141