summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorManaf Meethalavalappu Pallikunhi <manafm@codeaurora.org>2017-08-11 18:51:51 +0530
committerGerrit - the friendly Code Review server <code-review@localhost>2017-08-28 04:14:58 -0700
commit89fb51f2a7e14d10aba136eb11a14e4bb825cf32 (patch)
tree28df532cc20895d6203e19e94282e0808b97811a
parent8aedd7084222d4cce3acdfe3c71820c674503bee (diff)
msm: thermal: check LMH DCVS devicetree to enable reboot/suspend mitigation
KTM suspend/reboot frequency mitigation is not required for target which has LMH DCVS hardware support. lmh_dcvs_available flag in the KTM is initialized only post OSM driver is up. But during KTM probe, it checks this flag to register suspend/reboot notifier. Since it is not initialized, it always register with these notifier and does frequency mitigation whenever it notifies KTM. To avoid this, check if the LMH DCVS related devicetree node is enabled during KTM probe before enabling suspend/reboot notifier registration. To be safe use the same check in CPU frequency policy callback for KTM max cpu frequency request as well. Change-Id: I337477dd296e1e681498d702ab03c164d7554186 Signed-off-by: Manaf Meethalavalappu Pallikunhi <manafm@codeaurora.org>
-rw-r--r--drivers/thermal/msm_thermal.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/thermal/msm_thermal.c b/drivers/thermal/msm_thermal.c
index 4b586f62cdc7..50d1619d7bc3 100644
--- a/drivers/thermal/msm_thermal.c
+++ b/drivers/thermal/msm_thermal.c
@@ -200,6 +200,7 @@ static bool cluster_info_probed;
static bool cluster_info_nodes_called;
static bool in_suspend, retry_in_progress;
static bool lmh_dcvs_available;
+static bool lmh_dcvs_is_supported;
static int *tsens_id_map;
static int *zone_id_tsens_map;
static DEFINE_MUTEX(vdd_rstr_mutex);
@@ -995,7 +996,7 @@ static int msm_thermal_cpufreq_callback(struct notifier_block *nfb,
switch (event) {
case CPUFREQ_ADJUST:
- max_freq_req = (lmh_dcvs_available) ? UINT_MAX :
+ max_freq_req = (lmh_dcvs_is_supported) ? UINT_MAX :
cpus[policy->cpu].parent_ptr->limited_max_freq;
min_freq_req = cpus[policy->cpu].parent_ptr->limited_min_freq;
pr_debug("mitigating CPU%d to freq max: %u min: %u\n",
@@ -5379,7 +5380,7 @@ int msm_thermal_init(struct msm_thermal_data *pdata)
if (ret)
pr_err("cannot register cpufreq notifier. err:%d\n", ret);
- if (!lmh_dcvs_available) {
+ if (!lmh_dcvs_is_supported) {
register_reboot_notifier(&msm_thermal_reboot_notifier);
pm_notifier(msm_thermal_suspend_callback, 0);
}
@@ -7414,6 +7415,7 @@ static int msm_thermal_dev_probe(struct platform_device *pdev)
if (ret)
goto probe_exit;
+ lmh_dcvs_is_supported = of_property_read_bool(node, "clock-names");
probe_cc(node, &data, pdev);
probe_freq_mitigation(node, &data, pdev);
probe_cx_phase_ctrl(node, &data, pdev);