]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/commitdiff
Merge branch 'x86/urgent' into x86/cleanups
authorH. Peter Anvin <hpa@zytor.com>
Tue, 26 Aug 2008 05:45:37 +0000 (22:45 -0700)
committerH. Peter Anvin <hpa@zytor.com>
Tue, 26 Aug 2008 05:45:37 +0000 (22:45 -0700)
1  2 
arch/x86/kernel/cpuid.c
arch/x86/pci/irq.c

diff --combined arch/x86/kernel/cpuid.c
index 3fa4e926b510f7b9d0c807b37655d4ac5221ed74,8e9cd6a8ec120951c4683b410572d63b0c3d0824..6a44d646599156cc5910cce8f503832688c973a5
@@@ -36,6 -36,7 +36,6 @@@
  #include <linux/smp_lock.h>
  #include <linux/major.h>
  #include <linux/fs.h>
 -#include <linux/smp_lock.h>
  #include <linux/device.h>
  #include <linux/cpu.h>
  #include <linux/notifier.h>
@@@ -88,6 -89,8 +88,8 @@@ static ssize_t cpuid_read(struct file *
        struct cpuid_regs cmd;
        int cpu = iminor(file->f_path.dentry->d_inode);
        u64 pos = *ppos;
+       ssize_t bytes = 0;
+       int err = 0;
  
        if (count % 16)
                return -EINVAL; /* Invalid chunk size */
        for (; count; count -= 16) {
                cmd.eax = pos;
                cmd.ecx = pos >> 32;
-               smp_call_function_single(cpu, cpuid_smp_cpuid, &cmd, 1);
-               if (copy_to_user(tmp, &cmd, 16))
-                       return -EFAULT;
+               err = smp_call_function_single(cpu, cpuid_smp_cpuid, &cmd, 1);
+               if (err)
+                       break;
+               if (copy_to_user(tmp, &cmd, 16)) {
+                       err = -EFAULT;
+                       break;
+               }
                tmp += 16;
+               bytes += 16;
                *ppos = ++pos;
        }
  
-       return tmp - buf;
+       return bytes ? bytes : err;
  }
  
  static int cpuid_open(struct inode *inode, struct file *file)
diff --combined arch/x86/pci/irq.c
index d781cc4f725a6deb00cf79003bd1b0f269369ff8,8e077185e185cbc72e58be92fcbd29f05437ed23..006599db0dc7024a9bc9cde36bab97b2dc114b0f
@@@ -590,6 -590,8 +590,8 @@@ static __init int intel_router_probe(st
        case PCI_DEVICE_ID_INTEL_ICH10_1:
        case PCI_DEVICE_ID_INTEL_ICH10_2:
        case PCI_DEVICE_ID_INTEL_ICH10_3:
+       case PCI_DEVICE_ID_INTEL_PCH_0:
+       case PCI_DEVICE_ID_INTEL_PCH_1:
                r->name = "PIIX/ICH";
                r->get = pirq_piix_get;
                r->set = pirq_piix_set;
@@@ -1041,44 -1043,35 +1043,44 @@@ static void __init pcibios_fixup_irqs(v
                if (io_apic_assign_pci_irqs) {
                        int irq;
  
 -                      if (pin) {
 -                              /*
 -                               * interrupt pins are numbered starting
 -                               * from 1
 -                               */
 -                              pin--;
 -                              irq = IO_APIC_get_PCI_irq_vector(dev->bus->number,
 -                                      PCI_SLOT(dev->devfn), pin);
 -      /*
 -       * Busses behind bridges are typically not listed in the MP-table.
 -       * In this case we have to look up the IRQ based on the parent bus,
 -       * parent slot, and pin number. The SMP code detects such bridged
 -       * busses itself so we should get into this branch reliably.
 -       */
 -                              if (irq < 0 && dev->bus->parent) { /* go back to the bridge */
 -                                      struct pci_dev *bridge = dev->bus->self;
 -
 -                                      pin = (pin + PCI_SLOT(dev->devfn)) % 4;
 -                                      irq = IO_APIC_get_PCI_irq_vector(bridge->bus->number,
 -                                                      PCI_SLOT(bridge->devfn), pin);
 -                                      if (irq >= 0)
 -                                              dev_warn(&dev->dev, "using bridge %s INT %c to get IRQ %d\n",
 -                                                       pci_name(bridge),
 -                                                       'A' + pin, irq);
 -                              }
 -                              if (irq >= 0) {
 -                                      dev_info(&dev->dev, "PCI->APIC IRQ transform: INT %c -> IRQ %d\n", 'A' + pin, irq);
 -                                      dev->irq = irq;
 -                              }
 +                      if (!pin)
 +                              continue;
 +
 +                      /*
 +                       * interrupt pins are numbered starting from 1
 +                       */
 +                      pin--;
 +                      irq = IO_APIC_get_PCI_irq_vector(dev->bus->number,
 +                              PCI_SLOT(dev->devfn), pin);
 +                      /*
 +                       * Busses behind bridges are typically not listed in the
 +                       * MP-table.  In this case we have to look up the IRQ
 +                       * based on the parent bus, parent slot, and pin number.
 +                       * The SMP code detects such bridged busses itself so we
 +                       * should get into this branch reliably.
 +                       */
 +                      if (irq < 0 && dev->bus->parent) {
 +                              /* go back to the bridge */
 +                              struct pci_dev *bridge = dev->bus->self;
 +                              int bus;
 +
 +                              pin = (pin + PCI_SLOT(dev->devfn)) % 4;
 +                              bus = bridge->bus->number;
 +                              irq = IO_APIC_get_PCI_irq_vector(bus,
 +                                              PCI_SLOT(bridge->devfn), pin);
 +                              if (irq >= 0)
 +                                      dev_warn(&dev->dev,
 +                                              "using bridge %s INT %c to "
 +                                                      "get IRQ %d\n",
 +                                               pci_name(bridge),
 +                                               'A' + pin, irq);
 +                      }
 +                      if (irq >= 0) {
 +                              dev_info(&dev->dev,
 +                                      "PCI->APIC IRQ transform: INT %c "
 +                                              "-> IRQ %d\n",
 +                                      'A' + pin, irq);
 +                              dev->irq = irq;
                        }
                }
  #endif