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>pull/10/head
parent
5528107317
commit
ff29eef539
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue