cpufreq: qcom-hw: Initialize qcom_cpufreq_counter spinlock

Initialize qcom_cpufreq_counter spinlock to avoid uninitilized
access or panic when driver tries to get lock during cycle_counter
framework call.

Change-Id: If56cf3030a2d468c0493a5946c778908fd015221
Signed-off-by: Vivek Aknurwar <quic_viveka@quicinc.com>
This commit is contained in:
Vivek Aknurwar 2022-02-01 11:14:55 -08:00 committed by Mike Tipton
parent cb0c7a7d3a
commit c27180b4c7

View File

@ -705,7 +705,7 @@ static int qcom_cpufreq_hw_driver_probe(struct platform_device *pdev)
{
struct device *cpu_dev;
struct clk *clk;
int ret;
int ret, cpu;
clk = clk_get(&pdev->dev, "xo");
if (IS_ERR(clk))
@ -732,6 +732,9 @@ static int qcom_cpufreq_hw_driver_probe(struct platform_device *pdev)
if (ret)
return ret;
for_each_possible_cpu(cpu)
spin_lock_init(&qcom_cpufreq_counter[cpu].lock);
ret = cpufreq_register_driver(&cpufreq_qcom_hw_driver);
if (ret)
dev_err(&pdev->dev, "CPUFreq HW driver failed to register\n");