mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] thermal: rockchip: fixes the conversion table
@ 2017-01-05  4:37 Caesar Wang
  0 siblings, 0 replies; only message in thread
From: Caesar Wang @ 2017-01-05  4:37 UTC (permalink / raw)
  To: edubezval
  Cc: rui.zhang, linux-rockchip, linux-pm, linux-kernel, heiko,
	randy.li, ayaka, Caesar Wang

As Ayaka reported the thermal was abormal on rk3288 at booting time.
thermal thermal_zone1: critical temperature reached(125 C),shutting down
thermal thermal_zone2: critical temperature reached(125 C),shutting down
thermal thermal_zone1: critical temperature reached(125 C),shutting down
thermal thermal_zone2: critical temperature reached(125 C),shutting down
...
The root caused by reading the invald analogic value, the value is zero
will convert the 125 degree to trigger the critical temperature.
Fixes it with insteading of the incorrect reading now.

Fixes commit cadf29dc2a8bcaae83
("thermal: rockchip: optimize the conversion table")

Reported-by: ayaka <ayaka@soulik.info>
Signed-off-by: Caesar Wang <wxt@rock-chips.com>
---

 drivers/thermal/rockchip_thermal.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/thermal/rockchip_thermal.c b/drivers/thermal/rockchip_thermal.c
index cbbf0ce..4c77965 100644
--- a/drivers/thermal/rockchip_thermal.c
+++ b/drivers/thermal/rockchip_thermal.c
@@ -464,7 +464,7 @@ static int rk_tsadcv2_code_to_temp(const struct chip_tsadc_table *table,
 	switch (table->mode) {
 	case ADC_DECREMENT:
 		code &= table->data_mask;
-		if (code < table->id[high].code)
+		if (code <= table->id[high].code)
 			return -EAGAIN;		/* Incorrect reading */
 
 		while (low <= high) {
-- 
2.7.4

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2017-01-05  4:38 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-01-05  4:37 [PATCH] thermal: rockchip: fixes the conversion table Caesar Wang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®