Skip to content

Commit 81e2c1a

Browse files
lumagmartinkpetersen
authored andcommitted
scsi: ufs: qcom: Provide default cycles_in_1us value
The MSM8996 DT doesn't provide frequency limits for the core_clk_unipro clock, which results in miscalculation of the cycles_in_1us value. Provide the backwards-compatible default to support existing MSM8996 DT files. Fixes: b4e13e1 ("scsi: ufs: qcom: Add multiple frequency support for MAX_CORE_CLK_1US_CYCLES") Cc: Nitin Rawat <[email protected]> Cc: [email protected] # 6.7.x Reviewed-by: Konrad Dybcio <[email protected]> Reviewed-by: Manivannan Sadhasivam <[email protected]> Signed-off-by: Dmitry Baryshkov <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Martin K. Petersen <[email protected]>
1 parent 8e68a45 commit 81e2c1a

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

drivers/ufs/host/ufs-qcom.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1210,8 +1210,10 @@ static int ufs_qcom_set_core_clk_ctrl(struct ufs_hba *hba, bool is_scale_up)
12101210

12111211
list_for_each_entry(clki, head, list) {
12121212
if (!IS_ERR_OR_NULL(clki->clk) &&
1213-
!strcmp(clki->name, "core_clk_unipro")) {
1214-
if (is_scale_up)
1213+
!strcmp(clki->name, "core_clk_unipro")) {
1214+
if (!clki->max_freq)
1215+
cycles_in_1us = 150; /* default for backwards compatibility */
1216+
else if (is_scale_up)
12151217
cycles_in_1us = ceil(clki->max_freq, (1000 * 1000));
12161218
else
12171219
cycles_in_1us = ceil(clk_get_rate(clki->clk), (1000 * 1000));

0 commit comments

Comments
 (0)