ChangeSet 1.1994.6.23, 2005/03/08 12:11:37-08:00, [EMAIL PROTECTED]

        Merge intel.com:/data/home/aegl/BK/work/2
        into intel.com:/data/home/aegl/BK/linux-ia64-test-2.6.12



 pci.c |   69 +++++++++++++++++++++++-------------------------------------------
 1 files changed, 25 insertions(+), 44 deletions(-)


diff -Nru a/arch/ia64/pci/pci.c b/arch/ia64/pci/pci.c
--- a/arch/ia64/pci/pci.c       2005-03-31 18:06:23 -08:00
+++ b/arch/ia64/pci/pci.c       2005-03-31 18:06:23 -08:00
@@ -3,9 +3,9 @@
  *
  * Derived from bios32.c of i386 tree.
  *
- * Copyright (C) 2002 Hewlett-Packard Co
+ * (c) Copyright 2002, 2005 Hewlett-Packard Development Company, L.P.
  *     David Mosberger-Tang <[EMAIL PROTECTED]>
- *     Bjorn Helgaas <[EMAIL PROTECTED]>
+ *     Bjorn Helgaas <[EMAIL PROTECTED]>
  * Copyright (C) 2004 Silicon Graphics, Inc.
  *
  * Note: Above list of copyright holders is incomplete...
@@ -27,26 +27,12 @@
 #include <asm/segment.h>
 #include <asm/system.h>
 #include <asm/io.h>
-
 #include <asm/sal.h>
-
-
-#ifdef CONFIG_SMP
-# include <asm/smp.h>
-#endif
+#include <asm/smp.h>
 #include <asm/irq.h>
 #include <asm/hw_irq.h>
 
 
-#undef DEBUG
-#define DEBUG
-
-#ifdef DEBUG
-#define DBG(x...) printk(x)
-#else
-#define DBG(x...)
-#endif
-
 static int pci_routeirq;
 
 /*
@@ -55,23 +41,22 @@
  * synchronization mechanism here.
  */
 
-#define PCI_SAL_ADDRESS(seg, bus, devfn, reg)  \
-       ((u64)(seg << 24) | (u64)(bus << 16) |  \
-        (u64)(devfn << 8) | (u64)(reg))
+#define PCI_SAL_ADDRESS(seg, bus, devfn, reg)          \
+       (((u64) seg << 24) | (bus << 16) | (devfn << 8) | (reg))
 
 /* SAL 3.2 adds support for extended config space. */
 
 #define PCI_SAL_EXT_ADDRESS(seg, bus, devfn, reg)      \
-       ((u64)(seg << 28) | (u64)(bus << 20) |          \
-        (u64)(devfn << 12) | (u64)(reg))
+       (((u64) seg << 28) | (bus << 20) | (devfn << 12) | (reg))
 
 static int
-pci_sal_read (int seg, int bus, int devfn, int reg, int len, u32 *value)
+pci_sal_read (unsigned int seg, unsigned int bus, unsigned int devfn,
+             int reg, int len, u32 *value)
 {
-       u64 addr, mode, data = 0;
-       int result = 0;
+       u64 addr, data = 0;
+       int mode, result;
 
-       if ((seg > 65535) || (bus > 255) || (devfn > 255) || (reg > 4095))
+       if (!value || (seg > 65535) || (bus > 255) || (devfn > 255) || (reg > 
4095))
                return -EINVAL;
 
        if ((seg | reg) <= 255) {
@@ -82,16 +67,19 @@
                mode = 1;
        }
        result = ia64_sal_pci_config_read(addr, mode, len, &data);
+       if (result != 0)
+               return -EINVAL;
 
        *value = (u32) data;
-
-       return result;
+       return 0;
 }
 
 static int
-pci_sal_write (int seg, int bus, int devfn, int reg, int len, u32 value)
+pci_sal_write (unsigned int seg, unsigned int bus, unsigned int devfn,
+              int reg, int len, u32 value)
 {
-       u64 addr, mode;
+       u64 addr;
+       int mode, result;
 
        if ((seg > 65535) || (bus > 255) || (devfn > 255) || (reg > 4095))
                return -EINVAL;
@@ -103,7 +91,10 @@
                addr = PCI_SAL_EXT_ADDRESS(seg, bus, devfn, reg);
                mode = 1;
        }
-       return ia64_sal_pci_config_write(addr, mode, len, value);
+       result = ia64_sal_pci_config_write(addr, mode, len, value);
+       if (result != 0)
+               return -EINVAL;
+       return 0;
 }
 
 static struct pci_raw_ops pci_sal_ops = {
@@ -160,21 +151,11 @@
                 * also do it here in case there are still broken drivers that
                 * don't use pci_enable_device().
                 */
-               printk(KERN_INFO "** Routing PCI interrupts for all devices 
because \"pci=routeirq\"\n");
-               printk(KERN_INFO "** was specified.  If this was required to 
make a driver work,\n");
-               printk(KERN_INFO "** please email the output of \"lspci\" to 
[EMAIL PROTECTED]");
-               printk(KERN_INFO "** so I can fix the driver.\n");
+               printk(KERN_INFO "PCI: Routing interrupts for all devices 
because \"pci=routeirq\" specified\n");
                for_each_pci_dev(dev)
                        acpi_pci_irq_enable(dev);
-       } else {
-               printk(KERN_INFO "** PCI interrupts are no longer routed 
automatically.  If this\n");
-               printk(KERN_INFO "** causes a device to stop working, it is 
probably because the\n");
-               printk(KERN_INFO "** driver failed to call pci_enable_device(). 
 As a temporary\n");
-               printk(KERN_INFO "** workaround, the \"pci=routeirq\" argument 
restores the old\n");
-               printk(KERN_INFO "** behavior.  If this argument makes the 
device work again,\n");
-               printk(KERN_INFO "** please email the output of \"lspci\" to 
[EMAIL PROTECTED]");
-               printk(KERN_INFO "** so I can fix the driver.\n");
-       }
+       } else
+               printk(KERN_INFO "PCI: If a device doesn't work, try 
\"pci=routeirq\".  If it helps, post a report\n");
 
        return 0;
 }
-
To unsubscribe from this list: send the line "unsubscribe bk-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to