VIA IRQ quirk fixup only in XT-PIC mode Take 3

From: Sergio Monteiro Basto
Date: Sun Sep 03 2006 - 20:47:08 EST


Hi, this patch (now for 2.6.18-rc5).


I found, on my new VIA with IO-APIC working well, that quirks aren't
good/needed.
After, I found this interesting email http://lkml.org/lkml/2005/8/13/30
by Karsten Wiese, after, Alan Cox writes this
http://lkml.org/lkml/2005/8/16/160 (on same thread) and Karsten Wiese
end ups with the solution on http://lkml.org/lkml/2005/8/18/92, which I
want try to implement.
I have 2 VIAs with almost same IDs (others reporters have
with exactly the same IDs) and in ones I need the quirks and in others
don't, because one don't have APIC enabled, the other have it !?!

we have other reported of the same problem
http://lkml.org/lkml/2006/7/30/59
and
http://lkml.org/lkml/2006/9/1/106

Checking my emails that I send to Len Brown on May of 2005 about this
subject. I found, what I want, is just revert one patch of Bjorn
Helgaas, between kernel 2.6.12-rc5 and 6.14.
Check this out
http://sourceforge.net/mailarchive/message.php?msg_id=11858102

To finish I want put clear, the great work of Bjorn Helgaas which have
made all of this, but at the end, I suspect with one false positive
report introduce this regression, that I hopefully found.

Thanks,
I aspect all of you, your positive vote.

--
Sérgio M. B.

Cc: len.brown@xxxxxxxxx
Cc: bjorn.helgaas@xxxxxx
Cc: Daniel Drake <dsd@xxxxxxxxxx>
Cc: Alan Cox <alan@xxxxxxxxxxxxxxxxxxx>
Cc: "Scott J. Harmon" <harmon@xxxxxxx>
Cc: Andrew Morton <akpm@xxxxxxxx>
Cc: Chris Wedgwood <cw@xxxxxxxx>
Cc: Greg KH <greg@xxxxxxxxx>
Signed-off-by: Sergio Monteiro Basto <sergio@xxxxxxxxxxxxxxxxxx
diff linux-2.6.17.x86_64/drivers/pci/quirks.c.orig linux-2.6.17.x86_64/drivers/pci/quirks.c -up
--- linux-2.6.17.x86_64/drivers/pci/quirks.c.orig 2006-09-04 01:37:09.000000000 +0100
+++ linux-2.6.17.x86_64/drivers/pci/quirks.c 2006-09-04 01:40:16.000000000 +0100
@@ -654,22 +654,24 @@ static void quirk_via_irq(struct pci_dev
{
u8 irq, new_irq;

+#ifdef CONFIG_X86_IO_APIC
+ if (nr_ioapics && !skip_ioapic_setup)
+ return;
+#endif
+#ifdef CONFIG_ACPI
+ if (acpi_irq_model != ACPI_IRQ_MODEL_PIC)
+ return;
+#endif
new_irq = dev->irq & 0xf;
pci_read_config_byte(dev, PCI_INTERRUPT_LINE, &irq);
if (new_irq != irq) {
- printk(KERN_INFO "PCI: VIA IRQ fixup for %s, from %d to %d\n",
+ printk(KERN_INFO "PCI: VIA PIC IRQ fixup for %s, from %d to %d\n",
pci_name(dev), irq, new_irq);
udelay(15); /* unknown if delay really needed */
pci_write_config_byte(dev, PCI_INTERRUPT_LINE, new_irq);
}
}
-DECLARE_PCI_FIXUP_ENABLE(PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_82C586_0, quirk_via_irq);
-DECLARE_PCI_FIXUP_ENABLE(PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_82C586_1, quirk_via_irq);
-DECLARE_PCI_FIXUP_ENABLE(PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_82C586_2, quirk_via_irq);
-DECLARE_PCI_FIXUP_ENABLE(PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_82C586_3, quirk_via_irq);
-DECLARE_PCI_FIXUP_ENABLE(PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_82C686, quirk_via_irq);
-DECLARE_PCI_FIXUP_ENABLE(PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_82C686_4, quirk_via_irq);
-DECLARE_PCI_FIXUP_ENABLE(PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_82C686_5, quirk_via_irq);
+DECLARE_PCI_FIXUP_ENABLE(PCI_VENDOR_ID_VIA, PCI_ANY_ID, quirk_via_irq);

/*
* VIA VT82C598 has its device ID settable and many BIOSes

Attachment: smime.p7s
Description: S/MIME cryptographic signature