Out of bound access is reported by kernel address
sanitizer (KASan) tool.
==================================================================
BUG: KASan: out of bounds access in lmh_mon_init_call+0xec/0x180
at addr ffffffc0a297e108
Write of size 8 by task swapper/0/1
===========================================================================
BUG kmalloc-64 (Not tainted): kasan: bad access detected
---------------------------------------------------------------------------
Disabling lock debugging due to kernel taint
INFO: Slab 0xffffffbc0659eec0 objects=64 used=64 fp=0x(null) flags=0x0080
INFO: Object 0xffffffc0a297e100 @offset=256 fp=0xffffffc0a3b87cb0
Bytes b4 ffffffc0a297e0f0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
Object ffffffc0a297e100: b0 7c b8 a3 c0 ff ff ff 00 00 00 00 00 00 00 00
Object ffffffc0a297e110: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
Object ffffffc0a297e120: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
Object ffffffc0a297e130: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
CPU: 0 PID: 1 Comm: swapper/0 Tainted: G B
3.10.49-gef71b0c-00348-g4f06d68-dirty #160
Call trace:
[<ffffffc00040a2d4>] dump_backtrace+0x0/0x1d4
[<ffffffc00040a4b8>] show_stack+0x10/0x1c
[<ffffffc000face70>] dump_stack+0x1c/0x28
[<ffffffc00054d3a0>] print_trailer+0x144/0x158
[<ffffffc00054d6fc>] object_err+0x38/0x4c
[<ffffffc0005523dc>] kasan_report_error+0x228/0x3e4
[<ffffffc0005526a8>] kasan_report+0x68/0x78
[<ffffffc00055173c>] __asan_store8+0x94/0xa0
[<ffffffc00183c0a8>] lmh_mon_init_call+0xe8/0x180
[<ffffffc000400b08>] do_one_initcall+0xcc/0x188
[<ffffffc001800bd0>] kernel_init_freeable+0x1c0/0x264
[<ffffffc000f9f338>] kernel_init+0x10/0xcc
Memory state around the buggy address:
ffffffc0a297e000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
ffffffc0a297e080: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
ffffffc0a297e100: 00 fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
^
ffffffc0a297e180: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
ffffffc0a297e200: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
==================================================================
Fix out of bound access by allocating the buffer
with right size.
Change-Id: I90d669095030dd80c09d3e69ad3fdfa3f7483b19
Signed-off-by: Ram Chandrasekar <rkumbako@codeaurora.org>
Fix sensor number printed during thermal watchdog bite.
This change adds a lookup table to do a conversion between
sensor id and thermal zone id.
Change-Id: I06939c5707a7b89f7a796f0c524fcc82f833650e
Signed-off-by: Jeff Bernard <jbernard@codeaurora.org>
With the official announcement of 8976, remove all references to its
internal code name, and replace them with 8976.
Change-Id: I6d507418e5259908addedf2975e391200b4e0c83
Signed-off-by: Ian Maund <imaund@codeaurora.org>
Signed-off-by: Srinivas Ramana <sramana@codeaurora.org>
Add support in thermal driver to retry hotplug
request on failure to fulfill the request.
This retrying will be disabled when the device
enters suspend and will resume after the device
exits from suspend.
Change-Id: I9e2c305754465eb458566c0224804c5ad4bda240
Signed-off-by: Ram Chandrasekar <rkumbako@codeaurora.org>
Update thermal driver to retry hotplug, when
device exits from suspend. This will ensure that
any failure to offline/online the cores during
suspend will be re-applied, when device exits
suspend.
CRs-Fixed: 823919
Change-Id: Ifc25ad61288d88f984b18fe51b9dd5776f650cf5
Signed-off-by: Ram Chandrasekar <rkumbako@codeaurora.org>
Update KTM to use scm_call() and scm_call2()instead
of scm_call_atomic1() and scm_call2_atomic()
respectively to avoid possible race condition.
CRs-fixed: 734431
Change-Id: Ibb81c4c15a47d1f66ffa38cb65481e3c48fcb065
Signed-off-by: Shiju Mathew <shijum@codeaurora.org>
During boot up polling mode mitigation, KTM handles psm code even if
feature is disabled. Add a check in psm code whether feature is enabled
or not before handling this.
Change-Id: I55d6ed43e829dbf8a35cf8af4a3ca28cfb10c013
Signed-off-by: Manaf Meethalavalappu Pallikunhi <manafm@codeaurora.org>
The skue is using the different battery thermistor and mapping table
from the default. A new scale function is needed to use this mapping
table in the thermal adc driver.
Change-Id: Ib154bafe821ceae33803efced3c15321a39f1dad
Signed-off-by: Chunmei Cai <ccai@codeaurora.org>
Update the driver to check the last read intensity
value for all sensors before enabling the interrupt.
Also clear the last read value before getting the
intensity value from trustzone. This will cover the
cases, where the trustzone read errored out.
Change-Id: Iac22078c0ba92704e2448670248e99880e133d08
Signed-off-by: Ram Chandrasekar <rkumbako@codeaurora.org>
Interpret missing devicetree property lmh-trim-err-offset as
there being no trim error.Some asics have no trim error.
Change-Id: I6760184b74b0dd8ace6220675eac8034ff8151c0
Signed-off-by: Jeff Bernard <jbernard@codeaurora.org>
[imaund@codeaurora.org: Resolved context conflicts]
Signed-off-by: Ian Maund <imaund@codeaurora.org>
Add a scale factor to scale the temperature and
set points for asics that have a different thermal
sensor accuracy.
On MSM Thulium temperature sensors report in deci degree
C while previous asics report in degree C. KTM expects
the temperature in C.
Change-Id: I1a94652de48e1fb69164dfc63764a346333ca849
Signed-off-by: Jeff Bernard <jbernard@codeaurora.org>
[imaund@codeaurora.org: Resolved context conflicts, updated
instances of hi_temp to high_temp]
Signed-off-by: Ian Maund <imaund@codeaurora.org>
Virtual and physical memory allocators may return buffers
that are at physical addresses higher than 4GB. When
passing addresses to TZ, don't assume otherwise. Fix the
code to not truncate down to 32 bits (the assignment operation
u64 = u32 = u64 truncates down 64 bit addresses to 32 bits)
unnecessarily; perform the assignment in two discrete steps
to allow the desc.args[X] field to store the full 64 bit
address.
Change-Id: I209b272fc47c91f3dec5ea9ab631fdb1d8c81fb9
Signed-off-by: Vikram Mulukutla <markivx@codeaurora.org>
Thermal can set tsens threshold even if the threshold
value is equal to the current temperature. This will
trigger a tsens notification immediately, which will
print a kernel message. If the temperature stays in
the current value then the emergency mitigation
messages will flood the kernel logs.
Use rate limit feature in printk to reduce the amount
of messages printed from thermal.
CRs-Fixed: 803110
Change-Id: I8fa62ac73421a80658e3696577c0086a27c1102a
Signed-off-by: Ram Chandrasekar <rkumbako@codeaurora.org>
Update the msmterbium TSENS type to read the on die temperature from
supported sensors.
Change-Id: I212b987d8cc709da57b3e0ff738be2e1e4b933c7
Signed-off-by: Rama Krishna Phani A <rphani@codeaurora.org>
Use CPU phandles to map the physical cores to the corresponding
logical cores for all cpu mask related nodes in KTM. This will
ensure KTM will mitigate even if a CPU is removed or the physical
to logical core mapping is altered.
Change-Id: Ic225c5079aca301cdaf85fa568c3d7329b9f1f63
Signed-off-by: Manaf Meethalavalappu Pallikunhi <manafm@codeaurora.org>
Modify to use cpu phandles to input cluster and
cpu mapping.
Use of static bit-mask wont work well with removing
cpus during run time. With the new implementation, KTM
using phandles, will try to map the physical cores to
the corresponding logical cores to establish the cluster
cpu mask.
Change-Id: Id1fa76be35c2c70bf0d98408bd3ae5fc4c108cbd
Signed-off-by: Ram Chandrasekar <rkumbako@codeaurora.org>
Update the msm8939 fuse map to accommodate the new TSENS
fuse bit allocations.
Change-Id: I1f19a216bb13f3b38be514c4abec478d6d045415
Signed-off-by: Rama Krishna Phani A <rphani@codeaurora.org>
Add support to parse calibration data from devicetree
and also add generic sensor calibration function.
Change-Id: I8e89813c7c37bc52a06d4cf59eeff62c83a6dd88
Signed-off-by: Maulik Shah <mkshah@codeaurora.org>
Fix concurrency issues when a read and new throttling
intensity value updation happens simultaneously.
Added a new return value in interrupt reset API to notify
the caller that the particular sensor is still throttling.
On receiving this error, the lmh interface driver should
not reset interrupt but try again to read the throttling
intensity value later.
Change-Id: I883e4c6b9438ff73d9451acc897b623db9c677cf
Signed-off-by: Ram Chandrasekar <rkumbako@codeaurora.org>
Return error when sensor polling is disabled when
it is still throttling. This case can occur due
to a race condition between the sensor value read
and sensor throttling value update.
Change-Id: I1e9a9fa97e0e4221752208cf139df05d6eedccbf
Signed-off-by: Ram Chandrasekar <rkumbako@codeaurora.org>
Fix NULL pointer dereference and possible array over flow
scenarios in SUPPLY_LM driver.
Change-Id: Id895ee97d0c45eb7f3e1e8017dfe6c399dbd76e8
Signed-off-by: Manaf Meethalavalappu Pallikunhi <manafm@codeaurora.org>
Add support to vote for HKADC LDO and HKADC LDO ok signal
if needed.
Change-Id: I92dcb8bf0495e93a8eaedabfbd82c3cc9a527f7c
Signed-off-by: Siddartha Mohanadoss <smohanad@codeaurora.org>
Remove reference to target number and rename the driver to a generic name.
Change-Id: I135b4d0fad0416ceb14bb21134964f1413f5b810
Signed-off-by: Maulik Shah <mkshah@codeaurora.org>
Existing thermal driver can mitigate the CPUs during
reboot scenario. Extend this feature to support CPU
shutdown and halt scenarios.
Change-Id: I40fa8960ed54b36409836a615dd04d7a829a278c
Signed-off-by: Ram Chandrasekar <rkumbako@codeaurora.org>
Introduce msm8952 as the official name for msmtellurium.
Change-Id: Iad17e670df9107d5d2ba144fd90f2dac9e476fce
Signed-off-by: Kaushal Kumar <kaushalk@codeaurora.org>
Multi-Zone Temperature Control (MTC) provides an interface to
clients to enable or disable thresholds for supported zone of sensors
and to get log of recent commands.
Change-Id: Idb4d2725241f5b95a93bbe9c6969067f68a6bc6d
Signed-off-by: Rama Krishna Phani A <rphani@codeaurora.org>
Add the calibration masks used to abstract the fuse
data needed to obtain the offsets for each of the sensors.
The offsets are used in the temperature calculations.
The temperature sensors (TSENS) provides an interface
to clients to read temperature and set temperature
thresholds.
Change-Id: Ie8e0b93eb45a2235aac9d539ca5f37c505336a2a
Acked-by: Jim Granitzki <jamesg@qti.qualcomm.com>
Signed-off-by: Venkatesh Yadav Abbarapu <quicvenkat@codeaurora.org>
Sensor manager APIs uses devm_kzalloc to allocate memory for
thresholds. If probe is deferred, device related memory releases.
Later during re-probe, driver doesn't re-initialize all thresholds
which was successsful during first probe, which causes unexpected
values in previously initialized thresholds. Revert devm_kzalloc and
devm_kfree to kzalloc and kfree respectively in sensor manager APIs.
Change-Id: If1f39274e97c201d542b02fd501dbf60fac87de9
Signed-off-by: Manaf Meethalavalappu Pallikunhi <manafm@codeaurora.org>
Update the msmtellurium fuse map to accommodate the
new TSENS fuse bit allocations.
Change-Id: I47758792ec146e47e7ada9e4af3d27ec9e2888bc
Signed-off-by: Rama Krishna Phani A <rphani@codeaurora.org>
Remove supply lm devices init and de-init from probe function.
Devices initialization happens only when user requests to enable it.
Cleanup driver code in the error path to avoid any unexpected
behaviour.
Change-Id: Id43a9118173d3cd192b6b91e2cb33fc34e2b0126
Signed-off-by: Manaf Meethalavalappu Pallikunhi <manafm@codeaurora.org>
Cancel sensor trip for both high and low thresholds and fix memory
leak in sensor_mgr_remove_threshold API. Modify sensor manager APIs
to use client device to allocate/release memory for thresholds
using devm_kzalloc and devm_kfree.
Change-Id: Icf3b0253d72441e192be5f87c04bdf94799bb036
Signed-off-by: Manaf Meethalavalappu Pallikunhi <manafm@codeaurora.org>
Additional per-sensor offets are being observed after factory
calibration.
Fuse-based correction factors are implemented to the existing 30 / 120
deg C calibration fuses
CRs-Fixed: 782238
Change-Id: Ib70e074782ae38ee164afcaa27d5868d87075457
Signed-off-by: Rama Krishna Phani A <rphani@codeaurora.org>
Optimize locking in thermal frequency mitigation thread
to reduce lock contention with hotplug mitigation thread.
This lock is not explicitly required since the cpu driver
already have a per cluster lock down the freqency mitigation
call path. This would be much optimized since the new changes
will hold the lock for a shorter period and unlike previously
where the lock was for entire cluster, this is per cluster
lock that will further reduce lock contention. This would
help thermal to do mitigation faster.
Change-Id: I192efa77df8ad9b128759f31300d4a64a558cc16
Signed-off-by: Shiju Mathew <shijum@codeaurora.org>
This driver is a current limit management module to help manage
instantaneous peak current drawn by multiple subsystems on shared
supply. The inputs to the mitigation algorithm are current states
of different subsystems sharing this supply like cpu frequency,
gpu frequency, number of cores online, soc temperature, core leakage,
and modem state. It throttles cpu frequency and limits number of
online cores to reduce the dynamic current so as to keep the total
current drawn from supply in safe limits.
Change-Id: I4592b8be48bad3709e8cfb09da53f23279a8ff9b
Signed-off-by: Manaf Meethalavalappu Pallikunhi <manafm@codeaurora.org>
Add support for device manager framework to KTM. Device manager allows
for aggregation of muliple kernel clients request on mitigation
devices. Clients can set and register for device change notifications.
Currently it supports hotplug device and cpuX (X= 0... NR_CPUS - 1)
devices.
Device manager framework exports below 3 APIs for a device for
clients to use.
1. struct device_clnt_data *devmgr_register_mitigation_client(
struct device *dev,
const char *device_name,
void (*callback)(struct device_clnt_data *,
union device_request *, void *))
API to register mitigation device. This API returns handle, which
should be used by clients when placing mitigation request.
It supports to register for device change notification with callback
as an optional parameter to client.
@dev: Client device structure.
@device_name: Mitgation device name which the client is interested
to mitigate.
@callback: Optional callback pointer for device change notification,
otherwise pass NULL.
Returns client handle structure for that device on success, or NULL
with IS_ERR() condition containing error number.
2. int devmgr_client_request_mitigation(struct device_clnt_data *clnt,
enum device_req_type type,
union device_request *req);
API for clients to set valid mitigation for a registered device.
@clnt: Client handle for device.
@type: Type of device request populated above.
@req: Valid mitigation request.
Returns zero on successful mitigation update or
negative error number.
3. void devmgr_unregister_mitigation_client(
struct device *dev,
struct device_clnt_data *clnt)
API for clients to unregister for a device whenever it is done with
device.
@dev: Client device structure.
@clnt: Client handle for device.
Change-Id: Ieda99577a035a32b745df6b004b5487a55ec70ac
Signed-off-by: Manaf Meethalavalappu Pallikunhi <manafm@codeaurora.org>
Add and export sensor manager framework APIs for kernel clients
who are interested in thermal sensors. Sensor manager allows
multiple clients to set and get notification for a threshold.
Clients can also use multiple sensors to trigger a single
mitigation action.
Below are main sensor manager APIs to monitor sensor thresholds.
1.int sensor_mgr_init_threshold(struct threshold_info *thresh_inp,
int sensor_id, int32_t high_temp,
int32_t low_temp,
void (*callback)(struct therm_threshold *))
API to initialize thresholds data structure for sensor(s) with high
and low thresholds and threshold callback.
@thresh_inp: Client threshold data structure.
@sensor_id: Sensor h/w ID to be monitored. Use MONITOR_ALL_TSENS to
monitor all temperature sensor.
@high_temp: Trigger threshold value for sensor_id or all sensors.
@low_temp: Clear threshold value for sensor_id or all sensors.
@callback: Callback pointer for threshold notification.
Returns zero on success, negative error number on failure.
2.int sensor_mgr_set_threshold(uint32_t zone_id,
struct sensor_threshold *threshold)
It sets thermal threshold trips for a sensor.
@zone_id: Thermal zone id for the sensor.
@threshold: Threshold info for the sensor.
Returns which threshold is set on success, negative error number
on failure. MACRO IS_HI_THRESHOLD_SET/IS_LOW_THRESHOLD_SET can be
used to decipher which threshold being set.
3.int sensor_mgr_convert_id_and_set_threshold(
struct threshold_info *thresh_inp)
It accepts sensor HW id, converts it to sensor zone id and sets
thermal threshold for those sensors listed in threshold info.
@thresh_inp: Client threshold data structure.
Returns zero on success, negative error number on failure.
4.void sensor_mgr_remove_threshold(struct threshold_info *thresh_inp)
It cancels threshold notification and removes threshold from sensor
manager threshold list.
@thresh_inp: Threshold info which needs to be removed.
Change-Id: I916104bde472bd9b45bdb66d81b09cd850e11fba
Signed-off-by: Manaf Meethalavalappu Pallikunhi <manafm@codeaurora.org>
Add LMH Lite ftraces for the LMH Lite event.
Ftraces are added to events like,
1. SCM call entry and exit
2. Trim error event
3. LMH interrupt trigger and clear event
4. LMH sensor interrupt event with intensity value
5. LMH sensor intensity reading
Change-Id: I2bc0c31fab751f0ee23b52e7d978a90d20a0eea1
Signed-off-by: Ram Chandrasekar <rkumbako@codeaurora.org>
This reverts commit 383ac33a1e.
The temperature sensor drivers registering with thermal
core framework can call the thermal_sensor_trip() API in
interrupt context. This might cause potential thermal
reset issues because the interrupt might be disabled till
this API returns.
Change-Id: I8d6dfc55386fbdea8e51e7abbb0e7632208c6c38
Signed-off-by: Ram Chandrasekar <rkumbako@codeaurora.org>
Add separate threads for sysfs notify. This is required
so that any thermal trip is not blocked while handling
sysfs notify.
Change-Id: Ifee206c29fd1b3c226a342b7f048250d5062397e
Signed-off-by: Shiju Mathew <shijum@codeaurora.org>
Add RT priority to KTM hotplug mitigation thread. This
is required since we have seen cases where the thread
is not scheduled fast enough during high temperature rampup
that lead to thermal runaway. So this change would make sure
the thermal hotplug mitigation thread gets high priority
and mitigate core as soon as a temperature threshold is triggered.
Change-Id: I72ecf69ede0444fe74fd9c4eaf40a12e8734326c
Signed-off-by: Shiju Mathew <shijum@codeaurora.org>
Update registering the TSENS IRQ with request_threaded_irq()
instead of request_irq() to execute checking for the sensors
threshold. This is done to run with SCHED_FIFO and MAX_RT_PRIO/2
by default which request_threaded_irq() provides on the
threaded function to improve the response to notify clients
for temperature threshold crossing. Use the IRQF_ONESHOT flag
while registering the interrupt to keep the irq line at the
interrupt controller disabled until the threaded handler has been run.
Change-Id: I9dec7a21719a0a6a6f0bcbac3221b4a4bfdca322
Signed-off-by: Siddartha Mohanadoss <smohanad@codeaurora.org>
Track cores onlined by system prior to registering for cpu notifier
callbacks by copying cpu online mask. Use core up and down notfiers to
track cores being previously online when registered via cpu notifier.
Cores enabled by thermal driver to read cpu freq table are not counted
as previously enabled unless they were enabled by some external driver
and this was previously detected by the methods described earlier.
CRs-fixed: 772172
Change-Id: I7f3a53544d336d44644ad00ac1728f5a89b9e056
Signed-off-by: Jeff Bernard <jbernard@codeaurora.org>
Program the thresholds every time regardless so we guarantee
the threshold is programmed. Previous code didn't reprogram
the threshold if it was already believed to be set. This
check can be wrong is some cornor cases.
Change-Id: Ie94cb40302c585b2b779da57ad70d32cc2445c96
Signed-off-by: Jeff Bernard <jbernard@codeaurora.org>
Lock the sensor threshold list during notifications so it
isn't updated until notifications are sent out nor can
something else update thresholds until all notifications
are sent out.
Change-Id: Iafce75fa7fceda3de867044861e4a2e3eef47c95
Signed-off-by: Jeff Bernard <jbernard@codeaurora.org>
Add support in KTM driver to intimate EA driver
the current status of core frequency mitigation.
This is required for scheduler to optimize core
migration.
Change-Id: I6f5c3f7a7fe8656d6c6185ce23bce232c129c3c4
Signed-off-by: Shiju Mathew <shijum@codeaurora.org>
-Add debug count to the ISR and workqueue patch with timestamp.
-Log the last 10 samples of temperature read for each sensor.
Change-Id: Icc2e3809460eb382bbc1e6b2549706b9b21f9994
Signed-off-by: Siddartha Mohanadoss <smohanad@codeaurora.org>
Update TSENS IRQ to level trigger instead of using
edge trigger interrupt.
When a sensors temperature threshold is crossed the
controller asserts a level trigger. This level goes
low when the Upper/Lower status threshold is masked.
However, if another sensor threshold is crossed while we
are in the middle of servicing the previous sensors
threshold crossing in the workqueue the new sensors
threshold crossing will be missed as the interrupt level
remains high. Fix it by registering the interrupt as a
level interrupt, disable the interrupt in the
handler and enable it while we exit from the workqueue.
CRs-Fixed: 768227
Change-Id: I7b3f38afd8acb2903f85dcc23e1bfe70d7d9059a
Signed-off-by: Siddartha Mohanadoss <smohanad@codeaurora.org>
This patch fix failure to read LMh lite sensor from
TZ caused by out-of-order access. The change will
make the memory strongly ordered.
Change-Id: I868165ace6cd28010eb8d274d08a4b241535e3d2
Signed-off-by: Shiju Mathew <shijum@codeaurora.org>
MSM8992 has 13 sensors. Update the fusemap and physical
sensor mapping to accomodate change to read the corresponding
sensors offset for temperature calculation.
Change-Id: Ibd42d37d378762614f2b2840a6799b7ca2f20594
Signed-off-by: Siddartha Mohanadoss <smohanad@codeaurora.org>
KTM checks cpu topology info for all targets irrespective of
cluster or non cluster targets which will leads unexpected behaviour
for non cluster targets. Configure cluster related info only if
"qcom,synchronous-cluster-id" DT node is defined.
Change-Id: Icb460c40f9d3d1733aabe635f0f42bbedad17a81
Signed-off-by: Manaf Meethalavalappu Pallikunhi <manafm@codeaurora.org>
Add support to notify the userspace through sysfs
notification when a userspace threshold is crossed.
Change-Id: Ifdea7f15f288d1dca5365aedad16d1bdbc80be6c
Signed-off-by: Ram Chandrasekar <rkumbako@codeaurora.org>
Remove sysfs notification from tsens driver. Thermal core
framework will be the right place to determine the
userspace threshold trip and do a sysfs notify.
Change-Id: I14be7a01074ce4e9f6d309424115cbebd2e2b6cf
Signed-off-by: Ram Chandrasekar <rkumbako@codeaurora.org>
Introduce mdm9640 as the official name for msmzirc.
Update msm-tsens and clock-a7 bindings to make checkpatch happy along with
renaming.
Change-Id: I364cc0feab4cf4a1bac03dc08eec0214e09f40f7
Signed-off-by: Joonwoo Park <joonwoop@codeaurora.org>
Add RT priority to KTM frequency mitigation thread. This
is required since we have seen cases where this thread
is not scheduled fast enough during high temperature rampup
that lead to thermal runaway. So this change would make sure
the thermal frequency mitigation thread gets high priority
and mitigate core as soon as a temperature threshold is triggered.
Change-Id: Ie8a6fd80fb8e9bdb894a26a8bf7abd159a3f3bce
Signed-off-by: Shiju Mathew <shijum@codeaurora.org>
Add reboot notify in KTM to do mitigation actions during
reboot. This would prevent from triggering PS_HOLD resets.
Currently the callback does core frequency mitigation to
minimum frequency support by a core.
Change-Id: I3294e60107d4f120f608fb8af7a6648e310e89a1
Signed-off-by: Shiju Mathew <shijum@codeaurora.org>
Add memory barrier before reading data from trustzone
to make sure LMH driver doesnt fails because of
reading the data in out of order execution.
CRs-Fixed: 759855
Change-Id: Id2e917bf8100fc2f775186d8db630a39089337a2
Signed-off-by: Ram Chandrasekar <rkumbako@codeaurora.org>
Remove the error check for the input low trip less
than the high trip value. Thermal core framework
handles multiple clients and there is a possibility
where high trip is less than low trip. In this
case, tsens driver should proceed further.
Change-Id: Ifa8b7898f36c75468ebf8b3ea027b34a7ff75734
Signed-off-by: Ram Chandrasekar <rkumbako@codeaurora.org>
Skip thermal late init if thermal probe has not
completed since all the tasks in late init depend
on successful completion of thermal probe.
Change-Id: Iab763b80d2c878dd57a2401c92799c2534b349d2
Signed-off-by: Shiju Mathew <shijum@codeaurora.org>
Move the logs that give information about the LMH
interrupt and the LMH sensors to debug log level.
Change-Id: I69291334e05a16400174bbcbaf53ef1e848b2745
Signed-off-by: Ram Chandrasekar <rkumbako@codeaurora.org>
The sensor remove API already has semaphore locks
to protect the critical section access. Update the
calls, where this sensor remove API was called inside
the critical section leading to potential deadlock.
CRs-Fixed: 754828
Change-Id: Ia838843ae9d5202b347791df887616c65816f35e
Signed-off-by: Ram Chandrasekar <rkumbako@codeaurora.org>