summaryrefslogtreecommitdiff
path: root/drivers/thermal
diff options
context:
space:
mode:
authorAnson Huang <Anson.Huang@nxp.com>2017-08-30 10:42:07 +0800
committerJason Liu <jason.hui.liu@nxp.com>2019-02-12 10:28:19 +0800
commit14067eaa05669330709c70238a2f61e279cd9697 (patch)
treecf02cdb8a042d5d0d251313f07e448447b760127 /drivers/thermal
parent614f8ca3cf8bcbd464ca4282c6f2f43b2255e2c0 (diff)
MLK-16300 thermal: imx: avoid error message of get_temp when thermal zone is off
For i.MX system controller thermal, when some of the thermal zones are powered off, the get temp will fail, and thermal driver will return CPU thermal zone's temp instead. But current driver will return A53 cluster for all cases, and A53 cluster may be also off when booting up A72 cluster only, so below error message will come out: [ 475.606431] read temp sensor:0 failed [ 475.610107] thermal thermal_zone0: failed to read out thermal zone (-22) To avoid this error, for the case of thermal zones power off, thermal driver can return current thread's CPU cluster temperature. Signed-off-by: Anson Huang <Anson.Huang@nxp.com> Reviewed-by: Bai Ping <ping.bai@nxp.com>
Diffstat (limited to 'drivers/thermal')
-rw-r--r--drivers/thermal/imx_sc_thermal.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/drivers/thermal/imx_sc_thermal.c b/drivers/thermal/imx_sc_thermal.c
index 90c5c2500885..c956e420d395 100644
--- a/drivers/thermal/imx_sc_thermal.c
+++ b/drivers/thermal/imx_sc_thermal.c
@@ -58,11 +58,12 @@ static int imx_sc_tsens_get_temp(void *data, int *temp)
SC_C_TEMP, &celsius, &tenths);
/*
* if the SS power domain is down, read temp will fail, so
- * we can return the temp of A53 CPU domain instead.
+ * we can return the temp of CPU domain instead.
*/
if (sciErr != SC_ERR_NONE) {
- sciErr = sc_misc_get_temp(tsens_ipcHandle, sensor_hw_id[0],
- SC_C_TEMP, &celsius, &tenths);
+ sciErr = sc_misc_get_temp(tsens_ipcHandle,
+ sensor_hw_id[topology_physical_package_id(smp_processor_id())],
+ SC_C_TEMP, &celsius, &tenths);
if (sciErr != SC_ERR_NONE) {
pr_err("read temp sensor:%d failed\n", sensor->hw_id);
return -EINVAL;