Skip to contentSkip to conversation

hwmon: fix temp fault in dme1737 driver

PATCH Superseded Juerg Haefliger 2 participants 3 messages Jul 17, 2007 – Jul 20, 2007

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 hwmon: fix temp fault in dme1737 driver

Fix temp?_fault attribute. The temp was incorrectly compared against 0x0800 rather than 0x8000.

Signed-off-by Juerg Haefliger <juergh at gmail.com>

Fix temp?_fault attribute. The temp was incorrectly compared against 0x0800 rather than 0x8000.

Signed-off-by Juerg Haefliger <juergh at gmail.com>

---

drivers/hwmon/dme1737.c +1 -1
Index: linux-2.6/drivers/hwmon/dme1737.c
===================================================================
@@ -750,7 +750,7 @@
 		res = (data->alarms >> DME1737_BIT_ALARM_TEMP[ix]) & 0x01;
 		break;
 	case SYS_TEMP_FAULT:
-		res = (data->temp[ix] == 0x0800);
+		res = (data->temp[ix] == (s16)0x8000);
 		break;
 	default:
 		res = 0;

_______________________________________________
lm-sensors mailing list
[email protected]
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors

#1 lore raw

Hi Juerg,

Quoted 4 lines · Juerg Haefliger

Fix temp?_fault attribute. The temp was incorrectly compared against 0x0800 rather than 0x8000.

Signed-off-by Juerg Haefliger <juergh at gmail.com>

Have you verified that this works as intended in practice? The datasheet says that "a diode fault condition forces the diode reading register to a value of 80h", which leaves some doubt on whether the 4 LSBs, which live in a different register, are set to 0 as well or not. So I wonder if:

	res = ((data->temp[ix] & 0xff00) = (s16)0x8000);

wouldn't be a better test.

Signature · 6 lines
Jean Delvare

_______________________________________________
lm-sensors mailing list
[email protected]
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors
#2 lore raw
In reply to Juerg Haefliger

Hi Jean,

Quoted 14 lines

Hi Juerg,

Quoted 4 lines · Juerg Haefliger

Fix temp?_fault attribute. The temp was incorrectly compared against 0x0800 rather than 0x8000.

Signed-off-by Juerg Haefliger <juergh at gmail.com>

Have you verified that this works as intended in practice? The datasheet says that "a diode fault condition forces the diode reading register to a value of 80h", which leaves some doubt on whether the 4 LSBs, which live in a different register, are set to 0 as well or not. So I wonder if:

Quoted 3 lines
        res = ((data->temp[ix] & 0xff00) = (s16)0x8000);

wouldn't be a better test.

Yes I tested it but you have a valid point. I like your solution better, it's safer.

...juerg

Quoted 3 lines

--
Jean Delvare

_______________________________________________
lm-sensors mailing list
[email protected]
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors