Skip to content

Commit 668a7a1

Browse files
bebarinovireshk
authored andcommitted
cpufreq: qcom-hw: Don't do lmh things without a throttle interrupt
Offlining cpu6 and cpu7 and then onlining cpu6 hangs on sc7180-trogdor-lazor because the throttle interrupt doesn't exist. Similarly, things go sideways when suspend/resume runs. That's because the qcom_cpufreq_hw_cpu_online() and qcom_cpufreq_hw_lmh_exit() functions are calling genirq APIs with an interrupt value of '-6', i.e. -ENXIO, and that isn't good. Check the value of the throttle interrupt like we already do in other functions in this file and bail out early from lmh code to fix the hang. Reported-by: Rob Clark <robdclark@chromium.org> Cc: Vladimir Zapolskiy <vladimir.zapolskiy@linaro.org> Cc: Bjorn Andersson <bjorn.andersson@linaro.org> Cc: Dmitry Baryshkov <dmitry.baryshkov@linaro.org> Fixes: a1eb080 ("cpufreq: qcom-hw: provide online/offline operations") Signed-off-by: Stephen Boyd <swboyd@chromium.org> Reviewed-by: Vladimir Zapolskiy <vladimir.zapolskiy@linaro.org> Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
1 parent 4ff5a9b commit 668a7a1

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

drivers/cpufreq/qcom-cpufreq-hw.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -442,6 +442,9 @@ static int qcom_cpufreq_hw_cpu_online(struct cpufreq_policy *policy)
442442
struct platform_device *pdev = cpufreq_get_driver_data();
443443
int ret;
444444

445+
if (data->throttle_irq <= 0)
446+
return 0;
447+
445448
ret = irq_set_affinity_hint(data->throttle_irq, policy->cpus);
446449
if (ret)
447450
dev_err(&pdev->dev, "Failed to set CPU affinity of %s[%d]\n",
@@ -469,6 +472,9 @@ static int qcom_cpufreq_hw_cpu_offline(struct cpufreq_policy *policy)
469472

470473
static void qcom_cpufreq_hw_lmh_exit(struct qcom_cpufreq_data *data)
471474
{
475+
if (data->throttle_irq <= 0)
476+
return;
477+
472478
free_irq(data->throttle_irq, data);
473479
}
474480

0 commit comments

Comments
 (0)