i2c-nforce2: Disable the second SMBus channel on the DFI Lanparty NF4 Expert

There is a strange chip at 0x2e on the second SMBus channel of the
DFI Lanparty NF4 Expert motherboard. Accessing the chip reboots the
system. As there's nothing interesting on this SMBus channel, the
easiest and safest thing to do is to disable it on that board.

This is a better fix to bug #5889 than the it87 driver update that was
done originally:
http://bugzilla.kernel.org/show_bug.cgi?id=5889

Signed-off-by: Jean Delvare <khali@linux-fr.org>

authored by Jean Delvare and committed by Jean Delvare 08851d6e 710cf7e7

+24 -4
+24 -4
drivers/i2c/busses/i2c-nforce2.c
··· 50 50 #include <linux/init.h> 51 51 #include <linux/i2c.h> 52 52 #include <linux/delay.h> 53 + #include <linux/dmi.h> 53 54 #include <asm/io.h> 54 55 55 56 MODULE_LICENSE("GPL"); ··· 109 108 110 109 /* Misc definitions */ 111 110 #define MAX_TIMEOUT 100 111 + 112 + /* We disable the second SMBus channel on these boards */ 113 + static struct dmi_system_id __devinitdata nforce2_dmi_blacklist2[] = { 114 + { 115 + .ident = "DFI Lanparty NF4 Expert", 116 + .matches = { 117 + DMI_MATCH(DMI_BOARD_VENDOR, "DFI Corp,LTD"), 118 + DMI_MATCH(DMI_BOARD_NAME, "LP UT NF4 Expert"), 119 + }, 120 + }, 121 + { } 122 + }; 112 123 113 124 static struct pci_driver nforce2_driver; 114 125 ··· 380 367 smbuses[0].base = 0; /* to have a check value */ 381 368 } 382 369 /* SMBus adapter 2 */ 383 - res2 = nforce2_probe_smb(dev, 5, NFORCE_PCI_SMB2, &smbuses[1], "SMB2"); 384 - if (res2 < 0) { 385 - dev_err(&dev->dev, "Error probing SMB2.\n"); 386 - smbuses[1].base = 0; /* to have a check value */ 370 + if (dmi_check_system(nforce2_dmi_blacklist2)) { 371 + dev_err(&dev->dev, "Disabling SMB2 for safety reasons.\n"); 372 + res2 = -EPERM; 373 + smbuses[1].base = 0; 374 + } else { 375 + res2 = nforce2_probe_smb(dev, 5, NFORCE_PCI_SMB2, &smbuses[1], 376 + "SMB2"); 377 + if (res2 < 0) { 378 + dev_err(&dev->dev, "Error probing SMB2.\n"); 379 + smbuses[1].base = 0; /* to have a check value */ 380 + } 387 381 } 388 382 if ((res1 < 0) && (res2 < 0)) { 389 383 /* we did not find even one of the SMBuses, so we give up */