* [PATCH v2 0/3] clk: qcom: dispcc-sm8650: round of fixes
@ 2024-06-24 8:05 Neil Armstrong
2024-06-24 8:05 ` [PATCH v2 1/3] clk: qcom: dispcc-sm8650: Park RCG's clk source at XO during disable Neil Armstrong
` (2 more replies)
0 siblings, 3 replies; 7+ messages in thread
From: Neil Armstrong @ 2024-06-24 8:05 UTC (permalink / raw)
To: Bjorn Andersson, Michael Turquette, Stephen Boyd, Konrad Dybcio,
Taniya Das
Cc: linux-arm-msm, linux-clk, linux-kernel, Neil Armstrong, Dmitry Baryshkov
While trying to fix a crash when display is started late in the
boot process, I ran on multiple issues with the DISPCC clock
definitions that needed some fixups.
Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
---
Changes in v2:
- Squashed patch 2 into patch 1
- Dropped shared_ops to disp_cc_sleep_clk_src & disp_cc_xo_clk_src as Taniya recommends
- Dropped patch 3
- Removed wait_val fields updates from GDSC, this requires a larger solution
- Link to v1: https://lore.kernel.org/r/20240621-topic-sm8650-upstream-fix-dispcc-v1-0-7b297dd9fcc1@linaro.org
---
Neil Armstrong (3):
clk: qcom: dispcc-sm8650: Park RCG's clk source at XO during disable
clk: qcom: dispcc-sm8650: add missing CLK_SET_RATE_PARENT flag
clk: qcom: dispcc-sm8650: Update the GDSC flags
drivers/clk/qcom/dispcc-sm8650.c | 20 +++++++++++---------
1 file changed, 11 insertions(+), 9 deletions(-)
---
base-commit: b992b79ca8bc336fa8e2c80990b5af80ed8f36fd
change-id: 20240621-topic-sm8650-upstream-fix-dispcc-a1994038c003
Best regards,
--
Neil Armstrong <neil.armstrong@linaro.org>
^ permalink raw reply [flat|nested] 7+ messages in thread* [PATCH v2 1/3] clk: qcom: dispcc-sm8650: Park RCG's clk source at XO during disable 2024-06-24 8:05 [PATCH v2 0/3] clk: qcom: dispcc-sm8650: round of fixes Neil Armstrong @ 2024-06-24 8:05 ` Neil Armstrong 2024-06-24 9:25 ` Dmitry Baryshkov 2024-06-24 8:05 ` [PATCH v2 2/3] clk: qcom: dispcc-sm8650: add missing CLK_SET_RATE_PARENT flag Neil Armstrong 2024-06-24 8:05 ` [PATCH v2 3/3] clk: qcom: dispcc-sm8650: Update the GDSC flags Neil Armstrong 2 siblings, 1 reply; 7+ messages in thread From: Neil Armstrong @ 2024-06-24 8:05 UTC (permalink / raw) To: Bjorn Andersson, Michael Turquette, Stephen Boyd, Konrad Dybcio, Taniya Das Cc: linux-arm-msm, linux-clk, linux-kernel, Neil Armstrong The RCG's clk src has to be parked at XO while disabling as per the HW recommendation, hence use clk_rcg2_shared_ops to achieve the same. It also changes dptx1_aux_clk_src to use the correct ops instead of clk_dp_ops. Fixes: 9e939f008338 ("clk: qcom: add the SM8650 Display Clock Controller driver") Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org> --- drivers/clk/qcom/dispcc-sm8650.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/drivers/clk/qcom/dispcc-sm8650.c b/drivers/clk/qcom/dispcc-sm8650.c index c9d2751f5cb8..360b80377ed6 100644 --- a/drivers/clk/qcom/dispcc-sm8650.c +++ b/drivers/clk/qcom/dispcc-sm8650.c @@ -339,7 +339,7 @@ static struct clk_rcg2 disp_cc_mdss_dptx0_aux_clk_src = { .parent_data = disp_cc_parent_data_0, .num_parents = ARRAY_SIZE(disp_cc_parent_data_0), .flags = CLK_SET_RATE_PARENT, - .ops = &clk_rcg2_ops, + .ops = &clk_rcg2_shared_ops, }, }; @@ -398,7 +398,7 @@ static struct clk_rcg2 disp_cc_mdss_dptx1_aux_clk_src = { .parent_data = disp_cc_parent_data_0, .num_parents = ARRAY_SIZE(disp_cc_parent_data_0), .flags = CLK_SET_RATE_PARENT, - .ops = &clk_dp_ops, + .ops = &clk_rcg2_shared_ops, }, }; @@ -457,7 +457,7 @@ static struct clk_rcg2 disp_cc_mdss_dptx2_aux_clk_src = { .parent_data = disp_cc_parent_data_0, .num_parents = ARRAY_SIZE(disp_cc_parent_data_0), .flags = CLK_SET_RATE_PARENT, - .ops = &clk_rcg2_ops, + .ops = &clk_rcg2_shared_ops, }, }; @@ -516,7 +516,7 @@ static struct clk_rcg2 disp_cc_mdss_dptx3_aux_clk_src = { .parent_data = disp_cc_parent_data_0, .num_parents = ARRAY_SIZE(disp_cc_parent_data_0), .flags = CLK_SET_RATE_PARENT, - .ops = &clk_rcg2_ops, + .ops = &clk_rcg2_shared_ops, }, }; @@ -560,7 +560,7 @@ static struct clk_rcg2 disp_cc_mdss_esc0_clk_src = { .parent_data = disp_cc_parent_data_5, .num_parents = ARRAY_SIZE(disp_cc_parent_data_5), .flags = CLK_SET_RATE_PARENT, - .ops = &clk_rcg2_ops, + .ops = &clk_rcg2_shared_ops, }, }; @@ -575,7 +575,7 @@ static struct clk_rcg2 disp_cc_mdss_esc1_clk_src = { .parent_data = disp_cc_parent_data_5, .num_parents = ARRAY_SIZE(disp_cc_parent_data_5), .flags = CLK_SET_RATE_PARENT, - .ops = &clk_rcg2_ops, + .ops = &clk_rcg2_shared_ops, }, }; @@ -647,7 +647,7 @@ static struct clk_rcg2 disp_cc_mdss_vsync_clk_src = { .parent_data = disp_cc_parent_data_0, .num_parents = ARRAY_SIZE(disp_cc_parent_data_0), .flags = CLK_SET_RATE_PARENT, - .ops = &clk_rcg2_ops, + .ops = &clk_rcg2_shared_ops, }, }; -- 2.34.1 ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH v2 1/3] clk: qcom: dispcc-sm8650: Park RCG's clk source at XO during disable 2024-06-24 8:05 ` [PATCH v2 1/3] clk: qcom: dispcc-sm8650: Park RCG's clk source at XO during disable Neil Armstrong @ 2024-06-24 9:25 ` Dmitry Baryshkov 2024-07-16 8:45 ` Neil Armstrong 0 siblings, 1 reply; 7+ messages in thread From: Dmitry Baryshkov @ 2024-06-24 9:25 UTC (permalink / raw) To: Neil Armstrong Cc: Bjorn Andersson, Michael Turquette, Stephen Boyd, Konrad Dybcio, Taniya Das, linux-arm-msm, linux-clk, linux-kernel On Mon, Jun 24, 2024 at 10:05:50AM GMT, Neil Armstrong wrote: > The RCG's clk src has to be parked at XO while disabling as per the > HW recommendation, hence use clk_rcg2_shared_ops to achieve the same. > > It also changes dptx1_aux_clk_src to use the correct ops instead of > clk_dp_ops. > > Fixes: 9e939f008338 ("clk: qcom: add the SM8650 Display Clock Controller driver") > Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org> > --- > drivers/clk/qcom/dispcc-sm8650.c | 14 +++++++------- > 1 file changed, 7 insertions(+), 7 deletions(-) > > diff --git a/drivers/clk/qcom/dispcc-sm8650.c b/drivers/clk/qcom/dispcc-sm8650.c > index c9d2751f5cb8..360b80377ed6 100644 > --- a/drivers/clk/qcom/dispcc-sm8650.c > +++ b/drivers/clk/qcom/dispcc-sm8650.c > @@ -339,7 +339,7 @@ static struct clk_rcg2 disp_cc_mdss_dptx0_aux_clk_src = { > .parent_data = disp_cc_parent_data_0, > .num_parents = ARRAY_SIZE(disp_cc_parent_data_0), > .flags = CLK_SET_RATE_PARENT, > - .ops = &clk_rcg2_ops, > + .ops = &clk_rcg2_shared_ops, > }, > }; > > @@ -398,7 +398,7 @@ static struct clk_rcg2 disp_cc_mdss_dptx1_aux_clk_src = { > .parent_data = disp_cc_parent_data_0, > .num_parents = ARRAY_SIZE(disp_cc_parent_data_0), > .flags = CLK_SET_RATE_PARENT, > - .ops = &clk_dp_ops, > + .ops = &clk_rcg2_shared_ops, > }, > }; > > @@ -457,7 +457,7 @@ static struct clk_rcg2 disp_cc_mdss_dptx2_aux_clk_src = { > .parent_data = disp_cc_parent_data_0, > .num_parents = ARRAY_SIZE(disp_cc_parent_data_0), > .flags = CLK_SET_RATE_PARENT, > - .ops = &clk_rcg2_ops, > + .ops = &clk_rcg2_shared_ops, > }, > }; > > @@ -516,7 +516,7 @@ static struct clk_rcg2 disp_cc_mdss_dptx3_aux_clk_src = { > .parent_data = disp_cc_parent_data_0, > .num_parents = ARRAY_SIZE(disp_cc_parent_data_0), > .flags = CLK_SET_RATE_PARENT, > - .ops = &clk_rcg2_ops, > + .ops = &clk_rcg2_shared_ops, > }, > }; The only parent for these three clocks is the DT_BI_TCXO. Is this really going to work as expected? Also what's the point of parking the TCXO-sourced clocks? > > @@ -560,7 +560,7 @@ static struct clk_rcg2 disp_cc_mdss_esc0_clk_src = { > .parent_data = disp_cc_parent_data_5, > .num_parents = ARRAY_SIZE(disp_cc_parent_data_5), > .flags = CLK_SET_RATE_PARENT, > - .ops = &clk_rcg2_ops, > + .ops = &clk_rcg2_shared_ops, > }, > }; > > @@ -575,7 +575,7 @@ static struct clk_rcg2 disp_cc_mdss_esc1_clk_src = { > .parent_data = disp_cc_parent_data_5, > .num_parents = ARRAY_SIZE(disp_cc_parent_data_5), > .flags = CLK_SET_RATE_PARENT, > - .ops = &clk_rcg2_ops, > + .ops = &clk_rcg2_shared_ops, > }, > }; > > @@ -647,7 +647,7 @@ static struct clk_rcg2 disp_cc_mdss_vsync_clk_src = { > .parent_data = disp_cc_parent_data_0, > .num_parents = ARRAY_SIZE(disp_cc_parent_data_0), > .flags = CLK_SET_RATE_PARENT, > - .ops = &clk_rcg2_ops, > + .ops = &clk_rcg2_shared_ops, > }, > }; > > > -- > 2.34.1 > -- With best wishes Dmitry ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH v2 1/3] clk: qcom: dispcc-sm8650: Park RCG's clk source at XO during disable 2024-06-24 9:25 ` Dmitry Baryshkov @ 2024-07-16 8:45 ` Neil Armstrong 0 siblings, 0 replies; 7+ messages in thread From: Neil Armstrong @ 2024-07-16 8:45 UTC (permalink / raw) To: Dmitry Baryshkov Cc: Bjorn Andersson, Michael Turquette, Stephen Boyd, Konrad Dybcio, Taniya Das, linux-arm-msm, linux-clk, linux-kernel On 24/06/2024 11:25, Dmitry Baryshkov wrote: > On Mon, Jun 24, 2024 at 10:05:50AM GMT, Neil Armstrong wrote: >> The RCG's clk src has to be parked at XO while disabling as per the >> HW recommendation, hence use clk_rcg2_shared_ops to achieve the same. >> >> It also changes dptx1_aux_clk_src to use the correct ops instead of >> clk_dp_ops. >> >> Fixes: 9e939f008338 ("clk: qcom: add the SM8650 Display Clock Controller driver") >> Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org> >> --- >> drivers/clk/qcom/dispcc-sm8650.c | 14 +++++++------- >> 1 file changed, 7 insertions(+), 7 deletions(-) >> >> diff --git a/drivers/clk/qcom/dispcc-sm8650.c b/drivers/clk/qcom/dispcc-sm8650.c >> index c9d2751f5cb8..360b80377ed6 100644 >> --- a/drivers/clk/qcom/dispcc-sm8650.c >> +++ b/drivers/clk/qcom/dispcc-sm8650.c >> @@ -339,7 +339,7 @@ static struct clk_rcg2 disp_cc_mdss_dptx0_aux_clk_src = { >> .parent_data = disp_cc_parent_data_0, >> .num_parents = ARRAY_SIZE(disp_cc_parent_data_0), >> .flags = CLK_SET_RATE_PARENT, >> - .ops = &clk_rcg2_ops, >> + .ops = &clk_rcg2_shared_ops, >> }, >> }; >> >> @@ -398,7 +398,7 @@ static struct clk_rcg2 disp_cc_mdss_dptx1_aux_clk_src = { >> .parent_data = disp_cc_parent_data_0, >> .num_parents = ARRAY_SIZE(disp_cc_parent_data_0), >> .flags = CLK_SET_RATE_PARENT, >> - .ops = &clk_dp_ops, >> + .ops = &clk_rcg2_shared_ops, >> }, >> }; >> >> @@ -457,7 +457,7 @@ static struct clk_rcg2 disp_cc_mdss_dptx2_aux_clk_src = { >> .parent_data = disp_cc_parent_data_0, >> .num_parents = ARRAY_SIZE(disp_cc_parent_data_0), >> .flags = CLK_SET_RATE_PARENT, >> - .ops = &clk_rcg2_ops, >> + .ops = &clk_rcg2_shared_ops, >> }, >> }; >> >> @@ -516,7 +516,7 @@ static struct clk_rcg2 disp_cc_mdss_dptx3_aux_clk_src = { >> .parent_data = disp_cc_parent_data_0, >> .num_parents = ARRAY_SIZE(disp_cc_parent_data_0), >> .flags = CLK_SET_RATE_PARENT, >> - .ops = &clk_rcg2_ops, >> + .ops = &clk_rcg2_shared_ops, >> }, >> }; > > The only parent for these three clocks is the DT_BI_TCXO. Is this really > going to work as expected? Also what's the point of parking the > TCXO-sourced clocks? > Indeed will drop Thanks, Neil >> >> @@ -560,7 +560,7 @@ static struct clk_rcg2 disp_cc_mdss_esc0_clk_src = { >> .parent_data = disp_cc_parent_data_5, >> .num_parents = ARRAY_SIZE(disp_cc_parent_data_5), >> .flags = CLK_SET_RATE_PARENT, >> - .ops = &clk_rcg2_ops, >> + .ops = &clk_rcg2_shared_ops, >> }, >> }; >> >> @@ -575,7 +575,7 @@ static struct clk_rcg2 disp_cc_mdss_esc1_clk_src = { >> .parent_data = disp_cc_parent_data_5, >> .num_parents = ARRAY_SIZE(disp_cc_parent_data_5), >> .flags = CLK_SET_RATE_PARENT, >> - .ops = &clk_rcg2_ops, >> + .ops = &clk_rcg2_shared_ops, >> }, >> }; >> >> @@ -647,7 +647,7 @@ static struct clk_rcg2 disp_cc_mdss_vsync_clk_src = { >> .parent_data = disp_cc_parent_data_0, >> .num_parents = ARRAY_SIZE(disp_cc_parent_data_0), >> .flags = CLK_SET_RATE_PARENT, >> - .ops = &clk_rcg2_ops, >> + .ops = &clk_rcg2_shared_ops, >> }, >> }; >> >> >> -- >> 2.34.1 >> > ^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH v2 2/3] clk: qcom: dispcc-sm8650: add missing CLK_SET_RATE_PARENT flag 2024-06-24 8:05 [PATCH v2 0/3] clk: qcom: dispcc-sm8650: round of fixes Neil Armstrong 2024-06-24 8:05 ` [PATCH v2 1/3] clk: qcom: dispcc-sm8650: Park RCG's clk source at XO during disable Neil Armstrong @ 2024-06-24 8:05 ` Neil Armstrong 2024-06-24 8:05 ` [PATCH v2 3/3] clk: qcom: dispcc-sm8650: Update the GDSC flags Neil Armstrong 2 siblings, 0 replies; 7+ messages in thread From: Neil Armstrong @ 2024-06-24 8:05 UTC (permalink / raw) To: Bjorn Andersson, Michael Turquette, Stephen Boyd, Konrad Dybcio, Taniya Das Cc: linux-arm-msm, linux-clk, linux-kernel, Neil Armstrong, Dmitry Baryshkov Add the missing CLK_SET_RATE_PARENT for the byte0_div_clk_src and byte1_div_clk_src, the clock rate should propagate to the corresponding _clk_src. Fixes: 9e939f008338 ("clk: qcom: add the SM8650 Display Clock Controller driver") Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org> Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org> --- drivers/clk/qcom/dispcc-sm8650.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/clk/qcom/dispcc-sm8650.c b/drivers/clk/qcom/dispcc-sm8650.c index 360b80377ed6..1222a26c45c8 100644 --- a/drivers/clk/qcom/dispcc-sm8650.c +++ b/drivers/clk/qcom/dispcc-sm8650.c @@ -696,6 +696,7 @@ static struct clk_regmap_div disp_cc_mdss_byte0_div_clk_src = { &disp_cc_mdss_byte0_clk_src.clkr.hw, }, .num_parents = 1, + .flags = CLK_SET_RATE_PARENT, .ops = &clk_regmap_div_ops, }, }; @@ -710,6 +711,7 @@ static struct clk_regmap_div disp_cc_mdss_byte1_div_clk_src = { &disp_cc_mdss_byte1_clk_src.clkr.hw, }, .num_parents = 1, + .flags = CLK_SET_RATE_PARENT, .ops = &clk_regmap_div_ops, }, }; -- 2.34.1 ^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH v2 3/3] clk: qcom: dispcc-sm8650: Update the GDSC flags 2024-06-24 8:05 [PATCH v2 0/3] clk: qcom: dispcc-sm8650: round of fixes Neil Armstrong 2024-06-24 8:05 ` [PATCH v2 1/3] clk: qcom: dispcc-sm8650: Park RCG's clk source at XO during disable Neil Armstrong 2024-06-24 8:05 ` [PATCH v2 2/3] clk: qcom: dispcc-sm8650: add missing CLK_SET_RATE_PARENT flag Neil Armstrong @ 2024-06-24 8:05 ` Neil Armstrong 2024-06-24 9:25 ` Dmitry Baryshkov 2 siblings, 1 reply; 7+ messages in thread From: Neil Armstrong @ 2024-06-24 8:05 UTC (permalink / raw) To: Bjorn Andersson, Michael Turquette, Stephen Boyd, Konrad Dybcio, Taniya Das Cc: linux-arm-msm, linux-clk, linux-kernel, Neil Armstrong Update the GDSC flags by adding missing POLL_CFG_GDSCR flag. Fixes: 9e939f008338 ("clk: qcom: add the SM8650 Display Clock Controller driver") Reviewed-by: Konrad Dybcio <konrad.dybcio@linaro.org> Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org> --- drivers/clk/qcom/dispcc-sm8650.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/clk/qcom/dispcc-sm8650.c b/drivers/clk/qcom/dispcc-sm8650.c index 1222a26c45c8..85d8809e31e7 100644 --- a/drivers/clk/qcom/dispcc-sm8650.c +++ b/drivers/clk/qcom/dispcc-sm8650.c @@ -1610,7 +1610,7 @@ static struct gdsc mdss_gdsc = { .name = "mdss_gdsc", }, .pwrsts = PWRSTS_OFF_ON, - .flags = HW_CTRL | RETAIN_FF_ENABLE, + .flags = POLL_CFG_GDSCR | HW_CTRL | RETAIN_FF_ENABLE, }; static struct gdsc mdss_int2_gdsc = { @@ -1619,7 +1619,7 @@ static struct gdsc mdss_int2_gdsc = { .name = "mdss_int2_gdsc", }, .pwrsts = PWRSTS_OFF_ON, - .flags = HW_CTRL | RETAIN_FF_ENABLE, + .flags = POLL_CFG_GDSCR | HW_CTRL | RETAIN_FF_ENABLE, }; static struct clk_regmap *disp_cc_sm8650_clocks[] = { -- 2.34.1 ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH v2 3/3] clk: qcom: dispcc-sm8650: Update the GDSC flags 2024-06-24 8:05 ` [PATCH v2 3/3] clk: qcom: dispcc-sm8650: Update the GDSC flags Neil Armstrong @ 2024-06-24 9:25 ` Dmitry Baryshkov 0 siblings, 0 replies; 7+ messages in thread From: Dmitry Baryshkov @ 2024-06-24 9:25 UTC (permalink / raw) To: Neil Armstrong Cc: Bjorn Andersson, Michael Turquette, Stephen Boyd, Konrad Dybcio, Taniya Das, linux-arm-msm, linux-clk, linux-kernel On Mon, Jun 24, 2024 at 10:05:52AM GMT, Neil Armstrong wrote: > Update the GDSC flags by adding missing POLL_CFG_GDSCR flag. > > Fixes: 9e939f008338 ("clk: qcom: add the SM8650 Display Clock Controller driver") > Reviewed-by: Konrad Dybcio <konrad.dybcio@linaro.org> > Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org> > --- > drivers/clk/qcom/dispcc-sm8650.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org> -- With best wishes Dmitry ^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2024-07-16 8:45 UTC | newest] Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 2024-06-24 8:05 [PATCH v2 0/3] clk: qcom: dispcc-sm8650: round of fixes Neil Armstrong 2024-06-24 8:05 ` [PATCH v2 1/3] clk: qcom: dispcc-sm8650: Park RCG's clk source at XO during disable Neil Armstrong 2024-06-24 9:25 ` Dmitry Baryshkov 2024-07-16 8:45 ` Neil Armstrong 2024-06-24 8:05 ` [PATCH v2 2/3] clk: qcom: dispcc-sm8650: add missing CLK_SET_RATE_PARENT flag Neil Armstrong 2024-06-24 8:05 ` [PATCH v2 3/3] clk: qcom: dispcc-sm8650: Update the GDSC flags Neil Armstrong 2024-06-24 9:25 ` Dmitry Baryshkov
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®