Merge branch 'linux-next' of git://git.kernel.org/pub/scm/linux/kernel/git/jbarnes...
authorLinus Torvalds <torvalds@linux-foundation.org>
Sat, 30 Jul 2011 06:35:05 +0000 (23:35 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Sat, 30 Jul 2011 06:35:05 +0000 (23:35 -0700)
* 'linux-next' of git://git.kernel.org/pub/scm/linux/kernel/git/jbarnes/pci-2.6:
  PCI: remove printks about disabled bridge windows
  PCI: fold pci_calc_resource_flags() into decode_bar()
  PCI: treat mem BAR type "11" (reserved) as 32-bit, not 64-bit, BAR
  PCI: correct pcie_set_readrq write size
  PCI: pciehp: change wait time for valid configuration access
  x86/PCI: Preserve existing pci=bfsort whitelist for Dell systems
  PCI: ARI is a PCIe v2 feature
  x86/PCI: quirks: Use pci_dev->revision
  PCI: Make the struct pci_dev * argument of pci_fixup_irqs const.
  PCI hotplug: cpqphp: use pci_dev->vendor
  PCI hotplug: cpqphp: use pci_dev->subsystem_{vendor|device}
  x86/PCI: config space accessor functions should not ignore the segment argument
  PCI: Assign values to 'pci_obff_signal_type' enumeration constants
  x86/PCI: reduce severity of host bridge window conflict warnings
  PCI: enumerate the PCI device only removed out PCI hieratchy of OS when re-scanning PCI
  PCI: PCIe AER: add aer_recover_queue
  x86/PCI: select direct access mode for mmconfig option
  PCI hotplug: Rename is_ejectable which also exists in dock.c

17 files changed:
1  2 
arch/alpha/kernel/sys_ruffian.c
arch/arm/common/it8152.c
arch/arm/mach-cns3xxx/pcie.c
arch/arm/mach-dove/pcie.c
arch/arm/mach-iop13xx/pci.c
arch/arm/mach-ixp4xx/goramo_mlr.c
arch/arm/mach-kirkwood/pcie.c
arch/arm/mach-mv78xx0/pcie.c
arch/arm/mach-orion5x/pci.c
arch/arm/mach-pxa/cm-x2xx-pci.c
arch/arm/mach-sa1100/pci-nanoengine.c
arch/arm/mach-shark/pci.c
arch/arm/mach-tegra/pcie.c
arch/arm/mach-versatile/pci.c
arch/x86/Kconfig
drivers/pci/probe.c
include/linux/pci.h

index f33648e4e8cf1a69e2845266cab8c372638db0ed,915b97570c62f10475fbe90e39e708d7bdff391d..2581cbec6fc21bce1625677a5e58fd52a2db4287
@@@ -26,6 -26,7 +26,6 @@@
  #include <asm/pgtable.h>
  #include <asm/core_cia.h>
  #include <asm/tlbflush.h>
 -#include <asm/8253pit.h>
  
  #include "proto.h"
  #include "irq_impl.h"
@@@ -119,7 -120,7 +119,7 @@@ ruffian_kill_arch (int mode
   */
  
  static int __init
- ruffian_map_irq(struct pci_dev *dev, u8 slot, u8 pin)
+ ruffian_map_irq(const struct pci_dev *dev, u8 slot, u8 pin)
  {
          static char irq_tab[11][5] __initdata = {
              /*INT  INTA INTB INTC INTD */
diff --combined arch/arm/common/it8152.c
index 14ad62e16dd1f1de122ceb83e5b16a96d69cf1b6,17239bd1906b392544821e0d0917682dc7654e42..a7934ba9e1dfcc89ce97812d8b361b5375e1cc43
@@@ -144,7 -144,7 +144,7 @@@ void it8152_irq_demux(unsigned int irq
  }
  
  /* mapping for on-chip devices */
- int __init it8152_pci_map_irq(struct pci_dev *dev, u8 slot, u8 pin)
+ int __init it8152_pci_map_irq(const struct pci_dev *dev, u8 slot, u8 pin)
  {
        if ((dev->vendor == PCI_VENDOR_ID_ITE) &&
            (dev->device == PCI_DEVICE_ID_ITE_8152)) {
@@@ -243,12 -243,6 +243,12 @@@ static struct resource it8152_mem = 
   * ITE8152 chip can address up to 64MByte, so all the devices
   * connected to ITE8152 (PCI and USB) should have limited DMA window
   */
 +static int it8152_needs_bounce(struct device *dev, dma_addr_t dma_addr, size_t size)
 +{
 +      dev_dbg(dev, "%s: dma_addr %08x, size %08x\n",
 +              __func__, dma_addr, size);
 +      return (dma_addr + size - PHYS_OFFSET) >= SZ_64M;
 +}
  
  /*
   * Setup DMA mask to 64MB on devices connected to ITE8152. Ignore all
@@@ -260,7 -254,7 +260,7 @@@ static int it8152_pci_platform_notify(s
                if (dev->dma_mask)
                        *dev->dma_mask = (SZ_64M - 1) | PHYS_OFFSET;
                dev->coherent_dma_mask = (SZ_64M - 1) | PHYS_OFFSET;
 -              dmabounce_register_dev(dev, 2048, 4096);
 +              dmabounce_register_dev(dev, 2048, 4096, it8152_needs_bounce);
        }
        return 0;
  }
@@@ -273,6 -267,14 +273,6 @@@ static int it8152_pci_platform_notify_r
        return 0;
  }
  
 -int dma_needs_bounce(struct device *dev, dma_addr_t dma_addr, size_t size)
 -{
 -      dev_dbg(dev, "%s: dma_addr %08x, size %08x\n",
 -              __func__, dma_addr, size);
 -      return (dev->bus == &pci_bus_type) &&
 -              ((dma_addr + size - PHYS_OFFSET) >= SZ_64M);
 -}
 -
  int dma_set_coherent_mask(struct device *dev, u64 mask)
  {
        if (mask >= PHYS_OFFSET + SZ_64M - 1)
index a4ec080908b8f60f9181672b41380278264ca696,725b94fe919a79f49e32b8cffa88ae8adb963cf0..06fd25d70aec8064912eb1b70d82678b4b891f6d
@@@ -172,7 -172,7 +172,7 @@@ static struct pci_bus *cns3xxx_pci_scan
        return pci_scan_bus(sys->busnr, &cns3xxx_pcie_ops, sys);
  }
  
- static int cns3xxx_pcie_map_irq(struct pci_dev *dev, u8 slot, u8 pin)
+ static int cns3xxx_pcie_map_irq(const struct pci_dev *dev, u8 slot, u8 pin)
  {
        struct cns3xxx_pcie *cnspci = pdev_to_cnspci(dev);
        int irq = cnspci->irqs[slot];
@@@ -369,9 -369,6 +369,9 @@@ static int __init cns3xxx_pcie_init(voi
  {
        int i;
  
 +      pcibios_min_io = 0;
 +      pcibios_min_mem = 0;
 +
        hook_fault_code(16 + 6, cns3xxx_pcie_abort_handler, SIGBUS, 0,
                        "imprecise external abort");
  
index c2f1c4767f219a8c20ef6f9592db9676133e07ee,c6e93aa8caff0120faa72a5c4054dca14046431a..aa2b3a09a51dcdbd4efab8f33c72850eef6ef69b
@@@ -11,7 -11,6 +11,7 @@@
  #include <linux/kernel.h>
  #include <linux/pci.h>
  #include <linux/mbus.h>
 +#include <video/vga.h>
  #include <asm/mach/pci.h>
  #include <asm/mach/arch.h>
  #include <asm/setup.h>
@@@ -193,7 -192,7 +193,7 @@@ dove_pcie_scan_bus(int nr, struct pci_s
        return bus;
  }
  
- static int __init dove_pcie_map_irq(struct pci_dev *dev, u8 slot, u8 pin)
+ static int __init dove_pcie_map_irq(const struct pci_dev *dev, u8 slot, u8 pin)
  {
        struct pcie_port *pp = bus_to_port(dev->bus->number);
  
@@@ -229,8 -228,6 +229,8 @@@ static void __init add_pcie_port(int in
  
  void __init dove_pcie_init(int init_port0, int init_port1)
  {
 +      vga_base = DOVE_PCIE0_MEM_PHYS_BASE;
 +
        if (init_port0)
                add_pcie_port(0, DOVE_PCIE0_VIRT_BASE);
  
index 0690b1d7fd3e9f1b803f7449c9e6b1886ddfde0f,48a36937330f82913be27db882e1450624f3c52a..251c40897dad44085f23e9850bf29c23540c0a65
@@@ -39,6 -39,8 +39,6 @@@ u32 iop13xx_atue_mem_base
  u32 iop13xx_atux_mem_base;
  size_t iop13xx_atue_mem_size;
  size_t iop13xx_atux_mem_size;
 -unsigned long iop13xx_pcibios_min_io = 0;
 -unsigned long iop13xx_pcibios_min_mem = 0;
  
  EXPORT_SYMBOL(iop13xx_atue_mem_base);
  EXPORT_SYMBOL(iop13xx_atux_mem_base);
@@@ -388,7 -390,7 +388,7 @@@ static int iop13xx_atue_pci_status(int 
  }
  
  static int
- iop13xx_pcie_map_irq(struct pci_dev *dev, u8 idsel, u8 pin)
+ iop13xx_pcie_map_irq(const struct pci_dev *dev, u8 idsel, u8 pin)
  {
        WARN_ON(idsel != 0);
  
@@@ -969,8 -971,7 +969,8 @@@ void __init iop13xx_pci_init(void
        __raw_writel(__raw_readl(IOP13XX_XBG_BECSR) & 3, IOP13XX_XBG_BECSR);
  
        /* Setup the Min Address for PCI memory... */
 -      iop13xx_pcibios_min_mem = IOP13XX_PCIX_LOWER_MEM_BA;
 +      pcibios_min_io = 0;
 +      pcibios_min_mem = IOP13XX_PCIX_LOWER_MEM_BA;
  
        /* if Linux is given control of an ATU
         * clear out its prior configuration,
index 5f00ad224fe03ff8b76c8bc8d82cd876599a6aaf,249404d264b72357abe17b37e9852a6a444996de..7548d9a2efe21499031c8e0b02f98070a151a9e9
@@@ -462,7 -462,7 +462,7 @@@ static void __init gmlr_pci_postinit(vo
        }
  }
  
- static int __init gmlr_map_irq(struct pci_dev *dev, u8 slot, u8 pin)
+ static int __init gmlr_map_irq(const struct pci_dev *dev, u8 slot, u8 pin)
  {
        switch(slot) {
        case SLOT_ETHA: return IXP4XX_GPIO_IRQ(GPIO_IRQ_ETHA);
@@@ -501,7 -501,4 +501,7 @@@ MACHINE_START(GORAMO_MLR, "MultiLink"
        .timer          = &ixp4xx_timer,
        .boot_params    = 0x0100,
        .init_machine   = gmlr_init,
 +#if defined(CONFIG_PCI)
 +      .dma_zone_size  = SZ_64M,
 +#endif
  MACHINE_END
index bfeb9c900cec0573ba49e0237228bc80721ff58e,77d0f54a24e8967f216f3d17122235cced0702dd..74b992d810ea0137c4919a13f18c68cd937422d2
@@@ -12,7 -12,6 +12,7 @@@
  #include <linux/pci.h>
  #include <linux/slab.h>
  #include <linux/mbus.h>
 +#include <video/vga.h>
  #include <asm/irq.h>
  #include <asm/mach/pci.h>
  #include <plat/pcie.h>
@@@ -245,7 -244,8 +245,8 @@@ kirkwood_pcie_scan_bus(int nr, struct p
        return bus;
  }
  
- static int __init kirkwood_pcie_map_irq(struct pci_dev *dev, u8 slot, u8 pin)
+ static int __init kirkwood_pcie_map_irq(const struct pci_dev *dev, u8 slot,
+       u8 pin)
  {
        struct pcie_port *pp = bus_to_port(dev->bus);
  
@@@ -272,8 -272,6 +273,8 @@@ static void __init add_pcie_port(int in
  
  void __init kirkwood_pcie_init(unsigned int portmask)
  {
 +      vga_base = KIRKWOOD_PCIE_MEM_PHYS_BASE;
 +
        if (portmask & KW_PCIE0)
                add_pcie_port(0, PCIE_VIRT_BASE);
  
index d6336afe994836f5e3e870d2962738f292bd54f8,8854d8c7680b6f566543c864f86c4e513bc7c929..c51af1cac30040ee312f6416491c7535cb944d55
@@@ -11,7 -11,6 +11,7 @@@
  #include <linux/kernel.h>
  #include <linux/pci.h>
  #include <linux/mbus.h>
 +#include <video/vga.h>
  #include <asm/irq.h>
  #include <asm/mach/pci.h>
  #include <plat/pcie.h>
@@@ -130,12 -129,12 +130,12 @@@ static void __init mv78xx0_pcie_preinit
                struct pcie_port *pp = pcie_port + i;
  
                mv78xx0_setup_pcie_io_win(win++, pp->res[0].start,
 -                      pp->res[0].end - pp->res[0].start + 1,
 -                      pp->maj, pp->min);
 +                                        resource_size(&pp->res[0]),
 +                                        pp->maj, pp->min);
  
                mv78xx0_setup_pcie_mem_win(win++, pp->res[1].start,
 -                      pp->res[1].end - pp->res[1].start + 1,
 -                      pp->maj, pp->min);
 +                                         resource_size(&pp->res[1]),
 +                                         pp->maj, pp->min);
        }
  }
  
@@@ -260,7 -259,8 +260,8 @@@ mv78xx0_pcie_scan_bus(int nr, struct pc
        return bus;
  }
  
- static int __init mv78xx0_pcie_map_irq(struct pci_dev *dev, u8 slot, u8 pin)
+ static int __init mv78xx0_pcie_map_irq(const struct pci_dev *dev, u8 slot,
+       u8 pin)
  {
        struct pcie_port *pp = bus_to_port(dev->bus->number);
  
@@@ -298,8 -298,6 +299,8 @@@ static void __init add_pcie_port(int ma
  
  void __init mv78xx0_pcie_init(int init_port0, int init_port1)
  {
 +      vga_base = MV78XX0_PCIE_MEM_PHYS_BASE;
 +
        if (init_port0) {
                add_pcie_port(0, 0, PCIE00_VIRT_BASE);
                if (!orion_pcie_x4_mode((void __iomem *)PCIE00_VIRT_BASE)) {
index f64965d4f8e8c277ae94b363e104e98beaf1144a,0415250396d4c4d5add95029991c01b0d78c2405..28b8760ab9fa07c6e09128811bbfa3dd1ba1cffb
@@@ -560,8 -560,6 +560,8 @@@ int __init orion5x_pci_sys_setup(int nr
  {
        int ret = 0;
  
 +      vga_base = ORION5X_PCIE_MEM_PHYS_BASE;
 +
        if (nr == 0) {
                orion_pcie_set_local_bus_nr(PCIE_BASE, sys->busnr);
                ret = pcie_setup(sys);
@@@ -589,7 -587,7 +589,7 @@@ struct pci_bus __init *orion5x_pci_sys_
        return bus;
  }
  
- int __init orion5x_pci_map_irq(struct pci_dev *dev, u8 slot, u8 pin)
+ int __init orion5x_pci_map_irq(const struct pci_dev *dev, u8 slot, u8 pin)
  {
        int bus = dev->bus->number;
  
index 4eb7660a279d3f5d04407b44c09808dca90ac2b4,939a3695ac5d315fe63c1a4047e8a93ae190a5cf..6bf479d9b5ac5ffd154dc281d407d76ce1817a86
@@@ -77,7 -77,7 +77,7 @@@ void cmx2xx_pci_resume(void) {
  #endif
  
  /* PCI IRQ mapping*/
- static int __init cmx2xx_pci_map_irq(struct pci_dev *dev, u8 slot, u8 pin)
+ static int __init cmx2xx_pci_map_irq(const struct pci_dev *dev, u8 slot, u8 pin)
  {
        int irq;
  
@@@ -125,9 -125,6 +125,9 @@@ static void cmx2xx_pci_preinit(void
  {
        pr_info("Initializing CM-X2XX PCI subsystem\n");
  
 +      pcibios_min_io = 0;
 +      pcibios_min_mem = 0;
 +
        __raw_writel(0x800, IT8152_PCI_CFG_ADDR);
        if (__raw_readl(IT8152_PCI_CFG_DATA) == 0x81521283) {
                pr_info("PCI Bridge found.\n");
index 5fc074fe3eeee535f0d3909a9036ad190752d20c,a3cd2f7cab622ac6c9221ed7208f67ce7108556a..964c6c3cd7a668285b53a3ebcc7eed15bce2bf91
@@@ -122,7 -122,8 +122,8 @@@ static struct pci_ops pci_nano_ops = 
        .write  = nanoengine_write_config,
  };
  
- static int __init pci_nanoengine_map_irq(struct pci_dev *dev, u8 slot, u8 pin)
+ static int __init pci_nanoengine_map_irq(const struct pci_dev *dev, u8 slot,
+       u8 pin)
  {
        return NANOENGINE_IRQ_GPIO_PCI;
  }
@@@ -252,9 -253,6 +253,9 @@@ int __init pci_nanoengine_setup(int nr
  {
        int ret = 0;
  
 +      pcibios_min_io = 0;
 +      pcibios_min_mem = 0;
 +
        if (nr == 0) {
                sys->mem_offset = NANO_PCI_MEM_RW_PHYS;
                sys->io_offset = 0x400;
index 92d7227de0ac5648cc42a1097343d2f0a71e8779,e0d1d4348a32e1505627237407ff8703bbc8620e..7cb79a092f316571e68b8352d85bf0b8c42c14b5
@@@ -8,13 -8,12 +8,13 @@@
  #include <linux/kernel.h>
  #include <linux/pci.h>
  #include <linux/init.h>
 +#include <video/vga.h>
  
  #include <asm/irq.h>
  #include <asm/mach/pci.h>
  #include <asm/mach-types.h>
  
- static int __init shark_map_irq(struct pci_dev *dev, u8 slot, u8 pin)
+ static int __init shark_map_irq(const struct pci_dev *dev, u8 slot, u8 pin)
  {
        if (dev->bus->number == 0)
                if (dev->devfn == 0)
@@@ -38,15 -37,8 +38,15 @@@ static struct hw_pci shark_pci __initda
  
  static int __init shark_pci_init(void)
  {
 -      if (machine_is_shark())
 -              pci_common_init(&shark_pci);
 +      if (!machine_is_shark())
 +              return;
 +
 +      pcibios_min_io = 0x6000;
 +      pcibios_min_mem = 0x50000000;
 +      vga_base = 0xe8000000;
 +
 +      pci_common_init(&shark_pci);
 +
        return 0;
  }
  
index 031cd0a7d71d7a22cd6cfb00e321d060ac192b98,10639fff6116dc1e409da8677c51e344bbf7f040..f1f699d86c3278c90c514bd7ac3daec35b2fc7cb
@@@ -449,7 -449,7 +449,7 @@@ static int tegra_pcie_setup(int nr, str
        return 1;
  }
  
- static int tegra_pcie_map_irq(struct pci_dev *dev, u8 slot, u8 pin)
+ static int tegra_pcie_map_irq(const struct pci_dev *dev, u8 slot, u8 pin)
  {
        return INT_PCIE_INTR;
  }
@@@ -912,8 -912,6 +912,8 @@@ int __init tegra_pcie_init(bool init_po
        if (!(init_port0 || init_port1))
                return -ENODEV;
  
 +      pcibios_min_mem = 0;
 +
        err = tegra_pcie_get_resources();
        if (err)
                return err;
index 7848a177b1f0eb27ccf031e817168599a58f6d16,70f875c9370185a8d511ead2940af9001adf6e40..c898deb3ada01f2b5dacd1cd93e3e99dd8a7e3a7
@@@ -311,9 -311,6 +311,9 @@@ struct pci_bus * __init pci_versatile_s
  
  void __init pci_versatile_preinit(void)
  {
 +      pcibios_min_io = 0x44000000;
 +      pcibios_min_mem = 0x50000000;
 +
        __raw_writel(VERSATILE_PCI_MEM_BASE0 >> 28, PCI_IMAP0);
        __raw_writel(VERSATILE_PCI_MEM_BASE1 >> 28, PCI_IMAP1);
        __raw_writel(VERSATILE_PCI_MEM_BASE2 >> 28, PCI_IMAP2);
  /*
   * map the specified device/slot/pin to an IRQ.   Different backplanes may need to modify this.
   */
- static int __init versatile_map_irq(struct pci_dev *dev, u8 slot, u8 pin)
+ static int __init versatile_map_irq(const struct pci_dev *dev, u8 slot, u8 pin)
  {
        int irq;
        int devslot = PCI_SLOT(dev->devfn);
diff --combined arch/x86/Kconfig
index 153aa6f78299ea60210044409ce78d1f4b98743b,5b3e6ec4703d23d22cbd26d4ae07b5ff7c2a174c..7cf916fc1ce7e4920204a184a15b6e5ef2cfd1a4
@@@ -20,7 -20,6 +20,7 @@@ config X8
        select HAVE_UNSTABLE_SCHED_CLOCK
        select HAVE_IDE
        select HAVE_OPROFILE
 +      select HAVE_PCSPKR_PLATFORM
        select HAVE_PERF_EVENTS
        select HAVE_IRQ_WORK
        select HAVE_IOREMAP_PROT
@@@ -71,7 -70,6 +71,7 @@@
        select IRQ_FORCED_THREADING
        select USE_GENERIC_SMP_HELPERS if SMP
        select HAVE_BPF_JIT if (X86_64 && NET)
 +      select CLKEVT_I8253
  
  config INSTRUCTION_DECODER
        def_bool (KPROBES || PERF_EVENTS)
@@@ -95,10 -93,6 +95,10 @@@ config CLOCKSOURCE_WATCHDO
  config GENERIC_CLOCKEVENTS
        def_bool y
  
 +config ARCH_CLOCKSOURCE_DATA
 +      def_bool y
 +      depends on X86_64
 +
  config GENERIC_CLOCKEVENTS_BROADCAST
        def_bool y
        depends on X86_64 || (X86_32 && X86_LOCAL_APIC)
@@@ -390,21 -384,12 +390,21 @@@ config X86_INTEL_C
          This option compiles in support for the CE4100 SOC for settop
          boxes and media devices.
  
 +config X86_INTEL_MID
 +      bool "Intel MID platform support"
 +      depends on X86_32
 +      depends on X86_EXTENDED_PLATFORM
 +      ---help---
 +        Select to build a kernel capable of supporting Intel MID platform
 +        systems which do not have the PCI legacy interfaces (Moorestown,
 +        Medfield). If you are building for a PC class system say N here.
 +
 +if X86_INTEL_MID
 +
  config X86_MRST
         bool "Moorestown MID platform"
        depends on PCI
        depends on PCI_GOANY
 -      depends on X86_32
 -      depends on X86_EXTENDED_PLATFORM
        depends on X86_IO_APIC
        select APB_TIMER
        select I2C
          nor standard legacy replacement devices/features. e.g. Moorestown does
          not contain i8259, i8254, HPET, legacy BIOS, most of the io ports.
  
 +endif
 +
  config X86_RDC321X
        bool "RDC R-321x SoC"
        depends on X86_32
@@@ -529,18 -512,6 +529,18 @@@ menuconfig PARAVIRT_GUES
  
  if PARAVIRT_GUEST
  
 +config PARAVIRT_TIME_ACCOUNTING
 +      bool "Paravirtual steal time accounting"
 +      select PARAVIRT
 +      default n
 +      ---help---
 +        Select this option to enable fine granularity task steal time
 +        accounting. Time spent executing other tasks in parallel with
 +        the current vCPU is discounted from the vCPU power. To account for
 +        that, there can be a small performance impact.
 +
 +        If in doubt, say N here.
 +
  source "arch/x86/xen/Kconfig"
  
  config KVM_CLOCK
@@@ -646,7 -617,6 +646,7 @@@ config HPET_EMULATE_RT
  config APB_TIMER
         def_bool y if MRST
         prompt "Langwell APB Timer Support" if X86_MRST
 +       select DW_APB_TIMER
         help
           APB timer is the replacement for 8254, HPET on X86 MID platforms.
           The APBT provides a stable time base on SMP
@@@ -710,6 -680,33 +710,6 @@@ config CALGARY_IOMMU_ENABLED_BY_DEFAUL
          Calgary anyway, pass 'iommu=calgary' on the kernel command line.
          If unsure, say Y.
  
 -config AMD_IOMMU
 -      bool "AMD IOMMU support"
 -      select SWIOTLB
 -      select PCI_MSI
 -      select PCI_IOV
 -      depends on X86_64 && PCI && ACPI
 -      ---help---
 -        With this option you can enable support for AMD IOMMU hardware in
 -        your system. An IOMMU is a hardware component which provides
 -        remapping of DMA memory accesses from devices. With an AMD IOMMU you
 -        can isolate the the DMA memory of different devices and protect the
 -        system from misbehaving device drivers or hardware.
 -
 -        You can find out if your system has an AMD IOMMU if you look into
 -        your BIOS for an option to enable it or if you have an IVRS ACPI
 -        table.
 -
 -config AMD_IOMMU_STATS
 -      bool "Export AMD IOMMU statistics to debugfs"
 -      depends on AMD_IOMMU
 -      select DEBUG_FS
 -      ---help---
 -        This option enables code in the AMD IOMMU driver to collect various
 -        statistics about whats happening in the driver and exports that
 -        information to userspace via debugfs.
 -        If unsure, say N.
 -
  # need this always selected by IOMMU for the VIA workaround
  config SWIOTLB
        def_bool y if X86_64
  config IOMMU_HELPER
        def_bool (CALGARY_IOMMU || GART_IOMMU || SWIOTLB || AMD_IOMMU)
  
 -config IOMMU_API
 -      def_bool (AMD_IOMMU || DMAR)
 -
  config MAXSMP
        bool "Enable Maximum number of SMP Processors and NUMA Nodes"
        depends on X86_64 && SMP && DEBUG_KERNEL && EXPERIMENTAL
@@@ -1170,7 -1170,7 +1170,7 @@@ comment "NUMA (Summit) requires SMP, 64
  config AMD_NUMA
        def_bool y
        prompt "Old style AMD Opteron NUMA detection"
 -      depends on NUMA && PCI
 +      depends on X86_64 && NUMA && PCI
        ---help---
          Enable AMD NUMA node topology detection.  You should say Y here if
          you have a multi processor AMD system. This uses an old method to
@@@ -1737,8 -1737,8 +1737,8 @@@ menuconfig AP
          machines with more than one CPU.
  
          In order to use APM, you will need supporting software. For location
 -        and more information, read <file:Documentation/power/pm.txt> and the
 -        Battery Powered Linux mini-HOWTO, available from
 +        and more information, read <file:Documentation/power/apm-acpi.txt>
 +        and the Battery Powered Linux mini-HOWTO, available from
          <http://www.tldp.org/docs.html#howto>.
  
          This driver does not spin down disk drives (see the hdparm(8)
@@@ -1905,7 -1905,7 +1905,7 @@@ config PCI_BIO
  # x86-64 doesn't support PCI BIOS access from long mode so always go direct.
  config PCI_DIRECT
        def_bool y
-       depends on PCI && (X86_64 || (PCI_GODIRECT || PCI_GOANY || PCI_GOOLPC))
+       depends on PCI && (X86_64 || (PCI_GODIRECT || PCI_GOANY || PCI_GOOLPC || PCI_GOMMCONFIG))
  
  config PCI_MMCONFIG
        def_bool y
@@@ -1942,6 -1942,55 +1942,6 @@@ config PCI_CNB20LE_QUIR
  
          You should say N unless you know you need this.
  
 -config DMAR
 -      bool "Support for DMA Remapping Devices (EXPERIMENTAL)"
 -      depends on PCI_MSI && ACPI && EXPERIMENTAL
 -      help
 -        DMA remapping (DMAR) devices support enables independent address
 -        translations for Direct Memory Access (DMA) from devices.
 -        These DMA remapping devices are reported via ACPI tables
 -        and include PCI device scope covered by these DMA
 -        remapping devices.
 -
 -config DMAR_DEFAULT_ON
 -      def_bool y
 -      prompt "Enable DMA Remapping Devices by default"
 -      depends on DMAR
 -      help
 -        Selecting this option will enable a DMAR device at boot time if
 -        one is found. If this option is not selected, DMAR support can
 -        be enabled by passing intel_iommu=on to the kernel. It is
 -        recommended you say N here while the DMAR code remains
 -        experimental.
 -
 -config DMAR_BROKEN_GFX_WA
 -      bool "Workaround broken graphics drivers (going away soon)"
 -      depends on DMAR && BROKEN
 -      ---help---
 -        Current Graphics drivers tend to use physical address
 -        for DMA and avoid using DMA APIs. Setting this config
 -        option permits the IOMMU driver to set a unity map for
 -        all the OS-visible memory. Hence the driver can continue
 -        to use physical addresses for DMA, at least until this
 -        option is removed in the 2.6.32 kernel.
 -
 -config DMAR_FLOPPY_WA
 -      def_bool y
 -      depends on DMAR
 -      ---help---
 -        Floppy disk drivers are known to bypass DMA API calls
 -        thereby failing to work when IOMMU is enabled. This
 -        workaround will setup a 1:1 mapping for the first
 -        16MiB to make floppy (an ISA device) work.
 -
 -config INTR_REMAP
 -      bool "Support for Interrupt Remapping (EXPERIMENTAL)"
 -      depends on X86_64 && X86_IO_APIC && PCI_MSI && ACPI && EXPERIMENTAL
 -      ---help---
 -        Supports Interrupt remapping for IO-APIC and MSI devices.
 -        To use x2apic mode in the CPU's which support x2APIC enhancements or
 -        to support platforms with CPU's having > 8 bit APIC ID, say Y.
 -
  source "drivers/pci/pcie/Kconfig"
  
  source "drivers/pci/Kconfig"
@@@ -2024,44 -2073,11 +2024,44 @@@ config OLP
          Add support for detecting the unique features of the OLPC
          XO hardware.
  
 -config OLPC_XO1
 -      tristate "OLPC XO-1 support"
 -      depends on OLPC && MFD_CS5535
 -      ---help---
 -        Add support for non-essential features of the OLPC XO-1 laptop.
 +config OLPC_XO1_PM
 +      bool "OLPC XO-1 Power Management"
 +      depends on OLPC && MFD_CS5535 && PM_SLEEP
 +      select MFD_CORE
 +      ---help---
 +        Add support for poweroff and suspend of the OLPC XO-1 laptop.
 +
 +config OLPC_XO1_RTC
 +      bool "OLPC XO-1 Real Time Clock"
 +      depends on OLPC_XO1_PM && RTC_DRV_CMOS
 +      ---help---
 +        Add support for the XO-1 real time clock, which can be used as a
 +        programmable wakeup source.
 +
 +config OLPC_XO1_SCI
 +      bool "OLPC XO-1 SCI extras"
 +      depends on OLPC && OLPC_XO1_PM
 +      select POWER_SUPPLY
 +      select GPIO_CS5535
 +      select MFD_CORE
 +      ---help---
 +        Add support for SCI-based features of the OLPC XO-1 laptop:
 +         - EC-driven system wakeups
 +         - Power button
 +         - Ebook switch
 +         - Lid switch
 +         - AC adapter status updates
 +         - Battery status updates
 +
 +config OLPC_XO15_SCI
 +      bool "OLPC XO-1.5 SCI extras"
 +      depends on OLPC && ACPI
 +      select POWER_SUPPLY
 +      ---help---
 +        Add support for SCI-based features of the OLPC XO-1.5 laptop:
 +         - EC-driven system wakeups
 +         - AC adapter status updates
 +         - Battery status updates
  
  endif # X86_32
  
diff --combined drivers/pci/probe.c
index 9ab492f21f862ce73a1b994e1d1c259e73d6998f,fd6066dfde5cd8b01c8e0c787a755c620dd6bd53..795c9026d55fccfa512d9c2393973947af05dab9
@@@ -52,7 -52,6 +52,7 @@@ static void release_pcibus_dev(struct d
        if (pci_bus->bridge)
                put_device(pci_bus->bridge);
        pci_bus_remove_resources(pci_bus);
 +      pci_release_bus_of_node(pci_bus);
        kfree(pci_bus);
  }
  
@@@ -68,21 -67,6 +68,6 @@@ static int __init pcibus_class_init(voi
  }
  postcore_initcall(pcibus_class_init);
  
- /*
-  * Translate the low bits of the PCI base
-  * to the resource type
-  */
- static inline unsigned int pci_calc_resource_flags(unsigned int flags)
- {
-       if (flags & PCI_BASE_ADDRESS_SPACE_IO)
-               return IORESOURCE_IO;
-       if (flags & PCI_BASE_ADDRESS_MEM_PREFETCH)
-               return IORESOURCE_MEM | IORESOURCE_PREFETCH;
-       return IORESOURCE_MEM;
- }
  static u64 pci_size(u64 base, u64 maxbase, u64 mask)
  {
        u64 size = mask & maxbase;      /* Find the significant bits */
        return size;
  }
  
- static inline enum pci_bar_type decode_bar(struct resource *res, u32 bar)
+ static inline unsigned long decode_bar(struct pci_dev *dev, u32 bar)
  {
+       u32 mem_type;
+       unsigned long flags;
        if ((bar & PCI_BASE_ADDRESS_SPACE) == PCI_BASE_ADDRESS_SPACE_IO) {
-               res->flags = bar & ~PCI_BASE_ADDRESS_IO_MASK;
-               return pci_bar_io;
+               flags = bar & ~PCI_BASE_ADDRESS_IO_MASK;
+               flags |= IORESOURCE_IO;
+               return flags;
        }
  
-       res->flags = bar & ~PCI_BASE_ADDRESS_MEM_MASK;
-       if (res->flags & PCI_BASE_ADDRESS_MEM_TYPE_64)
-               return pci_bar_mem64;
-       return pci_bar_mem32;
+       flags = bar & ~PCI_BASE_ADDRESS_MEM_MASK;
+       flags |= IORESOURCE_MEM;
+       if (flags & PCI_BASE_ADDRESS_MEM_PREFETCH)
+               flags |= IORESOURCE_PREFETCH;
+       mem_type = bar & PCI_BASE_ADDRESS_MEM_TYPE_MASK;
+       switch (mem_type) {
+       case PCI_BASE_ADDRESS_MEM_TYPE_32:
+               break;
+       case PCI_BASE_ADDRESS_MEM_TYPE_1M:
+               dev_info(&dev->dev, "1M mem BAR treated as 32-bit BAR\n");
+               break;
+       case PCI_BASE_ADDRESS_MEM_TYPE_64:
+               flags |= IORESOURCE_MEM_64;
+               break;
+       default:
+               dev_warn(&dev->dev,
+                        "mem unknown type %x treated as 32-bit BAR\n",
+                        mem_type);
+               break;
+       }
+       return flags;
  }
  
  /**
@@@ -165,9 -170,9 +171,9 @@@ int __pci_read_base(struct pci_dev *dev
                l = 0;
  
        if (type == pci_bar_unknown) {
-               type = decode_bar(res, l);
-               res->flags |= pci_calc_resource_flags(l) | IORESOURCE_SIZEALIGN;
-               if (type == pci_bar_io) {
+               res->flags = decode_bar(dev, l);
+               res->flags |= IORESOURCE_SIZEALIGN;
+               if (res->flags & IORESOURCE_IO) {
                        l &= PCI_BASE_ADDRESS_IO_MASK;
                        mask = PCI_BASE_ADDRESS_IO_MASK & (u32) IO_SPACE_LIMIT;
                } else {
                mask = (u32)PCI_ROM_ADDRESS_MASK;
        }
  
-       if (type == pci_bar_mem64) {
+       if (res->flags & IORESOURCE_MEM_64) {
                u64 l64 = l;
                u64 sz64 = sz;
                u64 mask64 = mask | (u64)~0 << 32;
                        goto fail;
                }
  
-               res->flags |= IORESOURCE_MEM_64;
                if ((sizeof(resource_size_t) < 8) && l) {
                        /* Address above 32-bit boundary; disable the BAR */
                        pci_write_config_dword(dev, pos, 0);
        }
  
   out:
-       return (type == pci_bar_mem64) ? 1 : 0;
+       return (res->flags & IORESOURCE_MEM_64) ? 1 : 0;
   fail:
        res->flags = 0;
        goto out;
@@@ -284,10 -288,6 +289,6 @@@ static void __devinit pci_read_bridge_i
                if (!res->end)
                        res->end = limit + 0xfff;
                dev_printk(KERN_DEBUG, &dev->dev, "  bridge window %pR\n", res);
-       } else {
-               dev_printk(KERN_DEBUG, &dev->dev,
-                        "  bridge window [io  %#06lx-%#06lx] (disabled)\n",
-                                base, limit);
        }
  }
  
@@@ -308,10 -308,6 +309,6 @@@ static void __devinit pci_read_bridge_m
                res->start = base;
                res->end = limit + 0xfffff;
                dev_printk(KERN_DEBUG, &dev->dev, "  bridge window %pR\n", res);
-       } else {
-               dev_printk(KERN_DEBUG, &dev->dev,
-                       "  bridge window [mem %#010lx-%#010lx] (disabled)\n",
-                                        base, limit + 0xfffff);
        }
  }
  
@@@ -359,10 -355,6 +356,6 @@@ static void __devinit pci_read_bridge_m
                res->start = base;
                res->end = limit + 0xfffff;
                dev_printk(KERN_DEBUG, &dev->dev, "  bridge window %pR\n", res);
-       } else {
-               dev_printk(KERN_DEBUG, &dev->dev,
-                    "  bridge window [mem %#010lx-%#010lx pref] (disabled)\n",
-                                        base, limit + 0xfffff);
        }
  }
  
@@@ -589,7 -581,7 +582,7 @@@ static struct pci_bus *pci_alloc_child_
  
        child->self = bridge;
        child->bridge = get_device(&bridge->dev);
 -
 +      pci_set_bus_of_node(child);
        pci_set_bus_speed(child);
  
        /* Set up default resource pointers and names.. */
@@@ -725,12 -717,14 +718,14 @@@ int __devinit pci_scan_bridge(struct pc
                pci_write_config_word(dev, PCI_STATUS, 0xffff);
  
                /* Prevent assigning a bus number that already exists.
-                * This can happen when a bridge is hot-plugged */
-               if (pci_find_bus(pci_domain_nr(bus), max+1))
-                       goto out;
-               child = pci_add_new_bus(bus, dev, ++max);
-               if (!child)
-                       goto out;
+                * This can happen when a bridge is hot-plugged, so in
+                * this case we only re-scan this bus. */
+               child = pci_find_bus(pci_domain_nr(bus), max+1);
+               if (!child) {
+                       child = pci_add_new_bus(bus, dev, ++max);
+                       if (!child)
+                               goto out;
+               }
                buses = (buses & 0xff000000)
                      | ((unsigned int)(child->primary)     <<  0)
                      | ((unsigned int)(child->secondary)   <<  8)
@@@ -1039,7 -1033,6 +1034,7 @@@ static void pci_release_dev(struct devi
  
        pci_dev = to_pci_dev(dev);
        pci_release_capabilities(pci_dev);
 +      pci_release_of_node(pci_dev);
        kfree(pci_dev);
  }
  
@@@ -1159,8 -1152,6 +1154,8 @@@ static struct pci_dev *pci_scan_device(
        dev->vendor = l & 0xffff;
        dev->device = (l >> 16) & 0xffff;
  
 +      pci_set_of_node(dev);
 +
        if (pci_setup_device(dev)) {
                kfree(dev);
                return NULL;
@@@ -1413,7 -1404,6 +1408,7 @@@ struct pci_bus * pci_create_bus(struct 
                goto dev_reg_err;
        b->bridge = get_device(dev);
        device_enable_async_suspend(b->bridge);
 +      pci_set_bus_of_node(b);
  
        if (!parent)
                set_dev_node(b->bridge, pcibus_to_node(b));
diff --combined include/linux/pci.h
index 3a5626df37cec41e50b02b2a822ee191501a2a32,7053248a2cd1096137b0c5584582d82f7195204d..f27893b3b724205b3411e9081b99b4ca8e4429c2
@@@ -49,7 -49,7 +49,7 @@@
  #include <linux/compiler.h>
  #include <linux/errno.h>
  #include <linux/kobject.h>
 -#include <asm/atomic.h>
 +#include <linux/atomic.h>
  #include <linux/device.h>
  #include <linux/io.h>
  #include <linux/irqreturn.h>
@@@ -843,8 -843,8 +843,8 @@@ void pci_enable_ido(struct pci_dev *dev
  void pci_disable_ido(struct pci_dev *dev, unsigned long type);
  
  enum pci_obff_signal_type {
-       PCI_EXP_OBFF_SIGNAL_L0,
-       PCI_EXP_OBFF_SIGNAL_ALWAYS,
+       PCI_EXP_OBFF_SIGNAL_L0 = 0,
+       PCI_EXP_OBFF_SIGNAL_ALWAYS = 1,
  };
  int pci_enable_obff(struct pci_dev *dev, enum pci_obff_signal_type);
  void pci_disable_obff(struct pci_dev *dev);
@@@ -879,7 -879,7 +879,7 @@@ void pdev_enable_device(struct pci_dev 
  void pdev_sort_resources(struct pci_dev *, struct resource_list *);
  int pci_enable_resources(struct pci_dev *, int mask);
  void pci_fixup_irqs(u8 (*)(struct pci_dev *, u8 *),
-                   int (*)(struct pci_dev *, u8, u8));
+                   int (*)(const struct pci_dev *, u8, u8));
  #define HAVE_PCI_REQ_REGIONS  2
  int __must_check pci_request_regions(struct pci_dev *, const char *);
  int __must_check pci_request_regions_exclusive(struct pci_dev *, const char *);
@@@ -1589,44 -1589,5 +1589,44 @@@ int pci_vpd_find_tag(const u8 *buf, uns
  int pci_vpd_find_info_keyword(const u8 *buf, unsigned int off,
                              unsigned int len, const char *kw);
  
 +/* PCI <-> OF binding helpers */
 +#ifdef CONFIG_OF
 +struct device_node;
 +extern void pci_set_of_node(struct pci_dev *dev);
 +extern void pci_release_of_node(struct pci_dev *dev);
 +extern void pci_set_bus_of_node(struct pci_bus *bus);
 +extern void pci_release_bus_of_node(struct pci_bus *bus);
 +
 +/* Arch may override this (weak) */
 +extern struct device_node * __weak pcibios_get_phb_of_node(struct pci_bus *bus);
 +
 +static inline struct device_node *pci_device_to_OF_node(struct pci_dev *pdev)
 +{
 +      return pdev ? pdev->dev.of_node : NULL;
 +}
 +
 +static inline struct device_node *pci_bus_to_OF_node(struct pci_bus *bus)
 +{
 +      return bus ? bus->dev.of_node : NULL;
 +}
 +
 +#else /* CONFIG_OF */
 +static inline void pci_set_of_node(struct pci_dev *dev) { }
 +static inline void pci_release_of_node(struct pci_dev *dev) { }
 +static inline void pci_set_bus_of_node(struct pci_bus *bus) { }
 +static inline void pci_release_bus_of_node(struct pci_bus *bus) { }
 +#endif  /* CONFIG_OF */
 +
 +/**
 + * pci_find_upstream_pcie_bridge - find upstream PCIe-to-PCI bridge of a device
 + * @pdev: the PCI device
 + *
 + * if the device is PCIE, return NULL
 + * if the device isn't connected to a PCIe bridge (that is its parent is a
 + * legacy PCI bridge and the bridge is directly connected to bus 0), return its
 + * parent
 + */
 +struct pci_dev *pci_find_upstream_pcie_bridge(struct pci_dev *pdev);
 +
  #endif /* __KERNEL__ */
  #endif /* LINUX_PCI_H */