Re: 2.6.10-rc2-bk7, back to an irq 12 "nobody cared!"

From: Chris Wright
Date: Tue Nov 23 2004 - 15:00:29 EST


* Zwane Mwaikambo (zwane@xxxxxxxxxxxxx) wrote:
> On Tue, 23 Nov 2004, Chris Wright wrote:
>
> > * Zwane Mwaikambo (zwane@xxxxxxxxxxxxx) wrote:
> > > On Mon, 22 Nov 2004, Andrew Morton wrote:
> > >
> > > > Gene Heskett <gene.heskett@xxxxxxxxxxx> wrote:
> > > > >
> > > > > Just built bk7 after running the bk4-kjt1 version for a cpouple of
> > > > > days, and noticed this in /var/log/dmesg:
> >
> > Try current, should be fixed.
>
> Know which changeset fixed it?

The last two (currently numbered 1.2219,12220).


# ChangeSet
# 2004/11/22 21:02:49-08:00 torvalds@xxxxxxxxxxxx
# acpi: disable PCI links at boot again, fix ELCR
#
# Len Brown convinced me that the problem with disabling
# PCI routing entries wasn't the disable as much as the
# fact that ELCR needs to be updated when removing the PCI
# routing. So this reverts the previous cset and updates
# ELCR as suggested by Len.
#
# drivers/acpi/pci_link.c
# 2004/11/22 21:02:39-08:00 torvalds@xxxxxxxxxxxx +3 -0
# acpi: disable PCI links at boot again, fix ELCR
#
# Len Brown convinced me that the problem with disabling
# PCI routing entries wasn't the disable as much as the
# fact that ELCR needs to be updated when removing the PCI
# routing. So this reverts the previous cset and updates
# ELCR as suggested by Len.
#
# arch/i386/kernel/acpi/boot.c
# 2004/11/22 21:02:39-08:00 torvalds@xxxxxxxxxxxx +28 -18
# acpi: disable PCI links at boot again, fix ELCR
#
# Len Brown convinced me that the problem with disabling
# PCI routing entries wasn't the disable as much as the
# fact that ELCR needs to be updated when removing the PCI
# routing. So this reverts the previous cset and updates
# ELCR as suggested by Len.
#
# ChangeSet
# 2004/11/22 10:41:17-08:00 torvalds@xxxxxxxxxxxxxxx
# acpi: don't disable PCI irq links that were active at boot.
#
# This fixes at least some interrupt polarity setup cases.
# The ACPI guys may want to eventually do this differently, but
# in the meantime this makes ACPI behaviour closer to non-ACPI
# behaviour, and fixes known problems.
#
# I'll further argue that this protects non-PCI devices that may
# just share the irq routing from being screwed, but that may or
# may not be an argument that everybody buys into.
#
# drivers/acpi/pci_link.c
# 2004/11/22 10:41:11-08:00 torvalds@xxxxxxxxxxxxxxx +0 -3
# acpi: don't disable PCI irq links that were active at boot.
#
# This fixes at least some interrupt polarity setup cases.
# The ACPI guys may want to eventually do this differently, but
# in the meantime this makes ACPI behaviour closer to non-ACPI
# behaviour, and fixes known problems.
#
# I'll further argue that this protects non-PCI devices that may
# just share the irq routing from being screwed, but that may or
# may not be an argument that everybody buys into.
#
diff -Nru a/arch/i386/kernel/acpi/boot.c b/arch/i386/kernel/acpi/boot.c
--- a/arch/i386/kernel/acpi/boot.c 2004-11-23 11:53:08 -08:00
+++ b/arch/i386/kernel/acpi/boot.c 2004-11-23 11:53:08 -08:00
@@ -409,28 +409,38 @@
void __init
acpi_pic_sci_set_trigger(unsigned int irq, u16 trigger)
{
- unsigned char mask = 1 << (irq & 7);
- unsigned int port = 0x4d0 + (irq >> 3);
- unsigned char val = inb(port);
+ unsigned int mask = 1 << irq;
+ unsigned int old, new;

-
- printk(PREFIX "IRQ%d SCI:", irq);
- if (!(val & mask)) {
- printk(" Edge");
+ /* Real old ELCR mask */
+ old = inb(0x4d0) | (inb(0x4d1) << 8);

- if (trigger == 3) {
- printk(" set to Level");
- outb(val | mask, port);
- }
- } else {
- printk(" Level");
+ /*
+ * If we use ACPI to set PCI irq's, then we should clear ELCR
+ * since we will set it correctly as we enable the PCI irq
+ * routing.
+ */
+ new = acpi_noirq ? old : 0;

- if (trigger == 1) {
- printk(" set to Edge");
- outb(val & ~mask, port);
- }
+ /*
+ * Update SCI information in the ELCR, it isn't in the PCI
+ * routing tables..
+ */
+ switch (trigger) {
+ case 1: /* Edge - clear */
+ new &= ~mask;
+ break;
+ case 3: /* Level - set */
+ new |= mask;
+ break;
}
- printk(" Trigger.\n");
+
+ if (old == new)
+ return;
+
+ printk(PREFIX "setting ELCR to %04x (from %04x)\n", new, old);
+ outb(new, 0x4d0);
+ outb(new >> 8, 0x4d1);
}


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/