mirror of
https://github.com/torvalds/linux.git
synced 2026-07-31 19:47:08 +02:00
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:
parent
cb0c7a7d3a
commit
c27180b4c7
|
|
@ -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");
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user