Message ID | 20250502-ipq5018-cmn-pll-v1-2-27902c1c4071@outlook.com |
---|---|
State | New |
Headers | show |
Series | Add CMN PLL clock controller support for IPQ5018 | expand |
On 5/4/25 8:59 AM, George Moussalem wrote: > > > On 5/2/25 16:45, George Moussalem wrote: >> >> >> On 5/2/25 14:29, Konrad Dybcio wrote: >>> On 5/2/25 12:15 PM, George Moussalem via B4 Relay wrote: >>>> From: George Moussalem <george.moussalem@outlook.com> >>>> >>>> The XO clock must not be disabled, so let's add the CLK_IS_CRITICAL >>>> flag to avoid the kernel trying to disable the XO clock (when parenting >>>> it under the CMN PLL reference clock), else the kernel will panic and >>>> the following message will appear in the kernel logs: >>> >>> Remove the struct definition for this clock (and the assignment in >>> blah_blah_clks[]) and replace it with: >>> >>> qcom_branch_set_clk_en(regmap, 0x30030); /* GCC_XO_CLK */ >> >> understood, thanks for the quick turnaround! > > Tested it, but then then the issue is still there. This time fixable by setting the CLK_IS_CRITICAL flag on gcc_xo_clk_src. I was looking at removing the struct for gcc_xo_clk_src too and use qcom_branch_set_clk_en, but there are clocks that refer to the gcc_xo_clk_src as their parent. I'm a bit hesitant to tinker with the GCC driver without access to the datasheet. The downstream driver actually has the CLK_IS_CRITICAL flag set too on gcc_xo_clk as initially proposed in this patch: > > https://git.codelinaro.org/clo/qsdk/oss/kernel/linux-ipq-5.4/-/blob/NHSS.QSDK.12.5/drivers/clk/qcom/gcc-ipq5018.c#L1457 > > Are you okay with this suggested approach? Since turning off XO means the CPU (and nothing else on the soc for that matter) clock will not tick, just unregister the RCG along with it you can remove the .parent_hws (dont forget .num_parents along with it) from the affected clocks, this is effectively cosmetic Konrad
diff --git a/drivers/clk/qcom/gcc-ipq5018.c b/drivers/clk/qcom/gcc-ipq5018.c index 70f5dcb96700f55da1fb19fc893d22350a7e63bf..24eb4c40da63462077ee2e5714e838aa30ced2e3 100644 --- a/drivers/clk/qcom/gcc-ipq5018.c +++ b/drivers/clk/qcom/gcc-ipq5018.c @@ -1371,7 +1371,7 @@ static struct clk_branch gcc_xo_clk = { &gcc_xo_clk_src.clkr.hw, }, .num_parents = 1, - .flags = CLK_SET_RATE_PARENT, + .flags = CLK_SET_RATE_PARENT | CLK_IS_CRITICAL, .ops = &clk_branch2_ops, }, },