diff options
author | Mark M. Hoffman <mhoffman@lightlink.com> | 2007-01-08 22:11:29 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.osdl.org> | 2007-01-09 12:07:52 -0500 |
commit | 2f5c33b3180169f3eafb698b66686962d637fb0e (patch) | |
tree | 6272503c1072c41181a1e00301508d3f845816ef /drivers/pci/quirks.c | |
parent | efa06708fe77190f31bed5c3cb5da49e211240f5 (diff) |
[PATCH] i2c/pci: fix sis96x smbus quirk once and for all
The sis96x SMBus PCI device depends on two different quirks to run
in a specific order. Apart from being fragile, this was found to
actually break on (at least) recent FC4, FC5, and FC6 kernels. This
patch fixes the quirks so that they work without relying on the
compiler and/or linker to put them in any specific order.
http://lists.lm-sensors.org/pipermail/lm-sensors/2006-April/015962.html
https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=189719
I tested this patch.
Signed-off-by: Mark M. Hoffman <mhoffman@lightlink.com>
Cc: Andrew Morton <akpm@osdl.org>
Cc: Adrian Bunk <bunk@stusta.de>
Cc: Greg K-H <greg@kroah.com>
Cc: Jean Delvare <khali@linux-fr.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'drivers/pci/quirks.c')
-rw-r--r-- | drivers/pci/quirks.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/drivers/pci/quirks.c b/drivers/pci/quirks.c index 8f0322d6f3bf..0535efc4f184 100644 --- a/drivers/pci/quirks.c +++ b/drivers/pci/quirks.c | |||
@@ -1117,10 +1117,11 @@ DECLARE_PCI_FIXUP_RESUME(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_ICH6_1, asus_h | |||
1117 | static void quirk_sis_96x_smbus(struct pci_dev *dev) | 1117 | static void quirk_sis_96x_smbus(struct pci_dev *dev) |
1118 | { | 1118 | { |
1119 | u8 val = 0; | 1119 | u8 val = 0; |
1120 | printk(KERN_INFO "Enabling SiS 96x SMBus.\n"); | ||
1121 | pci_read_config_byte(dev, 0x77, &val); | ||
1122 | pci_write_config_byte(dev, 0x77, val & ~0x10); | ||
1123 | pci_read_config_byte(dev, 0x77, &val); | 1120 | pci_read_config_byte(dev, 0x77, &val); |
1121 | if (val & 0x10) { | ||
1122 | printk(KERN_INFO "Enabling SiS 96x SMBus.\n"); | ||
1123 | pci_write_config_byte(dev, 0x77, val & ~0x10); | ||
1124 | } | ||
1124 | } | 1125 | } |
1125 | 1126 | ||
1126 | /* | 1127 | /* |
@@ -1152,11 +1153,12 @@ static void quirk_sis_503(struct pci_dev *dev) | |||
1152 | printk(KERN_WARNING "Uncovering SIS%x that hid as a SIS503 (compatible=%d)\n", devid, sis_96x_compatible); | 1153 | printk(KERN_WARNING "Uncovering SIS%x that hid as a SIS503 (compatible=%d)\n", devid, sis_96x_compatible); |
1153 | 1154 | ||
1154 | /* | 1155 | /* |
1155 | * Ok, it now shows up as a 96x.. The 96x quirks are after | 1156 | * Ok, it now shows up as a 96x.. run the 96x quirk by |
1156 | * the 503 quirk in the quirk table, so they'll automatically | 1157 | * hand in case it has already been processed. |
1157 | * run and enable things like the SMBus device | 1158 | * (depends on link order, which is apparently not guaranteed) |
1158 | */ | 1159 | */ |
1159 | dev->device = devid; | 1160 | dev->device = devid; |
1161 | quirk_sis_96x_smbus(dev); | ||
1160 | } | 1162 | } |
1161 | 1163 | ||
1162 | static void __init quirk_sis_96x_compatible(struct pci_dev *dev) | 1164 | static void __init quirk_sis_96x_compatible(struct pci_dev *dev) |