Linux clock framework development
 help / color / mirror / Atom feed
From: "Luca Weiss" <luca.weiss@fairphone.com>
To: "Dmitry Baryshkov" <dmitry.baryshkov@linaro.org>,
	"Bjorn Andersson" <andersson@kernel.org>,
	"Michael Turquette" <mturquette@baylibre.com>,
	"Stephen Boyd" <sboyd@kernel.org>,
	"Konrad Dybcio" <konrad.dybcio@somainline.org>,
	"Konrad Dybcio" <konrad.dybcio@linaro.org>,
	"Neil Armstrong" <neil.armstrong@linaro.org>
Cc: <linux-arm-msm@vger.kernel.org>, <linux-clk@vger.kernel.org>,
	<linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 2/4] clk: qcom: dispcc-sm6350: fix DisplayPort clocks
Date: Thu, 11 Apr 2024 13:33:59 +0200	[thread overview]
Message-ID: <D0H9F200BT16.2HWU1I45AS1S7@fairphone.com> (raw)
In-Reply-To: <20240408-dispcc-dp-clocks-v1-2-f9e44902c28d@linaro.org>

On Mon Apr 8, 2024 at 1:47 PM CEST, Dmitry Baryshkov wrote:
> On SM6350 DisplayPort link clocks use frequency tables inherited from
> the vendor kernel, it is not applicable in the upstream kernel. Drop
> frequency tables and use clk_byte2_ops for those clocks.
>
> Fixes: 837519775f1d ("clk: qcom: Add display clock controller driver for SM6350")
> Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>

Appears to fix this non-critical error when enabling DisplayPort.

  msm-dp-display ae90000.displayport-controller: _opp_config_clk_single: failed to set clock rate: -22

And DisplayPort (over USB-C) continues to work as expected, thanks!

Tested-by: Luca Weiss <luca.weiss@fairphone.com>

For completeness, I wrote something about this also on #linux-msm IRC on
March 22nd.

> Hi, I'm trying to get displayport to work on sm6350 but hitting a
> weird issue regarding link clk frequency. For the requested link
> rate=540000 in dp_ctrl_enable_mainlink_clocks we call
> dev_pm_opp_set_rate with target_freq=540000000 (clk name:
> disp_cc_mdss_dp_link_clk) but the clk_round_rate there makes this into
> freq=810000 and subsequently qmp_dp_link_clk_determine_rate fails
> because that's not a valid frequency, only for example 810000000.
> Without any debug statements the visible error in kernel log is:
> "msm-dp-display ae90000.displayport-controller:
> _opp_config_clk_single: failed to set clock rate: -22"
>
> So somewhere there seems to be confusion between how many zeroes
> should be where.. But not sure how this is working on other SoCs, I
> don't see anything much different for my SoC
>
> Kernel base is 6.8.1 fwiw
>
> clk_round_rate behavior feels correct as
> ftbl_disp_cc_mdss_dp_link_clk_src lists the frequencies as
> 162000/270000/540000/810000 so it rounds it to the highest available
> frequency of the clock

Regards
Luca


> ---
>  drivers/clk/qcom/dispcc-sm6350.c | 11 +----------
>  1 file changed, 1 insertion(+), 10 deletions(-)
>
> diff --git a/drivers/clk/qcom/dispcc-sm6350.c b/drivers/clk/qcom/dispcc-sm6350.c
> index 839435362010..e4b7464c4d0e 100644
> --- a/drivers/clk/qcom/dispcc-sm6350.c
> +++ b/drivers/clk/qcom/dispcc-sm6350.c
> @@ -221,26 +221,17 @@ static struct clk_rcg2 disp_cc_mdss_dp_crypto_clk_src = {
>  	},
>  };
>  
> -static const struct freq_tbl ftbl_disp_cc_mdss_dp_link_clk_src[] = {
> -	F(162000, P_DP_PHY_PLL_LINK_CLK, 1, 0, 0),
> -	F(270000, P_DP_PHY_PLL_LINK_CLK, 1, 0, 0),
> -	F(540000, P_DP_PHY_PLL_LINK_CLK, 1, 0, 0),
> -	F(810000, P_DP_PHY_PLL_LINK_CLK, 1, 0, 0),
> -	{ }
> -};
> -
>  static struct clk_rcg2 disp_cc_mdss_dp_link_clk_src = {
>  	.cmd_rcgr = 0x10f8,
>  	.mnd_width = 0,
>  	.hid_width = 5,
>  	.parent_map = disp_cc_parent_map_0,
> -	.freq_tbl = ftbl_disp_cc_mdss_dp_link_clk_src,
>  	.clkr.hw.init = &(struct clk_init_data){
>  		.name = "disp_cc_mdss_dp_link_clk_src",
>  		.parent_data = disp_cc_parent_data_0,
>  		.num_parents = ARRAY_SIZE(disp_cc_parent_data_0),
>  		.flags = CLK_SET_RATE_PARENT | CLK_GET_RATE_NOCACHE,
> -		.ops = &clk_rcg2_ops,
> +		.ops = &clk_byte2_ops,
>  	},
>  };
>  


  parent reply	other threads:[~2024-04-11 11:34 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-08 11:47 [PATCH 0/4] clk: qcom: dispcc: fix DisplayPort link clocks Dmitry Baryshkov
2024-04-08 11:47 ` [PATCH 1/4] clk: qcom: dispcc-sm8450: fix DisplayPort clocks Dmitry Baryshkov
2024-04-09  2:34   ` Stephen Boyd
2024-04-10 16:27   ` Neil Armstrong
2024-04-10 17:11     ` Dmitry Baryshkov
2024-04-08 11:47 ` [PATCH 2/4] clk: qcom: dispcc-sm6350: " Dmitry Baryshkov
2024-04-10 16:32   ` Neil Armstrong
2024-04-11 11:33   ` Luca Weiss [this message]
2024-04-08 11:47 ` [PATCH 3/4] clk: qcom: dispcc-sm8550: " Dmitry Baryshkov
2024-04-10 16:26   ` Neil Armstrong
2024-04-08 11:47 ` [PATCH 4/4] clk: qcom: dispcc-sm8650: " Dmitry Baryshkov
2024-04-10 16:31   ` Neil Armstrong
2024-04-10 18:46 ` [PATCH 0/4] clk: qcom: dispcc: fix DisplayPort link clocks Konrad Dybcio
2024-04-20 18:05 ` Bjorn Andersson

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=D0H9F200BT16.2HWU1I45AS1S7@fairphone.com \
    --to=luca.weiss@fairphone.com \
    --cc=andersson@kernel.org \
    --cc=dmitry.baryshkov@linaro.org \
    --cc=konrad.dybcio@linaro.org \
    --cc=konrad.dybcio@somainline.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-clk@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mturquette@baylibre.com \
    --cc=neil.armstrong@linaro.org \
    --cc=sboyd@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox