Merge branch 'upstream' of git://git.linux-mips.org/pub/scm/ralf/upstream-linus
authorLinus Torvalds <torvalds@linux-foundation.org>
Wed, 30 May 2012 01:27:19 +0000 (18:27 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Wed, 30 May 2012 01:27:19 +0000 (18:27 -0700)
Pull MIPS updates from Ralf Baechle:
 "The whole series has been sitting in -next for quite a while with no
  complaints.  The last change to the series was before the weekend the
  removal of an SPI patch which Grant - even though previously acked by
  himself - appeared to raise objections.  So I removed it until the
  situation is clarified.  Other than that all the patches have the acks
  from their respective maintainers, all MIPS and x86 defconfigs are
  building fine and I'm not aware of any problems introduced by this
  series.

  Among the key features for this patch series is a sizable patchset for
  Lantiq which among other things introduces support for Lantiq's
  flagship product, the FALCON SOC.  It also means that the opensource
  developers behind this patchset have overtaken Lantiq's competing
  inhouse development team that was working behind closed doors.

  Less noteworthy the ath79 patchset which adds support for a few more
  chip variants, cleanups and fixes.  Finally the usual dose of tweaking
  of generic code."

Fix up trivial conflicts in arch/mips/lantiq/xway/gpio_{ebu,stp}.c where
printk spelling fixes clashed with file move and eventual removal of the
printk.

* 'upstream' of git://git.linux-mips.org/pub/scm/ralf/upstream-linus: (81 commits)
  MIPS: lantiq: remove orphaned code
  MIPS: Remove all -Wall and almost all -Werror usage from arch/mips.
  MIPS: lantiq: implement support for FALCON soc
  MTD: MIPS: lantiq: verify that the NOR interface is available on falcon soc
  MTD: MIPS: lantiq: implement OF support
  watchdog: MIPS: lantiq: implement OF support and minor fixes
  SERIAL: MIPS: lantiq: implement OF support
  GPIO: MIPS: lantiq: convert gpio-stp-xway to OF
  GPIO: MIPS: lantiq: convert gpio-mm-lantiq to OF and of_mm_gpio
  GPIO: MIPS: lantiq: move gpio-stp and gpio-ebu to the subsystem folder
  MIPS: pci: convert lantiq driver to OF
  MIPS: lantiq: convert dma to platform driver
  MIPS: lantiq: implement support for clkdev api
  MIPS: lantiq: drop ltq_gpio_request() and gpio_to_irq()
  OF: MIPS: lantiq: implement irq_domain support
  OF: MIPS: lantiq: implement OF support
  MIPS: lantiq: drop mips_machine support
  OF: PCI: const usage needed by MIPS
  MIPS: Cavium: Remove smp_reserve_lock.
  MIPS: Move cache setup to setup_arch().
  ...

1  2 
arch/mips/Kconfig
arch/mips/kernel/perf_event_mipsxx.c
arch/mips/kernel/smp.c
arch/mips/lantiq/xway/gpio.c
drivers/gpio/Kconfig
drivers/gpio/Makefile
drivers/pci/pci.c
include/linux/pci.h

diff --combined arch/mips/Kconfig
index 77050671eeef5ba9629cc5e991b23459350aa555,54be81c5a3b69e3bbc815b8a1115a073de13f870..09ab87ee6fef654eef0220ab05b1224492947efc
@@@ -8,7 -8,6 +8,7 @@@ config MIP
        select HAVE_PERF_EVENTS
        select PERF_USE_VMALLOC
        select HAVE_ARCH_KGDB
 +      select ARCH_HAVE_CUSTOM_GPIO_H
        select HAVE_FUNCTION_TRACER
        select HAVE_FUNCTION_TRACE_MCOUNT_TEST
        select HAVE_DYNAMIC_FTRACE
        select HAVE_MEMBLOCK
        select HAVE_MEMBLOCK_NODE_MAP
        select ARCH_DISCARD_MEMBLOCK
 +      select GENERIC_SMP_IDLE_THREAD
 +      select BUILDTIME_EXTABLE_SORT
 +      select GENERIC_CLOCKEVENTS
 +      select GENERIC_CMOS_UPDATE
  
  menu "Machine selection"
  
@@@ -233,8 -228,9 +233,9 @@@ config LANTI
        select ARCH_REQUIRE_GPIOLIB
        select SWAP_IO_SPACE
        select BOOT_RAW
-       select HAVE_CLK
-       select MIPS_MACHINE
+       select HAVE_MACH_CLKDEV
+       select CLKDEV_LOOKUP
+       select USE_OF
  
  config LASAT
        bool "LASAT Networks platforms"
@@@ -861,6 -857,14 +862,6 @@@ config GENERIC_CALIBRATE_DELA
        bool
        default y
  
 -config GENERIC_CLOCKEVENTS
 -      bool
 -      default y
 -
 -config GENERIC_CMOS_UPDATE
 -      bool
 -      default y
 -
  config SCHED_OMIT_FRAME_POINTER
        bool
        default y
@@@ -998,12 -1002,12 +999,12 @@@ config HOLES_IN_ZON
        bool
  
  #
 -# Endianess selection.  Sufficiently obscure so many users don't know what to
 +# Endianness selection.  Sufficiently obscure so many users don't know what to
  # answer,so we try hard to limit the available choices.  Also the use of a
  # choice statement should be more obvious to the user.
  #
  choice
 -      prompt "Endianess selection"
 +      prompt "Endianness selection"
        help
          Some MIPS machines can be configured for either little or big endian
          byte order. These modes require different kernels and a different
@@@ -1783,10 -1787,12 +1784,12 @@@ endchoic
  
  config FORCE_MAX_ZONEORDER
        int "Maximum zone order"
-       range 13 64 if SYS_SUPPORTS_HUGETLBFS && PAGE_SIZE_32KB
-       default "13" if SYS_SUPPORTS_HUGETLBFS && PAGE_SIZE_32KB
-       range 12 64 if SYS_SUPPORTS_HUGETLBFS && PAGE_SIZE_16KB
-       default "12" if SYS_SUPPORTS_HUGETLBFS && PAGE_SIZE_16KB
+       range 14 64 if HUGETLB_PAGE && PAGE_SIZE_64KB
+       default "14" if HUGETLB_PAGE && PAGE_SIZE_64KB
+       range 13 64 if HUGETLB_PAGE && PAGE_SIZE_32KB
+       default "13" if HUGETLB_PAGE && PAGE_SIZE_32KB
+       range 12 64 if HUGETLB_PAGE && PAGE_SIZE_16KB
+       default "12" if HUGETLB_PAGE && PAGE_SIZE_16KB
        range 11 64
        default "11"
        help
@@@ -2047,6 -2053,9 +2050,6 @@@ config CPU_HAS_SYN
        depends on !CPU_R3000
        default y
  
 -config GENERIC_CLOCKEVENTS_BROADCAST
 -      bool
 -
  #
  # CPU non-features
  #
@@@ -2208,6 -2217,8 +2211,6 @@@ config NR_CPU
          performance should round up your number of processors to the next
          power of two.
  
 -source "kernel/time/Kconfig"
 -
  #
  # Timer Interrupt Frequency Configuration
  #
index ab73fa2fb9b5707343c6081b821faf9775b90a2f,574b4e9df50fc708e76a31b748a74d85a2eba228..f29099b104c497e5cb4b4a3d368a801fc6c60d05
@@@ -1325,7 -1325,7 +1325,7 @@@ static int mipsxx_pmu_handle_shared_irq
  
        regs = get_irq_regs();
  
 -      perf_sample_data_init(&data, 0);
 +      perf_sample_data_init(&data, 0, 0);
  
        switch (counters) {
  #define HANDLE_COUNTER(n)                                             \
@@@ -1532,7 -1532,8 +1532,8 @@@ init_hw_perf_events(void
                irq = MSC01E_INT_BASE + MSC01E_INT_PERFCTR;
        } else {
  #endif
-               if (cp0_perfcount_irq >= 0)
+               if ((cp0_perfcount_irq >= 0) &&
+                               (cp0_compare_irq != cp0_perfcount_irq))
                        irq = MIPS_CPU_IRQ_BASE + cp0_perfcount_irq;
                else
                        irq = -1;
diff --combined arch/mips/kernel/smp.c
index 71a95f55a6493be90e4695de4d4c948a0dfa465f,dc019a1f128dd8d4bb5200966798117a447c7038..48650c8180401aeb1ce1c3f2713471d9c6e45536
@@@ -106,7 -106,7 +106,7 @@@ asmlinkage __cpuinit void start_seconda
  #endif /* CONFIG_MIPS_MT_SMTC */
        cpu_probe();
        cpu_report();
-       per_cpu_trap_init();
+       per_cpu_trap_init(false);
        mips_clockevent_init();
        mp_ops->init_secondary();
  
@@@ -186,9 -186,61 +186,9 @@@ void __devinit smp_prepare_boot_cpu(voi
        cpu_set(0, cpu_callin_map);
  }
  
 -/*
 - * Called once for each "cpu_possible(cpu)".  Needs to spin up the cpu
 - * and keep control until "cpu_online(cpu)" is set.  Note: cpu is
 - * physical, not logical.
 - */
 -static struct task_struct *cpu_idle_thread[NR_CPUS];
 -
 -struct create_idle {
 -      struct work_struct work;
 -      struct task_struct *idle;
 -      struct completion done;
 -      int cpu;
 -};
 -
 -static void __cpuinit do_fork_idle(struct work_struct *work)
 +int __cpuinit __cpu_up(unsigned int cpu, struct task_struct *tidle)
  {
 -      struct create_idle *c_idle =
 -              container_of(work, struct create_idle, work);
 -
 -      c_idle->idle = fork_idle(c_idle->cpu);
 -      complete(&c_idle->done);
 -}
 -
 -int __cpuinit __cpu_up(unsigned int cpu)
 -{
 -      struct task_struct *idle;
 -
 -      /*
 -       * Processor goes to start_secondary(), sets online flag
 -       * The following code is purely to make sure
 -       * Linux can schedule processes on this slave.
 -       */
 -      if (!cpu_idle_thread[cpu]) {
 -              /*
 -               * Schedule work item to avoid forking user task
 -               * Ported from arch/x86/kernel/smpboot.c
 -               */
 -              struct create_idle c_idle = {
 -                      .cpu    = cpu,
 -                      .done   = COMPLETION_INITIALIZER_ONSTACK(c_idle.done),
 -              };
 -
 -              INIT_WORK_ONSTACK(&c_idle.work, do_fork_idle);
 -              schedule_work(&c_idle.work);
 -              wait_for_completion(&c_idle.done);
 -              idle = cpu_idle_thread[cpu] = c_idle.idle;
 -
 -              if (IS_ERR(idle))
 -                      panic(KERN_ERR "Fork failed for CPU %d", cpu);
 -      } else {
 -              idle = cpu_idle_thread[cpu];
 -              init_idle(idle, cpu);
 -      }
 -
 -      mp_ops->boot_secondary(cpu, idle);
 +      mp_ops->boot_secondary(cpu, tidle);
  
        /*
         * Trust is futile.  We should really have timeouts ...
index c429a5bc080fdfca9fd9c40eb61c5cdb9b8198d6,a8b2edc808555f243f9a5617e43a93c964cd2e3b..2ab39e93d9beb711a7f8b3250a69e2ec094a287d
@@@ -36,18 -36,6 +36,6 @@@ struct ltq_gpio 
  
  static struct ltq_gpio ltq_gpio_port[MAX_PORTS];
  
- int gpio_to_irq(unsigned int gpio)
- {
-       return -EINVAL;
- }
- EXPORT_SYMBOL(gpio_to_irq);
- int irq_to_gpio(unsigned int gpio)
- {
-       return -EINVAL;
- }
- EXPORT_SYMBOL(irq_to_gpio);
  int ltq_gpio_request(unsigned int pin, unsigned int alt0,
        unsigned int alt1, unsigned int dir, const char *name)
  {
@@@ -188,7 -176,7 +176,7 @@@ int __init ltq_gpio_init(void
        int ret = platform_driver_register(&ltq_gpio_driver);
  
        if (ret)
 -              pr_info("ltq_gpio : Error registering platfom driver!");
 +              pr_info("ltq_gpio : Error registering platform driver!");
        return ret;
  }
  
diff --combined drivers/gpio/Kconfig
index 0356099ae040ea95836ec77878d19a207da496e5,8fae07935cd19e1b1d84477f8d633f6a7886cba7..c4067d0141f7c083ea9de58c72dc0ea3122ca300
@@@ -2,14 -2,6 +2,14 @@@
  # GPIO infrastructure and drivers
  #
  
 +config ARCH_HAVE_CUSTOM_GPIO_H
 +      bool
 +      help
 +        Selecting this config option from the architecture Kconfig allows
 +        the architecture to provide a custom asm/gpio.h implementation
 +        overriding the default implementations.  New uses of this are
 +        strongly discouraged.
 +
  config ARCH_WANT_OPTIONAL_GPIOLIB
        bool
        help
@@@ -45,10 -37,6 +45,10 @@@ menuconfig GPIOLI
  
  if GPIOLIB
  
 +config OF_GPIO
 +      def_bool y
 +      depends on OF && !SPARC
 +
  config DEBUG_GPIO
        bool "Debug GPIO calls"
        depends on DEBUG_KERNEL
@@@ -103,17 -91,19 +103,25 @@@ config GPIO_IT8761
        help
          Say yes here to support GPIO functionality of IT8761E super I/O chip.
  
 +config GPIO_EM
 +      tristate "Emma Mobile GPIO"
 +      depends on ARM
 +      help
 +        Say yes here to support GPIO on Renesas Emma Mobile SoCs.
 +
  config GPIO_EP93XX
        def_bool y
        depends on ARCH_EP93XX
        select GPIO_GENERIC
  
+ config GPIO_MM_LANTIQ
+       bool "Lantiq Memory mapped GPIOs"
+       depends on LANTIQ && SOC_XWAY
+       help
+         This enables support for memory mapped GPIOs on the External Bus Unit
+         (EBU) found on Lantiq SoCs. The gpios are output only as they are
+         created by attaching a 16bit latch to the bus.
  config GPIO_MPC5200
        def_bool y
        depends on PPC_MPC52xx
@@@ -167,14 -157,6 +175,14 @@@ config GPIO_PX
        help
          Say yes here to support the PXA GPIO device
  
 +config GPIO_STA2X11
 +      bool "STA2x11/ConneXt GPIO support"
 +      depends on MFD_STA2X11
 +      select GENERIC_IRQ_CHIP
 +      help
 +        Say yes here to support the STA2x11/ConneXt GPIO device.
 +        The GPIO module has 128 GPIO pins with alternate functions.
 +
  config GPIO_XILINX
        bool "Xilinx GPIO support"
        depends on PPC_OF || MICROBLAZE
@@@ -188,13 -170,13 +196,13 @@@ config GPIO_VR41X
          Say yes here to support the NEC VR4100 series General-purpose I/O Uint
  
  config GPIO_SCH
 -      tristate "Intel SCH/TunnelCreek GPIO"
 +      tristate "Intel SCH/TunnelCreek/Centerton GPIO"
        depends on PCI && X86
        select MFD_CORE
        select LPC_SCH
        help
 -        Say yes here to support GPIO interface on Intel Poulsbo SCH
 -        or Intel Tunnel Creek processor.
 +        Say yes here to support GPIO interface on Intel Poulsbo SCH,
 +        Intel Tunnel Creek processor or Intel Centerton processor.
          The Intel SCH contains a total of 14 GPIO pins. Ten GPIOs are
          powered by the core power rail and are turned off during sleep
          modes (S3 and higher). The remaining four GPIOs are powered by
          system from the Suspend-to-RAM state.
          The Intel Tunnel Creek processor has 5 GPIOs powered by the
          core power rail and 9 from suspend power supply.
 +        The Intel Centerton processor has a total of 30 GPIO pins.
 +        Twenty-one are powered by the core power rail and 9 from the
 +        suspend power supply.
 +
 +config GPIO_ICH
 +      tristate "Intel ICH GPIO"
 +      depends on PCI && X86
 +      select MFD_CORE
 +      select LPC_ICH
 +      help
 +        Say yes here to support the GPIO functionality of a number of Intel
 +        ICH-based chipsets.  Currently supported devices: ICH6, ICH7, ICH8
 +        ICH9, ICH10, Series 5/3400 (eg Ibex Peak), Series 6/C200 (eg
 +        Cougar Point), NM10 (Tiger Point), and 3100 (Whitmore Lake).
 +
 +        If unsure, say N.
  
  config GPIO_VX855
        tristate "VIA VX855/VX875 GPIO"
@@@ -285,7 -251,7 +293,7 @@@ config GPIO_MC9S08DZ6
          Select this to enable the MC9S08DZ60 GPIO driver
  
  config GPIO_PCA953X
 -      tristate "PCA953x, PCA955x, TCA64xx, and MAX7310 I/O ports"
 +      tristate "PCA953x, PCA955x, PCA957x, TCA64xx, and MAX7310 I/O ports"
        depends on I2C
        help
          Say yes here to provide access to several register-oriented
  
          4 bits:       pca9536, pca9537
  
 -        8 bits:       max7310, pca9534, pca9538, pca9554, pca9557,
 -                      tca6408
 +        8 bits:       max7310, max7315, pca6107, pca9534, pca9538, pca9554,
 +                      pca9556, pca9557, pca9574, tca6408
  
 -        16 bits:      pca9535, pca9539, pca9555, tca6416
 +        16 bits:      max7312, max7313, pca9535, pca9539, pca9555, pca9575,
 +                      tca6416
  
  config GPIO_PCA953X_IRQ
        bool "Interrupt controller support for PCA953x"
@@@ -331,15 -296,6 +339,15 @@@ config GPIO_PCF857
          This driver provides an in-kernel interface to those GPIOs using
          platform-neutral GPIO calls.
  
 +config GPIO_RC5T583
 +      bool "RICOH RC5T583 GPIO"
 +      depends on MFD_RC5T583
 +      help
 +        Select this option to enable GPIO driver for the Ricoh RC5T583
 +        chip family.
 +        This driver provides the support for driving/reading the gpio pins
 +        of RC5T583 device through standard gpio library.
 +
  config GPIO_SX150X
        bool "Semtech SX150x I2C GPIO expander"
        depends on I2C=y
@@@ -358,6 -314,16 +366,16 @@@ config GPIO_STMP
          This enables support for the GPIOs found on the STMPE I/O
          Expanders.
  
+ config GPIO_STP_XWAY
+       bool "XWAY STP GPIOs"
+       depends on SOC_XWAY
+       help
+         This enables support for the Serial To Parallel (STP) unit found on
+         XWAY SoC. The STP allows the SoC to drive a shift registers cascade,
+         that can be up to 24 bit. This peripheral is aimed at driving leds.
+         Some of the gpios/leds can be auto updated by the soc with dsl and
+         phy status.
  config GPIO_TC3589X
        bool "TC3589X GPIOs"
        depends on MFD_TC3589X
@@@ -451,7 -417,6 +469,7 @@@ config GPIO_BT8X
  config GPIO_LANGWELL
        bool "Intel Langwell/Penwell GPIO support"
        depends on PCI && X86
 +      select IRQ_DOMAIN
        help
          Say Y here to support Intel Langwell/Penwell GPIO.
  
@@@ -567,12 -532,4 +585,12 @@@ config GPIO_TPS6591
        help
          Select this option to enable GPIO driver for the TPS65910
          chip family.
 +
 +config GPIO_MSIC
 +      bool "Intel MSIC mixed signal gpio support"
 +      depends on MFD_INTEL_MSIC
 +      help
 +        Enable support for GPIO on intel MSIC controllers found in
 +        intel MID devices
 +
  endif
diff --combined drivers/gpio/Makefile
index fde36e5e35370caebc03a72fea4e013b808652aa,ed1c96db404bbb419a5e8e2f729655c400bbacaa..0f55662002c357c4d61c673b81655e4c74844742
@@@ -3,7 -3,6 +3,7 @@@
  ccflags-$(CONFIG_DEBUG_GPIO)  += -DDEBUG
  
  obj-$(CONFIG_GPIOLIB)         += gpiolib.o devres.o
 +obj-$(CONFIG_OF_GPIO)         += gpiolib-of.o
  
  # Device drivers. Generally keep list sorted alphabetically
  obj-$(CONFIG_GPIO_GENERIC)    += gpio-generic.o
@@@ -16,10 -15,8 +16,10 @@@ obj-$(CONFIG_GPIO_BT8XX)    += gpio-bt8xx.
  obj-$(CONFIG_GPIO_CS5535)     += gpio-cs5535.o
  obj-$(CONFIG_GPIO_DA9052)     += gpio-da9052.o
  obj-$(CONFIG_ARCH_DAVINCI)    += gpio-davinci.o
 +obj-$(CONFIG_GPIO_EM)         += gpio-em.o
  obj-$(CONFIG_GPIO_EP93XX)     += gpio-ep93xx.o
  obj-$(CONFIG_GPIO_GE_FPGA)    += gpio-ge.o
 +obj-$(CONFIG_GPIO_ICH)                += gpio-ich.o
  obj-$(CONFIG_GPIO_IT8761E)    += gpio-it8761e.o
  obj-$(CONFIG_GPIO_JANZ_TTL)   += gpio-janz-ttl.o
  obj-$(CONFIG_ARCH_KS8695)     += gpio-ks8695.o
@@@ -33,27 -30,27 +33,29 @@@ obj-$(CONFIG_GPIO_MC33880) += gpio-mc33
  obj-$(CONFIG_GPIO_MC9S08DZ60) += gpio-mc9s08dz60.o
  obj-$(CONFIG_GPIO_MCP23S08)   += gpio-mcp23s08.o
  obj-$(CONFIG_GPIO_ML_IOH)     += gpio-ml-ioh.o
+ obj-$(CONFIG_GPIO_MM_LANTIQ)  += gpio-mm-lantiq.o
  obj-$(CONFIG_GPIO_MPC5200)    += gpio-mpc5200.o
  obj-$(CONFIG_GPIO_MPC8XXX)    += gpio-mpc8xxx.o
 +obj-$(CONFIG_GPIO_MSIC)               += gpio-msic.o
  obj-$(CONFIG_GPIO_MSM_V1)     += gpio-msm-v1.o
  obj-$(CONFIG_GPIO_MSM_V2)     += gpio-msm-v2.o
  obj-$(CONFIG_GPIO_MXC)                += gpio-mxc.o
  obj-$(CONFIG_GPIO_MXS)                += gpio-mxs.o
 -obj-$(CONFIG_PLAT_NOMADIK)    += gpio-nomadik.o
  obj-$(CONFIG_ARCH_OMAP)               += gpio-omap.o
  obj-$(CONFIG_GPIO_PCA953X)    += gpio-pca953x.o
  obj-$(CONFIG_GPIO_PCF857X)    += gpio-pcf857x.o
  obj-$(CONFIG_GPIO_PCH)                += gpio-pch.o
  obj-$(CONFIG_GPIO_PL061)      += gpio-pl061.o
  obj-$(CONFIG_GPIO_PXA)                += gpio-pxa.o
 +obj-$(CONFIG_GPIO_RC5T583)    += gpio-rc5t583.o
  obj-$(CONFIG_GPIO_RDC321X)    += gpio-rdc321x.o
  obj-$(CONFIG_PLAT_SAMSUNG)    += gpio-samsung.o
  obj-$(CONFIG_ARCH_SA1100)     += gpio-sa1100.o
  obj-$(CONFIG_GPIO_SCH)                += gpio-sch.o
  obj-$(CONFIG_GPIO_SODAVILLE)  += gpio-sodaville.o
 +obj-$(CONFIG_GPIO_STA2X11)    += gpio-sta2x11.o
  obj-$(CONFIG_GPIO_STMPE)      += gpio-stmpe.o
+ obj-$(CONFIG_GPIO_STP_XWAY)   += gpio-stp-xway.o
  obj-$(CONFIG_GPIO_SX150X)     += gpio-sx150x.o
  obj-$(CONFIG_GPIO_TC3589X)    += gpio-tc3589x.o
  obj-$(CONFIG_ARCH_TEGRA)      += gpio-tegra.o
diff --combined drivers/pci/pci.c
index 8f169002dc7ec6b4581d4f7f049c35ff9ed7e8a2,8b91fe741f6a1b0780aa4e97137541c8a277eaf2..447e83472c01558705d0685f7fd6af17a6f8deef
@@@ -22,7 -22,6 +22,7 @@@
  #include <linux/interrupt.h>
  #include <linux/device.h>
  #include <linux/pm_runtime.h>
 +#include <asm-generic/pci-bridge.h>
  #include <asm/setup.h>
  #include "pci.h"
  
@@@ -2370,7 -2369,7 +2370,7 @@@ void pci_enable_acs(struct pci_dev *dev
   * number is always 0 (see the Implementation Note in section 2.2.8.1 of
   * the PCI Express Base Specification, Revision 2.1)
   */
- u8 pci_swizzle_interrupt_pin(struct pci_dev *dev, u8 pin)
+ u8 pci_swizzle_interrupt_pin(const struct pci_dev *dev, u8 pin)
  {
        int slot;
  
@@@ -3165,12 -3164,18 +3165,12 @@@ static int pci_parent_bus_reset(struct 
        return 0;
  }
  
 -static int pci_dev_reset(struct pci_dev *dev, int probe)
 +static int __pci_dev_reset(struct pci_dev *dev, int probe)
  {
        int rc;
  
        might_sleep();
  
 -      if (!probe) {
 -              pci_cfg_access_lock(dev);
 -              /* block PM suspend, driver probe, etc. */
 -              device_lock(&dev->dev);
 -      }
 -
        rc = pci_dev_specific_reset(dev, probe);
        if (rc != -ENOTTY)
                goto done;
  
        rc = pci_parent_bus_reset(dev, probe);
  done:
 +      return rc;
 +}
 +
 +static int pci_dev_reset(struct pci_dev *dev, int probe)
 +{
 +      int rc;
 +
 +      if (!probe) {
 +              pci_cfg_access_lock(dev);
 +              /* block PM suspend, driver probe, etc. */
 +              device_lock(&dev->dev);
 +      }
 +
 +      rc = __pci_dev_reset(dev, probe);
 +
        if (!probe) {
                device_unlock(&dev->dev);
                pci_cfg_access_unlock(dev);
        }
 -
        return rc;
  }
 -
  /**
   * __pci_reset_function - reset a PCI device function
   * @dev: PCI device to reset
@@@ -3254,7 -3246,7 +3254,7 @@@ EXPORT_SYMBOL_GPL(__pci_reset_function)
   */
  int __pci_reset_function_locked(struct pci_dev *dev)
  {
 -      return pci_dev_reset(dev, 1);
 +      return __pci_dev_reset(dev, 0);
  }
  EXPORT_SYMBOL_GPL(__pci_reset_function_locked);
  
@@@ -3901,8 -3893,6 +3901,8 @@@ static int __init pci_setup(char *str
                                pcie_bus_config = PCIE_BUS_PERFORMANCE;
                        } else if (!strncmp(str, "pcie_bus_peer2peer", 18)) {
                                pcie_bus_config = PCIE_BUS_PEER2PEER;
 +                      } else if (!strncmp(str, "pcie_scan_all", 13)) {
 +                              pci_add_flags(PCI_SCAN_ALL_PCIE_DEVS);
                        } else {
                                printk(KERN_ERR "PCI: Unknown option `%s'\n",
                                                str);
diff --combined include/linux/pci.h
index 17b7b5b01b4ad5feaf5ba91ef554406496b9fd91,3bbc77e20a6157f5f2e2427a3ee9921a09bcaf12..d8c379dba6adbb36ae9df6c18adea304e2c6b45c
@@@ -375,18 -375,11 +375,18 @@@ struct pci_host_bridge_window 
  };
  
  struct pci_host_bridge {
 -      struct list_head list;
 +      struct device dev;
        struct pci_bus *bus;            /* root bus */
        struct list_head windows;       /* pci_host_bridge_windows */
 +      void (*release_fn)(struct pci_host_bridge *);
 +      void *release_data;
  };
  
 +#define       to_pci_host_bridge(n) container_of(n, struct pci_host_bridge, dev)
 +void pci_set_host_bridge_release(struct pci_host_bridge *bridge,
 +                   void (*release_fn)(struct pci_host_bridge *),
 +                   void *release_data);
 +
  /*
   * The first PCI_BRIDGE_RESOURCE_NUM PCI bus resources (those that correspond
   * to P2P or CardBus bridge windows) go in a table.  Additional ones (for
@@@ -687,7 -680,7 +687,7 @@@ int __must_check pci_bus_add_device(str
  void pci_read_bridge_bases(struct pci_bus *child);
  struct resource *pci_find_parent_resource(const struct pci_dev *dev,
                                          struct resource *res);
- u8 pci_swizzle_interrupt_pin(struct pci_dev *dev, u8 pin);
+ u8 pci_swizzle_interrupt_pin(const struct pci_dev *dev, u8 pin);
  int pci_get_interrupt_pin(struct pci_dev *dev, struct pci_dev **bridge);
  u8 pci_common_swizzle(struct pci_dev *dev, u8 *pinp);
  extern struct pci_dev *pci_dev_get(struct pci_dev *dev);
@@@ -1692,7 -1685,8 +1692,8 @@@ extern void pci_release_bus_of_node(str
  /* 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)
+ static inline struct device_node *
+ pci_device_to_OF_node(const struct pci_dev *pdev)
  {
        return pdev ? pdev->dev.of_node : NULL;
  }