From 50332445df5d6f089d5687dab0afac37ee33f03c Mon Sep 17 00:00:00 2001 From: Linus Torvalds Date: Wed, 29 Oct 2003 19:03:38 -0800 Subject: [PATCH] Stop SIS 96x chips from lying about themselves. Some machines with the SIS 96x southbridge have it set up to claim it is a SIS 503 chip. That breaks irq routing logic among other things. Fix it properly by making everybody aware of the duplicity. --- drivers/pci/quirks.c | 26 ++++++++++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-) diff --git a/drivers/pci/quirks.c b/drivers/pci/quirks.c index 0fe0f7656939b..8c3777dc82473 100644 --- a/drivers/pci/quirks.c +++ b/drivers/pci/quirks.c @@ -750,13 +750,35 @@ static void __init quirk_sis_96x_smbus(struct pci_dev *dev) * bridges pretend to be 85C503/5513 instead. In that case see if we * spotted a compatible north bridge to make sure. * (pci_find_device doesn't work yet) + * + * We can also enable the sis96x bit in the discovery register.. */ static int __devinitdata sis_96x_compatible = 0; +#define SIS_DETECT_REGISTER 0x40 + static void __init quirk_sis_503_smbus(struct pci_dev *dev) { - if (sis_96x_compatible) - quirk_sis_96x_smbus(dev); + u8 reg; + u16 devid; + + pci_read_config_byte(dev, SIS_DETECT_REGISTER, ®); + pci_write_config_byte(dev, SIS_DETECT_REGISTER, reg | (1 << 6)); + pci_read_config_word(dev, PCI_DEVICE_ID, &devid); + if ((devid & 0xfff0) != 0x0960) { + pci_write_config_byte(dev, SIS_DETECT_REGISTER, reg); + return; + } + + /* Make people aware that we changed the config.. */ + printk(KERN_WARNING "Uncovering SIS%x that hid as a SIS503 (compatible=%d)\n", devid, sis_96x_compatible); + + /* + * Ok, it now shows up as a 96x.. The 96x quirks are after + * the 503 quirk in the quirk table, so they'll automatically + * run and enable things like the SMBus device + */ + dev->device = devid; } static void __init quirk_sis_96x_compatible(struct pci_dev *dev) -- 2.53.0