[PATCH] pci-irq.c fix

From: Dennis Fleurbaaij (dennis@core-lan.nl)
Date: Thu Jan 17 2002 - 06:53:18 EST


Hello,

A small bug in the patch, hereby the fixed version.

diff -ur linux-werkt/Documentation/Configure.help
linux/Documentation/Configure.help
--- linux-werkt/Documentation/Configure.help Fri Jan 11 21:44:55 2002
+++ linux/Documentation/Configure.help Wed Jan 16 11:23:48 2002
@@ -3613,6 +3613,25 @@
    "Bridge" is the name used for the hardware inside your computer that
    PCMCIA cards are plugged into. If unsure, say N.

+Allow IRQ mask expantion
+CONFIG_BIGGER_IRQ_MASK
+ Say Y here if you see that some devices are using the same IRQ while
+ there are free IRQ's available. This mostly due to bad BIOSes and
+ can be fixed by selecting this option.
+
+ This will improve selection of IRQ's that are not correctly set
+ by the BIOS. There is however a very slight chance that your hardware
+ can't be set to an IRQ that it was not build/programmed for and will
+ therefor refuse service, this is however not very likely.
+
+ This also fixes crashes from TI Cardbus controllers on laptops amongst
+ other IRQ-related crashes/hangs.
+
+ It will allow devices to also choose between IRQ 5,8,9,10 and 11 no
+ matter what the BIOS says.
+
+ If unsure say N.
+
  System V IPC
  CONFIG_SYSVIPC
    Inter Process Communication is a suite of library functions and
diff -ur linux-werkt/arch/i386/config.in linux/arch/i386/config.in
--- linux-werkt/arch/i386/config.in Fri Jan 11 21:44:20 2002
+++ linux/arch/i386/config.in Wed Jan 16 11:22:31 2002
@@ -250,6 +250,9 @@
     define_bool CONFIG_HOTPLUG_PCI n
  fi

+bool 'Enable bigger IRQ mask.' CONFIG_BIGGER_IRQ_MASK
+
+
  bool 'System V IPC' CONFIG_SYSVIPC
  bool 'BSD Process Accounting' CONFIG_BSD_PROCESS_ACCT
  bool 'Sysctl support' CONFIG_SYSCTL
diff -ur linux-werkt/arch/i386/kernel/pci-irq.c
linux/arch/i386/kernel/pci-irq.c
--- linux-werkt/arch/i386/kernel/pci-irq.c Sat Jan 12 11:48:03 2002
+++ linux/arch/i386/kernel/pci-irq.c Wed Jan 16 11:24:56 2002
@@ -19,6 +19,8 @@

  #include "pci-i386.h"

+#define IRQ_SAFE_MASK 0x1e60
+
  #define PIRQ_SIGNATURE (('$' << 0) + ('P' << 8) + ('I' << 16) + ('R'
<< 24))
  #define PIRQ_VERSION 0x0100

@@ -571,6 +573,16 @@
       */
      newirq = dev->irq;
      if (!newirq && assign) {
+
+ /*
+ * This adds the IRQ's that are marked as safe, this in order
to prevent wierd
+ * BIOSes to set insane values for irq-masks. It's a
selectable option.
+ */
+ #ifdef CONFIG_BIGGER_IRQ_MASK
+ mask |= IRQ_SAFE_MASK;
+ DBG(" -> mask expanded with %04x to %04x", IRQ_SAFE_MASK,
mask);
+ #endif
+
          for (i = 0; i < 16; i++) {
              if (!(mask & (1 << i)))
                  continue;

-- 
Cheers,

Dennis Fleurbaaij

diff -ur linux-werkt/Documentation/Configure.help linux/Documentation/Configure.help --- linux-werkt/Documentation/Configure.help Fri Jan 11 21:44:55 2002 +++ linux/Documentation/Configure.help Wed Jan 16 11:23:48 2002 @@ -3613,6 +3613,25 @@ "Bridge" is the name used for the hardware inside your computer that PCMCIA cards are plugged into. If unsure, say N. +Allow IRQ mask expantion +CONFIG_BIGGER_IRQ_MASK + Say Y here if you see that some devices are using the same IRQ while + there are free IRQ's available. This mostly due to bad BIOSes and + can be fixed by selecting this option. + + This will improve selection of IRQ's that are not correctly set + by the BIOS. There is however a very slight chance that your hardware + can't be set to an IRQ that it was not build/programmed for and will + therefor refuse service, this is however not very likely. + + This also fixes crashes from TI Cardbus controllers on laptops amongst + other IRQ-related crashes/hangs. + + It will allow devices to also choose between IRQ 5,8,9,10 and 11 no + matter what the BIOS says. + + If unsure say N. + System V IPC CONFIG_SYSVIPC Inter Process Communication is a suite of library functions and diff -ur linux-werkt/arch/i386/config.in linux/arch/i386/config.in --- linux-werkt/arch/i386/config.in Fri Jan 11 21:44:20 2002 +++ linux/arch/i386/config.in Wed Jan 16 11:22:31 2002 @@ -250,6 +250,9 @@ define_bool CONFIG_HOTPLUG_PCI n fi +bool 'Enable bigger IRQ mask.' CONFIG_BIGGER_IRQ_MASK + + bool 'System V IPC' CONFIG_SYSVIPC bool 'BSD Process Accounting' CONFIG_BSD_PROCESS_ACCT bool 'Sysctl support' CONFIG_SYSCTL diff -ur linux-werkt/arch/i386/kernel/pci-irq.c linux/arch/i386/kernel/pci-irq.c --- linux-werkt/arch/i386/kernel/pci-irq.c Sat Jan 12 11:48:03 2002 +++ linux/arch/i386/kernel/pci-irq.c Wed Jan 16 11:24:56 2002 @@ -19,6 +19,8 @@ #include "pci-i386.h" +#define IRQ_SAFE_MASK 0x1e60 + #define PIRQ_SIGNATURE (('$' << 0) + ('P' << 8) + ('I' << 16) + ('R' << 24)) #define PIRQ_VERSION 0x0100 @@ -571,6 +573,16 @@ */ newirq = dev->irq; if (!newirq && assign) { + + /* + * This adds the IRQ's that are marked as safe, this in order to prevent wierd + * BIOSes to set insane values for irq-masks. It's a selectable option. + */ + #ifdef CONFIG_BIGGER_IRQ_MASK + mask |= IRQ_SAFE_MASK; + DBG(" -> mask expanded with %04x to %04x", IRQ_SAFE_MASK, mask); + #endif + for (i = 0; i < 16; i++) { if (!(mask & (1 << i))) continue;

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



This archive was generated by hypermail 2b29 : Wed Jan 23 2002 - 21:00:20 EST