From: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
To: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Cc: Bjorn Andersson <andersson@kernel.org>,
Konrad Dybcio <konrad.dybcio@linaro.org>,
"James E.J. Bottomley" <jejb@linux.ibm.com>,
"Martin K. Petersen" <martin.petersen@oracle.com>,
Nitin Rawat <quic_nitirawa@quicinc.com>,
Can Guo <quic_cang@quicinc.com>,
Naveen Kumar Goud Arepalli <quic_narepall@quicinc.com>,
Rob Herring <robh@kernel.org>,
Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>,
Conor Dooley <conor+dt@kernel.org>,
Alim Akhtar <alim.akhtar@samsung.com>,
Avri Altman <avri.altman@wdc.com>,
Bart Van Assche <bvanassche@acm.org>,
Andy Gross <agross@kernel.org>,
linux-arm-msm@vger.kernel.org, linux-scsi@vger.kernel.org,
devicetree@vger.kernel.org
Subject: Re: [PATCH v2 1/6] scsi: ufs: qcom: provide default cycles_in_1us value
Date: Fri, 16 Feb 2024 19:22:45 +0530 [thread overview]
Message-ID: <20240216135245.GI2559@thinkpad> (raw)
In-Reply-To: <20240213-msm8996-fix-ufs-v2-1-650758c26458@linaro.org>
On Tue, Feb 13, 2024 at 01:22:17PM +0200, 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>
> Reviewed-by: Konrad Dybcio <konrad.dybcio@linaro.org>
> Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
CC stable list?
Reviewed-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
- Mani
> ---
> drivers/ufs/host/ufs-qcom.c | 6 ++++--
> 1 file changed, 4 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/ufs/host/ufs-qcom.c b/drivers/ufs/host/ufs-qcom.c
> index 0aeaee1c564c..79f8cb377710 100644
> --- a/drivers/ufs/host/ufs-qcom.c
> +++ b/drivers/ufs/host/ufs-qcom.c
> @@ -1210,8 +1210,10 @@ static int ufs_qcom_set_core_clk_ctrl(struct ufs_hba *hba, bool is_scale_up)
>
> list_for_each_entry(clki, head, list) {
> if (!IS_ERR_OR_NULL(clki->clk) &&
> - !strcmp(clki->name, "core_clk_unipro")) {
> - if (is_scale_up)
> + !strcmp(clki->name, "core_clk_unipro")) {
> + if (!clki->max_freq)
> + cycles_in_1us = 150; /* default for backwards compatibility */
> + else if (is_scale_up)
> cycles_in_1us = ceil(clki->max_freq, (1000 * 1000));
> else
> cycles_in_1us = ceil(clk_get_rate(clki->clk), (1000 * 1000));
>
> --
> 2.39.2
>
--
மணிவண்ணன் சதாசிவம்
next prev parent reply other threads:[~2024-02-16 13:52 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-02-13 11:22 [PATCH v2 0/6] scsi: ufs: qcom: fix UFSDHCD support on MSM8996 platform Dmitry Baryshkov
2024-02-13 11:22 ` [PATCH v2 1/6] scsi: ufs: qcom: provide default cycles_in_1us value Dmitry Baryshkov
2024-02-16 13:52 ` Manivannan Sadhasivam [this message]
2024-02-13 11:22 ` [PATCH v2 2/6] arm64: dts: qcom: msm8996: unbreak UFS HCD support Dmitry Baryshkov
2024-02-15 10:08 ` Konrad Dybcio
2024-02-16 13:54 ` Manivannan Sadhasivam
2024-02-13 11:22 ` [PATCH v2 3/6] arm64: dts: qcom: msm8996: specify UFS core_clk frequencies Dmitry Baryshkov
2024-02-14 21:24 ` Konrad Dybcio
2024-02-15 8:19 ` Dmitry Baryshkov
2024-02-15 10:09 ` Konrad Dybcio
2024-02-16 13:55 ` Manivannan Sadhasivam
2024-02-13 11:22 ` [PATCH v2 4/6] arm64: dts: qcom: msm8996: set GCC_UFS_ICE_CORE_CLK freq directly Dmitry Baryshkov
2024-02-15 10:12 ` Konrad Dybcio
2024-02-16 14:05 ` Manivannan Sadhasivam
2024-02-13 11:22 ` [PATCH v2 5/6] dt-bindings: ufs: qcom,ufs: drop source clock entries Dmitry Baryshkov
2024-02-16 14:06 ` Manivannan Sadhasivam
2024-02-13 11:22 ` [PATCH v2 6/6] arm64: dts: qcom: msm8996: drop source clock entries from the UFS node Dmitry Baryshkov
2024-02-15 10:13 ` Konrad Dybcio
2024-02-16 14:08 ` Manivannan Sadhasivam
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20240216135245.GI2559@thinkpad \
--to=manivannan.sadhasivam@linaro.org \
--cc=agross@kernel.org \
--cc=alim.akhtar@samsung.com \
--cc=andersson@kernel.org \
--cc=avri.altman@wdc.com \
--cc=bvanassche@acm.org \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=dmitry.baryshkov@linaro.org \
--cc=jejb@linux.ibm.com \
--cc=konrad.dybcio@linaro.org \
--cc=krzysztof.kozlowski+dt@linaro.org \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-scsi@vger.kernel.org \
--cc=martin.petersen@oracle.com \
--cc=quic_cang@quicinc.com \
--cc=quic_narepall@quicinc.com \
--cc=quic_nitirawa@quicinc.com \
--cc=robh@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.