Skip to content

Commit 883a8b4

Browse files
ahalaneymartinkpetersen
authored andcommitted
scsi: ufs: qcom: Clarify comments about the initial phy_gear
The comments that currently are within the hw_ver < 4 conditional are misleading. They really apply to various branches of the conditionals there and incorrectly state that the phy_gear value can increase. Right now the logic is to: - Default to max supported gear for phy_gear - Set phy_gear to minimum value if version < 4 since those versions only support one PHY init sequence (and therefore don't need reinit) - Set phy_gear to the optimal value if the device version is already populated in the controller registers on boot Let's move some of the comment to outside the if statement and clean up the bit left about switching to a higher gear on reinit. This way the comment more accurately reflects the logic. Signed-off-by: Andrew Halaney <ahalaney@redhat.com> Link: https://lore.kernel.org/r/20240123-ufs-reinit-comments-v1-1-ff2b3532d7fe@redhat.com Reviewed-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
1 parent 2b9bc9e commit 883a8b4

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

drivers/ufs/host/ufs-qcom.c

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -843,15 +843,20 @@ static void ufs_qcom_set_phy_gear(struct ufs_qcom_host *host)
843843
struct ufs_host_params *host_params = &host->host_params;
844844
u32 val, dev_major;
845845

846+
/*
847+
* Default to powering up the PHY to the max gear possible, which is
848+
* backwards compatible with lower gears but not optimal from
849+
* a power usage point of view. After device negotiation, if the
850+
* gear is lower a reinit will be performed to program the PHY
851+
* to the ideal gear for this combo of controller and device.
852+
*/
846853
host->phy_gear = host_params->hs_tx_gear;
847854

848855
if (host->hw_ver.major < 0x4) {
849856
/*
850-
* For controllers whose major HW version is < 4, power up the
851-
* PHY using minimum supported gear (UFS_HS_G2). Switching to
852-
* max gear will be performed during reinit if supported.
853-
* For newer controllers, whose major HW version is >= 4, power
854-
* up the PHY using max supported gear.
857+
* These controllers only have one PHY init sequence,
858+
* let's power up the PHY using that (the minimum supported
859+
* gear, UFS_HS_G2).
855860
*/
856861
host->phy_gear = UFS_HS_G2;
857862
} else if (host->hw_ver.major >= 0x5) {

0 commit comments

Comments
 (0)