Commit graph

9 commits

Author SHA1 Message Date
Duy Truong
04e554807c Update copyright to The Linux Foundation
Change-Id: Ibead64ce2e901dede2ddd1b86088b88f2350ce92
Signed-off-by: Duy Truong <dtruong@codeaurora.org>
2013-03-15 17:07:39 -07:00
Eugene Seah
fa14860a50 thermal: msm_thermal: Define and implement device tree bindings
Define device tree bindings for MSM_THERMAL driver, and implement
matching code to make the driver abide to these bindings.

Change-Id: I6ed08a09f45f8748841cf44db601f28659e49d9c
Signed-off-by: Eugene Seah <eseah@codeaurora.org>
2013-02-27 18:19:38 -08:00
Eugene Seah
1e1403391d msm: Add frequency backoff to thermal monitor
Make thermal monitor performance hit more gradual by stepping down
limit frequency instead of jumping directly to that frequency.
The monitor now steps down to the lowest available cpufreq
frequency, instead of fixing the limit frequency to 918MHz. Also
update the polling frequency to 250ms to improve responsiveness.

Change-Id: I6edb0cfc057284023978de04d7835e9783da5ebd
Signed-off-by: Eugene Seah <eseah@codeaurora.org>
2013-02-27 18:18:02 -08:00
Praveen Chidambaram
af014a3fc0 msm: thermal: Simplify kernel thermal safeguard mechanism
Using CPUFreq policy objects and setting the max frequency limit by
overriding the policy->max node, leads to race/overwrite conditions with
an user trying to use the scaling_max_frequency node.

The thermal limits are directly communicated to the 'msm' cpufreq driver
and use the cpufreq_update_policy() to ensure that the frequency is
limited as per the thermal safeguard requirements.

CRs-fixed: 370343
Change-Id: Iab5a15e0f0d25da4b9f6a9417dbfc01bf5d6f8f6
Signed-off-by: Praveen Chidambaram <pchidamb@codeaurora.org>
2013-02-27 18:12:38 -08:00
Eugene Seah
3dd97375e9 thermal: Don't limit CPU frequency after msm_thermal is disabled
There may be an outstanding task to check for threshold crossing
when msm_thermal is disabled and CPU is restored to maximum
frequency. This task can get scheduled after the maximum frequency
is restored, and result in another mitigation that pins CPU
frequencies to 918mHz. This happens in the case that the final
temperature was still above the max temperature threshold.
This patch ensures any outstanding tasks are cancelled and flushed
before finally restoring the CPU frequencies.

CRs-fixed: 351614
Change-Id: Ifce00b379989b78856803ac09c7403207f5c998b
Signed-off-by: Eugene Seah <eseah@codeaurora.org>
Signed-off-by: David Brown <davidb@codeaurora.org>
2013-02-25 11:33:35 -08:00
Eugene Seah
40d58c7a0d thermal: Fix hotplug race condition leading to memory corruption.
msm_thermal module made a copy of the CPUFreq policy structure
pointer but continues to try and use it after the core has been
hotplugged (and the original structure is freed). The fix is to
use cpufreq_cpu_get/put instead of copying cpufreq pointers.

CRs-fixed: 342351
Change-Id: I312d8bccc09a5df5805f99fecdc9409d9d4ed2be
Signed-off-by: Eugene Seah <eseah@codeaurora.org>
Signed-off-by: David Brown <davidb@codeaurora.org>
2013-02-25 11:33:33 -08:00
Praveen Chidambaram
ac6e574364 msm_thermal: Remove error messages from log when core is offline
If msm_thermal is not cancelled and TSENS reports a high temperature,
it might try to limit the frequency, but since the core is offline,
the frequency limit may not happen. We need not report this error.

Change-Id: I579e2329c6fb038d53f2d207a6a832185e633785
Signed-off-by: Praveen Chidambaram <pchidamb@codeaurora.org>
Signed-off-by: David Brown <davidb@codeaurora.org>
2013-02-25 11:33:29 -08:00
Jeff Ohlstein
b1add6d969 thermal: msm8960_tsens: nullify tmdev when early_init fails
The initialization code uses the tmdev variable as an indicator as to
whether or not early initialization succeeded. However, when early init
fails, it only kfrees the pointer, it doesn't set it to NULL. This
causes us to dereference the now-freed pointer.

Additionally, squash the message that prints each time we fail to read
the temperature sensor, and print a warning to the kernel log when tsens
calibration data is not present.

Change-Id: Iab400cac687cdbc36d8c69541675c29a0b82c704
Signed-off-by: Jeff Ohlstein <johlstei@codeaurora.org>
Signed-off-by: David Brown <davidb@codeaurora.org>
2013-02-25 11:33:29 -08:00
Praveen Chidambaram
b729ce4ae8 msm: thermal: Add MSM thermal sensing and limiting
Add a thermal driver to poll and detect any thermal condition at boot
and limit max cpu frequency on a thermal condition. This driver is
intended to limit cpu thermal output until the userspace thermald
kicks in. The thermald will disable this driver and take over the
cpu thermal sensing and mitigation.

Change-Id: I2710bfdeb5bf01c864437e13da835621d1b9202c
Signed-off-by: Praveen Chidambaram <pchidamb@codeaurora.org>
Signed-off-by: David Brown <davidb@codeaurora.org>
2013-02-25 11:33:28 -08:00