Merge tag 'pci-v4.8-changes' of git://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci
authorLinus Torvalds <torvalds@linux-foundation.org>
Tue, 2 Aug 2016 21:12:29 +0000 (17:12 -0400)
committerLinus Torvalds <torvalds@linux-foundation.org>
Tue, 2 Aug 2016 21:12:29 +0000 (17:12 -0400)
Pull PCI updates from Bjorn Helgaas:
 "Highlights:

   - ARM64 support for ACPI host bridges

   - new drivers for Axis ARTPEC-6 and Marvell Aardvark

   - new pci_alloc_irq_vectors() interface for MSI-X, MSI, legacy INTx

   - pci_resource_to_user() cleanup (more to come)

  Detailed summary:

  Enumeration:
   - Move ecam.h to linux/include/pci-ecam.h (Jayachandran C)
   - Add parent device field to ECAM struct pci_config_window (Jayachandran C)
   - Add generic MCFG table handling (Tomasz Nowicki)
   - Refactor pci_bus_assign_domain_nr() for CONFIG_PCI_DOMAINS_GENERIC (Tomasz Nowicki)
   - Factor DT-specific pci_bus_find_domain_nr() code out (Tomasz Nowicki)

  Resource management:
   - Add devm_request_pci_bus_resources() (Bjorn Helgaas)
   - Unify pci_resource_to_user() declarations (Bjorn Helgaas)
   - Implement pci_resource_to_user() with pcibios_resource_to_bus() (microblaze, powerpc, sparc) (Bjorn Helgaas)
   - Request host bridge window resources (designware, iproc, rcar, xgene, xilinx, xilinx-nwl) (Bjorn Helgaas)
   - Make PCI I/O space optional on ARM32 (Bjorn Helgaas)
   - Ignore write combining when mapping I/O port space (Bjorn Helgaas)
   - Claim bus resources on MIPS PCI_PROBE_ONLY set-ups (Bjorn Helgaas)
   - Remove unicore32 pci=firmware command line parameter handling (Bjorn Helgaas)
   - Support I/O resources when parsing host bridge resources (Jayachandran C)
   - Add helpers to request/release memory and I/O regions (Johannes Thumshirn)
   - Use pci_(request|release)_mem_regions (NVMe, lpfc, GenWQE, ethernet/intel, alx) (Johannes Thumshirn)
   - Extend pci=resource_alignment to specify device/vendor IDs (Koehrer Mathias (ETAS/ESW5))
   - Add generic pci_bus_claim_resources() (Lorenzo Pieralisi)
   - Claim bus resources on ARM32 PCI_PROBE_ONLY set-ups (Lorenzo Pieralisi)
   - Remove ARM32 and ARM64 arch-specific pcibios_enable_device() (Lorenzo Pieralisi)
   - Add pci_unmap_iospace() to unmap I/O resources (Sinan Kaya)
   - Remove powerpc __pci_mmap_set_pgprot() (Yinghai Lu)

  PCI device hotplug:
   - Allow additional bus numbers for hotplug bridges (Keith Busch)
   - Ignore interrupts during D3cold (Lukas Wunner)

  Power management:
   - Enforce type casting for pci_power_t (Andy Shevchenko)
   - Don't clear d3cold_allowed for PCIe ports (Mika Westerberg)
   - Put PCIe ports into D3 during suspend (Mika Westerberg)
   - Power on bridges before scanning new devices (Mika Westerberg)
   - Runtime resume bridge before rescan (Mika Westerberg)
   - Add runtime PM support for PCIe ports (Mika Westerberg)
   - Remove redundant check of pcie_set_clkpm (Shawn Lin)

  Virtualization:
   - Add function 1 DMA alias quirk for Marvell 88SE9182 (Aaron Sierra)
   - Add DMA alias quirk for Adaptec 3805 (Alex Williamson)
   - Mark Atheros AR9485 and QCA9882 to avoid bus reset (Chris Blake)
   - Add ACS quirk for Solarflare SFC9220 (Edward Cree)

  MSI:
   - Fix PCI_MSI dependencies (Arnd Bergmann)
   - Add pci_msix_desc_addr() helper (Christoph Hellwig)
   - Switch msix_program_entries() to use pci_msix_desc_addr() (Christoph Hellwig)
   - Make the "entries" argument to pci_enable_msix() optional (Christoph Hellwig)
   - Provide sensible IRQ vector alloc/free routines (Christoph Hellwig)
   - Spread interrupt vectors in pci_alloc_irq_vectors() (Christoph Hellwig)

  Error Handling:
   - Bind DPC to Root Ports as well as Downstream Ports (Keith Busch)
   - Remove DPC tristate module option (Keith Busch)
   - Convert Downstream Port Containment driver to use devm_* functions (Mika Westerberg)

  Generic host bridge driver:
   - Select IRQ_DOMAIN (Arnd Bergmann)
   - Claim bus resources on PCI_PROBE_ONLY set-ups (Lorenzo Pieralisi)

  ACPI host bridge driver:
   - Add ARM64 acpi_pci_bus_find_domain_nr() (Tomasz Nowicki)
   - Add ARM64 ACPI support for legacy IRQs parsing and consolidation with DT code (Tomasz Nowicki)
   - Implement ARM64 AML accessors for PCI_Config region (Tomasz Nowicki)
   - Support ARM64 ACPI-based PCI host controller (Tomasz Nowicki)

  Altera host bridge driver:
   - Check link status before retrain link (Ley Foon Tan)
   - Poll for link up status after retraining the link (Ley Foon Tan)

  Axis ARTPEC-6 host bridge driver:
   - Add PCI_MSI_IRQ_DOMAIN dependency (Arnd Bergmann)
   - Add DT binding for Axis ARTPEC-6 PCIe controller (Niklas Cassel)
   - Add Axis ARTPEC-6 PCIe controller driver (Niklas Cassel)

  Intel VMD host bridge driver:
   - Use lock save/restore in interrupt enable path (Jon Derrick)
   - Select device dma ops to override (Keith Busch)
   - Initialize list item in IRQ disable (Keith Busch)
   - Use x86_vector_domain as parent domain (Keith Busch)
   - Separate MSI and MSI-X vector sharing (Keith Busch)

  Marvell Aardvark host bridge driver:
   - Add DT binding for the Aardvark PCIe controller (Thomas Petazzoni)
   - Add Aardvark PCI host controller driver (Thomas Petazzoni)
   - Add Aardvark PCIe support for Armada 3700 (Thomas Petazzoni)

  Microsoft Hyper-V host bridge driver:
   - Fix interrupt cleanup path (Cathy Avery)
   - Don't leak buffer in hv_pci_onchannelcallback() (Vitaly Kuznetsov)
   - Handle all pending messages in hv_pci_onchannelcallback() (Vitaly Kuznetsov)

  NVIDIA Tegra host bridge driver:
   - Program PADS_REFCLK_CFG* always, not just on legacy SoCs (Stephen Warren)
   - Program PADS_REFCLK_CFG* registers with per-SoC values (Stephen Warren)
   - Use lower-case hex consistently for register definitions (Thierry Reding)
   - Use generic pci_remap_iospace() rather than ARM32-specific one (Thierry Reding)
   - Stop setting pcibios_min_mem (Thierry Reding)

  Renesas R-Car host bridge driver:
   - Drop gen2 dummy I/O port region (Bjorn Helgaas)

  TI DRA7xx host bridge driver:
   - Fix return value in case of error (Christophe JAILLET)

  Xilinx AXI host bridge driver:
   - Fix return value in case of error (Christophe JAILLET)

  Miscellaneous:
   - Make bus_attr_resource_alignment static (Ben Dooks)
   - Include <asm/dma.h> for isa_dma_bridge_buggy (Ben Dooks)
   - MAINTAINERS: Add file patterns for PCI device tree bindings (Geert Uytterhoeven)
   - Make host bridge drivers explicitly non-modular (Paul Gortmaker)"

* tag 'pci-v4.8-changes' of git://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci: (125 commits)
  PCI: xgene: Make explicitly non-modular
  PCI: thunder-pem: Make explicitly non-modular
  PCI: thunder-ecam: Make explicitly non-modular
  PCI: tegra: Make explicitly non-modular
  PCI: rcar-gen2: Make explicitly non-modular
  PCI: rcar: Make explicitly non-modular
  PCI: mvebu: Make explicitly non-modular
  PCI: layerscape: Make explicitly non-modular
  PCI: keystone: Make explicitly non-modular
  PCI: hisi: Make explicitly non-modular
  PCI: generic: Make explicitly non-modular
  PCI: designware-plat: Make it explicitly non-modular
  PCI: artpec6: Make explicitly non-modular
  PCI: armada8k: Make explicitly non-modular
  PCI: artpec: Add PCI_MSI_IRQ_DOMAIN dependency
  PCI: Add ACS quirk for Solarflare SFC9220
  arm64: dts: marvell: Add Aardvark PCIe support for Armada 3700
  PCI: aardvark: Add Aardvark PCI host controller driver
  dt-bindings: add DT binding for the Aardvark PCIe controller
  PCI: tegra: Program PADS_REFCLK_CFG* registers with per-SoC values
  ...

20 files changed:
1  2 
Documentation/kernel-parameters.txt
MAINTAINERS
arch/arm/Kconfig
arch/arm64/Kconfig
arch/arm64/boot/dts/marvell/armada-37xx.dtsi
arch/powerpc/kernel/pci-common.c
arch/x86/pci/vmd.c
drivers/acpi/Kconfig
drivers/acpi/Makefile
drivers/irqchip/Kconfig
drivers/net/ethernet/intel/e1000e/netdev.c
drivers/net/ethernet/intel/fm10k/fm10k_pci.c
drivers/net/ethernet/intel/i40e/i40e_main.c
drivers/net/ethernet/intel/igb/igb_main.c
drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
drivers/nvme/host/pci.c
drivers/pci/pci.c
drivers/pci/setup-bus.c
drivers/scsi/lpfc/lpfc_init.c
include/linux/pci.h

index e24aa11e8f8a1db6fe0ce50a846019c9c91ca3cd,2102248005b5be5568aff5719c529c2374bb6f3f..6420290120593a009742c330c1b0e315874dad9c
@@@ -582,9 -582,6 +582,9 @@@ bytes respectively. Such letter suffixe
  
        bootmem_debug   [KNL] Enable bootmem allocator debug messages.
  
 +      bert_disable    [ACPI]
 +                      Disable BERT OS support on buggy BIOSes.
 +
        bttv.card=      [HW,V4L] bttv (bt848 + bt878 based grabber cards)
        bttv.radio=     Most important insmod options are available as
                        kernel args too.
                        [SPARC64] tick
                        [X86-64] hpet,tsc
  
 +      clocksource.arm_arch_timer.evtstrm=
 +                      [ARM,ARM64]
 +                      Format: <bool>
 +                      Enable/disable the eventstream feature of the ARM
 +                      architected timer so that code using WFE-based polling
 +                      loops can be debugged more effectively on production
 +                      systems.
 +
        clearcpuid=BITNUM [X86]
                        Disable CPUID feature X for the kernel. See
                        arch/x86/include/asm/cpufeatures.h for the valid bit
        dhash_entries=  [KNL]
                        Set number of hash buckets for dentry cache.
  
 +      disable_1tb_segments [PPC]
 +                      Disables the use of 1TB hash page table segments. This
 +                      causes the kernel to fall back to 256MB segments which
 +                      can be useful when debugging issues that require an SLB
 +                      miss to occur.
 +
        disable=        [IPV6]
                        See Documentation/networking/ipv6.txt.
  
 +      disable_radix   [PPC]
 +                      Disable RADIX MMU mode on POWER9
 +
        disable_cpu_apicid= [X86,APIC,SMP]
                        Format: <int>
                        The number of initial APIC ID for the
                        Address Range Mirroring feature even if your box
                        doesn't support it.
  
 +      efivar_ssdt=    [EFI; X86] Name of an EFI variable that contains an SSDT
 +                      that is to be dynamically loaded by Linux. If there are
 +                      multiple variables with the same name but with different
 +                      vendor GUIDs, all of them will be loaded. See
 +                      Documentation/acpi/ssdt-overlays.txt for details.
 +
 +
        eisa_irq_edge=  [PARISC,HW]
                        See header of drivers/parisc/eisa.c.
  
        js=             [HW,JOY] Analog joystick
                        See Documentation/input/joystick.txt.
  
 -      kaslr/nokaslr   [X86]
 -                      Enable/disable kernel and module base offset ASLR
 -                      (Address Space Layout Randomization) if built into
 -                      the kernel. When CONFIG_HIBERNATION is selected,
 -                      kASLR is disabled by default. When kASLR is enabled,
 -                      hibernation will be disabled.
 +      nokaslr         [KNL]
 +                      When CONFIG_RANDOMIZE_BASE is set, this disables
 +                      kernel and module base offset ASLR (Address Space
 +                      Layout Randomization).
  
        keepinitrd      [HW,ARM]
  
                        timer: [X86] Force use of architectural NMI
                                timer mode (see also oprofile.timer
                                for generic hr timer mode)
 -                              [s390] Force legacy basic mode sampling
 -                                (report cpu_type "timer")
  
        oops=panic      Always panic on oopses. Default is to just kill the
                        process, but there is a small probability of
                resource_alignment=
                                Format:
                                [<order of align>@][<domain>:]<bus>:<slot>.<func>[; ...]
+                               [<order of align>@]pci:<vendor>:<device>\
+                                               [:<subvendor>:<subdevice>][; ...]
                                Specifies alignment and device to reassign
                                aligned memory resources.
                                If <order of align> is not specified,
                hpmemsize=nn[KMG]       The fixed amount of bus space which is
                                reserved for hotplug bridge's memory window.
                                Default size is 2 megabytes.
+               hpbussize=nn    The minimum amount of additional bus numbers
+                               reserved for buses below a hotplug bridge.
+                               Default is 1.
                realloc=        Enable/disable reallocating PCI bridge resources
                                if allocations done by BIOS are too small to
                                accommodate resources required by all child
                compat  Treat PCIe ports as PCI-to-PCI bridges, disable the PCIe
                        ports driver.
  
+       pcie_port_pm=   [PCIE] PCIe port power management handling:
+               off     Disable power management of all PCIe ports
+               force   Forcibly enable power management of all PCIe ports
        pcie_pme=       [PCIE,PM] Native PCIe PME signaling options:
                nomsi   Do not use MSI for native PCIe PME signaling (this makes
                        all PCIe root ports use INTx for all services).
                                present during boot.
                nocompress      Don't compress/decompress hibernation images.
                no              Disable hibernation and resume.
 +              protect_image   Turn on image protection during restoration
 +                              (that will set all pages holding image data
 +                              during restoration read-only).
  
        retain_initrd   [RAM] Keep initrd memory after extraction
  
  
        trace_event=[event-list]
                        [FTRACE] Set and start specified trace events in order
 -                      to facilitate early boot debugging.
 -                      See also Documentation/trace/events.txt
 +                      to facilitate early boot debugging. The event-list is a
 +                      comma separated list of trace events to enable. See
 +                      also Documentation/trace/events.txt
  
        trace_options=[option-list]
                        [FTRACE] Enable or disable tracer options at boot.
diff --combined MAINTAINERS
index 8f950e2752dee6afccafa3a26c58663e5f8d5eb5,a4f32b5ee8f84576fd03114bc69b4ac14b70d4bf..10074ff03c574322526868e38aa8d949d852541c
@@@ -213,7 -213,7 +213,7 @@@ S: Maintaine
  F:    drivers/media/dvb-frontends/a8293*
  
  AACRAID SCSI RAID DRIVER
 -M:    Adaptec OEM Raid Solutions <aacraid@adaptec.com>
 +M:    Adaptec OEM Raid Solutions <aacraid@microsemi.com>
  L:    linux-scsi@vger.kernel.org
  W:    http://www.adaptec.com/
  S:    Supported
@@@ -288,7 -288,6 +288,7 @@@ F: include/linux/acpi.
  F:    include/acpi/
  F:    Documentation/acpi/
  F:    Documentation/ABI/testing/sysfs-bus-acpi
 +F:    Documentation/ABI/testing/configfs-acpi
  F:    drivers/pci/*acpi*
  F:    drivers/pci/*/*acpi*
  F:    drivers/pci/*/*/*acpi*
@@@ -612,13 -611,6 +612,13 @@@ L:       linux-gpio@vger.kernel.or
  S:    Maintained
  F:    drivers/gpio/gpio-altera.c
  
 +ALTERA SYSTEM RESOURCE DRIVER FOR ARRIA10 DEVKIT
 +M:    Thor Thayer <tthayer@opensource.altera.com>
 +S:    Maintained
 +F:    drivers/gpio/gpio-altera-a10sr.c
 +F:    drivers/mfd/altera-a10sr.c
 +F:    include/linux/mfd/altera-a10sr.h
 +
  ALTERA TRIPLE SPEED ETHERNET DRIVER
  M:    Vince Bridgers <vbridger@opensource.altera.com>
  L:    netdev@vger.kernel.org
@@@ -847,9 -839,7 +847,9 @@@ M: Iyappan Subramanian <isubramanian@ap
  M:    Keyur Chudgar <kchudgar@apm.com>
  S:    Supported
  F:    drivers/net/ethernet/apm/xgene/
 +F:    drivers/net/phy/mdio-xgene.c
  F:    Documentation/devicetree/bindings/net/apm-xgene-enet.txt
 +F:    Documentation/devicetree/bindings/net/apm-xgene-mdio.txt
  
  APTINA CAMERA SENSOR PLL
  M:    Laurent Pinchart <Laurent.pinchart@ideasonboard.com>
@@@ -879,17 -869,9 +879,17 @@@ F:       Documentation/devicetree/bindings/di
  ARM HDLCD DRM DRIVER
  M:    Liviu Dudau <liviu.dudau@arm.com>
  S:    Supported
 -F:    drivers/gpu/drm/arm/
 +F:    drivers/gpu/drm/arm/hdlcd_*
  F:    Documentation/devicetree/bindings/display/arm,hdlcd.txt
  
 +ARM MALI-DP DRM DRIVER
 +M:    Liviu Dudau <liviu.dudau@arm.com>
 +M:    Brian Starkey <brian.starkey@arm.com>
 +M:    Mali DP Maintainers <malidp@foss.arm.com>
 +S:    Supported
 +F:    drivers/gpu/drm/arm/
 +F:    Documentation/devicetree/bindings/display/arm,malidp.txt
 +
  ARM MFM AND FLOPPY DRIVERS
  M:    Ian Molton <spyro@f2s.com>
  S:    Maintained
@@@ -1544,7 -1526,6 +1544,7 @@@ M:      David Brown <david.brown@linaro.org
  L:    linux-arm-msm@vger.kernel.org
  L:    linux-soc@vger.kernel.org
  S:    Maintained
 +F:    Documentation/devicetree/bindings/soc/qcom/
  F:    arch/arm/boot/dts/qcom-*.dts
  F:    arch/arm/boot/dts/qcom-*.dtsi
  F:    arch/arm/mach-qcom/
@@@ -1622,13 -1603,12 +1622,13 @@@ F:   arch/arm/mach-s3c24*
  F:    arch/arm/mach-s3c64xx/
  F:    arch/arm/mach-s5p*/
  F:    arch/arm/mach-exynos*/
 -F:    drivers/*/*s3c2410*
 -F:    drivers/*/*/*s3c2410*
 +F:    drivers/*/*s3c24*
 +F:    drivers/*/*/*s3c24*
 +F:    drivers/*/*s3c64xx*
 +F:    drivers/*/*s5pv210*
  F:    drivers/memory/samsung/*
  F:    drivers/soc/samsung/*
  F:    drivers/spi/spi-s3c*
 -F:    sound/soc/samsung/*
  F:    Documentation/arm/Samsung/
  F:    Documentation/devicetree/bindings/arm/samsung/
  F:    Documentation/devicetree/bindings/sram/samsung-sram.txt
@@@ -1667,13 -1647,6 +1667,13 @@@ L:    linux-media@vger.kernel.or
  S:    Maintained
  F:    drivers/media/platform/s5p-tv/
  
 +ARM/SAMSUNG S5P SERIES HDMI CEC SUBSYSTEM SUPPORT
 +M:    Kyungmin Park <kyungmin.park@samsung.com>
 +L:    linux-arm-kernel@lists.infradead.org
 +L:    linux-media@vger.kernel.org
 +S:    Maintained
 +F:    drivers/staging/media/platform/s5p-cec/
 +
  ARM/SAMSUNG S5P SERIES JPEG CODEC SUPPORT
  M:    Andrzej Pietrasiewicz <andrzej.p@samsung.com>
  M:    Jacek Anaszewski <j.anaszewski@samsung.com>
@@@ -1696,6 -1669,7 +1696,6 @@@ F:      arch/arm/boot/dts/sh
  F:    arch/arm/configs/shmobile_defconfig
  F:    arch/arm/include/debug/renesas-scif.S
  F:    arch/arm/mach-shmobile/
 -F:    drivers/sh/
  F:    drivers/soc/renesas/
  F:    include/linux/soc/renesas/
  
@@@ -1720,6 -1694,8 +1720,6 @@@ S:      Maintaine
  F:    drivers/edac/altera_edac.
  
  ARM/STI ARCHITECTURE
 -M:    Srinivas Kandagatla <srinivas.kandagatla@gmail.com>
 -M:    Maxime Coquelin <maxime.coquelin@st.com>
  M:    Patrice Chotard <patrice.chotard@st.com>
  L:    linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
  L:    kernel@stlinux.com
@@@ -1752,7 -1728,6 +1752,7 @@@ F:      drivers/ata/ahci_st.
  
  ARM/STM32 ARCHITECTURE
  M:    Maxime Coquelin <mcoquelin.stm32@gmail.com>
 +M:    Alexandre Torgue <alexandre.torgue@st.com>
  L:    linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
  S:    Maintained
  T:    git git://git.kernel.org/pub/scm/linux/kernel/git/mcoquelin/stm32.git
@@@ -1763,7 -1738,8 +1763,7 @@@ ARM/TANGO ARCHITECTUR
  M:    Marc Gonzalez <marc_gonzalez@sigmadesigns.com>
  L:    linux-arm-kernel@lists.infradead.org
  S:    Maintained
 -F:    arch/arm/mach-tango/
 -F:    arch/arm/boot/dts/tango*
 +N:    tango
  
  ARM/TECHNOLOGIC SYSTEMS TS7250 MACHINE SUPPORT
  M:    Lennert Buytenhek <kernel@wantstofly.org>
@@@ -1850,6 -1826,7 +1850,6 @@@ L:      linux-arm-kernel@lists.infradead.or
  T:    git git://git.linaro.org/people/ulfh/clk.git
  S:    Maintained
  F:    drivers/clk/ux500/
 -F:    include/linux/platform_data/clk-ux500.h
  
  ARM/VERSATILE EXPRESS PLATFORM
  M:    Liviu Dudau <liviu.dudau@arm.com>
@@@ -2320,7 -2297,6 +2320,7 @@@ S:      Maintaine
  F:    Documentation/ABI/testing/sysfs-class-net-batman-adv
  F:    Documentation/ABI/testing/sysfs-class-net-mesh
  F:    Documentation/networking/batman-adv.txt
 +F:    include/uapi/linux/batman_adv.h
  F:    net/batman-adv/
  
  BAYCOM/HDLCDRV DRIVERS FOR AX.25
@@@ -2484,14 -2460,6 +2484,14 @@@ L:    netdev@vger.kernel.or
  S:    Supported
  F:    drivers/net/ethernet/broadcom/b44.*
  
 +BROADCOM B53 ETHERNET SWITCH DRIVER
 +M:    Florian Fainelli <f.fainelli@gmail.com>
 +L:    netdev@vger.kernel.org
 +L:    openwrt-devel@lists.openwrt.org (subscribers-only)
 +S:    Supported
 +F:    drivers/net/dsa/b53/*
 +F:    include/linux/platform_data/b53.h
 +
  BROADCOM GENET ETHERNET DRIVER
  M:    Florian Fainelli <f.fainelli@gmail.com>
  L:    netdev@vger.kernel.org
@@@ -2516,14 -2484,17 +2516,14 @@@ BROADCOM BCM281XX/BCM11XXX/BCM216XX AR
  M:    Florian Fainelli <f.fainelli@gmail.com>
  M:    Ray Jui <rjui@broadcom.com>
  M:    Scott Branden <sbranden@broadcom.com>
 -L:    bcm-kernel-feedback-list@broadcom.com
 +M:    bcm-kernel-feedback-list@broadcom.com
  T:    git git://github.com/broadcom/mach-bcm
  S:    Maintained
 +N:    bcm281*
 +N:    bcm113*
 +N:    bcm216*
 +N:    kona
  F:    arch/arm/mach-bcm/
 -F:    arch/arm/boot/dts/bcm113*
 -F:    arch/arm/boot/dts/bcm216*
 -F:    arch/arm/boot/dts/bcm281*
 -F:    arch/arm64/boot/dts/broadcom/
 -F:    arch/arm/configs/bcm_defconfig
 -F:    drivers/mmc/host/sdhci-bcm-kona.c
 -F:    drivers/clocksource/bcm_kona_timer.c
  
  BROADCOM BCM2835 ARM ARCHITECTURE
  M:    Stephen Warren <swarren@wwwdotorg.org>
@@@ -2546,21 -2517,20 +2546,21 @@@ F:   arch/mips/include/asm/mach-bcm47xx/
  
  BROADCOM BCM5301X ARM ARCHITECTURE
  M:    Hauke Mehrtens <hauke@hauke-m.de>
 +M:    RafaÅ‚ MiÅ‚ecki <zajec5@gmail.com>
 +M:    bcm-kernel-feedback-list@broadcom.com
  L:    linux-arm-kernel@lists.infradead.org
  S:    Maintained
  F:    arch/arm/mach-bcm/bcm_5301x.c
 -F:    arch/arm/boot/dts/bcm5301x.dtsi
 +F:    arch/arm/boot/dts/bcm5301x*.dtsi
  F:    arch/arm/boot/dts/bcm470*
  
  BROADCOM BCM63XX ARM ARCHITECTURE
  M:    Florian Fainelli <f.fainelli@gmail.com>
 +M:    bcm-kernel-feedback-list@broadcom.com
  L:    linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
 -L:    bcm-kernel-feedback-list@broadcom.com
  T:    git git://github.com/broadcom/stblinux.git
  S:    Maintained
 -F:    arch/arm/mach-bcm/bcm63xx.c
 -F:    arch/arm/include/debug/bcm63xx.S
 +N:    bcm63xx
  
  BROADCOM BCM63XX/BCM33XX UDC DRIVER
  M:    Kevin Cernekee <cernekee@gmail.com>
@@@ -2572,8 -2542,8 +2572,8 @@@ BROADCOM BCM7XXX ARM ARCHITECTUR
  M:    Brian Norris <computersforpeace@gmail.com>
  M:    Gregory Fong <gregory.0xf0@gmail.com>
  M:    Florian Fainelli <f.fainelli@gmail.com>
 +M:    bcm-kernel-feedback-list@broadcom.com
  L:    linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
 -L:    bcm-kernel-feedback-list@broadcom.com
  T:    git git://github.com/broadcom/stblinux.git
  S:    Maintained
  F:    arch/arm/mach-bcm/*brcmstb*
@@@ -2606,11 -2576,12 +2606,11 @@@ S:   Supporte
  F:    drivers/net/ethernet/broadcom/tg3.*
  
  BROADCOM BRCM80211 IEEE802.11n WIRELESS DRIVER
 -M:    Brett Rudley <brudley@broadcom.com>
 -M:    Arend van Spriel <arend@broadcom.com>
 -M:    Franky (Zhenhui) Lin <frankyl@broadcom.com>
 -M:    Hante Meuleman <meuleman@broadcom.com>
 +M:    Arend van Spriel <arend.vanspriel@broadcom.com>
 +M:    Franky Lin <franky.lin@broadcom.com>
 +M:    Hante Meuleman <hante.meuleman@broadcom.com>
  L:    linux-wireless@vger.kernel.org
 -L:    brcm80211-dev-list@broadcom.com
 +L:    brcm80211-dev-list.pdl@broadcom.com
  S:    Supported
  F:    drivers/net/wireless/broadcom/brcm80211/
  
@@@ -2630,13 -2601,13 +2630,13 @@@ BROADCOM IPROC ARM ARCHITECTUR
  M:    Ray Jui <rjui@broadcom.com>
  M:    Scott Branden <sbranden@broadcom.com>
  M:    Jon Mason <jonmason@broadcom.com>
 +M:    bcm-kernel-feedback-list@broadcom.com
  L:    linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
 -L:    bcm-kernel-feedback-list@broadcom.com
  T:    git git://github.com/broadcom/cygnus-linux.git
  S:    Maintained
  N:    iproc
  N:    cygnus
 -N:    nsp
 +N:    bcm[-_]nsp
  N:    bcm9113*
  N:    bcm9583*
  N:    bcm9585*
@@@ -2647,9 -2618,6 +2647,9 @@@ N:      bcm583
  N:    bcm585*
  N:    bcm586*
  N:    bcm88312
 +F:    arch/arm64/boot/dts/broadcom/ns2*
 +F:    drivers/clk/bcm/clk-ns*
 +F:    drivers/pinctrl/bcm/pinctrl-ns*
  
  BROADCOM BRCMSTB GPIO DRIVER
  M:    Gregory Fong <gregory.0xf0@gmail.com>
@@@ -2694,8 -2662,8 +2694,8 @@@ F:      drivers/net/ethernet/broadcom/bcmsys
  
  BROADCOM VULCAN ARM64 SOC
  M:    Jayachandran C. <jchandra@broadcom.com>
 +M:    bcm-kernel-feedback-list@broadcom.com
  L:    linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
 -L:    bcm-kernel-feedback-list@broadcom.com
  S:    Maintained
  F:    arch/arm64/boot/dts/broadcom/vulcan*
  
@@@ -2845,7 -2813,6 +2845,7 @@@ W:      https://github.com/linux-ca
  T:    git git://git.kernel.org/pub/scm/linux/kernel/git/mkl/linux-can.git
  T:    git git://git.kernel.org/pub/scm/linux/kernel/git/mkl/linux-can-next.git
  S:    Maintained
 +F:    Documentation/devicetree/bindings/net/can/
  F:    drivers/net/can/
  F:    include/linux/can/dev.h
  F:    include/linux/can/platform/
@@@ -2853,7 -2820,7 +2853,7 @@@ F:      include/uapi/linux/can/error.
  F:    include/uapi/linux/can/netlink.h
  
  CAPABILITIES
 -M:    Serge Hallyn <serge.hallyn@canonical.com>
 +M:    Serge Hallyn <serge@hallyn.com>
  L:    linux-security-module@vger.kernel.org
  S:    Supported
  F:    include/linux/capability.h
@@@ -2885,22 -2852,6 +2885,22 @@@ F:    drivers/net/ieee802154/cc2520.
  F:    include/linux/spi/cc2520.h
  F:    Documentation/devicetree/bindings/net/ieee802154/cc2520.txt
  
 +CEC DRIVER
 +M:    Hans Verkuil <hans.verkuil@cisco.com>
 +L:    linux-media@vger.kernel.org
 +T:    git git://linuxtv.org/media_tree.git
 +W:    http://linuxtv.org
 +S:    Supported
 +F:    Documentation/cec.txt
 +F:    Documentation/DocBook/media/v4l/cec*
 +F:    drivers/staging/media/cec/
 +F:    drivers/media/cec-edid.c
 +F:    drivers/media/rc/keymaps/rc-cec.c
 +F:    include/media/cec.h
 +F:    include/media/cec-edid.h
 +F:    include/linux/cec.h
 +F:    include/linux/cec-funcs.h
 +
  CELL BROADBAND ENGINE ARCHITECTURE
  M:    Arnd Bergmann <arnd@arndb.de>
  L:    linuxppc-dev@lists.ozlabs.org
@@@ -3337,7 -3288,6 +3337,7 @@@ T:      git git://git.kernel.org/pub/scm/lin
  T:    git git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6.git
  S:    Maintained
  F:    Documentation/crypto/
 +F:    Documentation/devicetree/bindings/crypto/
  F:    Documentation/DocBook/crypto-API.tmpl
  F:    arch/*/crypto/
  F:    crypto/
@@@ -3728,8 -3678,6 +3728,8 @@@ M:      Support Opensource <support.opensour
  W:    http://www.dialog-semiconductor.com/products
  S:    Supported
  F:    Documentation/hwmon/da90??
 +F:    Documentation/devicetree/bindings/mfd/da90*.txt
 +F:    Documentation/devicetree/bindings/regulator/da92*.txt
  F:    Documentation/devicetree/bindings/sound/da[79]*.txt
  F:    drivers/gpio/gpio-da90??.c
  F:    drivers/hwmon/da90??-hwmon.c
@@@ -3750,10 -3698,8 +3750,10 @@@ F:    drivers/watchdog/da90??_wdt.
  F:    include/linux/mfd/da903x.h
  F:    include/linux/mfd/da9052/
  F:    include/linux/mfd/da9055/
 +F:    include/linux/mfd/da9062/
  F:    include/linux/mfd/da9063/
  F:    include/linux/mfd/da9150/
 +F:    include/linux/regulator/da9211.h
  F:    include/sound/da[79]*.h
  F:    sound/soc/codecs/da[79]*.[ch]
  
@@@ -3829,17 -3775,6 +3829,17 @@@ F:    include/linux/*fence.
  F:    Documentation/dma-buf-sharing.txt
  T:    git git://git.linaro.org/people/sumitsemwal/linux-dma-buf.git
  
 +SYNC FILE FRAMEWORK
 +M:    Sumit Semwal <sumit.semwal@linaro.org>
 +R:    Gustavo Padovan <gustavo@padovan.org>
 +S:    Maintained
 +L:    linux-media@vger.kernel.org
 +L:    dri-devel@lists.freedesktop.org
 +F:    drivers/dma-buf/sync_file.c
 +F:    include/linux/sync_file.h
 +F:    Documentation/sync_file.txt
 +T:    git git://git.linaro.org/people/sumitsemwal/linux-dma-buf.git
 +
  DMA GENERIC OFFLOAD ENGINE SUBSYSTEM
  M:    Vinod Koul <vinod.koul@intel.com>
  L:    dmaengine@vger.kernel.org
@@@ -3929,10 -3864,7 +3929,10 @@@ T:    git git://people.freedesktop.org/~ai
  S:    Maintained
  F:    drivers/gpu/drm/
  F:    drivers/gpu/vga/
 -F:    Documentation/DocBook/gpu.*
 +F:    Documentation/devicetree/bindings/display/
 +F:    Documentation/devicetree/bindings/gpu/
 +F:    Documentation/devicetree/bindings/video/
 +F:    Documentation/gpu/
  F:    include/drm/
  F:    include/uapi/drm/
  
@@@ -3984,7 -3916,6 +3984,7 @@@ S:      Supporte
  F:    drivers/gpu/drm/i915/
  F:    include/drm/i915*
  F:    include/uapi/drm/i915_drm.h
 +F:    Documentation/gpu/i915.rst
  
  DRM DRIVERS FOR ATMEL HLCDC
  M:    Boris Brezillon <boris.brezillon@free-electrons.com>
@@@ -4180,21 -4111,6 +4180,21 @@@ F:    drivers/gpu/drm/vc4
  F:    include/uapi/drm/vc4_drm.h
  F:    Documentation/devicetree/bindings/display/brcm,bcm-vc4.txt
  
 +DRM DRIVERS FOR TI OMAP
 +M:    Tomi Valkeinen <tomi.valkeinen@ti.com>
 +L:    dri-devel@lists.freedesktop.org
 +S:    Maintained
 +F:    drivers/gpu/drm/omapdrm/
 +F:    Documentation/devicetree/bindings/display/ti/
 +
 +DRM DRIVERS FOR TI LCDC
 +M:    Jyri Sarha <jsarha@ti.com>
 +R:    Tomi Valkeinen <tomi.valkeinen@ti.com>
 +L:    dri-devel@lists.freedesktop.org
 +S:    Maintained
 +F:    drivers/gpu/drm/tilcdc/
 +F:    Documentation/devicetree/bindings/display/tilcdc/
 +
  DSBR100 USB FM RADIO DRIVER
  M:    Alexey Klimov <klimov.linux@gmail.com>
  L:    linux-media@vger.kernel.org
@@@ -4561,7 -4477,7 +4561,7 @@@ S:      Orpha
  F:    fs/efs/
  
  EHEA (IBM pSeries eHEA 10Gb ethernet adapter) DRIVER
 -M:    Thadeu Lima de Souza Cascardo <cascardo@linux.vnet.ibm.com>
 +M:    Douglas Miller <dougmill@linux.vnet.ibm.com>
  L:    netdev@vger.kernel.org
  S:    Maintained
  F:    drivers/net/ethernet/ibm/ehea/
@@@ -4749,7 -4665,7 +4749,7 @@@ S:      Maintaine
  F:    drivers/staging/fbtft/
  
  FCOE SUBSYSTEM (libfc, libfcoe, fcoe)
 -M:    Vasu Dev <vasu.dev@intel.com>
 +M:    Johannes Thumshirn <jth@kernel.org>
  L:    fcoe-devel@open-fcoe.org
  W:    www.Open-FCoE.org
  S:    Supported
@@@ -4971,13 -4887,6 +4971,13 @@@ F:    drivers/net/ethernet/freescale/gianf
  X:    drivers/net/ethernet/freescale/gianfar_ptp.c
  F:    Documentation/devicetree/bindings/net/fsl-tsec-phy.txt
  
 +FREESCALE QUICC ENGINE UCC HDLC DRIVER
 +M:    Zhao Qiang <qiang.zhao@nxp.com>
 +L:    netdev@vger.kernel.org
 +L:    linuxppc-dev@lists.ozlabs.org
 +S:    Maintained
 +F:    drivers/net/wan/fsl_ucc_hdlc*
 +
  FREESCALE QUICC ENGINE UCC UART DRIVER
  M:    Timur Tabi <timur@tabi.org>
  L:    linuxppc-dev@lists.ozlabs.org
@@@ -5033,13 -4942,6 +5033,13 @@@ F:    Documentation/filesystems/caching
  F:    fs/fscache/
  F:    include/linux/fscache*.h
  
 +FS-CRYPTO: FILE SYSTEM LEVEL ENCRYPTION SUPPORT
 +M:    Theodore Y. Ts'o <tytso@mit.edu>
 +M:    Jaegeuk Kim <jaegeuk@kernel.org>
 +S:    Supported
 +F:    fs/crypto/
 +F:    include/linux/fscrypto.h
 +
  F2FS FILE SYSTEM
  M:    Jaegeuk Kim <jaegeuk@kernel.org>
  M:    Changman Lee <cm224.lee@samsung.com>
@@@ -5094,15 -4996,6 +5094,15 @@@ L:    linux-scsi@vger.kernel.or
  S:    Odd Fixes (e.g., new signatures)
  F:    drivers/scsi/fdomain.*
  
 +GCC PLUGINS
 +M:    Kees Cook <keescook@chromium.org>
 +R:    Emese Revfy <re.emese@gmail.com>
 +L:    kernel-hardening@lists.openwall.com
 +S:    Maintained
 +F:    scripts/gcc-plugins/
 +F:    scripts/gcc-plugin.sh
 +F:    Documentation/gcc-plugins.txt
 +
  GCOV BASED KERNEL PROFILING
  M:    Peter Oberparleiter <oberpar@linux.vnet.ibm.com>
  S:    Maintained
@@@ -5277,10 -5170,10 +5277,10 @@@ S:   Maintaine
  F:    drivers/media/usb/gspca/m5602/
  
  GSPCA PAC207 SONIXB SUBDRIVER
 -M:    Hans de Goede <hdegoede@redhat.com>
 +M:    Hans Verkuil <hverkuil@xs4all.nl>
  L:    linux-media@vger.kernel.org
  T:    git git://linuxtv.org/media_tree.git
 -S:    Maintained
 +S:    Odd Fixes
  F:    drivers/media/usb/gspca/pac207.c
  
  GSPCA SN9C20X SUBDRIVER
@@@ -5298,10 -5191,10 +5298,10 @@@ S:   Maintaine
  F:    drivers/media/usb/gspca/t613.c
  
  GSPCA USB WEBCAM DRIVER
 -M:    Hans de Goede <hdegoede@redhat.com>
 +M:    Hans Verkuil <hverkuil@xs4all.nl>
  L:    linux-media@vger.kernel.org
  T:    git git://linuxtv.org/media_tree.git
 -S:    Maintained
 +S:    Odd Fixes
  F:    drivers/media/usb/gspca/
  
  GUID PARTITION TABLE (GPT)
@@@ -5382,7 -5275,6 +5382,7 @@@ M:      Matt Mackall <mpm@selenic.com
  M:    Herbert Xu <herbert@gondor.apana.org.au>
  L:    linux-crypto@vger.kernel.org
  S:    Odd fixes
 +F:    Documentation/devicetree/bindings/rng/
  F:    Documentation/hw_random.txt
  F:    drivers/char/hw_random/
  F:    include/linux/hw_random.h
@@@ -5393,9 -5285,8 +5393,9 @@@ M:      Bjorn Andersson <bjorn.andersson@lin
  L:    linux-remoteproc@vger.kernel.org
  S:    Maintained
  T:    git git://git.kernel.org/pub/scm/linux/kernel/git/ohad/hwspinlock.git
 +F:    Documentation/devicetree/bindings/hwlock/
  F:    Documentation/hwspinlock.txt
 -F:    drivers/hwspinlock/hwspinlock_*
 +F:    drivers/hwspinlock/
  F:    include/linux/hwspinlock.h
  
  HARMONY SOUND DRIVER
@@@ -5413,12 -5304,6 +5413,12 @@@ T:    git git://linuxtv.org/anttip/media_t
  S:    Maintained
  F:    drivers/media/dvb-frontends/hd29l2*
  
 +HEWLETT PACKARD ENTERPRISE ILO NMI WATCHDOG DRIVER
 +M:    Brian Boylston <brian.boylston@hpe.com>
 +S:    Supported
 +F:    Documentation/watchdog/hpwdt.txt
 +F:    drivers/watchdog/hpwdt.c
 +
  HEWLETT-PACKARD SMART ARRAY RAID DRIVER (hpsa)
  M:    Don Brace <don.brace@microsemi.com>
  L:    iss_storagedev@hp.com
@@@ -5537,15 -5422,6 +5537,15 @@@ F:    include/uapi/linux/if_hippi.
  F:    net/802/hippi.c
  F:    drivers/net/hippi/
  
 +HISILICON NETWORK SUBSYSTEM DRIVER
 +M:    Yisen Zhuang <yisen.zhuang@huawei.com>
 +M:    Salil Mehta <salil.mehta@huawei.com>
 +L:    netdev@vger.kernel.org
 +W:    http://www.hisilicon.com
 +S:    Maintained
 +F:    drivers/net/ethernet/hisilicon/
 +F:    Documentation/devicetree/bindings/net/hisilicon*.txt
 +
  HISILICON SAS Controller
  M:    John Garry <john.garry@huawei.com>
  W:    http://www.hisilicon.com
@@@ -5913,9 -5789,7 +5913,9 @@@ R:      Hartmut Knaack <knaack.h@gmx.de
  R:    Lars-Peter Clausen <lars@metafoo.de>
  R:    Peter Meerwald-Stadler <pmeerw@pmeerw.net>
  L:    linux-iio@vger.kernel.org
 +T:    git git://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio.git
  S:    Maintained
 +F:    Documentation/devicetree/bindings/iio/
  F:    drivers/iio/
  F:    drivers/staging/iio/
  F:    include/linux/iio/
@@@ -6045,12 -5919,6 +6045,12 @@@ L:    platform-driver-x86@vger.kernel.or
  S:    Maintained
  F:    drivers/platform/x86/intel-hid.c
  
 +INTEL VIRTUAL BUTTON DRIVER
 +M:    AceLan Kao <acelan.kao@canonical.com>
 +L:    platform-driver-x86@vger.kernel.org
 +S:    Maintained
 +F:    drivers/platform/x86/intel-vbtn.c
 +
  INTEL IDLE DRIVER
  M:    Len Brown <lenb@kernel.org>
  L:    linux-pm@vger.kernel.org
@@@ -6153,12 -6021,6 +6153,12 @@@ L:     linux-rdma@vger.kernel.or
  S:     Supported
  F:     drivers/infiniband/hw/i40iw/
  
 +INTEL MERRIFIELD GPIO DRIVER
 +M:    Andy Shevchenko <andriy.shevchenko@linux.intel.com>
 +L:    linux-gpio@vger.kernel.org
 +S:    Maintained
 +F:    drivers/gpio/gpio-merrifield.c
 +
  INTEL-MID GPIO DRIVER
  M:    David Cohen <david.a.cohen@linux.intel.com>
  L:    linux-gpio@vger.kernel.org
@@@ -6283,7 -6145,6 +6283,7 @@@ M:      Joerg Roedel <joro@8bytes.org
  L:    iommu@lists.linux-foundation.org
  T:    git git://git.kernel.org/pub/scm/linux/kernel/git/joro/iommu.git
  S:    Maintained
 +F:    Documentation/devicetree/bindings/iommu/
  F:    drivers/iommu/
  
  IP MASQUERADING
@@@ -6374,6 -6235,7 +6374,6 @@@ F:      Documentation/devicetree/bindings/in
  F:    drivers/irqchip/
  
  IRQ DOMAINS (IRQ NUMBER MAPPING LIBRARY)
 -M:    Jiang Liu <jiang.liu@linux.intel.com>
  M:    Marc Zyngier <marc.zyngier@arm.com>
  S:    Maintained
  T:    git git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git irq/core
@@@ -6850,7 -6712,6 +6850,7 @@@ M:      Jacek Anaszewski <j.anaszewski@samsu
  L:    linux-leds@vger.kernel.org
  T:    git git://git.kernel.org/pub/scm/linux/kernel/git/j.anaszewski/linux-leds.git
  S:    Maintained
 +F:    Documentation/devicetree/bindings/leds/
  F:    drivers/leds/
  F:    include/linux/leds.h
  
@@@ -6906,7 -6767,6 +6906,7 @@@ S:      Maintaine
  F:    drivers/ata/
  F:    include/linux/ata.h
  F:    include/linux/libata.h
 +F:    Documentation/devicetree/bindings/ata/
  
  LIBATA PATA ARASAN COMPACT FLASH CONTROLLER
  M:    Viresh Kumar <vireshk@kernel.org>
@@@ -7014,7 -6874,6 +7014,7 @@@ F:      drivers/crypto/nx
  F:    drivers/crypto/vmx/
  F:    drivers/net/ethernet/ibm/ibmveth.*
  F:    drivers/net/ethernet/ibm/ibmvnic.*
 +F:    drivers/pci/hotplug/pnv_php.c
  F:    drivers/pci/hotplug/rpa*
  F:    drivers/scsi/ibmvscsi/
  N:    opal
@@@ -7112,7 -6971,7 +7112,7 @@@ T:      git git://git.kernel.org/pub/scm/lin
  LINUX KERNEL DUMP TEST MODULE (LKDTM)
  M:    Kees Cook <keescook@chromium.org>
  S:    Maintained
 -F:    drivers/misc/lkdtm.c
 +F:    drivers/misc/lkdtm*
  
  LLC (802.2)
  M:    Arnaldo Carvalho de Melo <acme@ghostprotocols.net>
@@@ -7165,23 -7024,15 +7165,23 @@@ Q:   http://patchwork.linuxtv.org/project
  S:    Maintained
  F:    drivers/media/usb/dvb-usb-v2/lmedm04*
  
 -LOCKDEP AND LOCKSTAT
 +LOCKING PRIMITIVES
  M:    Peter Zijlstra <peterz@infradead.org>
  M:    Ingo Molnar <mingo@redhat.com>
  L:    linux-kernel@vger.kernel.org
 -T:    git git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git core/locking
 +T:    git git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git locking/core
  S:    Maintained
 -F:    Documentation/locking/lockdep*.txt
 -F:    Documentation/locking/lockstat.txt
 +F:    Documentation/locking/
  F:    include/linux/lockdep.h
 +F:    include/linux/spinlock*.h
 +F:    arch/*/include/asm/spinlock*.h
 +F:    include/linux/rwlock*.h
 +F:    include/linux/mutex*.h
 +F:    arch/*/include/asm/mutex*.h
 +F:    include/linux/rwsem*.h
 +F:    arch/*/include/asm/rwsem.h
 +F:    include/linux/seqlock.h
 +F:    lib/locking*.[ch]
  F:    kernel/locking/
  
  LOGICAL DISK MANAGER SUPPORT (LDM, Windows 2000/XP/Vista Dynamic Disks)
@@@ -7322,12 -7173,6 +7322,12 @@@ W:    http://www.kernel.org/doc/man-page
  L:    linux-man@vger.kernel.org
  S:    Maintained
  
 +MARVELL 88E6XXX ETHERNET SWITCH FABRIC DRIVER
 +M:    Andrew Lunn <andrew@lunn.ch>
 +M:    Vivien Didelot <vivien.didelot@savoirfairelinux.com>
 +S:    Maintained
 +F:    drivers/net/dsa/mv88e6xxx/
 +
  MARVELL ARMADA DRM SUPPORT
  M:    Russell King <rmk+kernel@armlinux.org.uk>
  S:    Maintained
@@@ -7335,6 -7180,11 +7335,6 @@@ F:     drivers/gpu/drm/armada
  F:    include/uapi/drm/armada_drm.h
  F:    Documentation/devicetree/bindings/display/armada/
  
 -MARVELL 88E6352 DSA support
 -M:    Guenter Roeck <linux@roeck-us.net>
 -S:    Maintained
 -F:    drivers/net/dsa/mv88e6352.c
 -
  MARVELL CRYPTO DRIVER
  M:    Boris Brezillon <boris.brezillon@free-electrons.com>
  M:    Arnaud Ebalard <arno@natisbad.org>
@@@ -7421,13 -7271,6 +7421,13 @@@ F:    Documentation/devicetree/bindings/i2
  F:    drivers/hwmon/max6697.c
  F:    include/linux/platform_data/max6697.h
  
 +MAX9860 MONO AUDIO VOICE CODEC DRIVER
 +M:    Peter Rosin <peda@axentia.se>
 +L:    alsa-devel@alsa-project.org (moderated for non-subscribers)
 +S:    Maintained
 +F:    Documentation/devicetree/bindings/sound/max9860.txt
 +F:    sound/soc/codecs/max9860.*
 +
  MAXIM MUIC CHARGER DRIVERS FOR EXYNOS BASED BOARDS
  M:    Krzysztof Kozlowski <k.kozlowski@samsung.com>
  L:    linux-pm@vger.kernel.org
@@@ -7477,16 -7320,6 +7477,16 @@@ L:    linux-iio@vger.kernel.or
  S:    Maintained
  F:    drivers/iio/potentiometer/mcp4531.c
  
 +MEDIA DRIVERS FOR RENESAS - FCP
 +M:    Laurent Pinchart <laurent.pinchart@ideasonboard.com>
 +L:    linux-media@vger.kernel.org
 +L:    linux-renesas-soc@vger.kernel.org
 +T:    git git://linuxtv.org/media_tree.git
 +S:    Supported
 +F:    Documentation/devicetree/bindings/media/renesas,fcp.txt
 +F:    drivers/media/platform/rcar-fcp.c
 +F:    include/media/rcar-fcp.h
 +
  MEDIA DRIVERS FOR RENESAS - VSP1
  M:    Laurent Pinchart <laurent.pinchart@ideasonboard.com>
  L:    linux-media@vger.kernel.org
@@@ -7496,18 -7329,8 +7496,18 @@@ S:    Supporte
  F:    Documentation/devicetree/bindings/media/renesas,vsp1.txt
  F:    drivers/media/platform/vsp1/
  
 +MEDIA DRIVERS FOR HELENE
 +M:    Abylay Ospan <aospan@netup.ru>
 +L:    linux-media@vger.kernel.org
 +W:    https://linuxtv.org
 +W:    http://netup.tv/
 +T:    git git://linuxtv.org/media_tree.git
 +S:    Supported
 +F:    drivers/media/dvb-frontends/helene*
 +
  MEDIA DRIVERS FOR ASCOT2E
  M:    Sergey Kozlov <serjk@netup.ru>
 +M:    Abylay Ospan <aospan@netup.ru>
  L:    linux-media@vger.kernel.org
  W:    https://linuxtv.org
  W:    http://netup.tv/
@@@ -7517,7 -7340,6 +7517,7 @@@ F:      drivers/media/dvb-frontends/ascot2e
  
  MEDIA DRIVERS FOR CXD2841ER
  M:    Sergey Kozlov <serjk@netup.ru>
 +M:    Abylay Ospan <aospan@netup.ru>
  L:    linux-media@vger.kernel.org
  W:    https://linuxtv.org
  W:    http://netup.tv/
@@@ -7527,7 -7349,6 +7527,7 @@@ F:      drivers/media/dvb-frontends/cxd2841e
  
  MEDIA DRIVERS FOR HORUS3A
  M:    Sergey Kozlov <serjk@netup.ru>
 +M:    Abylay Ospan <aospan@netup.ru>
  L:    linux-media@vger.kernel.org
  W:    https://linuxtv.org
  W:    http://netup.tv/
@@@ -7537,7 -7358,6 +7537,7 @@@ F:      drivers/media/dvb-frontends/horus3a
  
  MEDIA DRIVERS FOR LNBH25
  M:    Sergey Kozlov <serjk@netup.ru>
 +M:    Abylay Ospan <aospan@netup.ru>
  L:    linux-media@vger.kernel.org
  W:    https://linuxtv.org
  W:    http://netup.tv/
@@@ -7547,7 -7367,6 +7547,7 @@@ F:      drivers/media/dvb-frontends/lnbh25
  
  MEDIA DRIVERS FOR NETUP PCI UNIVERSAL DVB devices
  M:    Sergey Kozlov <serjk@netup.ru>
 +M:    Abylay Ospan <aospan@netup.ru>
  L:    linux-media@vger.kernel.org
  W:    https://linuxtv.org
  W:    http://netup.tv/
@@@ -7657,7 -7476,6 +7657,7 @@@ Q:      http://patchwork.ozlabs.org/project/
  T:    git git://git.infradead.org/linux-mtd.git
  T:    git git://git.infradead.org/l2-mtd.git
  S:    Maintained
 +F:    Documentation/devicetree/bindings/mtd/
  F:    drivers/mtd/
  F:    include/linux/mtd/
  F:    include/uapi/mtd/
@@@ -7797,8 -7615,10 +7797,8 @@@ L:     linux-media@vger.kernel.or
  W:    https://linuxtv.org
  W:    http://palosaari.fi/linux/
  Q:    http://patchwork.linuxtv.org/project/linux-media/list/
 -T:    git git://linuxtv.org/anttip/media_tree.git
  S:    Maintained
 -F:    drivers/staging/media/mn88472/
 -F:    drivers/media/dvb-frontends/mn88472.h
 +F:    drivers/media/dvb-frontends/mn88472*
  
  MN88473 MEDIA DRIVER
  M:    Antti Palosaari <crope@iki.fi>
@@@ -7924,7 -7744,6 +7924,7 @@@ M:      Ulf Hansson <ulf.hansson@linaro.org
  L:    linux-mmc@vger.kernel.org
  T:    git git://git.linaro.org/people/ulf.hansson/mmc.git
  S:    Maintained
 +F:    Documentation/devicetree/bindings/mmc/
  F:    drivers/mmc/
  F:    include/linux/mmc/
  F:    include/uapi/linux/mmc/
@@@ -8354,13 -8173,6 +8354,13 @@@ S:    Supporte
  F:    drivers/nvme/host/
  F:    include/linux/nvme.h
  
 +NVM EXPRESS TARGET DRIVER
 +M:    Christoph Hellwig <hch@lst.de>
 +M:    Sagi Grimberg <sagi@grimberg.me>
 +L:    linux-nvme@lists.infradead.org
 +S:    Supported
 +F:    drivers/nvme/target/
 +
  NVMEM FRAMEWORK
  M:    Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
  M:    Maxime Ripard <maxime.ripard@free-electrons.com>
@@@ -8883,6 -8695,7 +8883,7 @@@ L:      linux-pci@vger.kernel.or
  Q:    http://patchwork.ozlabs.org/project/linux-pci/list/
  T:    git git://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci.git
  S:    Supported
+ F:    Documentation/devicetree/bindings/pci/
  F:    Documentation/PCI/
  F:    drivers/pci/
  F:    include/linux/pci*
@@@ -8946,6 -8759,13 +8947,13 @@@ L:    linux-arm-kernel@lists.infradead.or
  S:    Maintained
  F:    drivers/pci/host/*mvebu*
  
+ PCI DRIVER FOR AARDVARK (Marvell Armada 3700)
+ M:    Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
+ L:    linux-pci@vger.kernel.org
+ L:    linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
+ S:    Maintained
+ F:    drivers/pci/host/pci-aardvark.c
  PCI DRIVER FOR NVIDIA TEGRA
  M:    Thierry Reding <thierry.reding@gmail.com>
  L:    linux-tegra@vger.kernel.org
@@@ -9028,6 -8848,15 +9036,15 @@@ S:    Maintaine
  F:    Documentation/devicetree/bindings/pci/xgene-pci-msi.txt
  F:    drivers/pci/host/pci-xgene-msi.c
  
+ PCIE DRIVER FOR AXIS ARTPEC
+ M:    Niklas Cassel <niklas.cassel@axis.com>
+ M:    Jesper Nilsson <jesper.nilsson@axis.com>
+ L:    linux-arm-kernel@axis.com
+ L:    linux-pci@vger.kernel.org
+ S:    Maintained
+ F:    Documentation/devicetree/bindings/pci/axis,artpec*
+ F:    drivers/pci/host/*artpec*
  PCIE DRIVER FOR HISILICON
  M:    Zhou Wang <wangzhou1@hisilicon.com>
  M:    Gabriele Paoloni <gabriele.paoloni@huawei.com>
@@@ -9274,8 -9103,6 +9291,8 @@@ M:      David Woodhouse <dwmw2@infradead.org
  L:    linux-pm@vger.kernel.org
  T:    git git://git.infradead.org/battery-2.6.git
  S:    Maintained
 +F:    Documentation/devicetree/bindings/power/
 +F:    Documentation/devicetree/bindings/power_supply/
  F:    include/linux/power_supply.h
  F:    drivers/power/
  X:    drivers/power/avs/
@@@ -9289,12 -9116,6 +9306,12 @@@ F:    drivers/firmware/psci.
  F:    include/linux/psci.h
  F:    include/uapi/linux/psci.h
  
 +POWERNV OPERATOR PANEL LCD DISPLAY DRIVER
 +M:    Suraj Jitindar Singh <sjitindarsingh@gmail.com>
 +L:    linuxppc-dev@lists.ozlabs.org
 +S:    Maintained
 +F:    drivers/char/powernv-op-panel.c
 +
  PNP SUPPORT
  M:    "Rafael J. Wysocki" <rafael.j.wysocki@intel.com>
  S:    Maintained
@@@ -9419,13 -9240,6 +9436,13 @@@ F:    include/linux/tracehook.
  F:    include/uapi/linux/ptrace.h
  F:    kernel/ptrace.c
  
 +PULSE8-CEC DRIVER
 +M:    Hans Verkuil <hverkuil@xs4all.nl>
 +L:    linux-media@vger.kernel.org
 +T:    git git://linuxtv.org/media_tree.git
 +S:    Maintained
 +F:    drivers/staging/media/pulse8-cec
 +
  PVRUSB2 VIDEO4LINUX DRIVER
  M:    Mike Isely <isely@pobox.com>
  L:    pvrusb2@isely.net       (subscribers-only)
@@@ -9437,10 -9251,10 +9454,10 @@@ F:   Documentation/video4linux/README.pvr
  F:    drivers/media/usb/pvrusb2/
  
  PWC WEBCAM DRIVER
 -M:    Hans de Goede <hdegoede@redhat.com>
 +M:    Hans Verkuil <hverkuil@xs4all.nl>
  L:    linux-media@vger.kernel.org
  T:    git git://linuxtv.org/media_tree.git
 -S:    Maintained
 +S:    Odd Fixes
  F:    drivers/media/usb/pwc/*
  
  PWM FAN DRIVER
@@@ -9513,8 -9327,7 +9530,8 @@@ L:      rtc-linux@googlegroups.co
  S:    Maintained
  
  QAT DRIVER
 -M:    Tadeusz Struk <tadeusz.struk@intel.com>
 +M:    Giovanni Cabiddu <giovanni.cabiddu@intel.com>
 +M:    Salvatore Benedetto <salvatore.benedetto@intel.com>
  L:    qat-linux@intel.com
  S:    Supported
  F:    drivers/crypto/qat/
@@@ -9656,14 -9469,14 +9673,14 @@@ F:   drivers/video/fbdev/aty/radeon
  F:    include/uapi/linux/radeonfb.h
  
  RADIOSHARK RADIO DRIVER
 -M:    Hans de Goede <hdegoede@redhat.com>
 +M:    Hans Verkuil <hverkuil@xs4all.nl>
  L:    linux-media@vger.kernel.org
  T:    git git://linuxtv.org/media_tree.git
  S:    Maintained
  F:    drivers/media/radio/radio-shark.c
  
  RADIOSHARK2 RADIO DRIVER
 -M:    Hans de Goede <hdegoede@redhat.com>
 +M:    Hans Verkuil <hverkuil@xs4all.nl>
  L:    linux-media@vger.kernel.org
  T:    git git://linuxtv.org/media_tree.git
  S:    Maintained
@@@ -9737,7 -9550,7 +9754,7 @@@ M:      Florian Fainelli <florian@openwrt.or
  S:    Maintained
  
  RDC R6040 FAST ETHERNET DRIVER
 -M:    Florian Fainelli <florian@openwrt.org>
 +M:    Florian Fainelli <f.fainelli@gmail.com>
  L:    netdev@vger.kernel.org
  S:    Maintained
  F:    drivers/net/ethernet/rdc/r6040.c
@@@ -9804,7 -9617,6 +9821,7 @@@ M:      Mark Brown <broonie@kernel.org
  L:    linux-kernel@vger.kernel.org
  T:    git git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regmap.git
  S:    Supported
 +F:    Documentation/devicetree/bindings/regmap/
  F:    drivers/base/regmap/
  F:    include/linux/regmap.h
  
@@@ -9814,9 -9626,8 +9831,9 @@@ M:      Bjorn Andersson <bjorn.andersson@lin
  L:    linux-remoteproc@vger.kernel.org
  T:    git git://git.kernel.org/pub/scm/linux/kernel/git/ohad/remoteproc.git
  S:    Maintained
 -F:    drivers/remoteproc/
 +F:    Documentation/devicetree/bindings/remoteproc/
  F:    Documentation/remoteproc.txt
 +F:    drivers/remoteproc/
  F:    include/linux/remoteproc.h
  
  REMOTE PROCESSOR MESSAGING (RPMSG) SUBSYSTEM
@@@ -9890,6 -9701,7 +9907,6 @@@ F:      Documentation/ABI/*/sysfs-driver-hid
  
  ROCKER DRIVER
  M:    Jiri Pirko <jiri@resnulli.us>
 -M:    Scott Feldman <sfeldma@gmail.com>
  L:    netdev@vger.kernel.org
  S:    Supported
  F:    drivers/net/ethernet/rocker/
@@@ -10101,9 -9913,7 +10118,9 @@@ S:    Maintaine
  F:    drivers/platform/x86/samsung-laptop.c
  
  SAMSUNG AUDIO (ASoC) DRIVERS
 +M:    Krzysztof Kozlowski <k.kozlowski@samsung.com>
  M:    Sangbeom Kim <sbkim73@samsung.com>
 +M:    Sylwester Nawrocki <s.nawrocki@samsung.com>
  L:    alsa-devel@alsa-project.org (moderated for non-subscribers)
  S:    Supported
  F:    sound/soc/samsung/
@@@ -10208,7 -10018,6 +10225,7 @@@ SERIAL DRIVER
  M:    Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  L:    linux-serial@vger.kernel.org
  S:    Maintained
 +F:    Documentation/devicetree/bindings/serial/
  F:    drivers/tty/serial/
  
  SYNOPSYS DESIGNWARE DMAC DRIVER
@@@ -10345,7 -10154,6 +10362,7 @@@ M:   "Martin K. Petersen" <martin.peterse
  T:    git git://git.kernel.org/pub/scm/linux/kernel/git/mkp/scsi.git
  L:    linux-scsi@vger.kernel.org
  S:    Maintained
 +F:    Documentation/devicetree/bindings/scsi/
  F:    drivers/scsi/
  F:    include/scsi/
  
@@@ -10417,13 -10225,6 +10434,13 @@@ F: tools/testing/selftests/seccomp/
  K:    \bsecure_computing
  K:    \bTIF_SECCOMP\b
  
 +SECURE DIGITAL HOST CONTROLLER INTERFACE (SDHCI) Broadcom BRCMSTB DRIVER
 +M:    Al Cooper <alcooperx@gmail.com>
 +L:    linux-mmc@vger.kernel.org
 +L:    bcm-kernel-feedback-list@broadcom.com
 +S:    Maintained
 +F:    drivers/mmc/host/sdhci-brcmstb*
 +
  SECURE DIGITAL HOST CONTROLLER INTERFACE (SDHCI) SAMSUNG DRIVER
  M:    Ben Dooks <ben-linux@fluff.org>
  M:    Jaehoon Chung <jh80.chung@samsung.com>
@@@ -10497,9 -10298,10 +10514,9 @@@ W:  http://www.avagotech.co
  S:    Supported
  F:    drivers/scsi/be2iscsi/
  
 -Emulex 10Gbps NIC BE2, BE3-R, Lancer, Skyhawk-R DRIVER
 +Emulex 10Gbps NIC BE2, BE3-R, Lancer, Skyhawk-R DRIVER (be2net)
  M:    Sathya Perla <sathya.perla@broadcom.com>
  M:    Ajit Khaparde <ajit.khaparde@broadcom.com>
 -M:    Padmanabh Ratnakar <padmanabh.ratnakar@broadcom.com>
  M:    Sriharsha Basavapatna <sriharsha.basavapatna@broadcom.com>
  M:    Somnath Kotur <somnath.kotur@broadcom.com>
  L:    netdev@vger.kernel.org
@@@ -10765,7 -10567,7 +10782,7 @@@ SMACK SECURITY MODUL
  M:    Casey Schaufler <casey@schaufler-ca.com>
  L:    linux-security-module@vger.kernel.org
  W:    http://schaufler-ca.com
 -T:    git git://git.gitorious.org/smack-next/kernel.git
 +T:    git git://github.com/cschaufler/smack-next
  S:    Maintained
  F:    Documentation/security/Smack.txt
  F:    security/smack/
@@@ -10939,7 -10741,6 +10956,7 @@@ T:   git git://git.kernel.org/pub/scm/lin
  L:    alsa-devel@alsa-project.org (moderated for non-subscribers)
  W:    http://alsa-project.org/main/index.php/ASoC
  S:    Supported
 +F:    Documentation/devicetree/bindings/sound/
  F:    Documentation/sound/alsa/soc/
  F:    sound/soc/
  F:    include/sound/soc*
@@@ -11015,7 -10816,6 +11032,7 @@@ L:   linux-spi@vger.kernel.or
  T:    git git://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi.git
  Q:    http://patchwork.kernel.org/project/spi-devel-general/list/
  S:    Maintained
 +F:    Documentation/devicetree/bindings/spi/
  F:    Documentation/spi/
  F:    drivers/spi/
  F:    include/linux/spi/
@@@ -11078,7 -10878,6 +11095,7 @@@ STAGING - INDUSTRIAL I
  M:    Jonathan Cameron <jic23@kernel.org>
  L:    linux-iio@vger.kernel.org
  S:    Odd Fixes
 +F:    Documentation/devicetree/bindings/staging/iio/
  F:    drivers/staging/iio/
  
  STAGING - LIRC (LINUX INFRARED REMOTE CONTROL) DRIVERS
@@@ -11533,6 -11332,11 +11550,6 @@@ F:  Documentation/thermal/cpu-cooling-ap
  F:    drivers/thermal/cpu_cooling.c
  F:    include/linux/cpu_cooling.h
  
 -THINGM BLINK(1) USB RGB LED DRIVER
 -M:    Vivien Didelot <vivien.didelot@savoirfairelinux.com>
 -S:    Maintained
 -F:    drivers/hid/hid-thingm.c
 -
  THINKPAD ACPI EXTRAS DRIVER
  M:    Henrique de Moraes Holschuh <ibm-acpi@hmh.eng.br>
  L:    ibm-acpi-devel@lists.sourceforge.net
@@@ -11983,12 -11787,6 +12000,12 @@@ S: Supporte
  F:    Documentation/scsi/ufs.txt
  F:    drivers/scsi/ufs/
  
 +UNIVERSAL FLASH STORAGE HOST CONTROLLER DRIVER DWC HOOKS
 +M:    Joao Pinto <Joao.Pinto@synopsys.com>
 +L:    linux-scsi@vger.kernel.org
 +S:    Supported
 +F:    drivers/scsi/ufs/*dwc*
 +
  UNSORTED BLOCK IMAGES (UBI)
  M:    Artem Bityutskiy <dedekind1@gmail.com>
  M:    Richard Weinberger <richard@nod.at>
@@@ -12014,7 -11812,8 +12031,7 @@@ S:   Maintaine
  F:    drivers/net/wireless/ath/ar5523/
  
  USB ATTACHED SCSI
 -M:    Hans de Goede <hdegoede@redhat.com>
 -M:    Gerd Hoffmann <kraxel@redhat.com>
 +M:    Oliver Neukum <oneukum@suse.com>
  L:    linux-usb@vger.kernel.org
  L:    linux-scsi@vger.kernel.org
  S:    Maintained
@@@ -12513,7 -12312,7 +12530,7 @@@ S:   Maintaine
  F:    drivers/net/vmxnet3/
  
  VMware PVSCSI driver
 -M:    Arvind Kumar <arvindkumar@vmware.com>
 +M:    Jim Gill <jgill@vmware.com>
  M:    VMware PV-Drivers <pv-drivers@vmware.com>
  L:    linux-scsi@vger.kernel.org
  S:    Maintained
diff --combined arch/arm/Kconfig
index fc3dc0b90be2e0d23bffe6f334cac4565b936bcf,354c167a2b42a645eb5d50e8a4bb74dd4e85af1d..2d601d769a1cdddae7bbba2bb22571731e3d4f5e
@@@ -54,7 -54,6 +54,7 @@@ config AR
        select HAVE_FTRACE_MCOUNT_RECORD if (!XIP_KERNEL)
        select HAVE_FUNCTION_GRAPH_TRACER if (!THUMB2_KERNEL)
        select HAVE_FUNCTION_TRACER if (!XIP_KERNEL)
 +      select HAVE_GCC_PLUGINS
        select HAVE_GENERIC_DMA_COHERENT
        select HAVE_HW_BREAKPOINT if (PERF_EVENTS && (CPU_V6 || CPU_V6K || CPU_V7))
        select HAVE_IDE if PCI || ISA || PCMCIA
@@@ -328,6 -327,7 +328,6 @@@ choic
  config ARCH_MULTIPLATFORM
        bool "Allow multiple platforms to be selected"
        depends on MMU
 -      select ARCH_WANT_OPTIONAL_GPIOLIB
        select ARM_HAS_SG_CHAIN
        select ARM_PATCH_PHYS_VIRT
        select AUTO_ZRELADDR
  config ARM_SINGLE_ARMV7M
        bool "ARMv7-M based platforms (Cortex-M0/M3/M4)"
        depends on !MMU
 -      select ARCH_WANT_OPTIONAL_GPIOLIB
        select ARM_NVIC
        select AUTO_ZRELADDR
        select CLKSRC_OF
        select SPARSE_IRQ
        select USE_OF
  
 -
 -config ARCH_CLPS711X
 -      bool "Cirrus Logic CLPS711x/EP721x/EP731x-based"
 -      select ARCH_REQUIRE_GPIOLIB
 -      select AUTO_ZRELADDR
 -      select CLKSRC_MMIO
 -      select COMMON_CLK
 -      select CPU_ARM720T
 -      select GENERIC_CLOCKEVENTS
 -      select MFD_SYSCON
 -      select SOC_BUS
 -      help
 -        Support for Cirrus Logic 711x/721x/731x based boards.
 -
  config ARCH_GEMINI
        bool "Cortina Systems Gemini"
 -      select ARCH_REQUIRE_GPIOLIB
        select CLKSRC_MMIO
        select CPU_FA526
        select GENERIC_CLOCKEVENTS
 +      select GPIOLIB
        help
          Support for the Cortina Systems Gemini family SoCs
  
@@@ -378,6 -393,7 +378,6 @@@ config ARCH_EBSA11
  config ARCH_EP93XX
        bool "EP93xx-based"
        select ARCH_HAS_HOLES_MEMORYMODEL
 -      select ARCH_REQUIRE_GPIOLIB
        select ARM_AMBA
        select ARM_PATCH_PHYS_VIRT
        select ARM_VIC
        select CLKSRC_MMIO
        select CPU_ARM920T
        select GENERIC_CLOCKEVENTS
 +      select GPIOLIB
        help
          This enables support for the Cirrus EP93xx series of CPUs.
  
@@@ -427,9 -442,9 +427,9 @@@ config ARCH_IOP13X
  config ARCH_IOP32X
        bool "IOP32x-based"
        depends on MMU
 -      select ARCH_REQUIRE_GPIOLIB
        select CPU_XSCALE
        select GPIO_IOP
 +      select GPIOLIB
        select NEED_RET_TO_USER
        select PCI
        select PLAT_IOP
  config ARCH_IOP33X
        bool "IOP33x-based"
        depends on MMU
 -      select ARCH_REQUIRE_GPIOLIB
        select CPU_XSCALE
        select GPIO_IOP
 +      select GPIOLIB
        select NEED_RET_TO_USER
        select PCI
        select PLAT_IOP
@@@ -453,12 -468,12 +453,12 @@@ config ARCH_IXP4X
        bool "IXP4xx-based"
        depends on MMU
        select ARCH_HAS_DMA_SET_COHERENT_MASK
 -      select ARCH_REQUIRE_GPIOLIB
        select ARCH_SUPPORTS_BIG_ENDIAN
        select CLKSRC_MMIO
        select CPU_XSCALE
        select DMABOUNCE if PCI
        select GENERIC_CLOCKEVENTS
 +      select GPIOLIB
        select MIGHT_HAVE_PCI
        select NEED_MACH_IO_H
        select USB_EHCI_BIG_ENDIAN_DESC
  
  config ARCH_DOVE
        bool "Marvell Dove"
 -      select ARCH_REQUIRE_GPIOLIB
        select CPU_PJ4
        select GENERIC_CLOCKEVENTS
 +      select GPIOLIB
        select MIGHT_HAVE_PCI
        select MULTI_IRQ_HANDLER
        select MVEBU_MBUS
  
  config ARCH_KS8695
        bool "Micrel/Kendin KS8695"
 -      select ARCH_REQUIRE_GPIOLIB
        select CLKSRC_MMIO
        select CPU_ARM922T
        select GENERIC_CLOCKEVENTS
 +      select GPIOLIB
        select NEED_MACH_MEMORY_H
        help
          Support for Micrel/Kendin KS8695 "Centaur" (ARM922T) based
  
  config ARCH_W90X900
        bool "Nuvoton W90X900 CPU"
 -      select ARCH_REQUIRE_GPIOLIB
        select CLKDEV_LOOKUP
        select CLKSRC_MMIO
        select CPU_ARM926T
        select GENERIC_CLOCKEVENTS
 +      select GPIOLIB
        help
          Support for Nuvoton (Winbond logic dept.) ARM9 processor,
          At present, the w90x900 has been renamed nuc900, regarding
  
  config ARCH_LPC32XX
        bool "NXP LPC32XX"
 -      select ARCH_REQUIRE_GPIOLIB
        select ARM_AMBA
        select CLKDEV_LOOKUP
        select CLKSRC_LPC32XX
        select COMMON_CLK
        select CPU_ARM926T
        select GENERIC_CLOCKEVENTS
 +      select GPIOLIB
        select MULTI_IRQ_HANDLER
        select SPARSE_IRQ
        select USE_OF
@@@ -528,6 -543,7 +528,6 @@@ config ARCH_PX
        bool "PXA2xx/PXA3xx-based"
        depends on MMU
        select ARCH_MTD_XIP
 -      select ARCH_REQUIRE_GPIOLIB
        select ARM_CPU_SUSPEND if PM
        select AUTO_ZRELADDR
        select COMMON_CLK
        select CPU_XSCALE if !CPU_XSC3
        select GENERIC_CLOCKEVENTS
        select GPIO_PXA
 +      select GPIOLIB
        select HAVE_IDE
        select IRQ_DOMAIN
        select MULTI_IRQ_HANDLER
@@@ -569,6 -584,7 +569,6 @@@ config ARCH_RP
  config ARCH_SA1100
        bool "SA1100-based"
        select ARCH_MTD_XIP
 -      select ARCH_REQUIRE_GPIOLIB
        select ARCH_SPARSEMEM_ENABLE
        select CLKDEV_LOOKUP
        select CLKSRC_MMIO
        select CPU_FREQ
        select CPU_SA1100
        select GENERIC_CLOCKEVENTS
 +      select GPIOLIB
        select HAVE_IDE
        select IRQ_DOMAIN
        select ISA
  
  config ARCH_S3C24XX
        bool "Samsung S3C24XX SoCs"
 -      select ARCH_REQUIRE_GPIOLIB
        select ATAGS
        select CLKDEV_LOOKUP
        select CLKSRC_SAMSUNG_PWM
        select GENERIC_CLOCKEVENTS
        select GPIO_SAMSUNG
 +      select GPIOLIB
        select HAVE_S3C2410_I2C if I2C
        select HAVE_S3C2410_WATCHDOG if WATCHDOG
        select HAVE_S3C_RTC if RTC_CLASS
  config ARCH_DAVINCI
        bool "TI DaVinci"
        select ARCH_HAS_HOLES_MEMORYMODEL
 -      select ARCH_REQUIRE_GPIOLIB
        select CLKDEV_LOOKUP
        select CPU_ARM926T
        select GENERIC_ALLOCATOR
        select GENERIC_CLOCKEVENTS
        select GENERIC_IRQ_CHIP
 +      select GPIOLIB
        select HAVE_IDE
        select USE_OF
        select ZONE_DMA
@@@ -627,11 -642,11 +627,11 @@@ config ARCH_OMAP
        depends on MMU
        select ARCH_HAS_HOLES_MEMORYMODEL
        select ARCH_OMAP
 -      select ARCH_REQUIRE_GPIOLIB
        select CLKDEV_LOOKUP
        select CLKSRC_MMIO
        select GENERIC_CLOCKEVENTS
        select GENERIC_IRQ_CHIP
 +      select GPIOLIB
        select HAVE_IDE
        select IRQ_DOMAIN
        select MULTI_IRQ_HANDLER
@@@ -700,7 -715,7 +700,7 @@@ config ARCH_VIR
        depends on ARCH_MULTI_V7
        select ARM_AMBA
        select ARM_GIC
-       select ARM_GIC_V2M if PCI_MSI
+       select ARM_GIC_V2M if PCI
        select ARM_GIC_V3
        select ARM_PSCI
        select HAVE_ARM_ARCH_TIMER
@@@ -853,7 -868,7 +853,7 @@@ source "arch/arm/mach-zynq/Kconfig
  config ARCH_EFM32
        bool "Energy Micro efm32"
        depends on ARM_SINGLE_ARMV7M
 -      select ARCH_REQUIRE_GPIOLIB
 +      select GPIOLIB
        help
          Support for Energy Micro's (now Silicon Labs) efm32 Giant Gecko
          processors.
@@@ -886,7 -901,7 +886,7 @@@ config MACH_STM32F42
        default y
  
  config ARCH_MPS2
 -      bool "ARM MPS2 paltform"
 +      bool "ARM MPS2 platform"
        depends on ARM_SINGLE_ARMV7M
        select ARM_AMBA
        select CLKSRC_MPS2
@@@ -1171,60 -1186,6 +1171,60 @@@ config ARM_ERRATA_77302
          loop buffer may deliver incorrect instructions. This
          workaround disables the loop buffer to avoid the erratum.
  
 +config ARM_ERRATA_818325_852422
 +      bool "ARM errata: A12: some seqs of opposed cond code instrs => deadlock or corruption"
 +      depends on CPU_V7
 +      help
 +        This option enables the workaround for:
 +        - Cortex-A12 818325: Execution of an UNPREDICTABLE STR or STM
 +          instruction might deadlock.  Fixed in r0p1.
 +        - Cortex-A12 852422: Execution of a sequence of instructions might
 +          lead to either a data corruption or a CPU deadlock.  Not fixed in
 +          any Cortex-A12 cores yet.
 +        This workaround for all both errata involves setting bit[12] of the
 +        Feature Register. This bit disables an optimisation applied to a
 +        sequence of 2 instructions that use opposing condition codes.
 +
 +config ARM_ERRATA_821420
 +      bool "ARM errata: A12: sequence of VMOV to core registers might lead to a dead lock"
 +      depends on CPU_V7
 +      help
 +        This option enables the workaround for the 821420 Cortex-A12
 +        (all revs) erratum. In very rare timing conditions, a sequence
 +        of VMOV to Core registers instructions, for which the second
 +        one is in the shadow of a branch or abort, can lead to a
 +        deadlock when the VMOV instructions are issued out-of-order.
 +
 +config ARM_ERRATA_825619
 +      bool "ARM errata: A12: DMB NSHST/ISHST mixed ... might cause deadlock"
 +      depends on CPU_V7
 +      help
 +        This option enables the workaround for the 825619 Cortex-A12
 +        (all revs) erratum. Within rare timing constraints, executing a
 +        DMB NSHST or DMB ISHST instruction followed by a mix of Cacheable
 +        and Device/Strongly-Ordered loads and stores might cause deadlock
 +
 +config ARM_ERRATA_852421
 +      bool "ARM errata: A17: DMB ST might fail to create order between stores"
 +      depends on CPU_V7
 +      help
 +        This option enables the workaround for the 852421 Cortex-A17
 +        (r1p0, r1p1, r1p2) erratum. Under very rare timing conditions,
 +        execution of a DMB ST instruction might fail to properly order
 +        stores from GroupA and stores from GroupB.
 +
 +config ARM_ERRATA_852423
 +      bool "ARM errata: A17: some seqs of opposed cond code instrs => deadlock or corruption"
 +      depends on CPU_V7
 +      help
 +        This option enables the workaround for:
 +        - Cortex-A17 852423: Execution of a sequence of instructions might
 +          lead to either a data corruption or a CPU deadlock.  Not fixed in
 +          any Cortex-A17 cores yet.
 +        This is identical to Cortex-A12 erratum 852422.  It is a separate
 +        config option from the A12 erratum due to the way errata are checked
 +        for and handled.
 +
  endmenu
  
  source "arch/arm/common/Kconfig"
diff --combined arch/arm64/Kconfig
index 1b06db571fffb899b9f1149afde2c54ddd92f4aa,21d955de41812c1471e3e9b431853c76ee7a3c16..69c8787bec7d3f3e343b592b01997667f3f8c53d
@@@ -3,12 -3,11 +3,13 @@@ config ARM6
        select ACPI_CCA_REQUIRED if ACPI
        select ACPI_GENERIC_GSI if ACPI
        select ACPI_REDUCED_HARDWARE_ONLY if ACPI
+       select ACPI_MCFG if ACPI
        select ARCH_HAS_DEVMEM_IS_ALLOWED
 +      select ARCH_HAS_ACPI_TABLE_UPGRADE if ACPI
        select ARCH_HAS_ATOMIC64_DEC_IF_POSITIVE
        select ARCH_HAS_ELF_RANDOMIZE
        select ARCH_HAS_GCOV_PROFILE_ALL
 +      select ARCH_HAS_KCOV
        select ARCH_HAS_SG_CHAIN
        select ARCH_HAS_TICK_BROADCAST if GENERIC_CLOCKEVENTS_BROADCAST
        select ARCH_USE_CMPXCHG_LOCKREF
@@@ -22,9 -21,9 +23,9 @@@
        select ARM_ARCH_TIMER
        select ARM_GIC
        select AUDIT_ARCH_COMPAT_GENERIC
-       select ARM_GIC_V2M if PCI_MSI
+       select ARM_GIC_V2M if PCI
        select ARM_GIC_V3
-       select ARM_GIC_V3_ITS if PCI_MSI
+       select ARM_GIC_V3_ITS if PCI
        select ARM_PSCI_FW
        select BUILDTIME_EXTABLE_SORT
        select CLONE_BACKWARDS
@@@ -78,7 -77,6 +79,7 @@@
        select HAVE_FTRACE_MCOUNT_RECORD
        select HAVE_FUNCTION_TRACER
        select HAVE_FUNCTION_GRAPH_TRACER
 +      select HAVE_GCC_PLUGINS
        select HAVE_GENERIC_DMA_COHERENT
        select HAVE_HW_BREAKPOINT if PERF_EVENTS
        select HAVE_IRQ_TIME_ACCOUNTING
        select HAVE_PERF_EVENTS
        select HAVE_PERF_REGS
        select HAVE_PERF_USER_STACK_DUMP
 +      select HAVE_REGS_AND_STACK_ACCESS_API
        select HAVE_RCU_TABLE_FREE
        select HAVE_SYSCALL_TRACEPOINTS
 +      select HAVE_KPROBES
 +      select HAVE_KRETPROBES if HAVE_KPROBES
        select IOMMU_DMA if IOMMU_SUPPORT
        select IRQ_DOMAIN
        select IRQ_FORCED_THREADING
        select OF_EARLY_FLATTREE
        select OF_NUMA if NUMA && OF
        select OF_RESERVED_MEM
+       select PCI_ECAM if ACPI
        select PERF_USE_VMALLOC
        select POWER_RESET
        select POWER_SUPPLY
@@@ -670,16 -666,6 +672,16 @@@ config PARAVIRT_TIME_ACCOUNTIN
  
          If in doubt, say N here.
  
 +config KEXEC
 +      depends on PM_SLEEP_SMP
 +      select KEXEC_CORE
 +      bool "kexec system call"
 +      ---help---
 +        kexec is a system call that implements the ability to shutdown your
 +        current kernel, and to start another kernel.  It is like a reboot
 +        but it is independent of the system firmware.   And like a reboot
 +        you can start any kernel with it, not just Linux.
 +
  config XEN_DOM0
        def_bool y
        depends on XEN
@@@ -888,7 -874,7 +890,7 @@@ config RELOCATABL
  
  config RANDOMIZE_BASE
        bool "Randomize the address of the kernel image"
 -      select ARM64_MODULE_PLTS
 +      select ARM64_MODULE_PLTS if MODULES
        select RELOCATABLE
        help
          Randomizes the virtual address at which the kernel image is
index eb29280962d7482ada7a80228cffe2792011c173,8a9cae9677bf57c4407d2fb0cd4342356da3289f..c4762538ec0100dadfc8876f4f749d3b7bdc3a34
                                status = "disabled";
                        };
  
 +                      nb_perih_clk: nb-periph-clk@13000{
 +                              compatible = "marvell,armada-3700-periph-clock-nb";
 +                              reg = <0x13000 0x100>;
 +                              clocks = <&tbg 0>, <&tbg 1>, <&tbg 2>,
 +                              <&tbg 3>, <&xtalclk>;
 +                              #clock-cells = <1>;
 +                      };
 +
 +                      sb_perih_clk: sb-periph-clk@18000{
 +                              compatible = "marvell,armada-3700-periph-clock-sb";
 +                              reg = <0x18000 0x100>;
 +                              clocks = <&tbg 0>, <&tbg 1>, <&tbg 2>,
 +                              <&tbg 3>, <&xtalclk>;
 +                              #clock-cells = <1>;
 +                      };
 +
 +                      tbg: tbg@13200 {
 +                              compatible = "marvell,armada-3700-tbg-clock";
 +                              reg = <0x13200 0x100>;
 +                              clocks = <&xtalclk>;
 +                              #clock-cells = <1>;
 +                      };
 +
 +                      gpio1: gpio@13800 {
 +                              compatible = "marvell,mvebu-gpio-3700",
 +                              "syscon", "simple-mfd";
 +                              reg = <0x13800 0x500>;
 +
 +                              xtalclk: xtal-clk {
 +                                      compatible = "marvell,armada-3700-xtal-clock";
 +                                      clock-output-names = "xtal";
 +                                      #clock-cells = <0>;
 +                              };
 +                      };
 +
                        usb3: usb@58000 {
                                compatible = "marvell,armada3700-xhci",
                                "generic-xhci";
                                      <0x1d40000 0x40000>; /* GICR */
                        };
                };
+               pcie0: pcie@d0070000 {
+                       compatible = "marvell,armada-3700-pcie";
+                       device_type = "pci";
+                       status = "disabled";
+                       reg = <0 0xd0070000 0 0x20000>;
+                       #address-cells = <3>;
+                       #size-cells = <2>;
+                       bus-range = <0x00 0xff>;
+                       interrupts = <GIC_SPI 29 IRQ_TYPE_LEVEL_HIGH>;
+                       #interrupt-cells = <1>;
+                       msi-parent = <&pcie0>;
+                       msi-controller;
+                       ranges = <0x82000000 0 0xe8000000   0 0xe8000000 0 0x1000000 /* Port 0 MEM */
+                                 0x81000000 0 0xe9000000   0 0xe9000000 0 0x10000>; /* Port 0 IO*/
+                       interrupt-map-mask = <0 0 0 7>;
+                       interrupt-map = <0 0 0 1 &pcie_intc 0>,
+                                       <0 0 0 2 &pcie_intc 1>,
+                                       <0 0 0 3 &pcie_intc 2>,
+                                       <0 0 0 4 &pcie_intc 3>;
+                       pcie_intc: interrupt-controller {
+                               interrupt-controller;
+                               #interrupt-cells = <1>;
+                       };
+               };
        };
  };
index f93942b4b6a61a661aae7e4da92605eded111bd4,6de6e0e96ce5d1c6dccf94654531c05a91f6e401..a5c0153ede37f21d6dd8f47beac764587789fbc5
  #include <asm/ppc-pci.h>
  #include <asm/eeh.h>
  
 +/* hose_spinlock protects accesses to the the phb_bitmap. */
  static DEFINE_SPINLOCK(hose_spinlock);
  LIST_HEAD(hose_list);
  
 -/* XXX kill that some day ... */
 -static int global_phb_number;         /* Global phb counter */
 +/* For dynamic PHB numbering on get_phb_number(): max number of PHBs. */
 +#define MAX_PHBS 0x10000
 +
 +/*
 + * For dynamic PHB numbering: used/free PHBs tracking bitmap.
 + * Accesses to this bitmap should be protected by hose_spinlock.
 + */
 +static DECLARE_BITMAP(phb_bitmap, MAX_PHBS);
  
  /* ISA Memory physical address */
  resource_size_t isa_mem_base;
@@@ -71,42 -64,6 +71,42 @@@ struct dma_map_ops *get_pci_dma_ops(voi
  }
  EXPORT_SYMBOL(get_pci_dma_ops);
  
 +/*
 + * This function should run under locking protection, specifically
 + * hose_spinlock.
 + */
 +static int get_phb_number(struct device_node *dn)
 +{
 +      int ret, phb_id = -1;
 +      u64 prop;
 +
 +      /*
 +       * Try fixed PHB numbering first, by checking archs and reading
 +       * the respective device-tree properties. Firstly, try powernv by
 +       * reading "ibm,opal-phbid", only present in OPAL environment.
 +       */
 +      ret = of_property_read_u64(dn, "ibm,opal-phbid", &prop);
 +      if (ret)
 +              ret = of_property_read_u32_index(dn, "reg", 1, (u32 *)&prop);
 +
 +      if (!ret)
 +              phb_id = (int)(prop & (MAX_PHBS - 1));
 +
 +      /* We need to be sure to not use the same PHB number twice. */
 +      if ((phb_id >= 0) && !test_and_set_bit(phb_id, phb_bitmap))
 +              return phb_id;
 +
 +      /*
 +       * If not pseries nor powernv, or if fixed PHB numbering tried to add
 +       * the same PHB number twice, then fallback to dynamic PHB numbering.
 +       */
 +      phb_id = find_first_zero_bit(phb_bitmap, MAX_PHBS);
 +      BUG_ON(phb_id >= MAX_PHBS);
 +      set_bit(phb_id, phb_bitmap);
 +
 +      return phb_id;
 +}
 +
  struct pci_controller *pcibios_alloc_controller(struct device_node *dev)
  {
        struct pci_controller *phb;
        if (phb == NULL)
                return NULL;
        spin_lock(&hose_spinlock);
 -      phb->global_number = global_phb_number++;
 +      phb->global_number = get_phb_number(dev);
        list_add_tail(&phb->list_node, &hose_list);
        spin_unlock(&hose_spinlock);
        phb->dn = dev;
@@@ -137,11 -94,6 +137,11 @@@ EXPORT_SYMBOL_GPL(pcibios_alloc_control
  void pcibios_free_controller(struct pci_controller *phb)
  {
        spin_lock(&hose_spinlock);
 +
 +      /* Clear bit of phb_bitmap to allow reuse of this PHB number. */
 +      if (phb->global_number < MAX_PHBS)
 +              clear_bit(phb->global_number, phb_bitmap);
 +
        list_del(&phb->list_node);
        spin_unlock(&hose_spinlock);
  
@@@ -172,14 -124,6 +172,14 @@@ resource_size_t pcibios_window_alignmen
        return 1;
  }
  
 +void pcibios_setup_bridge(struct pci_bus *bus, unsigned long type)
 +{
 +      struct pci_controller *hose = pci_bus_to_host(bus);
 +
 +      if (hose->controller_ops.setup_bridge)
 +              hose->controller_ops.setup_bridge(bus, type);
 +}
 +
  void pcibios_reset_secondary_bus(struct pci_dev *dev)
  {
        struct pci_controller *phb = pci_bus_to_host(dev->bus);
@@@ -411,36 -355,6 +411,6 @@@ static struct resource *__pci_mmap_make
        return NULL;
  }
  
- /*
-  * Set vm_page_prot of VMA, as appropriate for this architecture, for a pci
-  * device mapping.
-  */
- static pgprot_t __pci_mmap_set_pgprot(struct pci_dev *dev, struct resource *rp,
-                                     pgprot_t protection,
-                                     enum pci_mmap_state mmap_state,
-                                     int write_combine)
- {
-       /* Write combine is always 0 on non-memory space mappings. On
-        * memory space, if the user didn't pass 1, we check for a
-        * "prefetchable" resource. This is a bit hackish, but we use
-        * this to workaround the inability of /sysfs to provide a write
-        * combine bit
-        */
-       if (mmap_state != pci_mmap_mem)
-               write_combine = 0;
-       else if (write_combine == 0) {
-               if (rp->flags & IORESOURCE_PREFETCH)
-                       write_combine = 1;
-       }
-       /* XXX would be nice to have a way to ask for write-through */
-       if (write_combine)
-               return pgprot_noncached_wc(protection);
-       else
-               return pgprot_noncached(protection);
- }
  /*
   * This one is used by /dev/mem and fbdev who have no clue about the
   * PCI device, it tries to find the PCI device first and calls the
@@@ -514,9 -428,10 +484,10 @@@ int pci_mmap_page_range(struct pci_dev 
                return -EINVAL;
  
        vma->vm_pgoff = offset >> PAGE_SHIFT;
-       vma->vm_page_prot = __pci_mmap_set_pgprot(dev, rp,
-                                                 vma->vm_page_prot,
-                                                 mmap_state, write_combine);
+       if (write_combine)
+               vma->vm_page_prot = pgprot_noncached_wc(vma->vm_page_prot);
+       else
+               vma->vm_page_prot = pgprot_noncached(vma->vm_page_prot);
  
        ret = remap_pfn_range(vma, vma->vm_start, vma->vm_pgoff,
                               vma->vm_end - vma->vm_start, vma->vm_page_prot);
@@@ -666,39 -581,25 +637,25 @@@ void pci_resource_to_user(const struct 
                          const struct resource *rsrc,
                          resource_size_t *start, resource_size_t *end)
  {
-       struct pci_controller *hose = pci_bus_to_host(dev->bus);
-       resource_size_t offset = 0;
+       struct pci_bus_region region;
  
-       if (hose == NULL)
+       if (rsrc->flags & IORESOURCE_IO) {
+               pcibios_resource_to_bus(dev->bus, &region,
+                                       (struct resource *) rsrc);
+               *start = region.start;
+               *end = region.end;
                return;
+       }
  
-       if (rsrc->flags & IORESOURCE_IO)
-               offset = (unsigned long)hose->io_base_virt - _IO_BASE;
-       /* We pass a fully fixed up address to userland for MMIO instead of
-        * a BAR value because X is lame and expects to be able to use that
-        * to pass to /dev/mem !
-        *
-        * That means that we'll have potentially 64 bits values where some
-        * userland apps only expect 32 (like X itself since it thinks only
-        * Sparc has 64 bits MMIO) but if we don't do that, we break it on
-        * 32 bits CHRPs :-(
-        *
-        * Hopefully, the sysfs insterface is immune to that gunk. Once X
-        * has been fixed (and the fix spread enough), we can re-enable the
-        * 2 lines below and pass down a BAR value to userland. In that case
-        * we'll also have to re-enable the matching code in
-        * __pci_mmap_make_offset().
+       /* We pass a CPU physical address to userland for MMIO instead of a
+        * BAR value because X is lame and expects to be able to use that
+        * to pass to /dev/mem!
         *
-        * BenH.
+        * That means we may have 64-bit values where some apps only expect
+        * 32 (like X itself since it thinks only Sparc has 64-bit MMIO).
         */
- #if 0
-       else if (rsrc->flags & IORESOURCE_MEM)
-               offset = hose->pci_mem_offset;
- #endif
-       *start = rsrc->start - offset;
-       *end = rsrc->end - offset;
+       *start = rsrc->start;
+       *end = rsrc->end;
  }
  
  /**
@@@ -1418,10 -1319,8 +1375,10 @@@ void __init pcibios_resource_survey(voi
        /* Allocate and assign resources */
        list_for_each_entry(b, &pci_root_buses, node)
                pcibios_allocate_bus_resources(b);
 -      pcibios_allocate_resources(0);
 -      pcibios_allocate_resources(1);
 +      if (!pci_has_flag(PCI_REASSIGN_ALL_RSRC)) {
 +              pcibios_allocate_resources(0);
 +              pcibios_allocate_resources(1);
 +      }
  
        /* Before we start assigning unassigned resource, we try to reserve
         * the low IO area and the VGA memory area if they intersect the
@@@ -1494,12 -1393,8 +1451,12 @@@ void pcibios_finish_adding_to_bus(struc
        /* Allocate bus and devices resources */
        pcibios_allocate_bus_resources(bus);
        pcibios_claim_one_bus(bus);
 -      if (!pci_has_flag(PCI_PROBE_ONLY))
 -              pci_assign_unassigned_bus_resources(bus);
 +      if (!pci_has_flag(PCI_PROBE_ONLY)) {
 +              if (bus->self)
 +                      pci_assign_unassigned_bridge_resources(bus->self);
 +              else
 +                      pci_assign_unassigned_bus_resources(bus);
 +      }
  
        /* Fixup EEH */
        eeh_add_device_tree_late(bus);
@@@ -1547,9 -1442,9 +1504,9 @@@ static void pcibios_setup_phb_resources
        res = &hose->io_resource;
  
        if (!res->flags) {
 -              pr_info("PCI: I/O resource not set for host"
 -                     " bridge %s (domain %d)\n",
 -                     hose->dn->full_name, hose->global_number);
 +              pr_debug("PCI: I/O resource not set for host"
 +                       " bridge %s (domain %d)\n",
 +                       hose->dn->full_name, hose->global_number);
        } else {
                offset = pcibios_io_space_offset(hose);
  
diff --combined arch/x86/pci/vmd.c
index 613cac7395c471f0a79ef6cb2254421304264cd0,fd582abfad910cb65d1ad0869c7cc50b38a4c162..e88b4176260fea0d0d19fcaa021b56a5d2a330f4
@@@ -119,10 -119,11 +119,11 @@@ static void vmd_compose_msi_msg(struct 
  static void vmd_irq_enable(struct irq_data *data)
  {
        struct vmd_irq *vmdirq = data->chip_data;
+       unsigned long flags;
  
-       raw_spin_lock(&list_lock);
+       raw_spin_lock_irqsave(&list_lock, flags);
        list_add_tail_rcu(&vmdirq->node, &vmdirq->irq->irq_list);
-       raw_spin_unlock(&list_lock);
+       raw_spin_unlock_irqrestore(&list_lock, flags);
  
        data->chip->irq_unmask(data);
  }
  static void vmd_irq_disable(struct irq_data *data)
  {
        struct vmd_irq *vmdirq = data->chip_data;
+       unsigned long flags;
  
        data->chip->irq_mask(data);
  
-       raw_spin_lock(&list_lock);
+       raw_spin_lock_irqsave(&list_lock, flags);
        list_del_rcu(&vmdirq->node);
-       raw_spin_unlock(&list_lock);
+       INIT_LIST_HEAD_RCU(&vmdirq->node);
+       raw_spin_unlock_irqrestore(&list_lock, flags);
  }
  
  /*
@@@ -166,16 -169,20 +169,20 @@@ static irq_hw_number_t vmd_get_hwirq(st
   * XXX: We can be even smarter selecting the best IRQ once we solve the
   * affinity problem.
   */
- static struct vmd_irq_list *vmd_next_irq(struct vmd_dev *vmd)
+ static struct vmd_irq_list *vmd_next_irq(struct vmd_dev *vmd, struct msi_desc *desc)
  {
-       int i, best = 0;
+       int i, best = 1;
+       unsigned long flags;
  
-       raw_spin_lock(&list_lock);
+       if (!desc->msi_attrib.is_msix || vmd->msix_count == 1)
+               return &vmd->irqs[0];
+       raw_spin_lock_irqsave(&list_lock, flags);
        for (i = 1; i < vmd->msix_count; i++)
                if (vmd->irqs[i].count < vmd->irqs[best].count)
                        best = i;
        vmd->irqs[best].count++;
-       raw_spin_unlock(&list_lock);
+       raw_spin_unlock_irqrestore(&list_lock, flags);
  
        return &vmd->irqs[best];
  }
@@@ -184,18 -191,19 +191,19 @@@ static int vmd_msi_init(struct irq_doma
                        unsigned int virq, irq_hw_number_t hwirq,
                        msi_alloc_info_t *arg)
  {
-       struct vmd_dev *vmd = vmd_from_bus(msi_desc_to_pci_dev(arg->desc)->bus);
+       struct msi_desc *desc = arg->desc;
+       struct vmd_dev *vmd = vmd_from_bus(msi_desc_to_pci_dev(desc)->bus);
        struct vmd_irq *vmdirq = kzalloc(sizeof(*vmdirq), GFP_KERNEL);
  
        if (!vmdirq)
                return -ENOMEM;
  
        INIT_LIST_HEAD(&vmdirq->node);
-       vmdirq->irq = vmd_next_irq(vmd);
+       vmdirq->irq = vmd_next_irq(vmd, desc);
        vmdirq->virq = virq;
  
        irq_domain_set_info(domain, virq, vmdirq->irq->vmd_vector, info->chip,
 -                          vmdirq, handle_simple_irq, vmd, NULL);
 +                          vmdirq, handle_untracked_irq, vmd, NULL);
        return 0;
  }
  
@@@ -203,11 -211,12 +211,12 @@@ static void vmd_msi_free(struct irq_dom
                        struct msi_domain_info *info, unsigned int virq)
  {
        struct vmd_irq *vmdirq = irq_get_chip_data(virq);
+       unsigned long flags;
  
        /* XXX: Potential optimization to rebalance */
-       raw_spin_lock(&list_lock);
+       raw_spin_lock_irqsave(&list_lock, flags);
        vmdirq->irq->count--;
-       raw_spin_unlock(&list_lock);
+       raw_spin_unlock_irqrestore(&list_lock, flags);
  
        kfree_rcu(vmdirq, rcu);
  }
@@@ -261,7 -270,7 +270,7 @@@ static struct device *to_vmd_dev(struc
  
  static struct dma_map_ops *vmd_dma_ops(struct device *dev)
  {
-       return to_vmd_dev(dev)->archdata.dma_ops;
+       return get_dma_ops(to_vmd_dev(dev));
  }
  
  static void *vmd_alloc(struct device *dev, size_t size, dma_addr_t *addr,
@@@ -367,7 -376,7 +376,7 @@@ static void vmd_teardown_dma_ops(struc
  {
        struct dma_domain *domain = &vmd->dma_domain;
  
-       if (vmd->dev->dev.archdata.dma_ops)
+       if (get_dma_ops(&vmd->dev->dev))
                del_dma_domain(domain);
  }
  
  
  static void vmd_setup_dma_ops(struct vmd_dev *vmd)
  {
-       const struct dma_map_ops *source = vmd->dev->dev.archdata.dma_ops;
+       const struct dma_map_ops *source = get_dma_ops(&vmd->dev->dev);
        struct dma_map_ops *dest = &vmd->dma_ops;
        struct dma_domain *domain = &vmd->dma_domain;
  
@@@ -594,7 -603,7 +603,7 @@@ static int vmd_enable_domain(struct vmd
        sd->node = pcibus_to_node(vmd->dev->bus);
  
        vmd->irq_domain = pci_msi_create_irq_domain(NULL, &vmd_msi_domain_info,
-                                                   NULL);
+                                                   x86_vector_domain);
        if (!vmd->irq_domain)
                return -ENODEV;
  
diff --combined drivers/acpi/Kconfig
index aebd944bdaa125e6c0cd52dc475fe366c0feb4ba,f98c3287256e50a1137c800c6ca3a986581dbced..445ce28475b3061d8f19abcff8e28550718e90e1
@@@ -213,14 -213,13 +213,17 @@@ config ACPI_CPU_FREQ_PS
        bool
        select THERMAL
  
 +config ACPI_PROCESSOR_CSTATE
 +      def_bool y
 +      depends on IA64 || X86
 +
  config ACPI_PROCESSOR_IDLE
        bool
        select CPU_IDLE
  
+ config ACPI_MCFG
+       bool
  config ACPI_CPPC_LIB
        bool
        depends on ACPI_PROCESSOR
  config ACPI_PROCESSOR
        tristate "Processor"
        depends on X86 || IA64 || ARM64
 -      select ACPI_PROCESSOR_IDLE if X86 || IA64
 +      select ACPI_PROCESSOR_IDLE
        select ACPI_CPU_FREQ_PSS if X86 || IA64
        default y
        help
@@@ -295,8 -294,8 +298,8 @@@ config ACPI_THERMA
  config ACPI_NUMA
        bool "NUMA support"
        depends on NUMA
 -      depends on (X86 || IA64)
 -      default y if IA64_GENERIC || IA64_SGI_SN2
 +      depends on (X86 || IA64 || ARM64)
 +      default y if IA64_GENERIC || IA64_SGI_SN2 || ARM64
  
  config ACPI_CUSTOM_DSDT_FILE
        string "Custom DSDT Table file to include"
@@@ -315,12 -314,9 +318,12 @@@ config ACPI_CUSTOM_DSD
        bool
        default ACPI_CUSTOM_DSDT_FILE != ""
  
 +config ARCH_HAS_ACPI_TABLE_UPGRADE
 +      def_bool n
 +
  config ACPI_TABLE_UPGRADE
        bool "Allow upgrading ACPI tables via initrd"
 -      depends on BLK_DEV_INITRD && X86
 +      depends on BLK_DEV_INITRD && ARCH_HAS_ACPI_TABLE_UPGRADE
        default y
        help
          This option provides functionality to upgrade arbitrary ACPI tables
@@@ -454,10 -450,34 +457,10 @@@ config ACPI_REDUCED_HARDWARE_ONL
  
          If you are unsure what to do, do not enable this option.
  
 -config ACPI_NFIT
 -      tristate "ACPI NVDIMM Firmware Interface Table (NFIT)"
 -      depends on PHYS_ADDR_T_64BIT
 -      depends on BLK_DEV
 -      depends on ARCH_HAS_MMIO_FLUSH
 -      select LIBNVDIMM
 -      help
 -        Infrastructure to probe ACPI 6 compliant platforms for
 -        NVDIMMs (NFIT) and register a libnvdimm device tree.  In
 -        addition to storage devices this also enables libnvdimm to pass
 -        ACPI._DSM messages for platform/dimm configuration.
 -
 -        To compile this driver as a module, choose M here:
 -        the module will be called nfit.
 -
 -config ACPI_NFIT_DEBUG
 -      bool "NFIT DSM debug"
 -      depends on ACPI_NFIT
 -      depends on DYNAMIC_DEBUG
 -      default n
 -      help
 -        Enabling this option causes the nfit driver to dump the
 -        input and output buffers of _DSM operations on the ACPI0012
 -        device and its children.  This can be very verbose, so leave
 -        it disabled unless you are debugging a hardware / firmware
 -        issue.
 +source "drivers/acpi/nfit/Kconfig"
  
  source "drivers/acpi/apei/Kconfig"
 +source "drivers/acpi/dptf/Kconfig"
  
  config ACPI_EXTLOG
        tristate "Extended Error Log support"
@@@ -502,20 -522,6 +505,20 @@@ config XPOWER_PMIC_OPREGIO
        help
          This config adds ACPI operation region support for XPower AXP288 PMIC.
  
 +config BXT_WC_PMIC_OPREGION
 +      bool "ACPI operation region support for BXT WhiskeyCove PMIC"
 +      depends on INTEL_SOC_PMIC
 +      help
 +        This config adds ACPI operation region support for BXT WhiskeyCove PMIC.
 +
  endif
  
 +config ACPI_CONFIGFS
 +      tristate "ACPI configfs support"
 +      select CONFIGFS_FS
 +      help
 +        Select this option to enable support for ACPI configuration from
 +        userspace. The configurable ACPI groups will be visible under
 +        /config/acpi, assuming configfs is mounted under /config.
 +
  endif # ACPI
diff --combined drivers/acpi/Makefile
index 35a6ccbe302580ecf713d5ec623168dc7ab48a0d,632e81feef697551597f11bc8b975d1771748749..5ae9d85c5159b64bef844a86e74a5ca3c53f2954
@@@ -40,10 -40,12 +40,11 @@@ acpi-$(CONFIG_ARCH_MIGHT_HAVE_ACPI_PDC
  acpi-y                                += ec.o
  acpi-$(CONFIG_ACPI_DOCK)      += dock.o
  acpi-y                                += pci_root.o pci_link.o pci_irq.o
+ obj-$(CONFIG_ACPI_MCFG)               += pci_mcfg.o
  acpi-y                                += acpi_lpss.o acpi_apd.o
  acpi-y                                += acpi_platform.o
  acpi-y                                += acpi_pnp.o
  acpi-$(CONFIG_ARM_AMBA)       += acpi_amba.o
 -acpi-y                                += int340x_thermal.o
  acpi-y                                += power.o
  acpi-y                                += event.o
  acpi-$(CONFIG_ACPI_REDUCED_HARDWARE_ONLY) += evged.o
@@@ -69,7 -71,7 +70,7 @@@ obj-$(CONFIG_ACPI_PCI_SLOT)   += pci_slot
  obj-$(CONFIG_ACPI_PROCESSOR)  += processor.o
  obj-$(CONFIG_ACPI)            += container.o
  obj-$(CONFIG_ACPI_THERMAL)    += thermal.o
 -obj-$(CONFIG_ACPI_NFIT)               += nfit.o
 +obj-$(CONFIG_ACPI_NFIT)               += nfit/
  obj-$(CONFIG_ACPI)            += acpi_memhotplug.o
  obj-$(CONFIG_ACPI_HOTPLUG_IOAPIC) += ioapic.o
  obj-$(CONFIG_ACPI_BATTERY)    += battery.o
@@@ -98,9 -100,5 +99,9 @@@ obj-$(CONFIG_ACPI_EXTLOG)    += acpi_extlo
  obj-$(CONFIG_PMIC_OPREGION)   += pmic/intel_pmic.o
  obj-$(CONFIG_CRC_PMIC_OPREGION) += pmic/intel_pmic_crc.o
  obj-$(CONFIG_XPOWER_PMIC_OPREGION) += pmic/intel_pmic_xpower.o
 +obj-$(CONFIG_BXT_WC_PMIC_OPREGION) += pmic/intel_pmic_bxtwc.o
 +
 +obj-$(CONFIG_ACPI_CONFIGFS)   += acpi_configfs.o
  
  video-objs                    += acpi_video.o video_detect.o
 +obj-y                         += dptf/
diff --combined drivers/irqchip/Kconfig
index 5495a5ba80390db482b7cb7e2c06c4cb4e6290ad,11ecb6cfb2e5cc853ca7ce5889910f65e5a718d1..7f8728984f4472eeb9efa4303f4d68433570d346
@@@ -8,12 -8,6 +8,12 @@@ config ARM_GI
        select IRQ_DOMAIN_HIERARCHY
        select MULTI_IRQ_HANDLER
  
 +config ARM_GIC_PM
 +      bool
 +      depends on PM
 +      select ARM_GIC
 +      select PM_CLK
 +
  config ARM_GIC_MAX_NR
        int
        default 2 if ARCH_REALVIEW
@@@ -21,9 -15,9 +21,9 @@@
  
  config ARM_GIC_V2M
        bool
-       depends on ARM_GIC
-       depends on PCI && PCI_MSI
-       select PCI_MSI_IRQ_DOMAIN
+       depends on PCI
+       select ARM_GIC
+       select PCI_MSI
  
  config GIC_NON_BANKED
        bool
@@@ -37,7 -31,8 +37,8 @@@ config ARM_GIC_V
  
  config ARM_GIC_V3_ITS
        bool
-       select PCI_MSI_IRQ_DOMAIN
+       depends on PCI
+       depends on PCI_MSI
  
  config ARM_NVIC
        bool
@@@ -62,13 -57,13 +63,13 @@@ config ARM_VIC_N
  config ARMADA_370_XP_IRQ
        bool
        select GENERIC_IRQ_CHIP
-       select PCI_MSI_IRQ_DOMAIN if PCI_MSI
+       select PCI_MSI if PCI
  
  config ALPINE_MSI
        bool
-       depends on PCI && PCI_MSI
+       depends on PCI
+       select PCI_MSI
        select GENERIC_IRQ_CHIP
-       select PCI_MSI_IRQ_DOMAIN
  
  config ATMEL_AIC_IRQ
        bool
@@@ -117,7 -112,6 +118,6 @@@ config HISILICON_IRQ_MBIGE
        bool
        select ARM_GIC_V3
        select ARM_GIC_V3_ITS
-       select GENERIC_MSI_IRQ_DOMAIN
  
  config IMGPDC_IRQ
        bool
@@@ -250,12 -244,10 +250,10 @@@ config IRQ_MX
  
  config MVEBU_ODMI
        bool
-       select GENERIC_MSI_IRQ_DOMAIN
  
  config LS_SCFG_MSI
        def_bool y if SOC_LS1021A || ARCH_LAYERSCAPE
        depends on PCI && PCI_MSI
-       select PCI_MSI_IRQ_DOMAIN
  
  config PARTITION_PERCPU
        bool
index 41f32c0b341ed08829cfb14415c397455fcef753,67e4e7b185e51252d30991d22dc5750d945fee82..02f443958f3199aaf95c786ef1b59bd2948f4937
@@@ -154,6 -154,16 +154,6 @@@ void __ew32(struct e1000_hw *hw, unsign
        writel(val, hw->hw_addr + reg);
  }
  
 -static bool e1000e_vlan_used(struct e1000_adapter *adapter)
 -{
 -      u16 vid;
 -
 -      for_each_set_bit(vid, adapter->active_vlans, VLAN_N_VID)
 -              return true;
 -
 -      return false;
 -}
 -
  /**
   * e1000_regdump - register printout routine
   * @hw: pointer to the HW structure
@@@ -3443,7 -3453,8 +3443,7 @@@ static void e1000e_set_rx_mode(struct n
  
        ew32(RCTL, rctl);
  
 -      if (netdev->features & NETIF_F_HW_VLAN_CTAG_RX ||
 -          e1000e_vlan_used(adapter))
 +      if (netdev->features & NETIF_F_HW_VLAN_CTAG_RX)
                e1000e_vlan_strip_enable(adapter);
        else
                e1000e_vlan_strip_disable(adapter);
@@@ -4352,8 -4363,7 +4352,8 @@@ static cycle_t e1000e_cyclecounter_read
  
                        time_delta = systim_next - systim;
                        temp = time_delta;
 -                      rem = do_div(temp, incvalue);
 +                      /* VMWare users have seen incvalue of zero, don't div / 0 */
 +                      rem = incvalue ? do_div(temp, incvalue) : (time_delta != 0);
  
                        systim = systim_next;
  
@@@ -6916,14 -6926,6 +6916,14 @@@ static netdev_features_t e1000_fix_feat
        if ((hw->mac.type >= e1000_pch2lan) && (netdev->mtu > ETH_DATA_LEN))
                features &= ~NETIF_F_RXFCS;
  
 +      /* Since there is no support for separate Rx/Tx vlan accel
 +       * enable/disable make sure Tx flag is always in same state as Rx.
 +       */
 +      if (features & NETIF_F_HW_VLAN_CTAG_RX)
 +              features |= NETIF_F_HW_VLAN_CTAG_TX;
 +      else
 +              features &= ~NETIF_F_HW_VLAN_CTAG_TX;
 +
        return features;
  }
  
@@@ -7330,8 -7332,7 +7330,7 @@@ err_flashmap
  err_ioremap:
        free_netdev(netdev);
  err_alloc_etherdev:
-       pci_release_selected_regions(pdev,
-                                    pci_select_bars(pdev, IORESOURCE_MEM));
+       pci_release_mem_regions(pdev);
  err_pci_reg:
  err_dma:
        pci_disable_device(pdev);
@@@ -7398,8 -7399,7 +7397,7 @@@ static void e1000_remove(struct pci_de
        if ((adapter->hw.flash_address) &&
            (adapter->hw.mac.type < e1000_pch_spt))
                iounmap(adapter->hw.flash_address);
-       pci_release_selected_regions(pdev,
-                                    pci_select_bars(pdev, IORESOURCE_MEM));
+       pci_release_mem_regions(pdev);
  
        free_netdev(netdev);
  
index b8245c734c969442bd6aa5d999fcff9c194ed62d,a5bccc8011772f3d5bd99cbf3acd8d20a3351c48..774a5654bf42489a8f7c37f7563d07144b30ec4c
@@@ -123,24 -123,11 +123,24 @@@ static void fm10k_service_timer(unsigne
  static void fm10k_detach_subtask(struct fm10k_intfc *interface)
  {
        struct net_device *netdev = interface->netdev;
 +      u32 __iomem *hw_addr;
 +      u32 value;
  
        /* do nothing if device is still present or hw_addr is set */
        if (netif_device_present(netdev) || interface->hw.hw_addr)
                return;
  
 +      /* check the real address space to see if we've recovered */
 +      hw_addr = READ_ONCE(interface->uc_addr);
 +      value = readl(hw_addr);
 +      if ((~value)) {
 +              interface->hw.hw_addr = interface->uc_addr;
 +              netif_device_attach(netdev);
 +              interface->flags |= FM10K_FLAG_RESET_REQUESTED;
 +              netdev_warn(netdev, "PCIe link restored, device now attached\n");
 +              return;
 +      }
 +
        rtnl_lock();
  
        if (netif_running(netdev))
        rtnl_unlock();
  }
  
 -static void fm10k_reinit(struct fm10k_intfc *interface)
 +static void fm10k_prepare_for_reset(struct fm10k_intfc *interface)
  {
        struct net_device *netdev = interface->netdev;
 -      struct fm10k_hw *hw = &interface->hw;
 -      int err;
  
        WARN_ON(in_interrupt());
  
        /* delay any future reset requests */
        interface->last_reset = jiffies + (10 * HZ);
  
 +      rtnl_unlock();
 +}
 +
 +static int fm10k_handle_reset(struct fm10k_intfc *interface)
 +{
 +      struct net_device *netdev = interface->netdev;
 +      struct fm10k_hw *hw = &interface->hw;
 +      int err;
 +
 +      rtnl_lock();
 +
 +      pci_set_master(interface->pdev);
 +
        /* reset and initialize the hardware so it is in a known state */
        err = hw->mac.ops.reset_hw(hw);
        if (err) {
                goto reinit_err;
        }
  
 -      /* reassociate interrupts */
 +      /* re-associate interrupts */
        err = fm10k_mbx_request_irq(interface);
        if (err)
                goto err_mbx_irq;
  
        clear_bit(__FM10K_RESETTING, &interface->state);
  
 -      return;
 +      return err;
  err_open:
        fm10k_mbx_free_irq(interface);
  err_mbx_irq:
@@@ -254,20 -230,6 +254,20 @@@ reinit_err
        rtnl_unlock();
  
        clear_bit(__FM10K_RESETTING, &interface->state);
 +
 +      return err;
 +}
 +
 +static void fm10k_reinit(struct fm10k_intfc *interface)
 +{
 +      int err;
 +
 +      fm10k_prepare_for_reset(interface);
 +
 +      err = fm10k_handle_reset(interface);
 +      if (err)
 +              dev_err(&interface->pdev->dev,
 +                      "fm10k_handle_reset failed: %d\n", err);
  }
  
  static void fm10k_reset_subtask(struct fm10k_intfc *interface)
@@@ -410,19 -372,12 +410,19 @@@ void fm10k_update_stats(struct fm10k_in
        u64 bytes, pkts;
        int i;
  
 +      /* ensure only one thread updates stats at a time */
 +      if (test_and_set_bit(__FM10K_UPDATING_STATS, &interface->state))
 +              return;
 +
        /* do not allow stats update via service task for next second */
        interface->next_stats_update = jiffies + HZ;
  
        /* gather some stats to the interface struct that are per queue */
        for (bytes = 0, pkts = 0, i = 0; i < interface->num_tx_queues; i++) {
 -              struct fm10k_ring *tx_ring = interface->tx_ring[i];
 +              struct fm10k_ring *tx_ring = READ_ONCE(interface->tx_ring[i]);
 +
 +              if (!tx_ring)
 +                      continue;
  
                restart_queue += tx_ring->tx_stats.restart_queue;
                tx_busy += tx_ring->tx_stats.tx_busy;
  
        /* gather some stats to the interface struct that are per queue */
        for (bytes = 0, pkts = 0, i = 0; i < interface->num_rx_queues; i++) {
 -              struct fm10k_ring *rx_ring = interface->rx_ring[i];
 +              struct fm10k_ring *rx_ring = READ_ONCE(interface->rx_ring[i]);
 +
 +              if (!rx_ring)
 +                      continue;
  
                bytes += rx_ring->stats.bytes;
                pkts += rx_ring->stats.packets;
        /* Fill out the OS statistics structure */
        net_stats->rx_errors = rx_errors;
        net_stats->rx_dropped = interface->stats.nodesc_drop.count;
 +
 +      clear_bit(__FM10K_UPDATING_STATS, &interface->state);
  }
  
  /**
@@@ -1616,9 -1566,6 +1616,9 @@@ void fm10k_up(struct fm10k_intfc *inter
        /* configure interrupts */
        hw->mac.ops.update_int_moderator(hw);
  
 +      /* enable statistics capture again */
 +      clear_bit(__FM10K_UPDATING_STATS, &interface->state);
 +
        /* clear down bit to indicate we are ready to go */
        clear_bit(__FM10K_DOWN, &interface->state);
  
@@@ -1651,11 -1598,10 +1651,11 @@@ void fm10k_down(struct fm10k_intfc *int
  {
        struct net_device *netdev = interface->netdev;
        struct fm10k_hw *hw = &interface->hw;
 -      int err;
 +      int err, i = 0, count = 0;
  
        /* signal that we are down to the interrupt handler and service task */
 -      set_bit(__FM10K_DOWN, &interface->state);
 +      if (test_and_set_bit(__FM10K_DOWN, &interface->state))
 +              return;
  
        /* call carrier off first to avoid false dev_watchdog timeouts */
        netif_carrier_off(netdev);
        /* reset Rx filters */
        fm10k_reset_rx_state(interface);
  
 -      /* allow 10ms for device to quiesce */
 -      usleep_range(10000, 20000);
 -
        /* disable polling routines */
        fm10k_napi_disable_all(interface);
  
        /* capture stats one last time before stopping interface */
        fm10k_update_stats(interface);
  
 +      /* prevent updating statistics while we're down */
 +      while (test_and_set_bit(__FM10K_UPDATING_STATS, &interface->state))
 +              usleep_range(1000, 2000);
 +
 +      /* skip waiting for TX DMA if we lost PCIe link */
 +      if (FM10K_REMOVED(hw->hw_addr))
 +              goto skip_tx_dma_drain;
 +
 +      /* In some rare circumstances it can take a while for Tx queues to
 +       * quiesce and be fully disabled. Attempt to .stop_hw() first, and
 +       * then if we get ERR_REQUESTS_PENDING, go ahead and wait in a loop
 +       * until the Tx queues have emptied, or until a number of retries. If
 +       * we fail to clear within the retry loop, we will issue a warning
 +       * indicating that Tx DMA is probably hung. Note this means we call
 +       * .stop_hw() twice but this shouldn't cause any problems.
 +       */
 +      err = hw->mac.ops.stop_hw(hw);
 +      if (err != FM10K_ERR_REQUESTS_PENDING)
 +              goto skip_tx_dma_drain;
 +
 +#define TX_DMA_DRAIN_RETRIES 25
 +      for (count = 0; count < TX_DMA_DRAIN_RETRIES; count++) {
 +              usleep_range(10000, 20000);
 +
 +              /* start checking at the last ring to have pending Tx */
 +              for (; i < interface->num_tx_queues; i++)
 +                      if (fm10k_get_tx_pending(interface->tx_ring[i]))
 +                              break;
 +
 +              /* if all the queues are drained, we can break now */
 +              if (i == interface->num_tx_queues)
 +                      break;
 +      }
 +
 +      if (count >= TX_DMA_DRAIN_RETRIES)
 +              dev_err(&interface->pdev->dev,
 +                      "Tx queues failed to drain after %d tries. Tx DMA is probably hung.\n",
 +                      count);
 +skip_tx_dma_drain:
        /* Disable DMA engine for Tx/Rx */
        err = hw->mac.ops.stop_hw(hw);
 -      if (err)
 +      if (err == FM10K_ERR_REQUESTS_PENDING)
 +              dev_err(&interface->pdev->dev,
 +                      "due to pending requests hw was not shut down gracefully\n");
 +      else if (err)
                dev_err(&interface->pdev->dev, "stop_hw failed: %d\n", err);
  
        /* free any buffers still on the rings */
@@@ -1843,7 -1750,6 +1843,7 @@@ static int fm10k_sw_init(struct fm10k_i
  
        /* Start off interface as being down */
        set_bit(__FM10K_DOWN, &interface->state);
 +      set_bit(__FM10K_UPDATING_STATS, &interface->state);
  
        return 0;
  }
@@@ -1963,10 -1869,7 +1963,7 @@@ static int fm10k_probe(struct pci_dev *
                goto err_dma;
        }
  
-       err = pci_request_selected_regions(pdev,
-                                          pci_select_bars(pdev,
-                                                          IORESOURCE_MEM),
-                                          fm10k_driver_name);
+       err = pci_request_mem_regions(pdev, fm10k_driver_name);
        if (err) {
                dev_err(&pdev->dev,
                        "pci_request_selected_regions failed: %d\n", err);
@@@ -2070,8 -1973,7 +2067,7 @@@ err_sw_init
  err_ioremap:
        free_netdev(netdev);
  err_alloc_netdev:
-       pci_release_selected_regions(pdev,
-                                    pci_select_bars(pdev, IORESOURCE_MEM));
+       pci_release_mem_regions(pdev);
  err_pci_reg:
  err_dma:
        pci_disable_device(pdev);
@@@ -2119,56 -2021,13 +2115,55 @@@ static void fm10k_remove(struct pci_de
  
        free_netdev(netdev);
  
-       pci_release_selected_regions(pdev,
-                                    pci_select_bars(pdev, IORESOURCE_MEM));
+       pci_release_mem_regions(pdev);
  
        pci_disable_pcie_error_reporting(pdev);
  
        pci_disable_device(pdev);
  }
  
 +static void fm10k_prepare_suspend(struct fm10k_intfc *interface)
 +{
 +      /* the watchdog task reads from registers, which might appear like
 +       * a surprise remove if the PCIe device is disabled while we're
 +       * stopped. We stop the watchdog task until after we resume software
 +       * activity.
 +       */
 +      set_bit(__FM10K_SERVICE_DISABLE, &interface->state);
 +      cancel_work_sync(&interface->service_task);
 +
 +      fm10k_prepare_for_reset(interface);
 +}
 +
 +static int fm10k_handle_resume(struct fm10k_intfc *interface)
 +{
 +      struct fm10k_hw *hw = &interface->hw;
 +      int err;
 +
 +      /* reset statistics starting values */
 +      hw->mac.ops.rebind_hw_stats(hw, &interface->stats);
 +
 +      err = fm10k_handle_reset(interface);
 +      if (err)
 +              return err;
 +
 +      /* assume host is not ready, to prevent race with watchdog in case we
 +       * actually don't have connection to the switch
 +       */
 +      interface->host_ready = false;
 +      fm10k_watchdog_host_not_ready(interface);
 +
 +      /* force link to stay down for a second to prevent link flutter */
 +      interface->link_down_event = jiffies + (HZ);
 +      set_bit(__FM10K_LINK_DOWN, &interface->state);
 +
 +      /* clear the service task disable bit to allow service task to start */
 +      clear_bit(__FM10K_SERVICE_DISABLE, &interface->state);
 +      fm10k_service_event_schedule(interface);
 +
 +      return err;
 +}
 +
  #ifdef CONFIG_PM
  /**
   * fm10k_resume - Restore device to pre-sleep state
@@@ -2205,13 -2064,60 +2200,13 @@@ static int fm10k_resume(struct pci_dev 
        /* refresh hw_addr in case it was dropped */
        hw->hw_addr = interface->uc_addr;
  
 -      /* reset hardware to known state */
 -      err = hw->mac.ops.init_hw(&interface->hw);
 -      if (err) {
 -              dev_err(&pdev->dev, "init_hw failed: %d\n", err);
 -              return err;
 -      }
 -
 -      /* reset statistics starting values */
 -      hw->mac.ops.rebind_hw_stats(hw, &interface->stats);
 -
 -      rtnl_lock();
 -
 -      err = fm10k_init_queueing_scheme(interface);
 -      if (err)
 -              goto err_queueing_scheme;
 -
 -      err = fm10k_mbx_request_irq(interface);
 -      if (err)
 -              goto err_mbx_irq;
 -
 -      err = fm10k_hw_ready(interface);
 +      err = fm10k_handle_resume(interface);
        if (err)
 -              goto err_open;
 -
 -      err = netif_running(netdev) ? fm10k_open(netdev) : 0;
 -      if (err)
 -              goto err_open;
 -
 -      rtnl_unlock();
 -
 -      /* assume host is not ready, to prevent race with watchdog in case we
 -       * actually don't have connection to the switch
 -       */
 -      interface->host_ready = false;
 -      fm10k_watchdog_host_not_ready(interface);
 -
 -      /* clear the service task disable bit to allow service task to start */
 -      clear_bit(__FM10K_SERVICE_DISABLE, &interface->state);
 -      fm10k_service_event_schedule(interface);
 -
 -      /* restore SR-IOV interface */
 -      fm10k_iov_resume(pdev);
 +              return err;
  
        netif_device_attach(netdev);
  
        return 0;
 -err_open:
 -      fm10k_mbx_free_irq(interface);
 -err_mbx_irq:
 -      fm10k_clear_queueing_scheme(interface);
 -err_queueing_scheme:
 -      rtnl_unlock();
 -
 -      return err;
  }
  
  /**
@@@ -2231,7 -2137,27 +2226,7 @@@ static int fm10k_suspend(struct pci_de
  
        netif_device_detach(netdev);
  
 -      fm10k_iov_suspend(pdev);
 -
 -      /* the watchdog tasks may read registers, which will appear like a
 -       * surprise-remove event once the PCI device is disabled. This will
 -       * cause us to close the netdevice, so we don't retain the open/closed
 -       * state post-resume. Prevent this by disabling the service task while
 -       * suspended, until we actually resume.
 -       */
 -      set_bit(__FM10K_SERVICE_DISABLE, &interface->state);
 -      cancel_work_sync(&interface->service_task);
 -
 -      rtnl_lock();
 -
 -      if (netif_running(netdev))
 -              fm10k_close(netdev);
 -
 -      fm10k_mbx_free_irq(interface);
 -
 -      fm10k_clear_queueing_scheme(interface);
 -
 -      rtnl_unlock();
 +      fm10k_prepare_suspend(interface);
  
        err = pci_save_state(pdev);
        if (err)
@@@ -2264,7 -2190,17 +2259,7 @@@ static pci_ers_result_t fm10k_io_error_
        if (state == pci_channel_io_perm_failure)
                return PCI_ERS_RESULT_DISCONNECT;
  
 -      rtnl_lock();
 -
 -      if (netif_running(netdev))
 -              fm10k_close(netdev);
 -
 -      fm10k_mbx_free_irq(interface);
 -
 -      /* free interrupts */
 -      fm10k_clear_queueing_scheme(interface);
 -
 -      rtnl_unlock();
 +      fm10k_prepare_suspend(interface);
  
        /* Request a slot reset. */
        return PCI_ERS_RESULT_NEED_RESET;
   */
  static pci_ers_result_t fm10k_io_slot_reset(struct pci_dev *pdev)
  {
 -      struct fm10k_intfc *interface = pci_get_drvdata(pdev);
        pci_ers_result_t result;
  
        if (pci_enable_device_mem(pdev)) {
  
                pci_wake_from_d3(pdev, false);
  
 -              /* refresh hw_addr in case it was dropped */
 -              interface->hw.hw_addr = interface->uc_addr;
 -
 -              interface->flags |= FM10K_FLAG_RESET_REQUESTED;
 -              fm10k_service_event_schedule(interface);
 -
                result = PCI_ERS_RESULT_RECOVERED;
        }
  
@@@ -2314,54 -2257,50 +2309,54 @@@ static void fm10k_io_resume(struct pci_
  {
        struct fm10k_intfc *interface = pci_get_drvdata(pdev);
        struct net_device *netdev = interface->netdev;
 -      struct fm10k_hw *hw = &interface->hw;
 -      int err = 0;
 -
 -      /* reset hardware to known state */
 -      err = hw->mac.ops.init_hw(&interface->hw);
 -      if (err) {
 -              dev_err(&pdev->dev, "init_hw failed: %d\n", err);
 -              return;
 -      }
 -
 -      /* reset statistics starting values */
 -      hw->mac.ops.rebind_hw_stats(hw, &interface->stats);
 -
 -      rtnl_lock();
 +      int err;
  
 -      err = fm10k_init_queueing_scheme(interface);
 -      if (err) {
 -              dev_err(&interface->pdev->dev,
 -                      "init_queueing_scheme failed: %d\n", err);
 -              goto unlock;
 -      }
 +      err = fm10k_handle_resume(interface);
  
 -      /* reassociate interrupts */
 -      fm10k_mbx_request_irq(interface);
 +      if (err)
 +              dev_warn(&pdev->dev,
 +                       "fm10k_io_resume failed: %d\n", err);
 +      else
 +              netif_device_attach(netdev);
 +}
  
 -      rtnl_lock();
 -      if (netif_running(netdev))
 -              err = fm10k_open(netdev);
 -      rtnl_unlock();
 +/**
 + * fm10k_io_reset_notify - called when PCI function is reset
 + * @pdev: Pointer to PCI device
 + *
 + * This callback is called when the PCI function is reset such as from
 + * /sys/class/net/<enpX>/device/reset or similar. When prepare is true, it
 + * means we should prepare for a function reset. If prepare is false, it means
 + * the function reset just occurred.
 + */
 +static void fm10k_io_reset_notify(struct pci_dev *pdev, bool prepare)
 +{
 +      struct fm10k_intfc *interface = pci_get_drvdata(pdev);
 +      int err = 0;
  
 -      /* final check of hardware state before registering the interface */
 -      err = err ? : fm10k_hw_ready(interface);
 +      if (prepare) {
 +              /* warn incase we have any active VF devices */
 +              if (pci_num_vf(pdev))
 +                      dev_warn(&pdev->dev,
 +                               "PCIe FLR may cause issues for any active VF devices\n");
  
 -      if (!err)
 -              netif_device_attach(netdev);
 +              fm10k_prepare_suspend(interface);
 +      } else {
 +              err = fm10k_handle_resume(interface);
 +      }
  
 -unlock:
 -      rtnl_unlock();
 +      if (err) {
 +              dev_warn(&pdev->dev,
 +                       "fm10k_io_reset_notify failed: %d\n", err);
 +              netif_device_detach(interface->netdev);
 +      }
  }
  
  static const struct pci_error_handlers fm10k_err_handler = {
        .error_detected = fm10k_io_error_detected,
        .slot_reset = fm10k_io_slot_reset,
        .resume = fm10k_io_resume,
 +      .reset_notify = fm10k_io_reset_notify,
  };
  
  static struct pci_driver fm10k_driver = {
index 339d99be4702599e0906ec1d4468d248216a575d,2e10d2341a299d2fd88d7f40864f14cbc5dcb119..81c99e1be708d445270323ece7c6c63cbc681111
  /* Local includes */
  #include "i40e.h"
  #include "i40e_diag.h"
 -#if IS_ENABLED(CONFIG_VXLAN)
 -#include <net/vxlan.h>
 -#endif
 -#if IS_ENABLED(CONFIG_GENEVE)
 -#include <net/geneve.h>
 -#endif
 +#include <net/udp_tunnel.h>
  
  const char i40e_driver_name[] = "i40e";
  static const char i40e_driver_string[] =
@@@ -40,8 -45,8 +40,8 @@@
  #define DRV_KERN "-k"
  
  #define DRV_VERSION_MAJOR 1
 -#define DRV_VERSION_MINOR 5
 -#define DRV_VERSION_BUILD 16
 +#define DRV_VERSION_MINOR 6
 +#define DRV_VERSION_BUILD 11
  #define DRV_VERSION __stringify(DRV_VERSION_MAJOR) "." \
             __stringify(DRV_VERSION_MINOR) "." \
             __stringify(DRV_VERSION_BUILD)    DRV_KERN
@@@ -86,6 -91,7 +86,6 @@@ static const struct pci_device_id i40e_
        {PCI_VDEVICE(INTEL, I40E_DEV_ID_1G_BASE_T_X722), 0},
        {PCI_VDEVICE(INTEL, I40E_DEV_ID_10G_BASE_T_X722), 0},
        {PCI_VDEVICE(INTEL, I40E_DEV_ID_SFP_I_X722), 0},
 -      {PCI_VDEVICE(INTEL, I40E_DEV_ID_QSFP_I_X722), 0},
        {PCI_VDEVICE(INTEL, I40E_DEV_ID_20G_KR2), 0},
        {PCI_VDEVICE(INTEL, I40E_DEV_ID_20G_KR2_A), 0},
        /* required last entry */
@@@ -1274,9 -1280,8 +1274,9 @@@ int i40e_del_mac_all_vlan(struct i40e_v
                    (is_vf == f->is_vf) &&
                    (is_netdev == f->is_netdev)) {
                        f->counter--;
 -                      f->changed = true;
                        changed = 1;
 +                      if (f->counter == 0)
 +                              f->state = I40E_FILTER_REMOVE;
                }
        }
        if (changed) {
   * @vsi: the PF Main VSI - inappropriate for any other VSI
   * @macaddr: the MAC address
   *
 - * Some older firmware configurations set up a default promiscuous VLAN
 - * filter that needs to be removed.
 + * Remove whatever filter the firmware set up so the driver can manage
 + * its own filtering intelligently.
   **/
 -static int i40e_rm_default_mac_filter(struct i40e_vsi *vsi, u8 *macaddr)
 +static void i40e_rm_default_mac_filter(struct i40e_vsi *vsi, u8 *macaddr)
  {
        struct i40e_aqc_remove_macvlan_element_data element;
        struct i40e_pf *pf = vsi->back;
 -      i40e_status ret;
  
        /* Only appropriate for the PF main VSI */
        if (vsi->type != I40E_VSI_MAIN)
 -              return -EINVAL;
 +              return;
  
        memset(&element, 0, sizeof(element));
        ether_addr_copy(element.mac_addr, macaddr);
        element.vlan_tag = 0;
 -      element.flags = I40E_AQC_MACVLAN_DEL_PERFECT_MATCH |
 -                      I40E_AQC_MACVLAN_DEL_IGNORE_VLAN;
 -      ret = i40e_aq_remove_macvlan(&pf->hw, vsi->seid, &element, 1, NULL);
 -      if (ret)
 -              return -ENOENT;
 +      /* Ignore error returns, some firmware does it this way... */
 +      element.flags = I40E_AQC_MACVLAN_DEL_PERFECT_MATCH;
 +      i40e_aq_remove_macvlan(&pf->hw, vsi->seid, &element, 1, NULL);
  
 -      return 0;
 +      memset(&element, 0, sizeof(element));
 +      ether_addr_copy(element.mac_addr, macaddr);
 +      element.vlan_tag = 0;
 +      /* ...and some firmware does it this way. */
 +      element.flags = I40E_AQC_MACVLAN_DEL_PERFECT_MATCH |
 +                      I40E_AQC_MACVLAN_ADD_IGNORE_VLAN;
 +      i40e_aq_remove_macvlan(&pf->hw, vsi->seid, &element, 1, NULL);
  }
  
  /**
@@@ -1338,18 -1340,10 +1338,18 @@@ struct i40e_mac_filter *i40e_add_filter
                                        bool is_vf, bool is_netdev)
  {
        struct i40e_mac_filter *f;
 +      int changed = false;
  
        if (!vsi || !macaddr)
                return NULL;
  
 +      /* Do not allow broadcast filter to be added since broadcast filter
 +       * is added as part of add VSI for any newly created VSI except
 +       * FDIR VSI
 +       */
 +      if (is_broadcast_ether_addr(macaddr))
 +              return NULL;
 +
        f = i40e_find_filter(vsi, macaddr, vlan, is_vf, is_netdev);
        if (!f) {
                f = kzalloc(sizeof(*f), GFP_ATOMIC);
  
                ether_addr_copy(f->macaddr, macaddr);
                f->vlan = vlan;
 -              f->changed = true;
 -
 +              /* If we're in overflow promisc mode, set the state directly
 +               * to failed, so we don't bother to try sending the filter
 +               * to the hardware.
 +               */
 +              if (test_bit(__I40E_FILTER_OVERFLOW_PROMISC, &vsi->state))
 +                      f->state = I40E_FILTER_FAILED;
 +              else
 +                      f->state = I40E_FILTER_NEW;
 +              changed = true;
                INIT_LIST_HEAD(&f->list);
                list_add_tail(&f->list, &vsi->mac_filter_list);
        }
                f->counter++;
        }
  
 -      /* changed tells sync_filters_subtask to
 -       * push the filter down to the firmware
 -       */
 -      if (f->changed) {
 +      if (changed) {
                vsi->flags |= I40E_VSI_FLAG_FILTER_CHANGED;
                vsi->back->flags |= I40E_FLAG_FILTER_SYNC;
        }
@@@ -1405,9 -1395,6 +1405,9 @@@ add_filter_out
   *
   * NOTE: This function is expected to be called with mac_filter_list_lock
   * being held.
 + * ANOTHER NOTE: This function MUST be called from within the context of
 + * the "safe" variants of any list iterators, e.g. list_for_each_entry_safe()
 + * instead of list_for_each_entry().
   **/
  void i40e_del_filter(struct i40e_vsi *vsi,
                     u8 *macaddr, s16 vlan,
         * remove the filter from the firmware's list
         */
        if (f->counter == 0) {
 -              f->changed = true;
 -              vsi->flags |= I40E_VSI_FLAG_FILTER_CHANGED;
 -              vsi->back->flags |= I40E_FLAG_FILTER_SYNC;
 +              if ((f->state == I40E_FILTER_FAILED) ||
 +                  (f->state == I40E_FILTER_NEW)) {
 +                      /* this one never got added by the FW. Just remove it,
 +                       * no need to sync anything.
 +                       */
 +                      list_del(&f->list);
 +                      kfree(f);
 +              } else {
 +                      f->state = I40E_FILTER_REMOVE;
 +                      vsi->flags |= I40E_VSI_FLAG_FILTER_CHANGED;
 +                      vsi->back->flags |= I40E_FLAG_FILTER_SYNC;
 +              }
        }
  }
  
@@@ -1480,6 -1458,7 +1480,6 @@@ static int i40e_set_mac(struct net_devi
        struct i40e_pf *pf = vsi->back;
        struct i40e_hw *hw = &pf->hw;
        struct sockaddr *addr = p;
 -      struct i40e_mac_filter *f;
  
        if (!is_valid_ether_addr(addr->sa_data))
                return -EADDRNOTAVAIL;
        else
                netdev_info(netdev, "set new mac address %pM\n", addr->sa_data);
  
 +      spin_lock_bh(&vsi->mac_filter_list_lock);
 +      i40e_del_mac_all_vlan(vsi, netdev->dev_addr, false, true);
 +      i40e_put_mac_in_vlan(vsi, addr->sa_data, false, true);
 +      spin_unlock_bh(&vsi->mac_filter_list_lock);
 +      ether_addr_copy(netdev->dev_addr, addr->sa_data);
        if (vsi->type == I40E_VSI_MAIN) {
                i40e_status ret;
  
                ret = i40e_aq_mac_address_write(&vsi->back->hw,
                                                I40E_AQC_WRITE_TYPE_LAA_WOL,
                                                addr->sa_data, NULL);
 -              if (ret) {
 -                      netdev_info(netdev,
 -                                  "Addr change for Main VSI failed: %d\n",
 -                                  ret);
 -                      return -EADDRNOTAVAIL;
 -              }
 -      }
 -
 -      if (ether_addr_equal(netdev->dev_addr, hw->mac.addr)) {
 -              struct i40e_aqc_remove_macvlan_element_data element;
 -
 -              memset(&element, 0, sizeof(element));
 -              ether_addr_copy(element.mac_addr, netdev->dev_addr);
 -              element.flags = I40E_AQC_MACVLAN_DEL_PERFECT_MATCH;
 -              i40e_aq_remove_macvlan(&pf->hw, vsi->seid, &element, 1, NULL);
 -      } else {
 -              spin_lock_bh(&vsi->mac_filter_list_lock);
 -              i40e_del_filter(vsi, netdev->dev_addr, I40E_VLAN_ANY,
 -                              false, false);
 -              spin_unlock_bh(&vsi->mac_filter_list_lock);
 -      }
 -
 -      if (ether_addr_equal(addr->sa_data, hw->mac.addr)) {
 -              struct i40e_aqc_add_macvlan_element_data element;
 -
 -              memset(&element, 0, sizeof(element));
 -              ether_addr_copy(element.mac_addr, hw->mac.addr);
 -              element.flags = cpu_to_le16(I40E_AQC_MACVLAN_ADD_PERFECT_MATCH);
 -              i40e_aq_add_macvlan(&pf->hw, vsi->seid, &element, 1, NULL);
 -      } else {
 -              spin_lock_bh(&vsi->mac_filter_list_lock);
 -              f = i40e_add_filter(vsi, addr->sa_data, I40E_VLAN_ANY,
 -                                  false, false);
 -              if (f)
 -                      f->is_laa = true;
 -              spin_unlock_bh(&vsi->mac_filter_list_lock);
 +              if (ret)
 +                      netdev_info(netdev, "Ignoring error from firmware on LAA update, status %s, AQ ret %s\n",
 +                                  i40e_stat_str(hw, ret),
 +                                  i40e_aq_str(hw, hw->aq.asq_last_status));
        }
  
 -      ether_addr_copy(netdev->dev_addr, addr->sa_data);
 -
        /* schedule our worker thread which will take care of
         * applying the new filter changes
         */
@@@ -1576,8 -1584,14 +1576,8 @@@ static void i40e_vsi_setup_queue_map(st
        vsi->tc_config.numtc = numtc;
        vsi->tc_config.enabled_tc = enabled_tc ? enabled_tc : 1;
        /* Number of queues per enabled TC */
 -      /* In MFP case we can have a much lower count of MSIx
 -       * vectors available and so we need to lower the used
 -       * q count.
 -       */
 -      if (pf->flags & I40E_FLAG_MSIX_ENABLED)
 -              qcount = min_t(int, vsi->alloc_queue_pairs, pf->num_lan_msix);
 -      else
 -              qcount = vsi->alloc_queue_pairs;
 +      qcount = vsi->alloc_queue_pairs;
 +
        num_tc_qps = qcount / numtc;
        num_tc_qps = min_t(int, num_tc_qps, i40e_pf_get_max_q_per_tc(pf));
  
@@@ -1746,6 -1760,28 +1746,6 @@@ bottom_of_search_loop
        i40e_service_event_schedule(vsi->back);
  }
  
 -/**
 - * i40e_mac_filter_entry_clone - Clones a MAC filter entry
 - * @src: source MAC filter entry to be clones
 - *
 - * Returns the pointer to newly cloned MAC filter entry or NULL
 - * in case of error
 - **/
 -static struct i40e_mac_filter *i40e_mac_filter_entry_clone(
 -                                      struct i40e_mac_filter *src)
 -{
 -      struct i40e_mac_filter *f;
 -
 -      f = kzalloc(sizeof(*f), GFP_ATOMIC);
 -      if (!f)
 -              return NULL;
 -      *f = *src;
 -
 -      INIT_LIST_HEAD(&f->list);
 -
 -      return f;
 -}
 -
  /**
   * i40e_undo_del_filter_entries - Undo the changes made to MAC filter entries
   * @vsi: pointer to vsi struct
@@@ -1760,61 -1796,41 +1760,61 @@@ static void i40e_undo_del_filter_entrie
        struct i40e_mac_filter *f, *ftmp;
  
        list_for_each_entry_safe(f, ftmp, from, list) {
 -              f->changed = true;
                /* Move the element back into MAC filter list*/
                list_move_tail(&f->list, &vsi->mac_filter_list);
        }
  }
  
  /**
 - * i40e_undo_add_filter_entries - Undo the changes made to MAC filter entries
 - * @vsi: pointer to vsi struct
 + * i40e_update_filter_state - Update filter state based on return data
 + * from firmware
 + * @count: Number of filters added
 + * @add_list: return data from fw
 + * @head: pointer to first filter in current batch
 + * @aq_err: status from fw
   *
 - * MAC filter entries from list were slated to be added from device.
 + * MAC filter entries from list were slated to be added to device. Returns
 + * number of successful filters. Note that 0 does NOT mean success!
   **/
 -static void i40e_undo_add_filter_entries(struct i40e_vsi *vsi)
 +static int
 +i40e_update_filter_state(int count,
 +                       struct i40e_aqc_add_macvlan_element_data *add_list,
 +                       struct i40e_mac_filter *add_head, int aq_err)
  {
 -      struct i40e_mac_filter *f, *ftmp;
 -
 -      list_for_each_entry_safe(f, ftmp, &vsi->mac_filter_list, list) {
 -              if (!f->changed && f->counter)
 -                      f->changed = true;
 -      }
 -}
 +      int retval = 0;
 +      int i;
  
 -/**
 - * i40e_cleanup_add_list - Deletes the element from add list and release
 - *                    memory
 - * @add_list: Pointer to list which contains MAC filter entries
 - **/
 -static void i40e_cleanup_add_list(struct list_head *add_list)
 -{
 -      struct i40e_mac_filter *f, *ftmp;
  
 -      list_for_each_entry_safe(f, ftmp, add_list, list) {
 -              list_del(&f->list);
 -              kfree(f);
 +      if (!aq_err) {
 +              retval = count;
 +              /* Everything's good, mark all filters active. */
 +              for (i = 0; i < count ; i++) {
 +                      add_head->state = I40E_FILTER_ACTIVE;
 +                      add_head = list_next_entry(add_head, list);
 +              }
 +      } else if (aq_err == I40E_AQ_RC_ENOSPC) {
 +              /* Device ran out of filter space. Check the return value
 +               * for each filter to see which ones are active.
 +               */
 +              for (i = 0; i < count ; i++) {
 +                      if (add_list[i].match_method ==
 +                          I40E_AQC_MM_ERR_NO_RES) {
 +                              add_head->state = I40E_FILTER_FAILED;
 +                      } else {
 +                              add_head->state = I40E_FILTER_ACTIVE;
 +                              retval++;
 +                      }
 +                      add_head = list_next_entry(add_head, list);
 +              }
 +      } else {
 +              /* Some other horrible thing happened, fail all filters */
 +              retval = 0;
 +              for (i = 0; i < count ; i++) {
 +                      add_head->state = I40E_FILTER_FAILED;
 +                      add_head = list_next_entry(add_head, list);
 +              }
        }
 +      return retval;
  }
  
  /**
   **/
  int i40e_sync_vsi_filters(struct i40e_vsi *vsi)
  {
 -      struct list_head tmp_del_list, tmp_add_list;
 -      struct i40e_mac_filter *f, *ftmp, *fclone;
 -      bool promisc_forced_on = false;
 -      bool add_happened = false;
 +      struct i40e_mac_filter *f, *ftmp, *add_head = NULL;
 +      struct list_head tmp_add_list, tmp_del_list;
 +      struct i40e_hw *hw = &vsi->back->hw;
 +      bool promisc_changed = false;
 +      char vsi_name[16] = "PF";
        int filter_list_len = 0;
        u32 changed_flags = 0;
        i40e_status aq_ret = 0;
 -      bool err_cond = false;
        int retval = 0;
        struct i40e_pf *pf;
        int num_add = 0;
        int num_del = 0;
        int aq_err = 0;
        u16 cmd_flags;
 +      int list_size;
 +      int fcnt;
  
        /* empty array typed pointers, kcalloc later */
        struct i40e_aqc_add_macvlan_element_data *add_list;
                vsi->current_netdev_flags = vsi->netdev->flags;
        }
  
 -      INIT_LIST_HEAD(&tmp_del_list);
        INIT_LIST_HEAD(&tmp_add_list);
 +      INIT_LIST_HEAD(&tmp_del_list);
 +
 +      if (vsi->type == I40E_VSI_SRIOV)
 +              snprintf(vsi_name, sizeof(vsi_name) - 1, "VF %d", vsi->vf_id);
 +      else if (vsi->type != I40E_VSI_MAIN)
 +              snprintf(vsi_name, sizeof(vsi_name) - 1, "vsi %d", vsi->seid);
  
        if (vsi->flags & I40E_VSI_FLAG_FILTER_CHANGED) {
                vsi->flags &= ~I40E_VSI_FLAG_FILTER_CHANGED;
  
                spin_lock_bh(&vsi->mac_filter_list_lock);
 +              /* Create a list of filters to delete. */
                list_for_each_entry_safe(f, ftmp, &vsi->mac_filter_list, list) {
 -                      if (!f->changed)
 -                              continue;
 -
 -                      if (f->counter != 0)
 -                              continue;
 -                      f->changed = false;
 -
 -                      /* Move the element into temporary del_list */
 -                      list_move_tail(&f->list, &tmp_del_list);
 -              }
 -
 -              list_for_each_entry_safe(f, ftmp, &vsi->mac_filter_list, list) {
 -                      if (!f->changed)
 -                              continue;
 -
 -                      if (f->counter == 0)
 -                              continue;
 -                      f->changed = false;
 -
 -                      /* Clone MAC filter entry and add into temporary list */
 -                      fclone = i40e_mac_filter_entry_clone(f);
 -                      if (!fclone) {
 -                              err_cond = true;
 -                              break;
 +                      if (f->state == I40E_FILTER_REMOVE) {
 +                              WARN_ON(f->counter != 0);
 +                              /* Move the element into temporary del_list */
 +                              list_move_tail(&f->list, &tmp_del_list);
 +                              vsi->active_filters--;
 +                      }
 +                      if (f->state == I40E_FILTER_NEW) {
 +                              WARN_ON(f->counter == 0);
 +                              /* Move the element into temporary add_list */
 +                              list_move_tail(&f->list, &tmp_add_list);
                        }
 -                      list_add_tail(&fclone->list, &tmp_add_list);
 -              }
 -
 -              /* if failed to clone MAC filter entry - undo */
 -              if (err_cond) {
 -                      i40e_undo_del_filter_entries(vsi, &tmp_del_list);
 -                      i40e_undo_add_filter_entries(vsi);
                }
                spin_unlock_bh(&vsi->mac_filter_list_lock);
 -
 -              if (err_cond) {
 -                      i40e_cleanup_add_list(&tmp_add_list);
 -                      retval = -ENOMEM;
 -                      goto out;
 -              }
        }
  
        /* Now process 'del_list' outside the lock */
        if (!list_empty(&tmp_del_list)) {
 -              int del_list_size;
 -
 -              filter_list_len = pf->hw.aq.asq_buf_size /
 +              filter_list_len = hw->aq.asq_buf_size /
                            sizeof(struct i40e_aqc_remove_macvlan_element_data);
 -              del_list_size = filter_list_len *
 +              list_size = filter_list_len *
                            sizeof(struct i40e_aqc_remove_macvlan_element_data);
 -              del_list = kzalloc(del_list_size, GFP_ATOMIC);
 +              del_list = kzalloc(list_size, GFP_ATOMIC);
                if (!del_list) {
 -                      i40e_cleanup_add_list(&tmp_add_list);
 -
                        /* Undo VSI's MAC filter entry element updates */
                        spin_lock_bh(&vsi->mac_filter_list_lock);
                        i40e_undo_del_filter_entries(vsi, &tmp_del_list);
 -                      i40e_undo_add_filter_entries(vsi);
                        spin_unlock_bh(&vsi->mac_filter_list_lock);
                        retval = -ENOMEM;
                        goto out;
  
                        /* add to delete list */
                        ether_addr_copy(del_list[num_del].mac_addr, f->macaddr);
 -                      del_list[num_del].vlan_tag =
 -                              cpu_to_le16((u16)(f->vlan ==
 -                                          I40E_VLAN_ANY ? 0 : f->vlan));
 +                      if (f->vlan == I40E_VLAN_ANY) {
 +                              del_list[num_del].vlan_tag = 0;
 +                              cmd_flags |= I40E_AQC_MACVLAN_ADD_IGNORE_VLAN;
 +                      } else {
 +                              del_list[num_del].vlan_tag =
 +                                      cpu_to_le16((u16)(f->vlan));
 +                      }
  
                        cmd_flags |= I40E_AQC_MACVLAN_DEL_PERFECT_MATCH;
                        del_list[num_del].flags = cmd_flags;
  
                        /* flush a full buffer */
                        if (num_del == filter_list_len) {
 -                              aq_ret = i40e_aq_remove_macvlan(&pf->hw,
 -                                                              vsi->seid,
 +                              aq_ret = i40e_aq_remove_macvlan(hw, vsi->seid,
                                                                del_list,
 -                                                              num_del,
 -                                                              NULL);
 -                              aq_err = pf->hw.aq.asq_last_status;
 +                                                              num_del, NULL);
 +                              aq_err = hw->aq.asq_last_status;
                                num_del = 0;
 -                              memset(del_list, 0, del_list_size);
 +                              memset(del_list, 0, list_size);
  
 -                              if (aq_ret && aq_err != I40E_AQ_RC_ENOENT) {
 +                              /* Explicitly ignore and do not report when
 +                               * firmware returns ENOENT.
 +                               */
 +                              if (aq_ret && !(aq_err == I40E_AQ_RC_ENOENT)) {
                                        retval = -EIO;
 -                                      dev_err(&pf->pdev->dev,
 -                                              "ignoring delete macvlan error, err %s, aq_err %s while flushing a full buffer\n",
 -                                              i40e_stat_str(&pf->hw, aq_ret),
 -                                              i40e_aq_str(&pf->hw, aq_err));
 +                                      dev_info(&pf->pdev->dev,
 +                                               "ignoring delete macvlan error on %s, err %s, aq_err %s\n",
 +                                               vsi_name,
 +                                               i40e_stat_str(hw, aq_ret),
 +                                               i40e_aq_str(hw, aq_err));
                                }
                        }
                        /* Release memory for MAC filter entries which were
                }
  
                if (num_del) {
 -                      aq_ret = i40e_aq_remove_macvlan(&pf->hw, vsi->seid,
 -                                                      del_list, num_del,
 -                                                      NULL);
 -                      aq_err = pf->hw.aq.asq_last_status;
 +                      aq_ret = i40e_aq_remove_macvlan(hw, vsi->seid, del_list,
 +                                                      num_del, NULL);
 +                      aq_err = hw->aq.asq_last_status;
                        num_del = 0;
  
 -                      if (aq_ret && aq_err != I40E_AQ_RC_ENOENT)
 +                      /* Explicitly ignore and do not report when firmware
 +                       * returns ENOENT.
 +                       */
 +                      if (aq_ret && !(aq_err == I40E_AQ_RC_ENOENT)) {
 +                              retval = -EIO;
                                dev_info(&pf->pdev->dev,
 -                                       "ignoring delete macvlan error, err %s aq_err %s\n",
 -                                       i40e_stat_str(&pf->hw, aq_ret),
 -                                       i40e_aq_str(&pf->hw, aq_err));
 +                                       "ignoring delete macvlan error on %s, err %s aq_err %s\n",
 +                                       vsi_name,
 +                                       i40e_stat_str(hw, aq_ret),
 +                                       i40e_aq_str(hw, aq_err));
 +                      }
                }
  
                kfree(del_list);
        }
  
        if (!list_empty(&tmp_add_list)) {
 -              int add_list_size;
 -
 -              /* do all the adds now */
 -              filter_list_len = pf->hw.aq.asq_buf_size /
 -                             sizeof(struct i40e_aqc_add_macvlan_element_data),
 -              add_list_size = filter_list_len *
 +              /* Do all the adds now. */
 +              filter_list_len = hw->aq.asq_buf_size /
                               sizeof(struct i40e_aqc_add_macvlan_element_data);
 -              add_list = kzalloc(add_list_size, GFP_ATOMIC);
 +              list_size = filter_list_len *
 +                             sizeof(struct i40e_aqc_add_macvlan_element_data);
 +              add_list = kzalloc(list_size, GFP_ATOMIC);
                if (!add_list) {
 -                      /* Purge element from temporary lists */
 -                      i40e_cleanup_add_list(&tmp_add_list);
 -
 -                      /* Undo add filter entries from VSI MAC filter list */
 -                      spin_lock_bh(&vsi->mac_filter_list_lock);
 -                      i40e_undo_add_filter_entries(vsi);
 -                      spin_unlock_bh(&vsi->mac_filter_list_lock);
                        retval = -ENOMEM;
                        goto out;
                }
 -
 -              list_for_each_entry_safe(f, ftmp, &tmp_add_list, list) {
 -
 -                      add_happened = true;
 -                      cmd_flags = 0;
 -
 +              num_add = 0;
 +              list_for_each_entry(f, &tmp_add_list, list) {
 +                      if (test_bit(__I40E_FILTER_OVERFLOW_PROMISC,
 +                                   &vsi->state)) {
 +                              f->state = I40E_FILTER_FAILED;
 +                              continue;
 +                      }
                        /* add to add array */
 +                      if (num_add == 0)
 +                              add_head = f;
 +                      cmd_flags = 0;
                        ether_addr_copy(add_list[num_add].mac_addr, f->macaddr);
 -                      add_list[num_add].vlan_tag =
 -                              cpu_to_le16(
 -                               (u16)(f->vlan == I40E_VLAN_ANY ? 0 : f->vlan));
 +                      if (f->vlan == I40E_VLAN_ANY) {
 +                              add_list[num_add].vlan_tag = 0;
 +                              cmd_flags |= I40E_AQC_MACVLAN_ADD_IGNORE_VLAN;
 +                      } else {
 +                              add_list[num_add].vlan_tag =
 +                                      cpu_to_le16((u16)(f->vlan));
 +                      }
                        add_list[num_add].queue_number = 0;
 -
                        cmd_flags |= I40E_AQC_MACVLAN_ADD_PERFECT_MATCH;
                        add_list[num_add].flags = cpu_to_le16(cmd_flags);
                        num_add++;
  
                        /* flush a full buffer */
                        if (num_add == filter_list_len) {
 -                              aq_ret = i40e_aq_add_macvlan(&pf->hw, vsi->seid,
 +                              aq_ret = i40e_aq_add_macvlan(hw, vsi->seid,
                                                             add_list, num_add,
                                                             NULL);
 -                              aq_err = pf->hw.aq.asq_last_status;
 +                              aq_err = hw->aq.asq_last_status;
 +                              fcnt = i40e_update_filter_state(num_add,
 +                                                              add_list,
 +                                                              add_head,
 +                                                              aq_ret);
 +                              vsi->active_filters += fcnt;
 +
 +                              if (fcnt != num_add) {
 +                                      promisc_changed = true;
 +                                      set_bit(__I40E_FILTER_OVERFLOW_PROMISC,
 +                                              &vsi->state);
 +                                      vsi->promisc_threshold =
 +                                              (vsi->active_filters * 3) / 4;
 +                                      dev_warn(&pf->pdev->dev,
 +                                               "Error %s adding RX filters on %s, promiscuous mode forced on\n",
 +                                               i40e_aq_str(hw, aq_err),
 +                                               vsi_name);
 +                              }
 +                              memset(add_list, 0, list_size);
                                num_add = 0;
 -
 -                              if (aq_ret)
 -                                      break;
 -                              memset(add_list, 0, add_list_size);
                        }
 -                      /* Entries from tmp_add_list were cloned from MAC
 -                       * filter list, hence clean those cloned entries
 -                       */
 -                      list_del(&f->list);
 -                      kfree(f);
                }
 -
                if (num_add) {
 -                      aq_ret = i40e_aq_add_macvlan(&pf->hw, vsi->seid,
 +                      aq_ret = i40e_aq_add_macvlan(hw, vsi->seid,
                                                     add_list, num_add, NULL);
 -                      aq_err = pf->hw.aq.asq_last_status;
 -                      num_add = 0;
 +                      aq_err = hw->aq.asq_last_status;
 +                      fcnt = i40e_update_filter_state(num_add, add_list,
 +                                                      add_head, aq_ret);
 +                      vsi->active_filters += fcnt;
 +                      if (fcnt != num_add) {
 +                              promisc_changed = true;
 +                              set_bit(__I40E_FILTER_OVERFLOW_PROMISC,
 +                                      &vsi->state);
 +                              vsi->promisc_threshold =
 +                                              (vsi->active_filters * 3) / 4;
 +                              dev_warn(&pf->pdev->dev,
 +                                       "Error %s adding RX filters on %s, promiscuous mode forced on\n",
 +                                       i40e_aq_str(hw, aq_err), vsi_name);
 +                      }
 +              }
 +              /* Now move all of the filters from the temp add list back to
 +               * the VSI's list.
 +               */
 +              spin_lock_bh(&vsi->mac_filter_list_lock);
 +              list_for_each_entry_safe(f, ftmp, &tmp_add_list, list) {
 +                      list_move_tail(&f->list, &vsi->mac_filter_list);
                }
 +              spin_unlock_bh(&vsi->mac_filter_list_lock);
                kfree(add_list);
                add_list = NULL;
 +      }
  
 -              if (add_happened && aq_ret && aq_err != I40E_AQ_RC_EINVAL) {
 -                      retval = i40e_aq_rc_to_posix(aq_ret, aq_err);
 +      /* Check to see if we can drop out of overflow promiscuous mode. */
 +      if (test_bit(__I40E_FILTER_OVERFLOW_PROMISC, &vsi->state) &&
 +          (vsi->active_filters < vsi->promisc_threshold)) {
 +              int failed_count = 0;
 +              /* See if we have any failed filters. We can't drop out of
 +               * promiscuous until these have all been deleted.
 +               */
 +              spin_lock_bh(&vsi->mac_filter_list_lock);
 +              list_for_each_entry(f, &vsi->mac_filter_list, list) {
 +                      if (f->state == I40E_FILTER_FAILED)
 +                              failed_count++;
 +              }
 +              spin_unlock_bh(&vsi->mac_filter_list_lock);
 +              if (!failed_count) {
                        dev_info(&pf->pdev->dev,
 -                               "add filter failed, err %s aq_err %s\n",
 -                               i40e_stat_str(&pf->hw, aq_ret),
 -                               i40e_aq_str(&pf->hw, aq_err));
 -                      if ((pf->hw.aq.asq_last_status == I40E_AQ_RC_ENOSPC) &&
 -                          !test_bit(__I40E_FILTER_OVERFLOW_PROMISC,
 -                                    &vsi->state)) {
 -                              promisc_forced_on = true;
 -                              set_bit(__I40E_FILTER_OVERFLOW_PROMISC,
 -                                      &vsi->state);
 -                              dev_info(&pf->pdev->dev, "promiscuous mode forced on\n");
 -                      }
 +                               "filter logjam cleared on %s, leaving overflow promiscuous mode\n",
 +                               vsi_name);
 +                      clear_bit(__I40E_FILTER_OVERFLOW_PROMISC, &vsi->state);
 +                      promisc_changed = true;
 +                      vsi->promisc_threshold = 0;
                }
        }
  
                                                               NULL);
                if (aq_ret) {
                        retval = i40e_aq_rc_to_posix(aq_ret,
 -                                                   pf->hw.aq.asq_last_status);
 +                                                   hw->aq.asq_last_status);
                        dev_info(&pf->pdev->dev,
 -                               "set multi promisc failed, err %s aq_err %s\n",
 -                               i40e_stat_str(&pf->hw, aq_ret),
 -                               i40e_aq_str(&pf->hw,
 -                                           pf->hw.aq.asq_last_status));
 +                               "set multi promisc failed on %s, err %s aq_err %s\n",
 +                               vsi_name,
 +                               i40e_stat_str(hw, aq_ret),
 +                               i40e_aq_str(hw, hw->aq.asq_last_status));
                }
        }
 -      if ((changed_flags & IFF_PROMISC) || promisc_forced_on) {
 +      if ((changed_flags & IFF_PROMISC) ||
 +          (promisc_changed &&
 +           test_bit(__I40E_FILTER_OVERFLOW_PROMISC, &vsi->state))) {
                bool cur_promisc;
  
                cur_promisc = (!!(vsi->current_netdev_flags & IFF_PROMISC) ||
                         */
                        if (pf->cur_promisc != cur_promisc) {
                                pf->cur_promisc = cur_promisc;
 -                              set_bit(__I40E_PF_RESET_REQUESTED, &pf->state);
 +                              if (cur_promisc)
 +                                      aq_ret =
 +                                            i40e_aq_set_default_vsi(hw,
 +                                                                    vsi->seid,
 +                                                                    NULL);
 +                              else
 +                                      aq_ret =
 +                                          i40e_aq_clear_default_vsi(hw,
 +                                                                    vsi->seid,
 +                                                                    NULL);
 +                              if (aq_ret) {
 +                                      retval = i40e_aq_rc_to_posix(aq_ret,
 +                                                      hw->aq.asq_last_status);
 +                                      dev_info(&pf->pdev->dev,
 +                                               "Set default VSI failed on %s, err %s, aq_err %s\n",
 +                                               vsi_name,
 +                                               i40e_stat_str(hw, aq_ret),
 +                                               i40e_aq_str(hw,
 +                                                   hw->aq.asq_last_status));
 +                              }
                        }
                } else {
                        aq_ret = i40e_aq_set_vsi_unicast_promiscuous(
 -                                                        &vsi->back->hw,
 +                                                        hw,
                                                          vsi->seid,
                                                          cur_promisc, NULL,
                                                          true);
                        if (aq_ret) {
                                retval =
                                i40e_aq_rc_to_posix(aq_ret,
 -                                                  pf->hw.aq.asq_last_status);
 +                                                  hw->aq.asq_last_status);
                                dev_info(&pf->pdev->dev,
 -                                       "set unicast promisc failed, err %d, aq_err %d\n",
 -                                       aq_ret, pf->hw.aq.asq_last_status);
 +                                       "set unicast promisc failed on %s, err %s, aq_err %s\n",
 +                                       vsi_name,
 +                                       i40e_stat_str(hw, aq_ret),
 +                                       i40e_aq_str(hw,
 +                                                   hw->aq.asq_last_status));
                        }
                        aq_ret = i40e_aq_set_vsi_multicast_promiscuous(
 -                                                        &vsi->back->hw,
 +                                                        hw,
                                                          vsi->seid,
                                                          cur_promisc, NULL);
                        if (aq_ret) {
                                retval =
                                i40e_aq_rc_to_posix(aq_ret,
 -                                                  pf->hw.aq.asq_last_status);
 +                                                  hw->aq.asq_last_status);
                                dev_info(&pf->pdev->dev,
 -                                       "set multicast promisc failed, err %d, aq_err %d\n",
 -                                       aq_ret, pf->hw.aq.asq_last_status);
 +                                       "set multicast promisc failed on %s, err %s, aq_err %s\n",
 +                                       vsi_name,
 +                                       i40e_stat_str(hw, aq_ret),
 +                                       i40e_aq_str(hw,
 +                                                   hw->aq.asq_last_status));
                        }
                }
                aq_ret = i40e_aq_set_vsi_broadcast(&vsi->back->hw,
                                                     pf->hw.aq.asq_last_status);
                        dev_info(&pf->pdev->dev,
                                 "set brdcast promisc failed, err %s, aq_err %s\n",
 -                               i40e_stat_str(&pf->hw, aq_ret),
 -                               i40e_aq_str(&pf->hw,
 -                                           pf->hw.aq.asq_last_status));
 +                                       i40e_stat_str(hw, aq_ret),
 +                                       i40e_aq_str(hw,
 +                                                   hw->aq.asq_last_status));
                }
        }
  out:
@@@ -2361,7 -2330,7 +2361,7 @@@ static void i40e_vlan_rx_register(struc
   **/
  int i40e_vsi_add_vlan(struct i40e_vsi *vsi, s16 vid)
  {
 -      struct i40e_mac_filter *f, *add_f;
 +      struct i40e_mac_filter *f, *ftmp, *add_f;
        bool is_netdev, is_vf;
  
        is_vf = (vsi->type == I40E_VSI_SRIOV);
                }
        }
  
 -      list_for_each_entry(f, &vsi->mac_filter_list, list) {
 +      list_for_each_entry_safe(f, ftmp, &vsi->mac_filter_list, list) {
                add_f = i40e_add_filter(vsi, f->macaddr, vid, is_vf, is_netdev);
                if (!add_f) {
                        dev_info(&vsi->back->pdev->dev,
        /* Now if we add a vlan tag, make sure to check if it is the first
         * tag (i.e. a "tag" -1 does exist) and if so replace the -1 "tag"
         * with 0, so we now accept untagged and specified tagged traffic
 -       * (and not any taged and untagged)
 +       * (and not all tags along with untagged)
         */
        if (vid > 0) {
                if (is_netdev && i40e_find_filter(vsi, vsi->netdev->dev_addr,
  
        /* Do not assume that I40E_VLAN_ANY should be reset to VLAN 0 */
        if (vid > 0 && !vsi->info.pvid) {
 -              list_for_each_entry(f, &vsi->mac_filter_list, list) {
 +              list_for_each_entry_safe(f, ftmp, &vsi->mac_filter_list, list) {
                        if (!i40e_find_filter(vsi, f->macaddr, I40E_VLAN_ANY,
                                              is_vf, is_netdev))
                                continue;
  int i40e_vsi_kill_vlan(struct i40e_vsi *vsi, s16 vid)
  {
        struct net_device *netdev = vsi->netdev;
 -      struct i40e_mac_filter *f, *add_f;
 +      struct i40e_mac_filter *f, *ftmp, *add_f;
        bool is_vf, is_netdev;
        int filter_count = 0;
  
        if (is_netdev)
                i40e_del_filter(vsi, netdev->dev_addr, vid, is_vf, is_netdev);
  
 -      list_for_each_entry(f, &vsi->mac_filter_list, list)
 +      list_for_each_entry_safe(f, ftmp, &vsi->mac_filter_list, list)
                i40e_del_filter(vsi, f->macaddr, vid, is_vf, is_netdev);
  
        /* go through all the filters for this VSI and if there is only
        }
  
        if (!filter_count) {
 -              list_for_each_entry(f, &vsi->mac_filter_list, list) {
 +              list_for_each_entry_safe(f, ftmp, &vsi->mac_filter_list, list) {
                        i40e_del_filter(vsi, f->macaddr, 0, is_vf, is_netdev);
                        add_f = i40e_add_filter(vsi, f->macaddr, I40E_VLAN_ANY,
                                                is_vf, is_netdev);
@@@ -2546,6 -2515,8 +2546,6 @@@ static int i40e_vlan_rx_add_vid(struct 
        if (vid > 4095)
                return -EINVAL;
  
 -      netdev_info(netdev, "adding %pM vid=%d\n", netdev->dev_addr, vid);
 -
        /* If the network stack called us with vid = 0 then
         * it is asking to receive priority tagged packets with
         * vlan id 0.  Our HW receives them by default when configured
@@@ -2579,6 -2550,8 +2579,6 @@@ static int i40e_vlan_rx_kill_vid(struc
        struct i40e_netdev_priv *np = netdev_priv(netdev);
        struct i40e_vsi *vsi = np->vsi;
  
 -      netdev_info(netdev, "removing %pM vid=%d\n", netdev->dev_addr, vid);
 -
        /* return code is ignored as there is nothing a user
         * can do about failure to remove and a log message was
         * already printed from the other function
        return 0;
  }
  
 +/**
 + * i40e_macaddr_init - explicitly write the mac address filters
 + *
 + * @vsi: pointer to the vsi
 + * @macaddr: the MAC address
 + *
 + * This is needed when the macaddr has been obtained by other
 + * means than the default, e.g., from Open Firmware or IDPROM.
 + * Returns 0 on success, negative on failure
 + **/
 +static int i40e_macaddr_init(struct i40e_vsi *vsi, u8 *macaddr)
 +{
 +      int ret;
 +      struct i40e_aqc_add_macvlan_element_data element;
 +
 +      ret = i40e_aq_mac_address_write(&vsi->back->hw,
 +                                      I40E_AQC_WRITE_TYPE_LAA_WOL,
 +                                      macaddr, NULL);
 +      if (ret) {
 +              dev_info(&vsi->back->pdev->dev,
 +                       "Addr change for VSI failed: %d\n", ret);
 +              return -EADDRNOTAVAIL;
 +      }
 +
 +      memset(&element, 0, sizeof(element));
 +      ether_addr_copy(element.mac_addr, macaddr);
 +      element.flags = cpu_to_le16(I40E_AQC_MACVLAN_ADD_PERFECT_MATCH);
 +      ret = i40e_aq_add_macvlan(&vsi->back->hw, vsi->seid, &element, 1, NULL);
 +      if (ret) {
 +              dev_info(&vsi->back->pdev->dev,
 +                       "add filter failed err %s aq_err %s\n",
 +                       i40e_stat_str(&vsi->back->hw, ret),
 +                       i40e_aq_str(&vsi->back->hw,
 +                                   vsi->back->hw.aq.asq_last_status));
 +      }
 +      return ret;
 +}
 +
  /**
   * i40e_restore_vlan - Reinstate vlans when vsi/netdev comes back up
   * @vsi: the vsi being brought back up
@@@ -3074,19 -3009,8 +3074,19 @@@ static void i40e_vsi_config_dcb_rings(s
   **/
  static void i40e_set_vsi_rx_mode(struct i40e_vsi *vsi)
  {
 +      struct i40e_pf *pf = vsi->back;
 +      int err;
 +
        if (vsi->netdev)
                i40e_set_rx_mode(vsi->netdev);
 +
 +      if (!!(pf->flags & I40E_FLAG_PF_MAC)) {
 +              err = i40e_macaddr_init(vsi, pf->hw.mac.addr);
 +              if (err) {
 +                      dev_warn(&pf->pdev->dev,
 +                               "could not set up macaddr; err %d\n", err);
 +              }
 +      }
  }
  
  /**
@@@ -4028,7 -3952,6 +4028,7 @@@ static void i40e_vsi_free_irq(struct i4
                        /* clear the affinity_mask in the IRQ descriptor */
                        irq_set_affinity_hint(pf->msix_entries[vector].vector,
                                              NULL);
 +                      synchronize_irq(pf->msix_entries[vector].vector);
                        free_irq(pf->msix_entries[vector].vector,
                                 vsi->q_vectors[i]);
  
@@@ -5035,6 -4958,7 +5035,6 @@@ static void i40e_dcb_reconfigure(struc
                        if (pf->vsi[v]->netdev)
                                i40e_dcbnl_set_all(pf->vsi[v]);
                }
 -              i40e_notify_client_of_l2_param_changes(pf->vsi[v]);
        }
  }
  
@@@ -5259,6 -5183,12 +5259,6 @@@ static void i40e_vsi_reinit_locked(stru
                usleep_range(1000, 2000);
        i40e_down(vsi);
  
 -      /* Give a VF some time to respond to the reset.  The
 -       * two second wait is based upon the watchdog cycle in
 -       * the VF driver.
 -       */
 -      if (vsi->type == I40E_VSI_SRIOV)
 -              msleep(2000);
        i40e_up(vsi);
        clear_bit(__I40E_CONFIG_BUSY, &pf->state);
  }
@@@ -5301,9 -5231,6 +5301,9 @@@ void i40e_down(struct i40e_vsi *vsi
                i40e_clean_tx_ring(vsi->tx_rings[i]);
                i40e_clean_rx_ring(vsi->rx_rings[i]);
        }
 +
 +      i40e_notify_client_of_netdev_close(vsi, false);
 +
  }
  
  /**
@@@ -5415,7 -5342,14 +5415,7 @@@ int i40e_open(struct net_device *netdev
                                                       TCP_FLAG_CWR) >> 16);
        wr32(&pf->hw, I40E_GLLAN_TSOMSK_L, be32_to_cpu(TCP_FLAG_CWR) >> 16);
  
 -#ifdef CONFIG_I40E_VXLAN
 -      vxlan_get_rx_port(netdev);
 -#endif
 -#ifdef CONFIG_I40E_GENEVE
 -      if (pf->flags & I40E_FLAG_GENEVE_OFFLOAD_CAPABLE)
 -              geneve_get_rx_port(netdev);
 -#endif
 -
 +      udp_tunnel_get_rx_info(netdev);
        i40e_notify_client_of_netdev_open(vsi);
  
        return 0;
@@@ -5782,8 -5716,6 +5782,8 @@@ static int i40e_handle_lldp_event(struc
                i40e_service_event_schedule(pf);
        } else {
                i40e_pf_unquiesce_all_vsi(pf);
 +              /* Notify the client for the DCB changes */
 +              i40e_notify_client_of_l2_param_changes(pf->vsi[pf->lan_vsi]);
        }
  
  exit:
@@@ -6008,6 -5940,7 +6008,6 @@@ static void i40e_fdir_flush_and_replay(
                if (I40E_DEBUG_FD & pf->hw.debug_mask)
                        dev_info(&pf->pdev->dev, "FD Filter table flushed and FD-SB replayed.\n");
        }
 -
  }
  
  /**
@@@ -7124,6 -7057,7 +7124,6 @@@ static void i40e_handle_mdd_event(struc
   **/
  static void i40e_sync_udp_filters_subtask(struct i40e_pf *pf)
  {
 -#if IS_ENABLED(CONFIG_VXLAN) || IS_ENABLED(CONFIG_GENEVE)
        struct i40e_hw *hw = &pf->hw;
        i40e_status ret;
        __be16 port;
                        }
                }
        }
 -#endif
  }
  
  /**
@@@ -7239,7 -7174,7 +7239,7 @@@ static int i40e_set_num_rings_in_vsi(st
                vsi->alloc_queue_pairs = 1;
                vsi->num_desc = ALIGN(I40E_FDIR_RING_COUNT,
                                      I40E_REQ_DESCRIPTOR_MULTIPLE);
 -              vsi->num_q_vectors = 1;
 +              vsi->num_q_vectors = pf->num_fdsb_msix;
                break;
  
        case I40E_VSI_VMDQ2:
@@@ -7623,11 -7558,9 +7623,11 @@@ static int i40e_init_msix(struct i40e_p
        /* reserve one vector for sideband flow director */
        if (pf->flags & I40E_FLAG_FD_SB_ENABLED) {
                if (vectors_left) {
 +                      pf->num_fdsb_msix = 1;
                        v_budget++;
                        vectors_left--;
                } else {
 +                      pf->num_fdsb_msix = 0;
                        pf->flags &= ~I40E_FLAG_FD_SB_ENABLED;
                }
        }
   * i40e_vsi_alloc_q_vector - Allocate memory for a single interrupt vector
   * @vsi: the VSI being configured
   * @v_idx: index of the vector in the vsi struct
 + * @cpu: cpu to be used on affinity_mask
   *
   * We allocate one q_vector.  If allocation fails we return -ENOMEM.
   **/
 -static int i40e_vsi_alloc_q_vector(struct i40e_vsi *vsi, int v_idx)
 +static int i40e_vsi_alloc_q_vector(struct i40e_vsi *vsi, int v_idx, int cpu)
  {
        struct i40e_q_vector *q_vector;
  
  
        q_vector->vsi = vsi;
        q_vector->v_idx = v_idx;
 -      cpumask_set_cpu(v_idx, &q_vector->affinity_mask);
 +      cpumask_set_cpu(cpu, &q_vector->affinity_mask);
 +
        if (vsi->netdev)
                netif_napi_add(vsi->netdev, &q_vector->napi,
                               i40e_napi_poll, NAPI_POLL_WEIGHT);
  static int i40e_vsi_alloc_q_vectors(struct i40e_vsi *vsi)
  {
        struct i40e_pf *pf = vsi->back;
 -      int v_idx, num_q_vectors;
 -      int err;
 +      int err, v_idx, num_q_vectors, current_cpu;
  
        /* if not MSIX, give the one vector only to the LAN VSI */
        if (pf->flags & I40E_FLAG_MSIX_ENABLED)
        else
                return -EINVAL;
  
 +      current_cpu = cpumask_first(cpu_online_mask);
 +
        for (v_idx = 0; v_idx < num_q_vectors; v_idx++) {
 -              err = i40e_vsi_alloc_q_vector(vsi, v_idx);
 +              err = i40e_vsi_alloc_q_vector(vsi, v_idx, current_cpu);
                if (err)
                        goto err_out;
 +              current_cpu = cpumask_next(current_cpu, cpu_online_mask);
 +              if (unlikely(current_cpu >= nr_cpu_ids))
 +                      current_cpu = cpumask_first(cpu_online_mask);
        }
  
        return 0;
@@@ -7978,6 -7905,7 +7978,6 @@@ static int i40e_config_rss_aq(struct i4
        u8 *rss_lut;
        int ret, i;
  
 -      memset(&rss_key, 0, sizeof(rss_key));
        memcpy(&rss_key, seed, sizeof(rss_key));
  
        rss_lut = kzalloc(pf->rss_table_size, GFP_KERNEL);
@@@ -8651,9 -8579,7 +8651,9 @@@ bool i40e_set_ntuple(struct i40e_pf *pf
                /* Enable filters and mark for reset */
                if (!(pf->flags & I40E_FLAG_FD_SB_ENABLED))
                        need_reset = true;
 -              pf->flags |= I40E_FLAG_FD_SB_ENABLED;
 +              /* enable FD_SB only if there is MSI-X vector */
 +              if (pf->num_fdsb_msix > 0)
 +                      pf->flags |= I40E_FLAG_FD_SB_ENABLED;
        } else {
                /* turn off filters, mark for reset and clear SW filter list */
                if (pf->flags & I40E_FLAG_FD_SB_ENABLED) {
@@@ -8702,6 -8628,7 +8702,6 @@@ static int i40e_set_features(struct net
        return 0;
  }
  
 -#if IS_ENABLED(CONFIG_VXLAN) || IS_ENABLED(CONFIG_GENEVE)
  /**
   * i40e_get_udp_port_idx - Lookup a possibly offloaded for Rx UDP port
   * @pf: board private structure
@@@ -8721,18 -8648,21 +8721,18 @@@ static u8 i40e_get_udp_port_idx(struct 
        return i;
  }
  
 -#endif
 -
 -#if IS_ENABLED(CONFIG_VXLAN)
  /**
 - * i40e_add_vxlan_port - Get notifications about VXLAN ports that come up
 + * i40e_udp_tunnel_add - Get notifications about UDP tunnel ports that come up
   * @netdev: This physical port's netdev
 - * @sa_family: Socket Family that VXLAN is notifying us about
 - * @port: New UDP port number that VXLAN started listening to
 + * @ti: Tunnel endpoint information
   **/
 -static void i40e_add_vxlan_port(struct net_device *netdev,
 -                              sa_family_t sa_family, __be16 port)
 +static void i40e_udp_tunnel_add(struct net_device *netdev,
 +                              struct udp_tunnel_info *ti)
  {
        struct i40e_netdev_priv *np = netdev_priv(netdev);
        struct i40e_vsi *vsi = np->vsi;
        struct i40e_pf *pf = vsi->back;
 +      __be16 port = ti->port;
        u8 next_idx;
        u8 idx;
  
  
        /* Check if port already exists */
        if (idx < I40E_MAX_PF_UDP_OFFLOAD_PORTS) {
 -              netdev_info(netdev, "vxlan port %d already offloaded\n",
 +              netdev_info(netdev, "port %d already offloaded\n",
                            ntohs(port));
                return;
        }
        next_idx = i40e_get_udp_port_idx(pf, 0);
  
        if (next_idx == I40E_MAX_PF_UDP_OFFLOAD_PORTS) {
 -              netdev_info(netdev, "maximum number of vxlan UDP ports reached, not adding port %d\n",
 +              netdev_info(netdev, "maximum number of offloaded UDP ports reached, not adding port %d\n",
                            ntohs(port));
                return;
        }
  
 -      /* New port: add it and mark its index in the bitmap */
 -      pf->udp_ports[next_idx].index = port;
 -      pf->udp_ports[next_idx].type = I40E_AQC_TUNNEL_TYPE_VXLAN;
 -      pf->pending_udp_bitmap |= BIT_ULL(next_idx);
 -      pf->flags |= I40E_FLAG_UDP_FILTER_SYNC;
 -}
 -
 -/**
 - * i40e_del_vxlan_port - Get notifications about VXLAN ports that go away
 - * @netdev: This physical port's netdev
 - * @sa_family: Socket Family that VXLAN is notifying us about
 - * @port: UDP port number that VXLAN stopped listening to
 - **/
 -static void i40e_del_vxlan_port(struct net_device *netdev,
 -                              sa_family_t sa_family, __be16 port)
 -{
 -      struct i40e_netdev_priv *np = netdev_priv(netdev);
 -      struct i40e_vsi *vsi = np->vsi;
 -      struct i40e_pf *pf = vsi->back;
 -      u8 idx;
 -
 -      idx = i40e_get_udp_port_idx(pf, port);
 -
 -      /* Check if port already exists */
 -      if (idx < I40E_MAX_PF_UDP_OFFLOAD_PORTS) {
 -              /* if port exists, set it to 0 (mark for deletion)
 -               * and make it pending
 -               */
 -              pf->udp_ports[idx].index = 0;
 -              pf->pending_udp_bitmap |= BIT_ULL(idx);
 -              pf->flags |= I40E_FLAG_UDP_FILTER_SYNC;
 -      } else {
 -              netdev_warn(netdev, "vxlan port %d was not found, not deleting\n",
 -                          ntohs(port));
 -      }
 -}
 -#endif
 -
 -#if IS_ENABLED(CONFIG_GENEVE)
 -/**
 - * i40e_add_geneve_port - Get notifications about GENEVE ports that come up
 - * @netdev: This physical port's netdev
 - * @sa_family: Socket Family that GENEVE is notifying us about
 - * @port: New UDP port number that GENEVE started listening to
 - **/
 -static void i40e_add_geneve_port(struct net_device *netdev,
 -                               sa_family_t sa_family, __be16 port)
 -{
 -      struct i40e_netdev_priv *np = netdev_priv(netdev);
 -      struct i40e_vsi *vsi = np->vsi;
 -      struct i40e_pf *pf = vsi->back;
 -      u8 next_idx;
 -      u8 idx;
 -
 -      if (!(pf->flags & I40E_FLAG_GENEVE_OFFLOAD_CAPABLE))
 -              return;
 -
 -      idx = i40e_get_udp_port_idx(pf, port);
 -
 -      /* Check if port already exists */
 -      if (idx < I40E_MAX_PF_UDP_OFFLOAD_PORTS) {
 -              netdev_info(netdev, "udp port %d already offloaded\n",
 -                          ntohs(port));
 -              return;
 -      }
 -
 -      /* Now check if there is space to add the new port */
 -      next_idx = i40e_get_udp_port_idx(pf, 0);
 -
 -      if (next_idx == I40E_MAX_PF_UDP_OFFLOAD_PORTS) {
 -              netdev_info(netdev, "maximum number of UDP ports reached, not adding port %d\n",
 -                          ntohs(port));
 +      switch (ti->type) {
 +      case UDP_TUNNEL_TYPE_VXLAN:
 +              pf->udp_ports[next_idx].type = I40E_AQC_TUNNEL_TYPE_VXLAN;
 +              break;
 +      case UDP_TUNNEL_TYPE_GENEVE:
 +              if (!(pf->flags & I40E_FLAG_GENEVE_OFFLOAD_CAPABLE))
 +                      return;
 +              pf->udp_ports[next_idx].type = I40E_AQC_TUNNEL_TYPE_NGE;
 +              break;
 +      default:
                return;
        }
  
        /* New port: add it and mark its index in the bitmap */
        pf->udp_ports[next_idx].index = port;
 -      pf->udp_ports[next_idx].type = I40E_AQC_TUNNEL_TYPE_NGE;
        pf->pending_udp_bitmap |= BIT_ULL(next_idx);
        pf->flags |= I40E_FLAG_UDP_FILTER_SYNC;
 -
 -      dev_info(&pf->pdev->dev, "adding geneve port %d\n", ntohs(port));
  }
  
  /**
 - * i40e_del_geneve_port - Get notifications about GENEVE ports that go away
 + * i40e_udp_tunnel_del - Get notifications about UDP tunnel ports that go away
   * @netdev: This physical port's netdev
 - * @sa_family: Socket Family that GENEVE is notifying us about
 - * @port: UDP port number that GENEVE stopped listening to
 + * @ti: Tunnel endpoint information
   **/
 -static void i40e_del_geneve_port(struct net_device *netdev,
 -                               sa_family_t sa_family, __be16 port)
 +static void i40e_udp_tunnel_del(struct net_device *netdev,
 +                              struct udp_tunnel_info *ti)
  {
        struct i40e_netdev_priv *np = netdev_priv(netdev);
        struct i40e_vsi *vsi = np->vsi;
        struct i40e_pf *pf = vsi->back;
 +      __be16 port = ti->port;
        u8 idx;
  
 -      if (!(pf->flags & I40E_FLAG_GENEVE_OFFLOAD_CAPABLE))
 -              return;
 -
        idx = i40e_get_udp_port_idx(pf, port);
  
        /* Check if port already exists */
 -      if (idx < I40E_MAX_PF_UDP_OFFLOAD_PORTS) {
 -              /* if port exists, set it to 0 (mark for deletion)
 -               * and make it pending
 -               */
 -              pf->udp_ports[idx].index = 0;
 -              pf->pending_udp_bitmap |= BIT_ULL(idx);
 -              pf->flags |= I40E_FLAG_UDP_FILTER_SYNC;
 +      if (idx >= I40E_MAX_PF_UDP_OFFLOAD_PORTS)
 +              goto not_found;
  
 -              dev_info(&pf->pdev->dev, "deleting geneve port %d\n",
 -                       ntohs(port));
 -      } else {
 -              netdev_warn(netdev, "geneve port %d was not found, not deleting\n",
 -                          ntohs(port));
 +      switch (ti->type) {
 +      case UDP_TUNNEL_TYPE_VXLAN:
 +              if (pf->udp_ports[idx].type != I40E_AQC_TUNNEL_TYPE_VXLAN)
 +                      goto not_found;
 +              break;
 +      case UDP_TUNNEL_TYPE_GENEVE:
 +              if (pf->udp_ports[idx].type != I40E_AQC_TUNNEL_TYPE_NGE)
 +                      goto not_found;
 +              break;
 +      default:
 +              goto not_found;
        }
 +
 +      /* if port exists, set it to 0 (mark for deletion)
 +       * and make it pending
 +       */
 +      pf->udp_ports[idx].index = 0;
 +      pf->pending_udp_bitmap |= BIT_ULL(idx);
 +      pf->flags |= I40E_FLAG_UDP_FILTER_SYNC;
 +
 +      return;
 +not_found:
 +      netdev_warn(netdev, "UDP port %d was not found, not deleting\n",
 +                  ntohs(port));
  }
 -#endif
  
  static int i40e_get_phys_port_id(struct net_device *netdev,
                                 struct netdev_phys_item_id *ppid)
@@@ -9047,8 -9033,14 +9047,8 @@@ static const struct net_device_ops i40e
        .ndo_set_vf_link_state  = i40e_ndo_set_vf_link_state,
        .ndo_set_vf_spoofchk    = i40e_ndo_set_vf_spoofchk,
        .ndo_set_vf_trust       = i40e_ndo_set_vf_trust,
 -#if IS_ENABLED(CONFIG_VXLAN)
 -      .ndo_add_vxlan_port     = i40e_add_vxlan_port,
 -      .ndo_del_vxlan_port     = i40e_del_vxlan_port,
 -#endif
 -#if IS_ENABLED(CONFIG_GENEVE)
 -      .ndo_add_geneve_port    = i40e_add_geneve_port,
 -      .ndo_del_geneve_port    = i40e_del_geneve_port,
 -#endif
 +      .ndo_udp_tunnel_add     = i40e_udp_tunnel_add,
 +      .ndo_udp_tunnel_del     = i40e_udp_tunnel_del,
        .ndo_get_phys_port_id   = i40e_get_phys_port_id,
        .ndo_fdb_add            = i40e_ndo_fdb_add,
        .ndo_features_check     = i40e_features_check,
   **/
  static int i40e_config_netdev(struct i40e_vsi *vsi)
  {
 -      u8 brdcast[ETH_ALEN] = {0xff, 0xff, 0xff, 0xff, 0xff, 0xff};
        struct i40e_pf *pf = vsi->back;
        struct i40e_hw *hw = &pf->hw;
        struct i40e_netdev_priv *np;
                 * default a MAC-VLAN filter that accepts any tagged packet
                 * which must be replaced by a normal filter.
                 */
 -              if (!i40e_rm_default_mac_filter(vsi, mac_addr)) {
 -                      spin_lock_bh(&vsi->mac_filter_list_lock);
 -                      i40e_add_filter(vsi, mac_addr,
 -                                      I40E_VLAN_ANY, false, true);
 -                      spin_unlock_bh(&vsi->mac_filter_list_lock);
 -              }
 -      } else if ((pf->hw.aq.api_maj_ver > 1) ||
 -                 ((pf->hw.aq.api_maj_ver == 1) &&
 -                  (pf->hw.aq.api_min_ver > 4))) {
 -              /* Supported in FW API version higher than 1.4 */
 -              pf->flags |= I40E_FLAG_GENEVE_OFFLOAD_CAPABLE;
 -              pf->auto_disable_flags = I40E_FLAG_HW_ATR_EVICT_CAPABLE;
 +              i40e_rm_default_mac_filter(vsi, mac_addr);
 +              spin_lock_bh(&vsi->mac_filter_list_lock);
 +              i40e_add_filter(vsi, mac_addr, I40E_VLAN_ANY, false, true);
 +              spin_unlock_bh(&vsi->mac_filter_list_lock);
        } else {
                /* relate the VSI_VMDQ name to the VSI_MAIN name */
                snprintf(netdev->name, IFNAMSIZ, "%sv%%d",
                spin_unlock_bh(&vsi->mac_filter_list_lock);
        }
  
 -      spin_lock_bh(&vsi->mac_filter_list_lock);
 -      i40e_add_filter(vsi, brdcast, I40E_VLAN_ANY, false, false);
 -      spin_unlock_bh(&vsi->mac_filter_list_lock);
 -
        ether_addr_copy(netdev->dev_addr, mac_addr);
        ether_addr_copy(netdev->perm_addr, mac_addr);
  
@@@ -9219,7 -9224,8 +9219,7 @@@ int i40e_is_vsi_uplink_mode_veb(struct 
  static int i40e_add_vsi(struct i40e_vsi *vsi)
  {
        int ret = -ENODEV;
 -      u8 laa_macaddr[ETH_ALEN];
 -      bool found_laa_mac_filter = false;
 +      i40e_status aq_ret = 0;
        struct i40e_pf *pf = vsi->back;
        struct i40e_hw *hw = &pf->hw;
        struct i40e_vsi_context ctxt;
                vsi->seid = ctxt.seid;
                vsi->id = ctxt.vsi_number;
        }
 +      /* Except FDIR VSI, for all othet VSI set the broadcast filter */
 +      if (vsi->type != I40E_VSI_FDIR) {
 +              aq_ret = i40e_aq_set_vsi_broadcast(hw, vsi->seid, true, NULL);
 +              if (aq_ret) {
 +                      ret = i40e_aq_rc_to_posix(aq_ret,
 +                                                hw->aq.asq_last_status);
 +                      dev_info(&pf->pdev->dev,
 +                               "set brdcast promisc failed, err %s, aq_err %s\n",
 +                               i40e_stat_str(hw, aq_ret),
 +                               i40e_aq_str(hw, hw->aq.asq_last_status));
 +              }
 +      }
  
 +      vsi->active_filters = 0;
 +      clear_bit(__I40E_FILTER_OVERFLOW_PROMISC, &vsi->state);
        spin_lock_bh(&vsi->mac_filter_list_lock);
        /* If macvlan filters already exist, force them to get loaded */
        list_for_each_entry_safe(f, ftmp, &vsi->mac_filter_list, list) {
 -              f->changed = true;
 +              f->state = I40E_FILTER_NEW;
                f_count++;
 -
 -              /* Expected to have only one MAC filter entry for LAA in list */
 -              if (f->is_laa && vsi->type == I40E_VSI_MAIN) {
 -                      ether_addr_copy(laa_macaddr, f->macaddr);
 -                      found_laa_mac_filter = true;
 -              }
        }
        spin_unlock_bh(&vsi->mac_filter_list_lock);
  
 -      if (found_laa_mac_filter) {
 -              struct i40e_aqc_remove_macvlan_element_data element;
 -
 -              memset(&element, 0, sizeof(element));
 -              ether_addr_copy(element.mac_addr, laa_macaddr);
 -              element.flags = I40E_AQC_MACVLAN_DEL_PERFECT_MATCH;
 -              ret = i40e_aq_remove_macvlan(hw, vsi->seid,
 -                                           &element, 1, NULL);
 -              if (ret) {
 -                      /* some older FW has a different default */
 -                      element.flags |=
 -                                     I40E_AQC_MACVLAN_DEL_IGNORE_VLAN;
 -                      i40e_aq_remove_macvlan(hw, vsi->seid,
 -                                             &element, 1, NULL);
 -              }
 -
 -              i40e_aq_mac_address_write(hw,
 -                                        I40E_AQC_WRITE_TYPE_LAA_WOL,
 -                                        laa_macaddr, NULL);
 -      }
 -
        if (f_count) {
                vsi->flags |= I40E_VSI_FLAG_FILTER_CHANGED;
                pf->flags |= I40E_FLAG_FILTER_SYNC;
@@@ -9640,8 -9659,6 +9640,8 @@@ static struct i40e_vsi *i40e_vsi_reinit
        pf->vsi[pf->lan_vsi]->tc_config.enabled_tc = 0;
        pf->vsi[pf->lan_vsi]->seid = pf->main_vsi_seid;
        i40e_vsi_config_tc(pf->vsi[pf->lan_vsi], enabled_tc);
 +      if (vsi->type == I40E_VSI_MAIN)
 +              i40e_rm_default_mac_filter(vsi, pf->hw.mac.perm_addr);
  
        /* assign it some queues */
        ret = i40e_alloc_rings(vsi);
@@@ -9666,6 -9683,44 +9666,6 @@@ err_vsi
        return NULL;
  }
  
 -/**
 - * i40e_macaddr_init - explicitly write the mac address filters.
 - *
 - * @vsi: pointer to the vsi.
 - * @macaddr: the MAC address
 - *
 - * This is needed when the macaddr has been obtained by other
 - * means than the default, e.g., from Open Firmware or IDPROM.
 - * Returns 0 on success, negative on failure
 - **/
 -static int i40e_macaddr_init(struct i40e_vsi *vsi, u8 *macaddr)
 -{
 -      int ret;
 -      struct i40e_aqc_add_macvlan_element_data element;
 -
 -      ret = i40e_aq_mac_address_write(&vsi->back->hw,
 -                                      I40E_AQC_WRITE_TYPE_LAA_WOL,
 -                                      macaddr, NULL);
 -      if (ret) {
 -              dev_info(&vsi->back->pdev->dev,
 -                       "Addr change for VSI failed: %d\n", ret);
 -              return -EADDRNOTAVAIL;
 -      }
 -
 -      memset(&element, 0, sizeof(element));
 -      ether_addr_copy(element.mac_addr, macaddr);
 -      element.flags = cpu_to_le16(I40E_AQC_MACVLAN_ADD_PERFECT_MATCH);
 -      ret = i40e_aq_add_macvlan(&vsi->back->hw, vsi->seid, &element, 1, NULL);
 -      if (ret) {
 -              dev_info(&vsi->back->pdev->dev,
 -                       "add filter failed err %s aq_err %s\n",
 -                       i40e_stat_str(&vsi->back->hw, ret),
 -                       i40e_aq_str(&vsi->back->hw,
 -                                   vsi->back->hw.aq.asq_last_status));
 -      }
 -      return ret;
 -}
 -
  /**
   * i40e_vsi_setup - Set up a VSI by a given type
   * @pf: board private structure
@@@ -10078,14 -10133,14 +10078,14 @@@ void i40e_veb_release(struct i40e_veb *
  static int i40e_add_veb(struct i40e_veb *veb, struct i40e_vsi *vsi)
  {
        struct i40e_pf *pf = veb->pf;
 -      bool is_default = veb->pf->cur_promisc;
        bool enable_stats = !!(pf->flags & I40E_FLAG_VEB_STATS_ENABLED);
        int ret;
  
 -      /* get a VEB from the hardware */
        ret = i40e_aq_add_veb(&pf->hw, veb->uplink_seid, vsi->seid,
 -                            veb->enabled_tc, is_default,
 +                            veb->enabled_tc, false,
                              &veb->seid, enable_stats, NULL);
 +
 +      /* get a VEB from the hardware */
        if (ret) {
                dev_info(&pf->pdev->dev,
                         "couldn't add VEB, err %s aq_err %s\n",
@@@ -10634,8 -10689,12 +10634,8 @@@ static void i40e_print_features(struct 
        }
        if (pf->flags & I40E_FLAG_DCB_CAPABLE)
                i += snprintf(&buf[i], REMAIN(i), " DCB");
 -#if IS_ENABLED(CONFIG_VXLAN)
        i += snprintf(&buf[i], REMAIN(i), " VxLAN");
 -#endif
 -#if IS_ENABLED(CONFIG_GENEVE)
        i += snprintf(&buf[i], REMAIN(i), " Geneve");
 -#endif
        if (pf->flags & I40E_FLAG_PTP)
                i += snprintf(&buf[i], REMAIN(i), " PTP");
  #ifdef I40E_FCOE
@@@ -10710,8 -10769,7 +10710,7 @@@ static int i40e_probe(struct pci_dev *p
        }
  
        /* set up pci connections */
-       err = pci_request_selected_regions(pdev, pci_select_bars(pdev,
-                                          IORESOURCE_MEM), i40e_driver_name);
+       err = pci_request_mem_regions(pdev, i40e_driver_name);
        if (err) {
                dev_info(&pdev->dev,
                         "pci_request_selected_regions failed %d\n", err);
@@@ -11208,8 -11266,7 +11207,7 @@@ err_ioremap
        kfree(pf);
  err_pf_alloc:
        pci_disable_pcie_error_reporting(pdev);
-       pci_release_selected_regions(pdev,
-                                    pci_select_bars(pdev, IORESOURCE_MEM));
+       pci_release_mem_regions(pdev);
  err_pci_reg:
  err_dma:
        pci_disable_device(pdev);
@@@ -11320,8 -11377,7 +11318,7 @@@ static void i40e_remove(struct pci_dev 
  
        iounmap(hw->hw_addr);
        kfree(pf);
-       pci_release_selected_regions(pdev,
-                                    pci_select_bars(pdev, IORESOURCE_MEM));
+       pci_release_mem_regions(pdev);
  
        pci_disable_pcie_error_reporting(pdev);
        pci_disable_device(pdev);
@@@ -11466,7 -11522,6 +11463,7 @@@ static int i40e_suspend(struct pci_dev 
  {
        struct i40e_pf *pf = pci_get_drvdata(pdev);
        struct i40e_hw *hw = &pf->hw;
 +      int retval = 0;
  
        set_bit(__I40E_SUSPENDED, &pf->state);
        set_bit(__I40E_DOWN, &pf->state);
        wr32(hw, I40E_PFPM_APM, (pf->wol_en ? I40E_PFPM_APM_APME_MASK : 0));
        wr32(hw, I40E_PFPM_WUFC, (pf->wol_en ? I40E_PFPM_WUFC_MAG_MASK : 0));
  
 +      i40e_stop_misc_vector(pf);
 +
 +      retval = pci_save_state(pdev);
 +      if (retval)
 +              return retval;
 +
        pci_wake_from_d3(pdev, pf->wol_en);
        pci_set_power_state(pdev, PCI_D3hot);
  
 -      return 0;
 +      return retval;
  }
  
  /**
index 9bcba42abb919c3a4df996773b909a9f93620862,1c96fe83000a10ea7ce16d809b9009cf3fdb3a55..942a89fb009088619936ea8e3ad909287d76ceca
@@@ -2027,8 -2027,7 +2027,8 @@@ void igb_reset(struct igb_adapter *adap
        wr32(E1000_VET, ETHERNET_IEEE_VLAN_TYPE);
  
        /* Re-enable PTP, where applicable. */
 -      igb_ptp_reset(adapter);
 +      if (adapter->ptp_flags & IGB_PTP_ENABLED)
 +              igb_ptp_reset(adapter);
  
        igb_get_phy_info(hw);
  }
@@@ -2324,9 -2323,7 +2324,7 @@@ static int igb_probe(struct pci_dev *pd
                }
        }
  
-       err = pci_request_selected_regions(pdev, pci_select_bars(pdev,
-                                          IORESOURCE_MEM),
-                                          igb_driver_name);
+       err = pci_request_mem_regions(pdev, igb_driver_name);
        if (err)
                goto err_pci_reg;
  
@@@ -2750,8 -2747,7 +2748,7 @@@ err_sw_init
  err_ioremap:
        free_netdev(netdev);
  err_alloc_etherdev:
-       pci_release_selected_regions(pdev,
-                                    pci_select_bars(pdev, IORESOURCE_MEM));
+       pci_release_mem_regions(pdev);
  err_pci_reg:
  err_dma:
        pci_disable_device(pdev);
@@@ -2916,8 -2912,7 +2913,7 @@@ static void igb_remove(struct pci_dev *
        pci_iounmap(pdev, adapter->io_addr);
        if (hw->flash_address)
                iounmap(hw->flash_address);
-       pci_release_selected_regions(pdev,
-                                    pci_select_bars(pdev, IORESOURCE_MEM));
+       pci_release_mem_regions(pdev);
  
        kfree(adapter->shadow_vfta);
        free_netdev(netdev);
@@@ -6856,12 -6851,12 +6852,12 @@@ static bool igb_can_reuse_rx_page(struc
   **/
  static bool igb_add_rx_frag(struct igb_ring *rx_ring,
                            struct igb_rx_buffer *rx_buffer,
 +                          unsigned int size,
                            union e1000_adv_rx_desc *rx_desc,
                            struct sk_buff *skb)
  {
        struct page *page = rx_buffer->page;
        unsigned char *va = page_address(page) + rx_buffer->page_offset;
 -      unsigned int size = le16_to_cpu(rx_desc->wb.upper.length);
  #if (PAGE_SIZE < 8192)
        unsigned int truesize = IGB_RX_BUFSZ;
  #else
@@@ -6913,7 -6908,6 +6909,7 @@@ static struct sk_buff *igb_fetch_rx_buf
                                           union e1000_adv_rx_desc *rx_desc,
                                           struct sk_buff *skb)
  {
 +      unsigned int size = le16_to_cpu(rx_desc->wb.upper.length);
        struct igb_rx_buffer *rx_buffer;
        struct page *page;
  
        dma_sync_single_range_for_cpu(rx_ring->dev,
                                      rx_buffer->dma,
                                      rx_buffer->page_offset,
 -                                    IGB_RX_BUFSZ,
 +                                    size,
                                      DMA_FROM_DEVICE);
  
        /* pull page into skb */
 -      if (igb_add_rx_frag(rx_ring, rx_buffer, rx_desc, skb)) {
 +      if (igb_add_rx_frag(rx_ring, rx_buffer, size, rx_desc, skb)) {
                /* hand second half of page back to the ring */
                igb_reuse_rx_page(rx_ring, rx_buffer);
        } else {
@@@ -7529,8 -7523,6 +7525,8 @@@ static int __igb_shutdown(struct pci_de
        if (netif_running(netdev))
                __igb_close(netdev, true);
  
 +      igb_ptp_suspend(adapter);
 +
        igb_clear_interrupt_scheme(adapter);
  
  #ifdef CONFIG_PM
index 7871f538f0ad0ea67e4d1564d19552706e5a501b,1629468387729c55b30505326229cac952821de6..5418c69a74630bdd8b2aa2519c9e7f41c3e76ac9
@@@ -50,7 -50,7 +50,7 @@@
  #include <linux/if_bridge.h>
  #include <linux/prefetch.h>
  #include <scsi/fc/fc_fcoe.h>
 -#include <net/vxlan.h>
 +#include <net/udp_tunnel.h>
  #include <net/pkt_cls.h>
  #include <net/tc_act/tc_gact.h>
  #include <net/tc_act/tc_mirred.h>
@@@ -2887,7 -2887,7 +2887,7 @@@ int ixgbe_poll(struct napi_struct *napi
        if (!test_bit(__IXGBE_DOWN, &adapter->state))
                ixgbe_irq_enable_queues(adapter, BIT_ULL(q_vector->v_idx));
  
 -      return 0;
 +      return min(work_done, budget - 1);
  }
  
  /**
@@@ -3084,7 -3084,7 +3084,7 @@@ static void ixgbe_free_irq(struct ixgbe
                free_irq(entry->vector, q_vector);
        }
  
 -      free_irq(adapter->msix_entries[vector++].vector, adapter);
 +      free_irq(adapter->msix_entries[vector].vector, adapter);
  }
  
  /**
@@@ -5625,6 -5625,7 +5625,6 @@@ static int ixgbe_sw_init(struct ixgbe_a
        struct pci_dev *pdev = adapter->pdev;
        unsigned int rss, fdir;
        u32 fwsm;
 -      u16 device_caps;
        int i;
  
        /* PCI config space info */
  #ifdef CONFIG_IXGBE_DCA
                adapter->flags &= ~IXGBE_FLAG_DCA_CAPABLE;
  #endif
 -#ifdef CONFIG_IXGBE_VXLAN
                adapter->flags |= IXGBE_FLAG_VXLAN_OFFLOAD_CAPABLE;
 -#endif
                break;
        default:
                break;
        adapter->tx_ring_count = IXGBE_DEFAULT_TXD;
        adapter->rx_ring_count = IXGBE_DEFAULT_RXD;
  
 -      /* Cache bit indicating need for crosstalk fix */
 -      switch (hw->mac.type) {
 -      case ixgbe_mac_82599EB:
 -      case ixgbe_mac_X550EM_x:
 -      case ixgbe_mac_x550em_a:
 -              hw->mac.ops.get_device_caps(hw, &device_caps);
 -              if (device_caps & IXGBE_DEVICE_CAPS_NO_CROSSTALK_WR)
 -                      adapter->need_crosstalk_fix = false;
 -              else
 -                      adapter->need_crosstalk_fix = true;
 -              break;
 -      default:
 -              adapter->need_crosstalk_fix = false;
 -              break;
 -      }
 -
        /* set default work limits */
        adapter->tx_work_limit = IXGBE_DEFAULT_TX_WORK;
  
@@@ -6139,7 -6158,9 +6139,7 @@@ int ixgbe_open(struct net_device *netde
        ixgbe_up_complete(adapter);
  
        ixgbe_clear_vxlan_port(adapter);
 -#ifdef CONFIG_IXGBE_VXLAN
 -      vxlan_get_rx_port(netdev);
 -#endif
 +      udp_tunnel_get_rx_info(netdev);
  
        return 0;
  
@@@ -6690,6 -6711,18 +6690,6 @@@ static void ixgbe_watchdog_update_link(
                link_up = true;
        }
  
 -      /* If Crosstalk fix enabled do the sanity check of making sure
 -       * the SFP+ cage is empty.
 -       */
 -      if (adapter->need_crosstalk_fix) {
 -              u32 sfp_cage_full;
 -
 -              sfp_cage_full = IXGBE_READ_REG(hw, IXGBE_ESDP) &
 -                              IXGBE_ESDP_SDP2;
 -              if (ixgbe_is_sfp(hw) && link_up && !sfp_cage_full)
 -                      link_up = false;
 -      }
 -
        if (adapter->ixgbe_ieee_pfc)
                pfc_en |= !!(adapter->ixgbe_ieee_pfc->pfc_en);
  
@@@ -7036,6 -7069,16 +7036,6 @@@ static void ixgbe_sfp_detection_subtask
        struct ixgbe_hw *hw = &adapter->hw;
        s32 err;
  
 -      /* If crosstalk fix enabled verify the SFP+ cage is full */
 -      if (adapter->need_crosstalk_fix) {
 -              u32 sfp_cage_full;
 -
 -              sfp_cage_full = IXGBE_READ_REG(hw, IXGBE_ESDP) &
 -                              IXGBE_ESDP_SDP2;
 -              if (!sfp_cage_full)
 -                      return;
 -      }
 -
        /* not searching for SFP so there is nothing to do here */
        if (!(adapter->flags2 & IXGBE_FLAG2_SEARCH_FOR_SFP) &&
            !(adapter->flags2 & IXGBE_FLAG2_SFP_NEEDS_RESET))
@@@ -7219,12 -7262,14 +7219,12 @@@ static void ixgbe_service_task(struct w
                ixgbe_service_event_complete(adapter);
                return;
        }
 -#ifdef CONFIG_IXGBE_VXLAN
 -      rtnl_lock();
        if (adapter->flags2 & IXGBE_FLAG2_VXLAN_REREG_NEEDED) {
 +              rtnl_lock();
                adapter->flags2 &= ~IXGBE_FLAG2_VXLAN_REREG_NEEDED;
 -              vxlan_get_rx_port(adapter->netdev);
 +              udp_tunnel_get_rx_info(adapter->netdev);
 +              rtnl_unlock();
        }
 -      rtnl_unlock();
 -#endif /* CONFIG_IXGBE_VXLAN */
        ixgbe_reset_subtask(adapter);
        ixgbe_phy_interrupt_subtask(adapter);
        ixgbe_sfp_detection_subtask(adapter);
@@@ -7652,6 -7697,7 +7652,6 @@@ static void ixgbe_atr(struct ixgbe_rin
        /* snag network header to get L4 type and address */
        skb = first->skb;
        hdr.network = skb_network_header(skb);
 -#ifdef CONFIG_IXGBE_VXLAN
        if (skb->encapsulation &&
            first->protocol == htons(ETH_P_IP) &&
            hdr.ipv4->protocol != IPPROTO_UDP) {
                    udp_hdr(skb)->dest == adapter->vxlan_port)
                        hdr.network = skb_inner_network_header(skb);
        }
 -#endif /* CONFIG_IXGBE_VXLAN */
  
        /* Currently only IPv4/IPv6 with TCP is supported */
        switch (hdr.ipv4->version) {
@@@ -8261,53 -8308,14 +8261,53 @@@ int ixgbe_setup_tc(struct net_device *d
  static int ixgbe_delete_clsu32(struct ixgbe_adapter *adapter,
                               struct tc_cls_u32_offload *cls)
  {
 +      u32 hdl = cls->knode.handle;
        u32 uhtid = TC_U32_USERHTID(cls->knode.handle);
 -      u32 loc;
 -      int err;
 +      u32 loc = cls->knode.handle & 0xfffff;
 +      int err = 0, i, j;
 +      struct ixgbe_jump_table *jump = NULL;
 +
 +      if (loc > IXGBE_MAX_HW_ENTRIES)
 +              return -EINVAL;
  
        if ((uhtid != 0x800) && (uhtid >= IXGBE_MAX_LINK_HANDLE))
                return -EINVAL;
  
 -      loc = cls->knode.handle & 0xfffff;
 +      /* Clear this filter in the link data it is associated with */
 +      if (uhtid != 0x800) {
 +              jump = adapter->jump_tables[uhtid];
 +              if (!jump)
 +                      return -EINVAL;
 +              if (!test_bit(loc - 1, jump->child_loc_map))
 +                      return -EINVAL;
 +              clear_bit(loc - 1, jump->child_loc_map);
 +      }
 +
 +      /* Check if the filter being deleted is a link */
 +      for (i = 1; i < IXGBE_MAX_LINK_HANDLE; i++) {
 +              jump = adapter->jump_tables[i];
 +              if (jump && jump->link_hdl == hdl) {
 +                      /* Delete filters in the hardware in the child hash
 +                       * table associated with this link
 +                       */
 +                      for (j = 0; j < IXGBE_MAX_HW_ENTRIES; j++) {
 +                              if (!test_bit(j, jump->child_loc_map))
 +                                      continue;
 +                              spin_lock(&adapter->fdir_perfect_lock);
 +                              err = ixgbe_update_ethtool_fdir_entry(adapter,
 +                                                                    NULL,
 +                                                                    j + 1);
 +                              spin_unlock(&adapter->fdir_perfect_lock);
 +                              clear_bit(j, jump->child_loc_map);
 +                      }
 +                      /* Remove resources for this link */
 +                      kfree(jump->input);
 +                      kfree(jump->mask);
 +                      kfree(jump);
 +                      adapter->jump_tables[i] = NULL;
 +                      return err;
 +              }
 +      }
  
        spin_lock(&adapter->fdir_perfect_lock);
        err = ixgbe_update_ethtool_fdir_entry(adapter, NULL, loc);
@@@ -8541,18 -8549,6 +8541,18 @@@ static int ixgbe_configure_clsu32(struc
                if (!test_bit(link_uhtid - 1, &adapter->tables))
                        return err;
  
 +              /* Multiple filters as links to the same hash table are not
 +               * supported. To add a new filter with the same next header
 +               * but different match/jump conditions, create a new hash table
 +               * and link to it.
 +               */
 +              if (adapter->jump_tables[link_uhtid] &&
 +                  (adapter->jump_tables[link_uhtid])->link_hdl) {
 +                      e_err(drv, "Link filter exists for link: %x\n",
 +                            link_uhtid);
 +                      return err;
 +              }
 +
                for (i = 0; nexthdr[i].jump; i++) {
                        if (nexthdr[i].o != cls->knode.sel->offoff ||
                            nexthdr[i].s != cls->knode.sel->offshift ||
                        }
                        jump->input = input;
                        jump->mask = mask;
 +                      jump->link_hdl = cls->knode.handle;
 +
                        err = ixgbe_clsu32_build_input(input, mask, cls,
                                                       field_ptr, &nexthdr[i]);
                        if (!err) {
                if ((adapter->jump_tables[uhtid])->mask)
                        memcpy(mask, (adapter->jump_tables[uhtid])->mask,
                               sizeof(*mask));
 +
 +              /* Lookup in all child hash tables if this location is already
 +               * filled with a filter
 +               */
 +              for (i = 1; i < IXGBE_MAX_LINK_HANDLE; i++) {
 +                      struct ixgbe_jump_table *link = adapter->jump_tables[i];
 +
 +                      if (link && (test_bit(loc - 1, link->child_loc_map))) {
 +                              e_err(drv, "Filter exists in location: %x\n",
 +                                    loc);
 +                              err = -EINVAL;
 +                              goto err_out;
 +                      }
 +              }
        }
        err = ixgbe_clsu32_build_input(input, mask, cls, field_ptr, NULL);
        if (err)
                ixgbe_update_ethtool_fdir_entry(adapter, input, input->sw_idx);
        spin_unlock(&adapter->fdir_perfect_lock);
  
 +      if ((uhtid != 0x800) && (adapter->jump_tables[uhtid]))
 +              set_bit(loc - 1, (adapter->jump_tables[uhtid])->child_loc_map);
 +
        kfree(mask);
        return err;
  err_out_w_lock:
@@@ -8793,12 -8770,14 +8793,12 @@@ static int ixgbe_set_features(struct ne
  
        netdev->features = features;
  
 -#ifdef CONFIG_IXGBE_VXLAN
        if ((adapter->flags & IXGBE_FLAG_VXLAN_OFFLOAD_CAPABLE)) {
                if (features & NETIF_F_RXCSUM)
                        adapter->flags2 |= IXGBE_FLAG2_VXLAN_REREG_NEEDED;
                else
                        ixgbe_clear_vxlan_port(adapter);
        }
 -#endif /* CONFIG_IXGBE_VXLAN */
  
        if (need_reset)
                ixgbe_do_reset(netdev);
        return 0;
  }
  
 -#ifdef CONFIG_IXGBE_VXLAN
  /**
   * ixgbe_add_vxlan_port - Get notifications about VXLAN ports that come up
   * @dev: The port's netdev
 - * @sa_family: Socket Family that VXLAN is notifiying us about
 - * @port: New UDP port number that VXLAN started listening to
 + * @ti: Tunnel endpoint information
   **/
 -static void ixgbe_add_vxlan_port(struct net_device *dev, sa_family_t sa_family,
 -                               __be16 port)
 +static void ixgbe_add_vxlan_port(struct net_device *dev,
 +                               struct udp_tunnel_info *ti)
  {
        struct ixgbe_adapter *adapter = netdev_priv(dev);
        struct ixgbe_hw *hw = &adapter->hw;
 +      __be16 port = ti->port;
  
 -      if (!(adapter->flags & IXGBE_FLAG_VXLAN_OFFLOAD_CAPABLE))
 +      if (ti->type != UDP_TUNNEL_TYPE_VXLAN)
                return;
  
 -      if (sa_family == AF_INET6)
 +      if (ti->sa_family != AF_INET)
 +              return;
 +
 +      if (!(adapter->flags & IXGBE_FLAG_VXLAN_OFFLOAD_CAPABLE))
                return;
  
        if (adapter->vxlan_port == port)
  /**
   * ixgbe_del_vxlan_port - Get notifications about VXLAN ports that go away
   * @dev: The port's netdev
 - * @sa_family: Socket Family that VXLAN is notifying us about
 - * @port: UDP port number that VXLAN stopped listening to
 + * @ti: Tunnel endpoint information
   **/
 -static void ixgbe_del_vxlan_port(struct net_device *dev, sa_family_t sa_family,
 -                               __be16 port)
 +static void ixgbe_del_vxlan_port(struct net_device *dev,
 +                               struct udp_tunnel_info *ti)
  {
        struct ixgbe_adapter *adapter = netdev_priv(dev);
  
 -      if (!(adapter->flags & IXGBE_FLAG_VXLAN_OFFLOAD_CAPABLE))
 +      if (ti->type != UDP_TUNNEL_TYPE_VXLAN)
                return;
  
 -      if (sa_family == AF_INET6)
 +      if (ti->sa_family != AF_INET)
                return;
  
 -      if (adapter->vxlan_port != port) {
 +      if (!(adapter->flags & IXGBE_FLAG_VXLAN_OFFLOAD_CAPABLE))
 +              return;
 +
 +      if (adapter->vxlan_port != ti->port) {
                netdev_info(dev, "Port %d was not found, not deleting\n",
 -                          ntohs(port));
 +                          ntohs(ti->port));
                return;
        }
  
        ixgbe_clear_vxlan_port(adapter);
        adapter->flags2 |= IXGBE_FLAG2_VXLAN_REREG_NEEDED;
  }
 -#endif /* CONFIG_IXGBE_VXLAN */
  
  static int ixgbe_ndo_fdb_add(struct ndmsg *ndm, struct nlattr *tb[],
                             struct net_device *dev,
@@@ -9184,8 -9160,10 +9184,8 @@@ static const struct net_device_ops ixgb
        .ndo_bridge_getlink     = ixgbe_ndo_bridge_getlink,
        .ndo_dfwd_add_station   = ixgbe_fwd_add,
        .ndo_dfwd_del_station   = ixgbe_fwd_del,
 -#ifdef CONFIG_IXGBE_VXLAN
 -      .ndo_add_vxlan_port     = ixgbe_add_vxlan_port,
 -      .ndo_del_vxlan_port     = ixgbe_del_vxlan_port,
 -#endif /* CONFIG_IXGBE_VXLAN */
 +      .ndo_udp_tunnel_add     = ixgbe_add_vxlan_port,
 +      .ndo_udp_tunnel_del     = ixgbe_del_vxlan_port,
        .ndo_features_check     = ixgbe_features_check,
  };
  
@@@ -9353,8 -9331,7 +9353,7 @@@ static int ixgbe_probe(struct pci_dev *
                pci_using_dac = 0;
        }
  
-       err = pci_request_selected_regions(pdev, pci_select_bars(pdev,
-                                          IORESOURCE_MEM), ixgbe_driver_name);
+       err = pci_request_mem_regions(pdev, ixgbe_driver_name);
        if (err) {
                dev_err(&pdev->dev,
                        "pci_request_selected_regions failed 0x%x\n", err);
@@@ -9740,8 -9717,7 +9739,7 @@@ err_ioremap
        disable_dev = !test_and_set_bit(__IXGBE_DISABLED, &adapter->state);
        free_netdev(netdev);
  err_alloc_etherdev:
-       pci_release_selected_regions(pdev,
-                                    pci_select_bars(pdev, IORESOURCE_MEM));
+       pci_release_mem_regions(pdev);
  err_pci_reg:
  err_dma:
        if (!adapter || disable_dev)
@@@ -9808,8 -9784,7 +9806,7 @@@ static void ixgbe_remove(struct pci_de
  
  #endif
        iounmap(adapter->io_addr);
-       pci_release_selected_regions(pdev, pci_select_bars(pdev,
-                                    IORESOURCE_MEM));
+       pci_release_mem_regions(pdev);
  
        e_dev_info("complete\n");
  
@@@ -10073,7 -10048,6 +10070,7 @@@ static int __init ixgbe_init_module(voi
  
        ret = pci_register_driver(&ixgbe_driver);
        if (ret) {
 +              destroy_workqueue(ixgbe_wq);
                ixgbe_dbg_exit();
                return ret;
        }
diff --combined drivers/nvme/host/pci.c
index 4cb9b156cab7dfadefa3ab613b18e584b6aa6fbc,7e4d81208da77dafa1a949c6b2b645ea01ea767b..d7c33f9361aa0361d762d1da31368f03bdca3082
@@@ -310,11 -310,6 +310,11 @@@ static int nvme_init_iod(struct reques
        iod->npages = -1;
        iod->nents = 0;
        iod->length = size;
 +
 +      if (!(rq->cmd_flags & REQ_DONTPREP)) {
 +              rq->retries = 0;
 +              rq->cmd_flags |= REQ_DONTPREP;
 +      }
        return 0;
  }
  
@@@ -525,8 -520,8 +525,8 @@@ static int nvme_map_data(struct nvme_de
                        goto out_unmap;
        }
  
 -      cmnd->rw.prp1 = cpu_to_le64(sg_dma_address(iod->sg));
 -      cmnd->rw.prp2 = cpu_to_le64(iod->first_dma);
 +      cmnd->rw.dptr.prp1 = cpu_to_le64(sg_dma_address(iod->sg));
 +      cmnd->rw.dptr.prp2 = cpu_to_le64(iod->first_dma);
        if (blk_integrity_rq(req))
                cmnd->rw.metadata = cpu_to_le64(sg_dma_address(&iod->meta_sg));
        return BLK_MQ_RQ_QUEUE_OK;
@@@ -628,7 -623,6 +628,7 @@@ static void nvme_complete_rq(struct req
  
        if (unlikely(req->errors)) {
                if (nvme_req_needs_retry(req, req->errors)) {
 +                      req->retries++;
                        nvme_requeue_req(req);
                        return;
                }
@@@ -907,7 -901,7 +907,7 @@@ static enum blk_eh_timer_return nvme_ti
                 req->tag, nvmeq->qid);
  
        abort_req = nvme_alloc_request(dev->ctrl.admin_q, &cmd,
 -                      BLK_MQ_REQ_NOWAIT);
 +                      BLK_MQ_REQ_NOWAIT, NVME_QID_ANY);
        if (IS_ERR(abort_req)) {
                atomic_inc(&dev->ctrl.abort_limit);
                return BLK_EH_RESET_TIMER;
        return BLK_EH_RESET_TIMER;
  }
  
 -static void nvme_cancel_io(struct request *req, void *data, bool reserved)
 -{
 -      int status;
 -
 -      if (!blk_mq_request_started(req))
 -              return;
 -
 -      dev_dbg_ratelimited(((struct nvme_dev *) data)->ctrl.device,
 -                              "Cancelling I/O %d", req->tag);
 -
 -      status = NVME_SC_ABORT_REQ;
 -      if (blk_queue_dying(req->q))
 -              status |= NVME_SC_DNR;
 -      blk_mq_complete_request(req, status);
 -}
 -
  static void nvme_free_queue(struct nvme_queue *nvmeq)
  {
        dma_free_coherent(nvmeq->q_dmadev, CQ_SIZE(nvmeq->q_depth),
@@@ -1389,8 -1399,16 +1389,8 @@@ static int nvme_setup_io_queues(struct 
        if (result < 0)
                return result;
  
 -      /*
 -       * Degraded controllers might return an error when setting the queue
 -       * count.  We still want to be able to bring them online and offer
 -       * access to the admin queue, as that might be only way to fix them up.
 -       */
 -      if (result > 0) {
 -              dev_err(dev->ctrl.device,
 -                      "Could not set queue count (%d)\n", result);
 +      if (nr_io_queues == 0)
                return 0;
 -      }
  
        if (dev->cmb && NVME_CMB_SQS(dev->cmbsz)) {
                result = nvme_cmb_qdepth(dev, nr_io_queues,
@@@ -1518,7 -1536,7 +1518,7 @@@ static int nvme_delete_queue(struct nvm
        cmd.delete_queue.opcode = opcode;
        cmd.delete_queue.qid = cpu_to_le16(nvmeq->qid);
  
 -      req = nvme_alloc_request(q, &cmd, BLK_MQ_REQ_NOWAIT);
 +      req = nvme_alloc_request(q, &cmd, BLK_MQ_REQ_NOWAIT, NVME_QID_ANY);
        if (IS_ERR(req))
                return PTR_ERR(req);
  
@@@ -1661,14 -1679,9 +1661,9 @@@ static int nvme_pci_enable(struct nvme_
  
  static void nvme_dev_unmap(struct nvme_dev *dev)
  {
-       struct pci_dev *pdev = to_pci_dev(dev->dev);
-       int bars;
        if (dev->bar)
                iounmap(dev->bar);
-       bars = pci_select_bars(pdev, IORESOURCE_MEM);
-       pci_release_selected_regions(pdev, bars);
+       pci_release_mem_regions(to_pci_dev(dev->dev));
  }
  
  static void nvme_pci_disable(struct nvme_dev *dev)
@@@ -1709,8 -1722,8 +1704,8 @@@ static void nvme_dev_disable(struct nvm
        }
        nvme_pci_disable(dev);
  
 -      blk_mq_tagset_busy_iter(&dev->tagset, nvme_cancel_io, dev);
 -      blk_mq_tagset_busy_iter(&dev->admin_tagset, nvme_cancel_io, dev);
 +      blk_mq_tagset_busy_iter(&dev->tagset, nvme_cancel_request, &dev->ctrl);
 +      blk_mq_tagset_busy_iter(&dev->admin_tagset, nvme_cancel_request, &dev->ctrl);
        mutex_unlock(&dev->shutdown_lock);
  }
  
@@@ -1884,7 -1897,6 +1879,7 @@@ static int nvme_pci_reset_ctrl(struct n
  }
  
  static const struct nvme_ctrl_ops nvme_pci_ctrl_ops = {
 +      .name                   = "pcie",
        .module                 = THIS_MODULE,
        .reg_read32             = nvme_pci_reg_read32,
        .reg_write32            = nvme_pci_reg_write32,
  
  static int nvme_dev_map(struct nvme_dev *dev)
  {
-       int bars;
        struct pci_dev *pdev = to_pci_dev(dev->dev);
  
-       bars = pci_select_bars(pdev, IORESOURCE_MEM);
-       if (!bars)
-               return -ENODEV;
-       if (pci_request_selected_regions(pdev, bars, "nvme"))
+       if (pci_request_mem_regions(pdev, "nvme"))
                return -ENODEV;
  
        dev->bar = ioremap(pci_resource_start(pdev, 0), 8192);
  
         return 0;
    release:
-        pci_release_selected_regions(pdev, bars);
+        pci_release_mem_regions(pdev);
         return -ENODEV;
  }
  
@@@ -1923,7 -1931,7 +1914,7 @@@ static int nvme_probe(struct pci_dev *p
  
        node = dev_to_node(&pdev->dev);
        if (node == NUMA_NO_NODE)
 -              set_dev_node(&pdev->dev, 0);
 +              set_dev_node(&pdev->dev, first_memory_node);
  
        dev = kzalloc_node(sizeof(*dev), GFP_KERNEL, node);
        if (!dev)
@@@ -2020,24 -2028,6 +2011,24 @@@ static void nvme_remove(struct pci_dev 
        nvme_put_ctrl(&dev->ctrl);
  }
  
 +static int nvme_pci_sriov_configure(struct pci_dev *pdev, int numvfs)
 +{
 +      int ret = 0;
 +
 +      if (numvfs == 0) {
 +              if (pci_vfs_assigned(pdev)) {
 +                      dev_warn(&pdev->dev,
 +                              "Cannot disable SR-IOV VFs while assigned\n");
 +                      return -EPERM;
 +              }
 +              pci_disable_sriov(pdev);
 +              return 0;
 +      }
 +
 +      ret = pci_enable_sriov(pdev, numvfs);
 +      return ret ? ret : numvfs;
 +}
 +
  #ifdef CONFIG_PM_SLEEP
  static int nvme_suspend(struct device *dev)
  {
@@@ -2123,8 -2113,6 +2114,8 @@@ static const struct pci_device_id nvme_
                                NVME_QUIRK_DISCARD_ZEROES, },
        { PCI_VDEVICE(INTEL, 0x5845),   /* Qemu emulated controller */
                .driver_data = NVME_QUIRK_IDENTIFY_CNS, },
 +      { PCI_DEVICE(0x1c58, 0x0003),   /* HGST adapter */
 +              .driver_data = NVME_QUIRK_DELAY_BEFORE_CHK_RDY, },
        { PCI_DEVICE_CLASS(PCI_CLASS_STORAGE_EXPRESS, 0xffffff) },
        { PCI_DEVICE(PCI_VENDOR_ID_APPLE, 0x2001) },
        { 0, }
@@@ -2140,7 -2128,6 +2131,7 @@@ static struct pci_driver nvme_driver = 
        .driver         = {
                .pm     = &nvme_dev_pm_ops,
        },
 +      .sriov_configure = nvme_pci_sriov_configure,
        .err_handler    = &nvme_err_handler,
  };
  
diff --combined drivers/pci/pci.c
index badbddc683f006fc0510c6e609a01772fc0ba4f8,9a6bc77ce3aa9137c9327eba06eb48117403de0f..aab9d5115a5f65ab4e945e5a29c00c91745a13e3
@@@ -7,8 -7,10 +7,10 @@@
   *    Copyright 1997 -- 2000 Martin Mares <mj@ucw.cz>
   */
  
+ #include <linux/acpi.h>
  #include <linux/kernel.h>
  #include <linux/delay.h>
+ #include <linux/dmi.h>
  #include <linux/init.h>
  #include <linux/of.h>
  #include <linux/of_pci.h>
@@@ -25,7 -27,9 +27,9 @@@
  #include <linux/device.h>
  #include <linux/pm_runtime.h>
  #include <linux/pci_hotplug.h>
+ #include <linux/vmalloc.h>
  #include <asm/setup.h>
+ #include <asm/dma.h>
  #include <linux/aer.h>
  #include "pci.h"
  
@@@ -81,6 -85,9 +85,9 @@@ unsigned long pci_cardbus_mem_size = DE
  unsigned long pci_hotplug_io_size  = DEFAULT_HOTPLUG_IO_SIZE;
  unsigned long pci_hotplug_mem_size = DEFAULT_HOTPLUG_MEM_SIZE;
  
+ #define DEFAULT_HOTPLUG_BUS_SIZE      1
+ unsigned long pci_hotplug_bus_size = DEFAULT_HOTPLUG_BUS_SIZE;
  enum pcie_bus_config_types pcie_bus_config = PCIE_BUS_DEFAULT;
  
  /*
@@@ -101,6 -108,21 +108,21 @@@ unsigned int pcibios_max_latency = 255
  /* If set, the PCIe ARI capability will not be used. */
  static bool pcie_ari_disabled;
  
+ /* Disable bridge_d3 for all PCIe ports */
+ static bool pci_bridge_d3_disable;
+ /* Force bridge_d3 for all PCIe ports */
+ static bool pci_bridge_d3_force;
+ static int __init pcie_port_pm_setup(char *str)
+ {
+       if (!strcmp(str, "off"))
+               pci_bridge_d3_disable = true;
+       else if (!strcmp(str, "force"))
+               pci_bridge_d3_force = true;
+       return 1;
+ }
+ __setup("pcie_port_pm=", pcie_port_pm_setup);
  /**
   * pci_bus_max_busnr - returns maximum PCI bus number of given bus' children
   * @bus: pointer to PCI bus structure to search
@@@ -530,8 -552,8 +552,8 @@@ static const struct pci_platform_pm_op
  
  int pci_set_platform_pm(const struct pci_platform_pm_ops *ops)
  {
 -      if (!ops->is_manageable || !ops->set_state || !ops->choose_state
 -          || !ops->sleep_wake)
 +      if (!ops->is_manageable || !ops->set_state || !ops->choose_state ||
 +          !ops->sleep_wake || !ops->run_wake || !ops->need_resume)
                return -EINVAL;
        pci_platform_pm = ops;
        return 0;
@@@ -2155,6 -2177,164 +2177,164 @@@ void pci_config_pm_runtime_put(struct p
                pm_runtime_put_sync(parent);
  }
  
+ /**
+  * pci_bridge_d3_possible - Is it possible to put the bridge into D3
+  * @bridge: Bridge to check
+  *
+  * This function checks if it is possible to move the bridge to D3.
+  * Currently we only allow D3 for recent enough PCIe ports.
+  */
+ static bool pci_bridge_d3_possible(struct pci_dev *bridge)
+ {
+       unsigned int year;
+       if (!pci_is_pcie(bridge))
+               return false;
+       switch (pci_pcie_type(bridge)) {
+       case PCI_EXP_TYPE_ROOT_PORT:
+       case PCI_EXP_TYPE_UPSTREAM:
+       case PCI_EXP_TYPE_DOWNSTREAM:
+               if (pci_bridge_d3_disable)
+                       return false;
+               if (pci_bridge_d3_force)
+                       return true;
+               /*
+                * It should be safe to put PCIe ports from 2015 or newer
+                * to D3.
+                */
+               if (dmi_get_date(DMI_BIOS_DATE, &year, NULL, NULL) &&
+                   year >= 2015) {
+                       return true;
+               }
+               break;
+       }
+       return false;
+ }
+ static int pci_dev_check_d3cold(struct pci_dev *dev, void *data)
+ {
+       bool *d3cold_ok = data;
+       bool no_d3cold;
+       /*
+        * The device needs to be allowed to go D3cold and if it is wake
+        * capable to do so from D3cold.
+        */
+       no_d3cold = dev->no_d3cold || !dev->d3cold_allowed ||
+               (device_may_wakeup(&dev->dev) && !pci_pme_capable(dev, PCI_D3cold)) ||
+               !pci_power_manageable(dev);
+       *d3cold_ok = !no_d3cold;
+       return no_d3cold;
+ }
+ /*
+  * pci_bridge_d3_update - Update bridge D3 capabilities
+  * @dev: PCI device which is changed
+  * @remove: Is the device being removed
+  *
+  * Update upstream bridge PM capabilities accordingly depending on if the
+  * device PM configuration was changed or the device is being removed.  The
+  * change is also propagated upstream.
+  */
+ static void pci_bridge_d3_update(struct pci_dev *dev, bool remove)
+ {
+       struct pci_dev *bridge;
+       bool d3cold_ok = true;
+       bridge = pci_upstream_bridge(dev);
+       if (!bridge || !pci_bridge_d3_possible(bridge))
+               return;
+       pci_dev_get(bridge);
+       /*
+        * If the device is removed we do not care about its D3cold
+        * capabilities.
+        */
+       if (!remove)
+               pci_dev_check_d3cold(dev, &d3cold_ok);
+       if (d3cold_ok) {
+               /*
+                * We need to go through all children to find out if all of
+                * them can still go to D3cold.
+                */
+               pci_walk_bus(bridge->subordinate, pci_dev_check_d3cold,
+                            &d3cold_ok);
+       }
+       if (bridge->bridge_d3 != d3cold_ok) {
+               bridge->bridge_d3 = d3cold_ok;
+               /* Propagate change to upstream bridges */
+               pci_bridge_d3_update(bridge, false);
+       }
+       pci_dev_put(bridge);
+ }
+ /**
+  * pci_bridge_d3_device_changed - Update bridge D3 capabilities on change
+  * @dev: PCI device that was changed
+  *
+  * If a device is added or its PM configuration, such as is it allowed to
+  * enter D3cold, is changed this function updates upstream bridge PM
+  * capabilities accordingly.
+  */
+ void pci_bridge_d3_device_changed(struct pci_dev *dev)
+ {
+       pci_bridge_d3_update(dev, false);
+ }
+ /**
+  * pci_bridge_d3_device_removed - Update bridge D3 capabilities on remove
+  * @dev: PCI device being removed
+  *
+  * Function updates upstream bridge PM capabilities based on other devices
+  * still left on the bus.
+  */
+ void pci_bridge_d3_device_removed(struct pci_dev *dev)
+ {
+       pci_bridge_d3_update(dev, true);
+ }
+ /**
+  * pci_d3cold_enable - Enable D3cold for device
+  * @dev: PCI device to handle
+  *
+  * This function can be used in drivers to enable D3cold from the device
+  * they handle.  It also updates upstream PCI bridge PM capabilities
+  * accordingly.
+  */
+ void pci_d3cold_enable(struct pci_dev *dev)
+ {
+       if (dev->no_d3cold) {
+               dev->no_d3cold = false;
+               pci_bridge_d3_device_changed(dev);
+       }
+ }
+ EXPORT_SYMBOL_GPL(pci_d3cold_enable);
+ /**
+  * pci_d3cold_disable - Disable D3cold for device
+  * @dev: PCI device to handle
+  *
+  * This function can be used in drivers to disable D3cold from the device
+  * they handle.  It also updates upstream PCI bridge PM capabilities
+  * accordingly.
+  */
+ void pci_d3cold_disable(struct pci_dev *dev)
+ {
+       if (!dev->no_d3cold) {
+               dev->no_d3cold = true;
+               pci_bridge_d3_device_changed(dev);
+       }
+ }
+ EXPORT_SYMBOL_GPL(pci_d3cold_disable);
  /**
   * pci_pm_init - Initialize PM functions of given PCI device
   * @dev: PCI device to handle.
@@@ -2189,6 -2369,7 +2369,7 @@@ void pci_pm_init(struct pci_dev *dev
        dev->pm_cap = pm;
        dev->d3_delay = PCI_PM_D3_WAIT;
        dev->d3cold_delay = PCI_PM_D3COLD_WAIT;
+       dev->bridge_d3 = pci_bridge_d3_possible(dev);
        dev->d3cold_allowed = true;
  
        dev->d1_support = false;
@@@ -3165,6 -3346,23 +3346,23 @@@ int __weak pci_remap_iospace(const stru
  #endif
  }
  
+ /**
+  *    pci_unmap_iospace - Unmap the memory mapped I/O space
+  *    @res: resource to be unmapped
+  *
+  *    Unmap the CPU virtual address @res from virtual address space.
+  *    Only architectures that have memory mapped IO functions defined
+  *    (and the PCI_IOBASE value defined) should call this function.
+  */
+ void pci_unmap_iospace(struct resource *res)
+ {
+ #if defined(PCI_IOBASE) && defined(CONFIG_MMU)
+       unsigned long vaddr = (unsigned long)PCI_IOBASE + res->start;
+       unmap_kernel_range(vaddr, resource_size(res));
+ #endif
+ }
  static void __pci_set_master(struct pci_dev *dev, bool enable)
  {
        u16 old_cmd, cmd;
@@@ -4755,6 -4953,7 +4953,7 @@@ static DEFINE_SPINLOCK(resource_alignme
  static resource_size_t pci_specified_resource_alignment(struct pci_dev *dev)
  {
        int seg, bus, slot, func, align_order, count;
+       unsigned short vendor, device, subsystem_vendor, subsystem_device;
        resource_size_t align = 0;
        char *p;
  
                } else {
                        align_order = -1;
                }
-               if (sscanf(p, "%x:%x:%x.%x%n",
-                       &seg, &bus, &slot, &func, &count) != 4) {
-                       seg = 0;
-                       if (sscanf(p, "%x:%x.%x%n",
-                                       &bus, &slot, &func, &count) != 3) {
-                               /* Invalid format */
-                               printk(KERN_ERR "PCI: Can't parse resource_alignment parameter: %s\n",
-                                       p);
+               if (strncmp(p, "pci:", 4) == 0) {
+                       /* PCI vendor/device (subvendor/subdevice) ids are specified */
+                       p += 4;
+                       if (sscanf(p, "%hx:%hx:%hx:%hx%n",
+                               &vendor, &device, &subsystem_vendor, &subsystem_device, &count) != 4) {
+                               if (sscanf(p, "%hx:%hx%n", &vendor, &device, &count) != 2) {
+                                       printk(KERN_ERR "PCI: Can't parse resource_alignment parameter: pci:%s\n",
+                                               p);
+                                       break;
+                               }
+                               subsystem_vendor = subsystem_device = 0;
+                       }
+                       p += count;
+                       if ((!vendor || (vendor == dev->vendor)) &&
+                               (!device || (device == dev->device)) &&
+                               (!subsystem_vendor || (subsystem_vendor == dev->subsystem_vendor)) &&
+                               (!subsystem_device || (subsystem_device == dev->subsystem_device))) {
+                               if (align_order == -1)
+                                       align = PAGE_SIZE;
+                               else
+                                       align = 1 << align_order;
+                               /* Found */
                                break;
                        }
                }
-               p += count;
-               if (seg == pci_domain_nr(dev->bus) &&
-                       bus == dev->bus->number &&
-                       slot == PCI_SLOT(dev->devfn) &&
-                       func == PCI_FUNC(dev->devfn)) {
-                       if (align_order == -1)
-                               align = PAGE_SIZE;
-                       else
-                               align = 1 << align_order;
-                       /* Found */
-                       break;
+               else {
+                       if (sscanf(p, "%x:%x:%x.%x%n",
+                               &seg, &bus, &slot, &func, &count) != 4) {
+                               seg = 0;
+                               if (sscanf(p, "%x:%x.%x%n",
+                                               &bus, &slot, &func, &count) != 3) {
+                                       /* Invalid format */
+                                       printk(KERN_ERR "PCI: Can't parse resource_alignment parameter: %s\n",
+                                               p);
+                                       break;
+                               }
+                       }
+                       p += count;
+                       if (seg == pci_domain_nr(dev->bus) &&
+                               bus == dev->bus->number &&
+                               slot == PCI_SLOT(dev->devfn) &&
+                               func == PCI_FUNC(dev->devfn)) {
+                               if (align_order == -1)
+                                       align = PAGE_SIZE;
+                               else
+                                       align = 1 << align_order;
+                               /* Found */
+                               break;
+                       }
                }
                if (*p != ';' && *p != ',') {
                        /* End of param or invalid format */
@@@ -4897,7 -5123,7 +5123,7 @@@ static ssize_t pci_resource_alignment_s
        return pci_set_resource_alignment_param(buf, count);
  }
  
- BUS_ATTR(resource_alignment, 0644, pci_resource_alignment_show,
static BUS_ATTR(resource_alignment, 0644, pci_resource_alignment_show,
                                        pci_resource_alignment_store);
  
  static int __init pci_resource_alignment_sysfs_init(void)
@@@ -4923,7 -5149,7 +5149,7 @@@ int pci_get_new_domain_nr(void
  }
  
  #ifdef CONFIG_PCI_DOMAINS_GENERIC
void pci_bus_assign_domain_nr(struct pci_bus *bus, struct device *parent)
static int of_pci_bus_find_domain_nr(struct device *parent)
  {
        static int use_dt_domains = -1;
        int domain = -1;
                domain = -1;
        }
  
-       bus->domain_nr = domain;
+       return domain;
+ }
+ int pci_bus_find_domain_nr(struct pci_bus *bus, struct device *parent)
+ {
+       return acpi_disabled ? of_pci_bus_find_domain_nr(parent) :
+                              acpi_pci_bus_find_domain_nr(bus);
  }
  #endif
  #endif
@@@ -5021,6 -5253,11 +5253,11 @@@ static int __init pci_setup(char *str
                                pci_hotplug_io_size = memparse(str + 9, &str);
                        } else if (!strncmp(str, "hpmemsize=", 10)) {
                                pci_hotplug_mem_size = memparse(str + 10, &str);
+                       } else if (!strncmp(str, "hpbussize=", 10)) {
+                               pci_hotplug_bus_size =
+                                       simple_strtoul(str + 10, &str, 0);
+                               if (pci_hotplug_bus_size > 0xff)
+                                       pci_hotplug_bus_size = DEFAULT_HOTPLUG_BUS_SIZE;
                        } else if (!strncmp(str, "pcie_bus_tune_off", 17)) {
                                pcie_bus_config = PCIE_BUS_TUNE_OFF;
                        } else if (!strncmp(str, "pcie_bus_safe", 13)) {
diff --combined drivers/pci/setup-bus.c
index d678c46e5f03309a8b8babba4b9b1e7684a26f43,1d1a2c952c351e308cc2aefe7ffd4de82d528488..c74059e10a6de9d1afe89cea272c4146bc183e68
@@@ -695,16 -695,11 +695,16 @@@ static void __pci_setup_bridge(struct p
        pci_write_config_word(bridge, PCI_BRIDGE_CONTROL, bus->bridge_ctl);
  }
  
 +void __weak pcibios_setup_bridge(struct pci_bus *bus, unsigned long type)
 +{
 +}
 +
  void pci_setup_bridge(struct pci_bus *bus)
  {
        unsigned long type = IORESOURCE_IO | IORESOURCE_MEM |
                                  IORESOURCE_PREFETCH;
  
 +      pcibios_setup_bridge(bus, type);
        __pci_setup_bridge(bus, type);
  }
  
@@@ -1428,6 -1423,74 +1428,74 @@@ void pci_bus_assign_resources(const str
  }
  EXPORT_SYMBOL(pci_bus_assign_resources);
  
+ static void pci_claim_device_resources(struct pci_dev *dev)
+ {
+       int i;
+       for (i = 0; i < PCI_BRIDGE_RESOURCES; i++) {
+               struct resource *r = &dev->resource[i];
+               if (!r->flags || r->parent)
+                       continue;
+               pci_claim_resource(dev, i);
+       }
+ }
+ static void pci_claim_bridge_resources(struct pci_dev *dev)
+ {
+       int i;
+       for (i = PCI_BRIDGE_RESOURCES; i < PCI_NUM_RESOURCES; i++) {
+               struct resource *r = &dev->resource[i];
+               if (!r->flags || r->parent)
+                       continue;
+               pci_claim_bridge_resource(dev, i);
+       }
+ }
+ static void pci_bus_allocate_dev_resources(struct pci_bus *b)
+ {
+       struct pci_dev *dev;
+       struct pci_bus *child;
+       list_for_each_entry(dev, &b->devices, bus_list) {
+               pci_claim_device_resources(dev);
+               child = dev->subordinate;
+               if (child)
+                       pci_bus_allocate_dev_resources(child);
+       }
+ }
+ static void pci_bus_allocate_resources(struct pci_bus *b)
+ {
+       struct pci_bus *child;
+       /*
+        * Carry out a depth-first search on the PCI bus
+        * tree to allocate bridge apertures. Read the
+        * programmed bridge bases and recursively claim
+        * the respective bridge resources.
+        */
+       if (b->self) {
+               pci_read_bridge_bases(b);
+               pci_claim_bridge_resources(b->self);
+       }
+       list_for_each_entry(child, &b->children, node)
+               pci_bus_allocate_resources(child);
+ }
+ void pci_bus_claim_resources(struct pci_bus *b)
+ {
+       pci_bus_allocate_resources(b);
+       pci_bus_allocate_dev_resources(b);
+ }
+ EXPORT_SYMBOL(pci_bus_claim_resources);
  static void __pci_bridge_assign_resources(const struct pci_dev *bridge,
                                          struct list_head *add_head,
                                          struct list_head *fail_head)
index adf61b43eb70716f5b00d2c019fec6e4099376e1,3a0f3a4ee944fb2982e55d3416407030cea89400..734a0428ef0efb90aaef478a957ae9f34a5db30e
@@@ -52,7 -52,6 +52,7 @@@
  #include "lpfc_crtn.h"
  #include "lpfc_vport.h"
  #include "lpfc_version.h"
 +#include "lpfc_ids.h"
  
  char *_dump_buf_data;
  unsigned long _dump_buf_data_order;
@@@ -569,7 -568,7 +569,7 @@@ lpfc_config_port_post(struct lpfc_hba *
        phba->last_completion_time = jiffies;
        /* Set up error attention (ERATT) polling timer */
        mod_timer(&phba->eratt_poll,
 -                jiffies + msecs_to_jiffies(1000 * LPFC_ERATT_POLL_INTERVAL));
 +                jiffies + msecs_to_jiffies(1000 * phba->eratt_poll_interval));
  
        if (phba->hba_flag & LINK_DISABLED) {
                lpfc_printf_log(phba,
@@@ -1588,39 -1587,35 +1588,39 @@@ lpfc_sli4_port_sta_fn_reset(struct lpfc
        int rc;
        uint32_t intr_mode;
  
 -      /*
 -       * On error status condition, driver need to wait for port
 -       * ready before performing reset.
 -       */
 -      rc = lpfc_sli4_pdev_status_reg_wait(phba);
 -      if (!rc) {
 -              /* need reset: attempt for port recovery */
 -              if (en_rn_msg)
 -                      lpfc_printf_log(phba, KERN_ERR, LOG_INIT,
 -                                      "2887 Reset Needed: Attempting Port "
 -                                      "Recovery...\n");
 -              lpfc_offline_prep(phba, mbx_action);
 -              lpfc_offline(phba);
 -              /* release interrupt for possible resource change */
 -              lpfc_sli4_disable_intr(phba);
 -              lpfc_sli_brdrestart(phba);
 -              /* request and enable interrupt */
 -              intr_mode = lpfc_sli4_enable_intr(phba, phba->intr_mode);
 -              if (intr_mode == LPFC_INTR_ERROR) {
 -                      lpfc_printf_log(phba, KERN_ERR, LOG_INIT,
 -                                      "3175 Failed to enable interrupt\n");
 -                      return -EIO;
 -              } else {
 -                      phba->intr_mode = intr_mode;
 -              }
 -              rc = lpfc_online(phba);
 -              if (rc == 0)
 -                      lpfc_unblock_mgmt_io(phba);
 +      if (bf_get(lpfc_sli_intf_if_type, &phba->sli4_hba.sli_intf) ==
 +          LPFC_SLI_INTF_IF_TYPE_2) {
 +              /*
 +               * On error status condition, driver need to wait for port
 +               * ready before performing reset.
 +               */
 +              rc = lpfc_sli4_pdev_status_reg_wait(phba);
 +              if (rc)
 +                      return rc;
        }
 +
 +      /* need reset: attempt for port recovery */
 +      if (en_rn_msg)
 +              lpfc_printf_log(phba, KERN_ERR, LOG_INIT,
 +                              "2887 Reset Needed: Attempting Port "
 +                              "Recovery...\n");
 +      lpfc_offline_prep(phba, mbx_action);
 +      lpfc_offline(phba);
 +      /* release interrupt for possible resource change */
 +      lpfc_sli4_disable_intr(phba);
 +      lpfc_sli_brdrestart(phba);
 +      /* request and enable interrupt */
 +      intr_mode = lpfc_sli4_enable_intr(phba, phba->intr_mode);
 +      if (intr_mode == LPFC_INTR_ERROR) {
 +              lpfc_printf_log(phba, KERN_ERR, LOG_INIT,
 +                              "3175 Failed to enable interrupt\n");
 +              return -EIO;
 +      }
 +      phba->intr_mode = intr_mode;
 +      rc = lpfc_online(phba);
 +      if (rc == 0)
 +              lpfc_unblock_mgmt_io(phba);
 +
        return rc;
  }
  
@@@ -1641,11 -1636,10 +1641,11 @@@ lpfc_handle_eratt_s4(struct lpfc_hba *p
        struct lpfc_register portstat_reg = {0};
        uint32_t reg_err1, reg_err2;
        uint32_t uerrlo_reg, uemasklo_reg;
 -      uint32_t pci_rd_rc1, pci_rd_rc2;
 +      uint32_t smphr_port_status = 0, pci_rd_rc1, pci_rd_rc2;
        bool en_rn_msg = true;
        struct temp_event temp_event_data;
 -      int rc;
 +      struct lpfc_register portsmphr_reg;
 +      int rc, i;
  
        /* If the pci channel is offline, ignore possible errors, since
         * we cannot communicate with the pci card anyway.
        if (pci_channel_offline(phba->pcidev))
                return;
  
 +      memset(&portsmphr_reg, 0, sizeof(portsmphr_reg));
        if_type = bf_get(lpfc_sli_intf_if_type, &phba->sli4_hba.sli_intf);
        switch (if_type) {
        case LPFC_SLI_INTF_IF_TYPE_0:
                /* consider PCI bus read error as pci_channel_offline */
                if (pci_rd_rc1 == -EIO && pci_rd_rc2 == -EIO)
                        return;
 +              if (!(phba->hba_flag & HBA_RECOVERABLE_UE)) {
 +                      lpfc_sli4_offline_eratt(phba);
 +                      return;
 +              }
 +              lpfc_printf_log(phba, KERN_ERR, LOG_INIT,
 +                              "7623 Checking UE recoverable");
 +
 +              for (i = 0; i < phba->sli4_hba.ue_to_sr / 1000; i++) {
 +                      if (lpfc_readl(phba->sli4_hba.PSMPHRregaddr,
 +                                     &portsmphr_reg.word0))
 +                              continue;
 +
 +                      smphr_port_status = bf_get(lpfc_port_smphr_port_status,
 +                                                 &portsmphr_reg);
 +                      if ((smphr_port_status & LPFC_PORT_SEM_MASK) ==
 +                          LPFC_PORT_SEM_UE_RECOVERABLE)
 +                              break;
 +                      /*Sleep for 1Sec, before checking SEMAPHORE */
 +                      msleep(1000);
 +              }
 +
 +              lpfc_printf_log(phba, KERN_ERR, LOG_INIT,
 +                              "4827 smphr_port_status x%x : Waited %dSec",
 +                              smphr_port_status, i);
 +
 +              /* Recoverable UE, reset the HBA device */
 +              if ((smphr_port_status & LPFC_PORT_SEM_MASK) ==
 +                  LPFC_PORT_SEM_UE_RECOVERABLE) {
 +                      for (i = 0; i < 20; i++) {
 +                              msleep(1000);
 +                              if (!lpfc_readl(phba->sli4_hba.PSMPHRregaddr,
 +                                  &portsmphr_reg.word0) &&
 +                                  (LPFC_POST_STAGE_PORT_READY ==
 +                                   bf_get(lpfc_port_smphr_port_status,
 +                                   &portsmphr_reg))) {
 +                                      rc = lpfc_sli4_port_sta_fn_reset(phba,
 +                                              LPFC_MBX_NO_WAIT, en_rn_msg);
 +                                      if (rc == 0)
 +                                              return;
 +                                      lpfc_printf_log(phba,
 +                                              KERN_ERR, LOG_INIT,
 +                                              "4215 Failed to recover UE");
 +                                      break;
 +                              }
 +                      }
 +              }
 +              lpfc_printf_log(phba, KERN_ERR, LOG_INIT,
 +                              "7624 Firmware not ready: Failing UE recovery,"
 +                              " waited %dSec", i);
                lpfc_sli4_offline_eratt(phba);
                break;
  
                                "taking port offline Data: x%x x%x\n",
                                reg_err1, reg_err2);
  
 +                      phba->sfp_alarm |= LPFC_TRANSGRESSION_HIGH_TEMPERATURE;
                        temp_event_data.event_type = FC_REG_TEMPERATURE_EVENT;
                        temp_event_data.event_code = LPFC_CRIT_TEMP;
                        temp_event_data.data = 0xFFFFFFFF;
@@@ -4042,8 -3985,6 +4042,8 @@@ lpfc_sli4_async_fc_evt(struct lpfc_hba 
  {
        struct lpfc_dmabuf *mp;
        LPFC_MBOXQ_t *pmb;
 +      MAILBOX_t *mb;
 +      struct lpfc_mbx_read_top *la;
        int rc;
  
        if (bf_get(lpfc_trailer_type, acqe_fc) !=
        pmb->mbox_cmpl = lpfc_mbx_cmpl_read_topology;
        pmb->vport = phba->pport;
  
 +      if (phba->sli4_hba.link_state.status != LPFC_FC_LA_TYPE_LINK_UP) {
 +              /* Parse and translate status field */
 +              mb = &pmb->u.mb;
 +              mb->mbxStatus = lpfc_sli4_parse_latt_fault(phba,
 +                                                         (void *)acqe_fc);
 +
 +              /* Parse and translate link attention fields */
 +              la = (struct lpfc_mbx_read_top *)&pmb->u.mb.un.varReadTop;
 +              la->eventTag = acqe_fc->event_tag;
 +              bf_set(lpfc_mbx_read_top_att_type, la,
 +                     LPFC_FC_LA_TYPE_LINK_DOWN);
 +
 +              /* Invoke the mailbox command callback function */
 +              lpfc_mbx_cmpl_read_topology(phba, pmb);
 +
 +              return;
 +      }
 +
        rc = lpfc_sli_issue_mbox(phba, pmb, MBX_NOWAIT);
        if (rc == MBX_NOT_FINISHED)
                goto out_free_dmabuf;
@@@ -4184,7 -4107,6 +4184,7 @@@ lpfc_sli4_async_sli_evt(struct lpfc_hb
                                "3190 Over Temperature:%d Celsius- Port Name %c\n",
                                acqe_sli->event_data1, port_name);
  
 +              phba->sfp_warning |= LPFC_TRANSGRESSION_HIGH_TEMPERATURE;
                shost = lpfc_shost_from_vport(phba->pport);
                fc_host_post_vendor_event(shost, fc_get_event_number(),
                                          sizeof(temp_event_data),
@@@ -4486,8 -4408,7 +4486,8 @@@ lpfc_sli4_async_fip_evt(struct lpfc_hb
                 * the corresponding FCF bit in the roundrobin bitmap.
                 */
                spin_lock_irq(&phba->hbalock);
 -              if (phba->fcf.fcf_flag & FCF_DISCOVERY) {
 +              if ((phba->fcf.fcf_flag & FCF_DISCOVERY) &&
 +                  (phba->fcf.current_rec.fcf_indx != acqe_fip->index)) {
                        spin_unlock_irq(&phba->hbalock);
                        /* Update FLOGI FCF failover eligible FCF bmask */
                        lpfc_sli4_fcf_rr_index_clear(phba, acqe_fip->index);
@@@ -4854,20 -4775,17 +4854,17 @@@ static in
  lpfc_enable_pci_dev(struct lpfc_hba *phba)
  {
        struct pci_dev *pdev;
-       int bars = 0;
  
        /* Obtain PCI device reference */
        if (!phba->pcidev)
                goto out_error;
        else
                pdev = phba->pcidev;
-       /* Select PCI BARs */
-       bars = pci_select_bars(pdev, IORESOURCE_MEM);
        /* Enable PCI device */
        if (pci_enable_device_mem(pdev))
                goto out_error;
        /* Request PCI resource for the device */
-       if (pci_request_selected_regions(pdev, bars, LPFC_DRIVER_NAME))
+       if (pci_request_mem_regions(pdev, LPFC_DRIVER_NAME))
                goto out_disable_device;
        /* Set up device as PCI master and save state for EEH */
        pci_set_master(pdev);
@@@ -4884,7 -4802,7 +4881,7 @@@ out_disable_device
        pci_disable_device(pdev);
  out_error:
        lpfc_printf_log(phba, KERN_ERR, LOG_INIT,
-                       "1401 Failed to enable pci device, bars:x%x\n", bars);
+                       "1401 Failed to enable pci device\n");
        return -ENODEV;
  }
  
@@@ -4899,17 -4817,14 +4896,14 @@@ static voi
  lpfc_disable_pci_dev(struct lpfc_hba *phba)
  {
        struct pci_dev *pdev;
-       int bars;
  
        /* Obtain PCI device reference */
        if (!phba->pcidev)
                return;
        else
                pdev = phba->pcidev;
-       /* Select PCI BARs */
-       bars = pci_select_bars(pdev, IORESOURCE_MEM);
        /* Release PCI resource and disable PCI device */
-       pci_release_selected_regions(pdev, bars);
+       pci_release_mem_regions(pdev);
        pci_disable_device(pdev);
  
        return;
@@@ -5442,7 -5357,6 +5436,7 @@@ lpfc_sli4_driver_resource_setup(struct 
                        goto out_free_bsmbx;
                }
        }
 +
        /*
         * Get sli4 parameters that override parameters from Port capabilities.
         * If this call fails, it isn't critical unless the SLI4 parameters come
@@@ -6171,7 -6085,6 +6165,7 @@@ lpfc_hba_alloc(struct pci_dev *pdev
                kfree(phba);
                return NULL;
        }
 +      phba->eratt_poll_interval = LPFC_ERATT_POLL_INTERVAL;
  
        spin_lock_init(&phba->ct_ev_lock);
        INIT_LIST_HEAD(&phba->ct_ev_waiters);
@@@ -9608,14 -9521,6 +9602,14 @@@ lpfc_get_sli4_parameters(struct lpfc_hb
                phba->fcp_embed_io = 1;
        else
                phba->fcp_embed_io = 0;
 +
 +      /*
 +       * Check if the SLI port supports MDS Diagnostics
 +       */
 +      if (bf_get(cfg_mds_diags, mbx_sli4_parameters))
 +              phba->mds_diags_support = 1;
 +      else
 +              phba->mds_diags_support = 0;
        return 0;
  }
  
@@@ -9811,7 -9716,6 +9805,6 @@@ lpfc_pci_remove_one_s3(struct pci_dev *
        struct lpfc_vport **vports;
        struct lpfc_hba   *phba = vport->phba;
        int i;
-       int bars = pci_select_bars(pdev, IORESOURCE_MEM);
  
        spin_lock_irq(&phba->hbalock);
        vport->load_flag |= FC_UNLOADING;
  
        lpfc_hba_free(phba);
  
-       pci_release_selected_regions(pdev, bars);
+       pci_release_mem_regions(pdev);
        pci_disable_device(pdev);
  }
  
@@@ -11387,6 -11291,106 +11380,6 @@@ lpfc_fof_queue_destroy(struct lpfc_hba 
        return 0;
  }
  
 -static struct pci_device_id lpfc_id_table[] = {
 -      {PCI_VENDOR_ID_EMULEX, PCI_DEVICE_ID_VIPER,
 -              PCI_ANY_ID, PCI_ANY_ID, },
 -      {PCI_VENDOR_ID_EMULEX, PCI_DEVICE_ID_FIREFLY,
 -              PCI_ANY_ID, PCI_ANY_ID, },
 -      {PCI_VENDOR_ID_EMULEX, PCI_DEVICE_ID_THOR,
 -              PCI_ANY_ID, PCI_ANY_ID, },
 -      {PCI_VENDOR_ID_EMULEX, PCI_DEVICE_ID_PEGASUS,
 -              PCI_ANY_ID, PCI_ANY_ID, },
 -      {PCI_VENDOR_ID_EMULEX, PCI_DEVICE_ID_CENTAUR,
 -              PCI_ANY_ID, PCI_ANY_ID, },
 -      {PCI_VENDOR_ID_EMULEX, PCI_DEVICE_ID_DRAGONFLY,
 -              PCI_ANY_ID, PCI_ANY_ID, },
 -      {PCI_VENDOR_ID_EMULEX, PCI_DEVICE_ID_SUPERFLY,
 -              PCI_ANY_ID, PCI_ANY_ID, },
 -      {PCI_VENDOR_ID_EMULEX, PCI_DEVICE_ID_RFLY,
 -              PCI_ANY_ID, PCI_ANY_ID, },
 -      {PCI_VENDOR_ID_EMULEX, PCI_DEVICE_ID_PFLY,
 -              PCI_ANY_ID, PCI_ANY_ID, },
 -      {PCI_VENDOR_ID_EMULEX, PCI_DEVICE_ID_NEPTUNE,
 -              PCI_ANY_ID, PCI_ANY_ID, },
 -      {PCI_VENDOR_ID_EMULEX, PCI_DEVICE_ID_NEPTUNE_SCSP,
 -              PCI_ANY_ID, PCI_ANY_ID, },
 -      {PCI_VENDOR_ID_EMULEX, PCI_DEVICE_ID_NEPTUNE_DCSP,
 -              PCI_ANY_ID, PCI_ANY_ID, },
 -      {PCI_VENDOR_ID_EMULEX, PCI_DEVICE_ID_HELIOS,
 -              PCI_ANY_ID, PCI_ANY_ID, },
 -      {PCI_VENDOR_ID_EMULEX, PCI_DEVICE_ID_HELIOS_SCSP,
 -              PCI_ANY_ID, PCI_ANY_ID, },
 -      {PCI_VENDOR_ID_EMULEX, PCI_DEVICE_ID_HELIOS_DCSP,
 -              PCI_ANY_ID, PCI_ANY_ID, },
 -      {PCI_VENDOR_ID_EMULEX, PCI_DEVICE_ID_BMID,
 -              PCI_ANY_ID, PCI_ANY_ID, },
 -      {PCI_VENDOR_ID_EMULEX, PCI_DEVICE_ID_BSMB,
 -              PCI_ANY_ID, PCI_ANY_ID, },
 -      {PCI_VENDOR_ID_EMULEX, PCI_DEVICE_ID_ZEPHYR,
 -              PCI_ANY_ID, PCI_ANY_ID, },
 -      {PCI_VENDOR_ID_EMULEX, PCI_DEVICE_ID_HORNET,
 -              PCI_ANY_ID, PCI_ANY_ID, },
 -      {PCI_VENDOR_ID_EMULEX, PCI_DEVICE_ID_ZEPHYR_SCSP,
 -              PCI_ANY_ID, PCI_ANY_ID, },
 -      {PCI_VENDOR_ID_EMULEX, PCI_DEVICE_ID_ZEPHYR_DCSP,
 -              PCI_ANY_ID, PCI_ANY_ID, },
 -      {PCI_VENDOR_ID_EMULEX, PCI_DEVICE_ID_ZMID,
 -              PCI_ANY_ID, PCI_ANY_ID, },
 -      {PCI_VENDOR_ID_EMULEX, PCI_DEVICE_ID_ZSMB,
 -              PCI_ANY_ID, PCI_ANY_ID, },
 -      {PCI_VENDOR_ID_EMULEX, PCI_DEVICE_ID_TFLY,
 -              PCI_ANY_ID, PCI_ANY_ID, },
 -      {PCI_VENDOR_ID_EMULEX, PCI_DEVICE_ID_LP101,
 -              PCI_ANY_ID, PCI_ANY_ID, },
 -      {PCI_VENDOR_ID_EMULEX, PCI_DEVICE_ID_LP10000S,
 -              PCI_ANY_ID, PCI_ANY_ID, },
 -      {PCI_VENDOR_ID_EMULEX, PCI_DEVICE_ID_LP11000S,
 -              PCI_ANY_ID, PCI_ANY_ID, },
 -      {PCI_VENDOR_ID_EMULEX, PCI_DEVICE_ID_LPE11000S,
 -              PCI_ANY_ID, PCI_ANY_ID, },
 -      {PCI_VENDOR_ID_EMULEX, PCI_DEVICE_ID_SAT,
 -              PCI_ANY_ID, PCI_ANY_ID, },
 -      {PCI_VENDOR_ID_EMULEX, PCI_DEVICE_ID_SAT_MID,
 -              PCI_ANY_ID, PCI_ANY_ID, },
 -      {PCI_VENDOR_ID_EMULEX, PCI_DEVICE_ID_SAT_SMB,
 -              PCI_ANY_ID, PCI_ANY_ID, },
 -      {PCI_VENDOR_ID_EMULEX, PCI_DEVICE_ID_SAT_DCSP,
 -              PCI_ANY_ID, PCI_ANY_ID, },
 -      {PCI_VENDOR_ID_EMULEX, PCI_DEVICE_ID_SAT_SCSP,
 -              PCI_ANY_ID, PCI_ANY_ID, },
 -      {PCI_VENDOR_ID_EMULEX, PCI_DEVICE_ID_SAT_S,
 -              PCI_ANY_ID, PCI_ANY_ID, },
 -      {PCI_VENDOR_ID_EMULEX, PCI_DEVICE_ID_PROTEUS_VF,
 -              PCI_ANY_ID, PCI_ANY_ID, },
 -      {PCI_VENDOR_ID_EMULEX, PCI_DEVICE_ID_PROTEUS_PF,
 -              PCI_ANY_ID, PCI_ANY_ID, },
 -      {PCI_VENDOR_ID_EMULEX, PCI_DEVICE_ID_PROTEUS_S,
 -              PCI_ANY_ID, PCI_ANY_ID, },
 -      {PCI_VENDOR_ID_SERVERENGINE, PCI_DEVICE_ID_TIGERSHARK,
 -              PCI_ANY_ID, PCI_ANY_ID, },
 -      {PCI_VENDOR_ID_SERVERENGINE, PCI_DEVICE_ID_TOMCAT,
 -              PCI_ANY_ID, PCI_ANY_ID, },
 -      {PCI_VENDOR_ID_EMULEX, PCI_DEVICE_ID_FALCON,
 -              PCI_ANY_ID, PCI_ANY_ID, },
 -      {PCI_VENDOR_ID_EMULEX, PCI_DEVICE_ID_BALIUS,
 -              PCI_ANY_ID, PCI_ANY_ID, },
 -      {PCI_VENDOR_ID_EMULEX, PCI_DEVICE_ID_LANCER_FC,
 -              PCI_ANY_ID, PCI_ANY_ID, },
 -      {PCI_VENDOR_ID_EMULEX, PCI_DEVICE_ID_LANCER_FCOE,
 -              PCI_ANY_ID, PCI_ANY_ID, },
 -      {PCI_VENDOR_ID_EMULEX, PCI_DEVICE_ID_LANCER_FC_VF,
 -              PCI_ANY_ID, PCI_ANY_ID, },
 -      {PCI_VENDOR_ID_EMULEX, PCI_DEVICE_ID_LANCER_FCOE_VF,
 -              PCI_ANY_ID, PCI_ANY_ID, },
 -      {PCI_VENDOR_ID_EMULEX, PCI_DEVICE_ID_LANCER_G6_FC,
 -              PCI_ANY_ID, PCI_ANY_ID, },
 -      {PCI_VENDOR_ID_EMULEX, PCI_DEVICE_ID_SKYHAWK,
 -              PCI_ANY_ID, PCI_ANY_ID, },
 -      {PCI_VENDOR_ID_EMULEX, PCI_DEVICE_ID_SKYHAWK_VF,
 -              PCI_ANY_ID, PCI_ANY_ID, },
 -      { 0 }
 -};
 -
  MODULE_DEVICE_TABLE(pci, lpfc_id_table);
  
  static const struct pci_error_handlers lpfc_err_handler = {
@@@ -11441,17 -11445,21 +11434,17 @@@ lpfc_init(void
                printk(KERN_ERR "Could not register lpfcmgmt device, "
                        "misc_register returned with status %d", error);
  
 -      if (lpfc_enable_npiv) {
 -              lpfc_transport_functions.vport_create = lpfc_vport_create;
 -              lpfc_transport_functions.vport_delete = lpfc_vport_delete;
 -      }
 +      lpfc_transport_functions.vport_create = lpfc_vport_create;
 +      lpfc_transport_functions.vport_delete = lpfc_vport_delete;
        lpfc_transport_template =
                                fc_attach_transport(&lpfc_transport_functions);
        if (lpfc_transport_template == NULL)
                return -ENOMEM;
 -      if (lpfc_enable_npiv) {
 -              lpfc_vport_transport_template =
 -                      fc_attach_transport(&lpfc_vport_transport_functions);
 -              if (lpfc_vport_transport_template == NULL) {
 -                      fc_release_transport(lpfc_transport_template);
 -                      return -ENOMEM;
 -              }
 +      lpfc_vport_transport_template =
 +              fc_attach_transport(&lpfc_vport_transport_functions);
 +      if (lpfc_vport_transport_template == NULL) {
 +              fc_release_transport(lpfc_transport_template);
 +              return -ENOMEM;
        }
  
        /* Initialize in case vector mapping is needed */
        error = pci_register_driver(&lpfc_driver);
        if (error) {
                fc_release_transport(lpfc_transport_template);
 -              if (lpfc_enable_npiv)
 -                      fc_release_transport(lpfc_vport_transport_template);
 +              fc_release_transport(lpfc_vport_transport_template);
        }
  
        return error;
@@@ -11482,7 -11491,8 +11475,7 @@@ lpfc_exit(void
        misc_deregister(&lpfc_mgmt_dev);
        pci_unregister_driver(&lpfc_driver);
        fc_release_transport(lpfc_transport_template);
 -      if (lpfc_enable_npiv)
 -              fc_release_transport(lpfc_vport_transport_template);
 +      fc_release_transport(lpfc_vport_transport_template);
        if (_dump_buf_data) {
                printk(KERN_ERR "9062 BLKGRD: freeing %lu pages for "
                                "_dump_buf_data at 0x%p\n",
diff --combined include/linux/pci.h
index c40ac910cce4a9b51c81f0c21a613044d28c0309,98909063a70ce5223e6741e63c98c265dd38798c..2599a980340f44f2550bacded406cb34f38808dc
@@@ -101,6 -101,10 +101,10 @@@ enum 
        DEVICE_COUNT_RESOURCE = PCI_NUM_RESOURCES,
  };
  
+ /*
+  * pci_power_t values must match the bits in the Capabilities PME_Support
+  * and Control/Status PowerState fields in the Power Management capability.
+  */
  typedef int __bitwise pci_power_t;
  
  #define PCI_D0                ((pci_power_t __force) 0)
@@@ -116,7 -120,7 +120,7 @@@ extern const char *pci_power_names[]
  
  static inline const char *pci_power_name(pci_power_t state)
  {
-       return pci_power_names[1 + (int) state];
+       return pci_power_names[1 + (__force int) state];
  }
  
  #define PCI_PM_D2_DELAY               200
@@@ -294,6 -298,7 +298,7 @@@ struct pci_dev 
        unsigned int    d2_support:1;   /* Low power state D2 is supported */
        unsigned int    no_d1d2:1;      /* D1 and D2 are forbidden */
        unsigned int    no_d3cold:1;    /* D3cold is forbidden */
+       unsigned int    bridge_d3:1;    /* Allow D3 for bridge */
        unsigned int    d3cold_allowed:1;       /* D3cold is allowed by user */
        unsigned int    mmio_always_on:1;       /* disallow turning off io/mem
                                                   decoding during bar sizing */
         * directly, use the values stored here. They might be different!
         */
        unsigned int    irq;
+       struct cpumask  *irq_affinity;
        struct resource resource[DEVICE_COUNT_RESOURCE]; /* I/O and memory regions + expansion ROMs */
  
        bool match_driver;              /* Skip attaching driver */
@@@ -854,7 -860,6 +860,7 @@@ void pci_stop_and_remove_bus_device_loc
  void pci_stop_root_bus(struct pci_bus *bus);
  void pci_remove_root_bus(struct pci_bus *bus);
  void pci_setup_cardbus(struct pci_bus *bus);
 +void pcibios_setup_bridge(struct pci_bus *bus, unsigned long type);
  void pci_sort_breadthfirst(void);
  #define dev_is_pci(d) ((d)->bus == &pci_bus_type)
  #define dev_is_pf(d) ((dev_is_pci(d) ? to_pci_dev(d)->is_physfn : false))
@@@ -1084,6 -1089,8 +1090,8 @@@ int pci_back_from_sleep(struct pci_dev 
  bool pci_dev_run_wake(struct pci_dev *dev);
  bool pci_check_pme_status(struct pci_dev *dev);
  void pci_pme_wakeup_bus(struct pci_bus *bus);
+ void pci_d3cold_enable(struct pci_dev *dev);
+ void pci_d3cold_disable(struct pci_dev *dev);
  
  static inline int pci_enable_wake(struct pci_dev *dev, pci_power_t state,
                                  bool enable)
@@@ -1115,6 -1122,7 +1123,7 @@@ int pci_set_vpd_size(struct pci_dev *de
  /* Helper functions for low-level code (drivers/pci/setup-[bus,res].c) */
  resource_size_t pcibios_retrieve_fw_addr(struct pci_dev *dev, int idx);
  void pci_bus_assign_resources(const struct pci_bus *bus);
+ void pci_bus_claim_resources(struct pci_bus *bus);
  void pci_bus_size_bridges(struct pci_bus *bus);
  int pci_claim_resource(struct pci_dev *, int);
  int pci_claim_bridge_resource(struct pci_dev *bridge, int i);
@@@ -1144,9 -1152,12 +1153,12 @@@ void pci_add_resource(struct list_head 
  void pci_add_resource_offset(struct list_head *resources, struct resource *res,
                             resource_size_t offset);
  void pci_free_resource_list(struct list_head *resources);
- void pci_bus_add_resource(struct pci_bus *bus, struct resource *res, unsigned int flags);
+ void pci_bus_add_resource(struct pci_bus *bus, struct resource *res,
+                         unsigned int flags);
  struct resource *pci_bus_resource_n(const struct pci_bus *bus, int n);
  void pci_bus_remove_resources(struct pci_bus *bus);
+ int devm_request_pci_bus_resources(struct device *dev,
+                                  struct list_head *resources);
  
  #define pci_bus_for_each_resource(bus, res, i)                                \
        for (i = 0;                                                     \
@@@ -1168,6 -1179,7 +1180,7 @@@ int pci_register_io_range(phys_addr_t a
  unsigned long pci_address_to_pio(phys_addr_t addr);
  phys_addr_t pci_pio_to_address(unsigned long pio);
  int pci_remap_iospace(const struct resource *res, phys_addr_t phys_addr);
+ void pci_unmap_iospace(struct resource *res);
  
  static inline pci_bus_addr_t pci_bus_address(struct pci_dev *pdev, int bar)
  {
@@@ -1238,6 -1250,11 +1251,11 @@@ resource_size_t pcibios_iov_resource_al
  int pci_set_vga_state(struct pci_dev *pdev, bool decode,
                      unsigned int command_bits, u32 flags);
  
+ #define PCI_IRQ_NOLEGACY      (1 << 0) /* don't use legacy interrupts */
+ #define PCI_IRQ_NOMSI         (1 << 1) /* don't use MSI interrupts */
+ #define PCI_IRQ_NOMSIX                (1 << 2) /* don't use MSI-X interrupts */
+ #define PCI_IRQ_NOAFFINITY    (1 << 3) /* don't auto-assign affinity */
  /* kmem_cache style wrapper around pci_alloc_consistent() */
  
  #include <linux/pci-dma.h>
@@@ -1285,6 -1302,11 +1303,11 @@@ static inline int pci_enable_msix_exact
                return rc;
        return 0;
  }
+ int pci_alloc_irq_vectors(struct pci_dev *dev, unsigned int min_vecs,
+               unsigned int max_vecs, unsigned int flags);
+ void pci_free_irq_vectors(struct pci_dev *dev);
+ int pci_irq_vector(struct pci_dev *dev, unsigned int nr);
  #else
  static inline int pci_msi_vec_count(struct pci_dev *dev) { return -ENOSYS; }
  static inline void pci_msi_shutdown(struct pci_dev *dev) { }
@@@ -1308,6 -1330,24 +1331,24 @@@ static inline int pci_enable_msix_range
  static inline int pci_enable_msix_exact(struct pci_dev *dev,
                      struct msix_entry *entries, int nvec)
  { return -ENOSYS; }
+ static inline int pci_alloc_irq_vectors(struct pci_dev *dev,
+               unsigned int min_vecs, unsigned int max_vecs,
+               unsigned int flags)
+ {
+       if (min_vecs > 1)
+               return -EINVAL;
+       return 1;
+ }
+ static inline void pci_free_irq_vectors(struct pci_dev *dev)
+ {
+ }
+ static inline int pci_irq_vector(struct pci_dev *dev, unsigned int nr)
+ {
+       if (WARN_ON_ONCE(nr > 0))
+               return -EINVAL;
+       return dev->irq;
+ }
  #endif
  
  #ifdef CONFIG_PCIEPORTBUS
@@@ -1390,12 -1430,13 +1431,13 @@@ static inline int pci_domain_nr(struct 
  {
        return bus->domain_nr;
  }
- void pci_bus_assign_domain_nr(struct pci_bus *bus, struct device *parent);
+ #ifdef CONFIG_ACPI
+ int acpi_pci_bus_find_domain_nr(struct pci_bus *bus);
  #else
- static inline void pci_bus_assign_domain_nr(struct pci_bus *bus,
-                                       struct device *parent)
- {
- }
+ static inline int acpi_pci_bus_find_domain_nr(struct pci_bus *bus)
+ { return 0; }
+ #endif
+ int pci_bus_find_domain_nr(struct pci_bus *bus, struct device *parent);
  #endif
  
  /* some architectures require additional setup to direct VGA traffic */
@@@ -1403,6 -1444,34 +1445,34 @@@ typedef int (*arch_set_vga_state_t)(str
                      unsigned int command_bits, u32 flags);
  void pci_register_set_vga_state(arch_set_vga_state_t func);
  
+ static inline int
+ pci_request_io_regions(struct pci_dev *pdev, const char *name)
+ {
+       return pci_request_selected_regions(pdev,
+                           pci_select_bars(pdev, IORESOURCE_IO), name);
+ }
+ static inline void
+ pci_release_io_regions(struct pci_dev *pdev)
+ {
+       return pci_release_selected_regions(pdev,
+                           pci_select_bars(pdev, IORESOURCE_IO));
+ }
+ static inline int
+ pci_request_mem_regions(struct pci_dev *pdev, const char *name)
+ {
+       return pci_request_selected_regions(pdev,
+                           pci_select_bars(pdev, IORESOURCE_MEM), name);
+ }
+ static inline void
+ pci_release_mem_regions(struct pci_dev *pdev)
+ {
+       return pci_release_selected_regions(pdev,
+                           pci_select_bars(pdev, IORESOURCE_MEM));
+ }
  #else /* CONFIG_PCI is not enabled */
  
  static inline void pci_set_flags(int flags) { }
@@@ -1555,7 -1624,11 +1625,11 @@@ static inline const char *pci_name(cons
  /* Some archs don't want to expose struct resource to userland as-is
   * in sysfs and /proc
   */
- #ifndef HAVE_ARCH_PCI_RESOURCE_TO_USER
+ #ifdef HAVE_ARCH_PCI_RESOURCE_TO_USER
+ void pci_resource_to_user(const struct pci_dev *dev, int bar,
+                         const struct resource *rsrc,
+                         resource_size_t *start, resource_size_t *end);
+ #else
  static inline void pci_resource_to_user(const struct pci_dev *dev, int bar,
                const struct resource *rsrc, resource_size_t *start,
                resource_size_t *end)
@@@ -1707,6 -1780,7 +1781,7 @@@ extern u8 pci_cache_line_size
  
  extern unsigned long pci_hotplug_io_size;
  extern unsigned long pci_hotplug_mem_size;
+ extern unsigned long pci_hotplug_bus_size;
  
  /* Architecture-specific versions may override these (weak) */
  void pcibios_disable_device(struct pci_dev *dev);
@@@ -1723,7 -1797,7 +1798,7 @@@ void pcibios_free_irq(struct pci_dev *d
  extern struct dev_pm_ops pcibios_pm_ops;
  #endif
  
- #ifdef CONFIG_PCI_MMCONFIG
+ #if defined(CONFIG_PCI_MMCONFIG) || defined(CONFIG_ACPI_MCFG)
  void __init pci_mmcfg_early_init(void);
  void __init pci_mmcfg_late_init(void);
  #else
This page took 0.124482 seconds and 5 git commands to generate.