Skip to contentSkip to conversation

PATCH: hwmon-lm78-detect-isa-with-chipid-0x20.patch

lm-sensors Hans de Goede 3 participants 3 messages Jul 24, 2007 – Jul 25, 2007

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

Mark,

Here is a small but important bugfix to the lm78 driver. I found out about this problem because a Fedora user filed a bug that the lm78 driver no longer worked on his system: https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=249428

The problem is that sometime ago the isa lm78 detection was made more stringent and this new code now checks the chip-id, but does not accept a chip-id of 20h, however a chip-id of 20h is valid, and is excepted in the main probe function of the driver, see line 551. This fixed also makes the isa detection code accept the chip-id of 0x20 fixing this issue.

Please include this in the next batch to be send to Linus so that it will get into 2.6.23, this is a regression rendering the lm78 driver not working in certain cases.

Regards,

Hans

Mark,

Here is a small but important bugfix to the lm78 driver. I found out about this problem because a Fedora user filed a bug that the lm78 driver no longer worked on his system: https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=249428

The problem is that sometime ago the isa lm78 detection was made more stringent and this new code now checks the chip-id, but does not accept a chip-id of 20h, however a chip-id of 20h is valid, and is excepted in the main probe function of the driver, see line 551. This fixed also makes the isa detection code accept the chip-id of 0x20 fixing this issue.

drivers/hwmon/lm78.c renamed from drivers/hwmon/lm78.c~ +1 -1
diff -up linux-2.6.22.x86_64/drivers/hwmon/lm78.c~ linux-2.6.22.x86_64/drivers/hwmon/lm78.c
@@ -864,7 +864,7 @@ static int __init lm78_isa_found(unsigne
 	/* Determine the chip type */
 	outb_p(LM78_REG_CHIPID, address + LM78_ADDR_REG_OFFSET);
 	val = inb_p(address + LM78_DATA_REG_OFFSET);
-	if (val == 0x00			/* LM78 */
+	if (val == 0x00 || val == 0x20	/* LM78 */
 	 || val == 0x40			/* LM78-J */
 	 || (val & 0xfe) == 0xc0)	/* LM79 */
 		found = 1;

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

#1 lore raw

Hi Hans:

Quoted 17 lines · Hans de Goede

Mark,

Here is a small but important bugfix to the lm78 driver. I found out about this problem because a Fedora user filed a bug that the lm78 driver no longer worked on his system: https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id$9428

The problem is that sometime ago the isa lm78 detection was made more stringent and this new code now checks the chip-id, but does not accept a chip-id of 20h, however a chip-id of 20h is valid, and is excepted in the main probe function of the driver, see line 551. This fixed also makes the isa detection code accept the chip-id of 0x20 fixing this issue.

diff -up linux-2.6.22.x86_64/drivers/hwmon/lm78.c~ linux-2.6.22.x86_64/drivers/hwmon/lm78.c

drivers/hwmon/lm78.c static int __init lm78_isa_found(unsigne · line 870

Quoted 8 lines
drivers/hwmon/lm78.c renamed from drivers/hwmon/lm78.c~ +1 -1
@@ -864,7 +864,7 @@ static int __init lm78_isa_found(unsigne
 	/* Determine the chip type */
 	outb_p(LM78_REG_CHIPID, address + LM78_ADDR_REG_OFFSET);
 	val = inb_p(address + LM78_DATA_REG_OFFSET);
-	if (val = 0x00			/* LM78 */
+	if (val = 0x00 || val = 0x20	/* LM78 */
 	 || val = 0x40			/* LM78-J */
 	 || (val & 0xfe) = 0xc0)	/* LM79 */
 		found = 1;

Applied to testing, thanks.

Regards,

Signature · 8 lines
Mark M. Hoffman
[email protected]


_______________________________________________
lm-sensors mailing list
[email protected]
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors
Acked-by
#2 lore raw
In reply to Hans de Goede
Quoted 5 lines · Hans de Goede

Here is a small but important bugfix to the lm78 driver. I found out about this problem because a Fedora user filed a bug that the lm78 driver no longer worked on his system:
https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id$9428

Quoted 8 lines

The problem is that sometime ago the isa lm78 detection was made more stringent and this new code now checks the chip-id, but does not accept a chip-id of 20h, however a chip-id of 20h is valid, and is excepted in the main probe function of the driver, see line 551. This fixed also makes the isa detection code accept the chip-id of 0x20 fixing this issue.

--
Jean Delvare

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