public inbox for linux-scsi@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH v3 0/3] Bug fixes for UFS multi-frequency scaling on Qcom platform
@ 2025-05-09  7:50 Ziqi Chen
  2025-05-09  7:50 ` [PATCH v3 1/3] scsi: ufs: qcom: Check gear against max gear in vop freq_to_gear() Ziqi Chen
                   ` (4 more replies)
  0 siblings, 5 replies; 9+ messages in thread
From: Ziqi Chen @ 2025-05-09  7:50 UTC (permalink / raw)
  To: quic_cang, bvanassche, mani, beanhuo, avri.altman, junwoo80.lee,
	martin.petersen, quic_ziqichen, quic_nguyenb, quic_nitirawa,
	quic_rampraka, neil.armstrong, luca.weiss, konrad.dybcio,
	peter.wang
  Cc: linux-arm-msm, linux-scsi

This series fixes a few corner cases introduced by multi-frequency scaling feature
on some old Qcom platforms design.

1. On some platforms, the frequency tables for unipro clock and the core clock are different,
   which has led to errors when handling the unipro clock.

2. On some platforms, the maximum gear supported by the host may exceed the maximum gear
   supported by connected UFS device. Therefore, this should be taken into account when
   find mapped gear for frequency.

This series has been tested on below platforms -
sm8550 mtp + UFS3.1
SM8650 MTP + UFS3.1
QCS6490 BR3GEN2 + UFS2.2

For change "scsi: ufs: qcom: Check gear against max gear in vop freq_to_gear()"
Reported-by: Neil Armstrong <neil.armstrong@linaro.org>
Tested-by: Neil Armstrong <neil.armstrong@linaro.org> # on RB3GEN2

For change "scsi: ufs: qcom: Map devfreq OPP freq to UniPro Core Clock freq"
           "scsi: ufs: qcom: Call ufs_qcom_cfg_timers() in clock scaling path"

Reported-by: Luca Weiss <luca.weiss@fairphone.com>
Closes: https://lore.kernel.org/linux-arm-msm/D9FZ9U3AEXW4.1I12FX3YQ3JPW@fairphone.com/
Tested-by: Luca Weiss <luca.weiss@fairphone.com> # sm7225-fairphone-fp4


v1 - > v2:
Change "scsi: ufs: qcom: Check gear against max gear in vop freq_to_gear()":
1. Instead of return 'gear', return '0' directly if didn't find mapped gear
2. Derectly return min_t(gear,max_gear) instead assign to 'gear' then return it.

v2 - > v3:
Change "scsi: ufs: qcom: Check gear against max gear in vop freq_to_gear()":
  Replace hard code '0' with enum 'UFS_HS_DONT_CHANGE'.

Change "scsi: ufs: qcom: Map devfreq OPP freq to UniPro Core Clock freq"
1. Skip calling ufs_qcom_opp_freq_to_clk_freq() if freq is ULONG_MAX to avoid useless error prints.
2. Correct indentation size to follow Linux kernel coding style.

Change 'scsi: ufs: qcom: Call ufs_qcom_cfg_timers() in clock scaling path':
Skip calling ufs_qcom_opp_freq_to_clk_freq() if freq is ULONG_MAX to avoid useless prints.


Can Guo (2):
  scsi: ufs: qcom: Map devfreq OPP freq to UniPro Core Clock freq
  scsi: ufs: qcom: Call ufs_qcom_cfg_timers() in clock scaling path

Ziqi Chen (1):
  scsi: ufs: qcom: Check gear against max gear in vop freq_to_gear()

 drivers/ufs/host/ufs-qcom.c | 136 +++++++++++++++++++++++++++---------
 1 file changed, 103 insertions(+), 33 deletions(-)

-- 
2.34.1


^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2025-05-21  8:24 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-05-09  7:50 [PATCH v3 0/3] Bug fixes for UFS multi-frequency scaling on Qcom platform Ziqi Chen
2025-05-09  7:50 ` [PATCH v3 1/3] scsi: ufs: qcom: Check gear against max gear in vop freq_to_gear() Ziqi Chen
2025-05-09  7:50 ` [PATCH v3 2/3] scsi: ufs: qcom: Map devfreq OPP freq to UniPro Core Clock freq Ziqi Chen
2025-05-12  8:57   ` Bean Huo
2025-05-09  7:50 ` [PATCH v3 3/3] scsi: ufs: qcom: Call ufs_qcom_cfg_timers() in clock scaling path Ziqi Chen
2025-05-12  8:58   ` Bean Huo
2025-05-15 13:19 ` [PATCH v3 0/3] Bug fixes for UFS multi-frequency scaling on Qcom platform Loic Minier
2025-05-21  1:58 ` Martin K. Petersen
2025-05-21  8:23   ` Ziqi Chen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox