Re: [PATCH 05/13] clk: qcom: cpu-8996: skip ACD init if the setup is valid

Konrad Dybcio
2023-01-12T12:20:21Z

On 11.01.2023 22:55, Dmitry Baryshkov wrote:
> On 11/01/2023 23:00, Konrad Dybcio wrote:
>>
>>
>> On 11.01.2023 20:19, Dmitry Baryshkov wrote:
>>> Check whether L2 registers contain correct values and skip programming
>>> if they are valid. This follows the code present downstream.
>>>
>>> Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
>>> ---
>> Once again, my random local msm-3.18 doesn't do this, can you show
>> me the downstream source for this?
>
> https://git.codelinaro.org/clo/la/kernel/msm-3.18/-/blob/LA.UM.7.5.r1-05300-8x96.0/drivers/clk/msm/clock-cpu-8996.c#L856
Reviewed-by: Konrad Dybcio <konrad.dybcio@linaro.org>

Konrad
>
>>
>> Konrad
>>>   drivers/clk/qcom/clk-cpu-8996.c | 6 ++++++
>>>   1 file changed, 6 insertions(+)
>>>
>>> diff --git a/drivers/clk/qcom/clk-cpu-8996.c b/drivers/clk/qcom/clk-cpu-8996.c
>>> index 0e0c00d44c6f..7e5246ca7e7f 100644
>>> --- a/drivers/clk/qcom/clk-cpu-8996.c
>>> +++ b/drivers/clk/qcom/clk-cpu-8996.c
>>> @@ -472,10 +472,15 @@ static void __iomem *base;
>>>   static void qcom_cpu_clk_msm8996_acd_init(void __iomem *base)
>>>   {
>>>       u64 hwid;
>>> +    u32 val;
>>>       unsigned long flags;
>>>         spin_lock_irqsave(&qcom_clk_acd_lock, flags);
>>>   +    val = kryo_l2_get_indirect_reg(L2ACDTD_REG);
>>> +    if (val == 0x00006a11)
>>> +        goto out;
>>> +
>>>       hwid = read_cpuid_mpidr() & CPU_AFINITY_MASK;
>>>         kryo_l2_set_indirect_reg(L2ACDTD_REG, 0x00006a11);
>>> @@ -492,6 +497,7 @@ static void qcom_cpu_clk_msm8996_acd_init(void __iomem *base)
>>>           writel(0xf, base + PERFCL_REG_OFFSET + SSSCTL_OFFSET);
>>>       }
>>>   +out:
>>>       spin_unlock_irqrestore(&qcom_clk_acd_lock, flags);
>>>   }
>>>
>