mbox series

[0/8] scsi: ufs: qcom: fix UFSDHCD support on MSM8996 platform

Message ID 20240209-msm8996-fix-ufs-v1-0-107b52e57420@linaro.org
Headers show
Series scsi: ufs: qcom: fix UFSDHCD support on MSM8996 platform | expand

Message

Dmitry Baryshkov Feb. 9, 2024, 9:50 p.m. UTC
First several patches target fixing the UFS support on the Qualcomm
MSM8996 / APQ8096 platforms, broken by the commit b4e13e1ae95e ("scsi:
ufs: qcom: Add multiple frequency support for MAX_CORE_CLK_1US_CYCLES").
Last two patches clean up the UFS DT device on that platform to follow
the bindings on other MSM8969 platforms. If such breaking change is
unacceptable, they can be simply ignored, merging fixes only.

Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
---
Dmitry Baryshkov (8):
      dt-bindings: ufs: qcom,ufs: add second RX lane on MSM8996 platform
      scsi: ufs: qcom: provide default cycles_in_1us value
      arm64: dts: qcom: msm8996: unbreak UFS HCD support
      arm64: dts: qcom: msm8996: specify UFS core_clk frequencies
      arm64: dts: qcom: msm8996: add second UFS RX lane on MSM8996 platform
      arm64: dts: qcom: msm8996: set GCC_UFS_ICE_CORE_CLK freq directly
      dt-bindings: ufs: qcom,ufs: drop source clock entries
      arm64: dts: qcom: msm8996: drop source clock entries from the UFS node

 Documentation/devicetree/bindings/ufs/qcom,ufs.yaml | 13 ++++++-------
 arch/arm64/boot/dts/qcom/msm8996.dtsi               | 13 +++++--------
 drivers/ufs/host/ufs-qcom.c                         |  6 ++++--
 3 files changed, 15 insertions(+), 17 deletions(-)
---
base-commit: 13e3d132c10bbb94e4efe7824f4aff317969cd17
change-id: 20240209-msm8996-fix-ufs-f80ae6d4d8cf

Best regards,

Comments

Konrad Dybcio Feb. 9, 2024, 10:26 p.m. UTC | #1
On 9.02.2024 22:50, Dmitry Baryshkov wrote:
> 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: b4e13e1ae95e ("scsi: ufs: qcom: Add multiple frequency support for MAX_CORE_CLK_1US_CYCLES")
> Cc: Nitin Rawat <quic_nitirawa@quicinc.com>
> Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
> ---

Reviewed-by: Konrad Dybcio <konrad.dybcio@linaro.org>

Konrad
Konrad Dybcio Feb. 9, 2024, 10:27 p.m. UTC | #2
On 9.02.2024 22:50, Dmitry Baryshkov wrote:
> Since the commit b4e13e1ae95e ("scsi: ufs: qcom: Add multiple frequency
> support for MAX_CORE_CLK_1US_CYCLES") the Qualcomm UFS driver uses
> core_clk_unipro values from frequency table to calculate cycles_in_1us.
> The DT file for MSM8996  passed 0 HZ frequencies there, resulting in
> broken UFS support on that platform. Fix the corresponding clock values
> in the frequency table.
> 
> Suggested-by: Nitin Rawat <quic_nitirawa@quicinc.com>
> Fixes: 57fc67ef0d35 ("arm64: dts: qcom: msm8996: Add ufs related nodes")
> Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
> ---

I'd reword the commit title but okay

Reviewed-by: Konrad Dybcio <konrad.dybcio@linaro.org>

Konrad
Konrad Dybcio Feb. 9, 2024, 10:28 p.m. UTC | #3
On 9.02.2024 22:50, Dmitry Baryshkov wrote:
> Follow the example of other platforms and specify core_clk frequencies
> in the frequency table in addition to the core_clk_src frequencies. The
> driver should be setting the leaf frequency instead of some interim
> clock freq.
> 
> Suggested-by: Nitin Rawat <quic_nitirawa@quicinc.com>
> Fixes: 57fc67ef0d35 ("arm64: dts: qcom: msm8996: Add ufs related nodes")
> Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
> ---

3.18 says the clock can even go as high as 240000000

Konrad
Konrad Dybcio Feb. 9, 2024, 10:29 p.m. UTC | #4
On 9.02.2024 22:50, Dmitry Baryshkov wrote:
> Describe the second RX lane used by the UFS controller on MSM8996
> platform.
> 
> Fixes: 462c5c0aa798 ("dt-bindings: ufs: qcom,ufs: convert to dtschema")
> Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
> ---

Reviewed-by: Konrad Dybcio <konrad.dybcio@linaro.org>

Konrad
Konrad Dybcio Feb. 9, 2024, 10:29 p.m. UTC | #5
On 9.02.2024 22:50, Dmitry Baryshkov wrote:
> Instead of setting the frequency of the interim UFS_ICE_CORE_CLK_SRC
> clokc, set the freency of the leaf GCC_UFS_ICE_CORE_CLK clock directly.
> 
> Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
> ---

Why on earth is the _SRC clock described?

Konrad
Konrad Dybcio Feb. 9, 2024, 10:30 p.m. UTC | #6
On 9.02.2024 23:29, Konrad Dybcio wrote:
> On 9.02.2024 22:50, Dmitry Baryshkov wrote:
>> Instead of setting the frequency of the interim UFS_ICE_CORE_CLK_SRC
>> clokc, set the freency of the leaf GCC_UFS_ICE_CORE_CLK clock directly.
>>
>> Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
>> ---
> 
> Why on earth is the _SRC clock described?

Ah, I see patch 8 ;)

Konrad
Dmitry Baryshkov Feb. 9, 2024, 10:30 p.m. UTC | #7
On Sat, 10 Feb 2024 at 00:29, Konrad Dybcio <konrad.dybcio@linaro.org> wrote:
>
> On 9.02.2024 22:50, Dmitry Baryshkov wrote:
> > Follow the example of other platforms and specify core_clk frequencies
> > in the frequency table in addition to the core_clk_src frequencies. The
> > driver should be setting the leaf frequency instead of some interim
> > clock freq.
> >
> > Suggested-by: Nitin Rawat <quic_nitirawa@quicinc.com>
> > Fixes: 57fc67ef0d35 ("arm64: dts: qcom: msm8996: Add ufs related nodes")
> > Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
> > ---
>
> 3.18 says the clock can even go as high as 240000000

Yeah. I just copied the core_clk_src specs. We can bump the clocks
when this gets rewritten to use OPP tables.