From 4964814d6fe44e6eb1defea40355c160973876ce Mon Sep 17 00:00:00 2001 From: Taniya Das Date: Thu, 3 Oct 2019 09:05:45 +0530 Subject: [PATCH] cpufreq: qcom: Fix multiple request of IRQs The cpufreq init would be invoked every cpu online and thus resulting into multiple IRQ requests, so fix the same. Change-Id: I271cd7f82e2ddde7466fa0949b8627c8d7573c47 Signed-off-by: Taniya Das --- drivers/cpufreq/qcom-cpufreq-hw.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/cpufreq/qcom-cpufreq-hw.c b/drivers/cpufreq/qcom-cpufreq-hw.c index d509bc6a2f1a..e50c8533d3ed 100644 --- a/drivers/cpufreq/qcom-cpufreq-hw.c +++ b/drivers/cpufreq/qcom-cpufreq-hw.c @@ -66,6 +66,7 @@ struct cpufreq_qcom { int dcvsh_irq; char dcvsh_irq_name[MAX_FN_SIZE]; bool is_irq_enabled; + bool is_irq_requested; }; struct cpufreq_counter { @@ -295,7 +296,7 @@ static int qcom_cpufreq_hw_cpu_init(struct cpufreq_policy *policy) dev_pm_opp_of_register_em(policy->cpus); - if (c->dcvsh_irq > 0) { + if (c->dcvsh_irq > 0 && !c->is_irq_requested) { snprintf(c->dcvsh_irq_name, sizeof(c->dcvsh_irq_name), "dcvsh-irq-%d", policy->cpu); ret = devm_request_threaded_irq(cpu_dev, c->dcvsh_irq, NULL, @@ -306,6 +307,7 @@ static int qcom_cpufreq_hw_cpu_init(struct cpufreq_policy *policy) return ret; } + c->is_irq_requested = true; c->is_irq_enabled = true; writel_relaxed(LT_IRQ_STATUS, c->base + offsets[REG_INTR_EN]); c->freq_limit_attr.attr.name = "dcvsh_freq_limit";