Skip to content

Commit

Permalink
thermal: exynos: Reduce severity of too early temperature read
Browse files Browse the repository at this point in the history
Thermal core tries to read temperature during sensor registering in
thermal_zone_of_sensor_register().  In that time Exynos TMU driver and
hardware are not yet initialized.  Commit 0eb875d ("thermal:
exynos: Reading temperature makes sense only when TMU is turned on")
added a boolean flag to prevent reading bogus temperature in such
case but it exposed warning message during boot:
	[    3.864913] thermal thermal_zone0: failed to read out thermal zone (-22)

Return EAGAIN in such case to skip omitting such message because it
might mislead user.

Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
Acked-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
Signed-off-by: Eduardo Valentin <edubezval@gmail.com>
  • Loading branch information
Krzysztof Kozlowski authored and Eduardo Valentin committed Jun 1, 2018
1 parent 45f8b0d commit ffe6e16
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion drivers/thermal/samsung/exynos_tmu.c
Original file line number Diff line number Diff line change
Expand Up @@ -666,8 +666,14 @@ static int exynos_get_temp(void *p, int *temp)
struct exynos_tmu_data *data = p;
int value, ret = 0;

if (!data || !data->tmu_read || !data->enabled)
if (!data || !data->tmu_read)
return -EINVAL;
else if (!data->enabled)
/*
* Called too early, probably
* from thermal_zone_of_sensor_register().
*/
return -EAGAIN;

mutex_lock(&data->lock);
clk_enable(data->clk);
Expand Down

0 comments on commit ffe6e16

Please sign in to comment.