Merge tag 'pci-v5.4-changes' of git://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci
authorLinus Torvalds <torvalds@linux-foundation.org>
Tue, 24 Sep 2019 02:16:01 +0000 (19:16 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Tue, 24 Sep 2019 02:16:01 +0000 (19:16 -0700)
Pull PCI updates from Bjorn Helgaas:
 "Enumeration:

   - Consolidate _HPP/_HPX stuff in pci-acpi.c and simplify it
     (Krzysztof Wilczynski)

   - Fix incorrect PCIe device types and remove dev->has_secondary_link
     to simplify code that deals with upstream/downstream ports (Mika
     Westerberg)

   - After suspend, restore Resizable BAR size bits correctly for 1MB
     BARs (Sumit Saxena)

   - Enable PCI_MSI_IRQ_DOMAIN support for RISC-V (Wesley Terpstra)

  Virtualization:

   - Add ACS quirks for iProc PAXB (Abhinav Ratna), Amazon Annapurna
     Labs (Ali Saidi)

   - Move sysfs SR-IOV functions to iov.c (Kelsey Skunberg)

   - Remove group write permissions from sysfs sriov_numvfs,
     sriov_drivers_autoprobe (Kelsey Skunberg)

  Hotplug:

   - Simplify pciehp indicator control (Denis Efremov)

  Peer-to-peer DMA:

   - Allow P2P DMA between root ports for whitelisted bridges (Logan
     Gunthorpe)

   - Whitelist some Intel host bridges for P2P DMA (Logan Gunthorpe)

   - DMA map P2P DMA requests that traverse host bridge (Logan
     Gunthorpe)

  Amazon Annapurna Labs host bridge driver:

   - Add DT binding and controller driver (Jonathan Chocron)

  Hyper-V host bridge driver:

   - Fix hv_pci_dev->pci_slot use-after-free (Dexuan Cui)

   - Fix PCI domain number collisions (Haiyang Zhang)

   - Use instance ID bytes 4 & 5 as PCI domain numbers (Haiyang Zhang)

   - Fix build errors on non-SYSFS config (Randy Dunlap)

  i.MX6 host bridge driver:

   - Limit DBI register length (Stefan Agner)

  Intel VMD host bridge driver:

   - Fix config addressing issues (Jon Derrick)

  Layerscape host bridge driver:

   - Add bar_fixed_64bit property to endpoint driver (Xiaowei Bao)

   - Add CONFIG_PCI_LAYERSCAPE_EP to build EP/RC drivers separately
     (Xiaowei Bao)

  Mediatek host bridge driver:

   - Add MT7629 controller support (Jianjun Wang)

  Mobiveil host bridge driver:

   - Fix CPU base address setup (Hou Zhiqiang)

   - Make "num-lanes" property optional (Hou Zhiqiang)

  Tegra host bridge driver:

   - Fix OF node reference leak (Nishka Dasgupta)

   - Disable MSI for root ports to work around design problem (Vidya
     Sagar)

   - Add Tegra194 DT binding and controller support (Vidya Sagar)

   - Add support for sideband pins and slot regulators (Vidya Sagar)

   - Add PIPE2UPHY support (Vidya Sagar)

  Misc:

   - Remove unused pci_block_cfg_access() et al (Kelsey Skunberg)

   - Unexport pci_bus_get(), etc (Kelsey Skunberg)

   - Hide PM, VC, link speed, ATS, ECRC, PTM constants and interfaces in
     the PCI core (Kelsey Skunberg)

   - Clean up sysfs DEVICE_ATTR() usage (Kelsey Skunberg)

   - Mark expected switch fall-through (Gustavo A. R. Silva)

   - Propagate errors for optional regulators and PHYs (Thierry Reding)

   - Fix kernel command line resource_alignment parameter issues (Logan
     Gunthorpe)"

* tag 'pci-v5.4-changes' of git://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci: (112 commits)
  PCI: Add pci_irq_vector() and other stubs when !CONFIG_PCI
  arm64: tegra: Add PCIe slot supply information in p2972-0000 platform
  arm64: tegra: Add configuration for PCIe C5 sideband signals
  PCI: tegra: Add support to enable slot regulators
  PCI: tegra: Add support to configure sideband pins
  PCI: vmd: Fix shadow offsets to reflect spec changes
  PCI: vmd: Fix config addressing when using bus offsets
  PCI: dwc: Add validation that PCIe core is set to correct mode
  PCI: dwc: al: Add Amazon Annapurna Labs PCIe controller driver
  dt-bindings: PCI: Add Amazon's Annapurna Labs PCIe host bridge binding
  PCI: Add quirk to disable MSI-X support for Amazon's Annapurna Labs Root Port
  PCI/VPD: Prevent VPD access for Amazon's Annapurna Labs Root Port
  PCI: Add ACS quirk for Amazon Annapurna Labs root ports
  PCI: Add Amazon's Annapurna Labs vendor ID
  MAINTAINERS: Add PCI native host/endpoint controllers designated reviewer
  PCI: hv: Use bytes 4 and 5 from instance ID as the PCI domain numbers
  dt-bindings: PCI: tegra: Add PCIe slot supplies regulator entries
  dt-bindings: PCI: tegra: Add sideband pins configuration entries
  PCI: tegra: Add Tegra194 PCIe support
  PCI: Get rid of dev->has_secondary_link flag
  ...

23 files changed:
1  2 
Documentation/admin-guide/kernel-parameters.txt
Documentation/devicetree/bindings/pci/pci-armada8k.txt
MAINTAINERS
arch/arm64/boot/dts/freescale/fsl-ls1012a.dtsi
arch/arm64/boot/dts/freescale/fsl-ls1088a.dtsi
arch/arm64/boot/dts/freescale/fsl-ls208xa.dtsi
drivers/net/ethernet/jme.c
drivers/net/ethernet/realtek/r8169_main.c
drivers/net/wireless/intel/iwlwifi/pcie/trans.c
drivers/nvme/host/pci.c
drivers/pci/Kconfig
drivers/pci/controller/pci-hyperv.c
drivers/pci/hotplug/rpaphp_core.c
drivers/pci/pci.c
drivers/pci/pci.h
drivers/pci/pcie/aspm.c
drivers/pci/probe.c
drivers/pci/quirks.c
drivers/scsi/hpsa.c
drivers/scsi/mpt3sas/mpt3sas_scsih.c
include/linux/memremap.h
include/linux/pci.h
include/linux/pci_ids.h

index d3814789304fac0cada06423faf3ab590a2d9876,7d407bdded998dedf1089b5861c5f9169e6acdf3..254d8a369f328c82313d6cbcb8d235f543994ce8
        disable_radix   [PPC]
                        Disable RADIX MMU mode on POWER9
  
 +      disable_tlbie   [PPC]
 +                      Disable TLBIE instruction. Currently does not work
 +                      with KVM, with HASH MMU, or with coherent accelerators.
 +
        disable_cpu_apicid= [X86,APIC,SMP]
                        Format: <int>
                        The number of initial APIC ID for the
                        specified address. The serial port must already be
                        setup and configured. Options are not yet supported.
  
 +              sbi
 +                      Use RISC-V SBI (Supervisor Binary Interface) for early
 +                      console.
 +
                smh     Use ARM semihosting calls for early console.
  
                s3c2410,<addr>
                        the framebuffer, pass the 'ram' option so that it is
                        mapped with the correct attributes.
  
 +              linflex,<addr>
 +                      Use early console provided by Freescale LinFlex UART
 +                      serial driver for NXP S32V234 SoCs. A valid base
 +                      address must be provided, and the serial port must
 +                      already be setup and configured.
 +
        earlyprintk=    [X86,SH,ARM,M68k,S390]
                        earlyprintk=vga
                        earlyprintk=sclp
                        See comment before function elanfreq_setup() in
                        arch/x86/kernel/cpu/cpufreq/elanfreq.c.
  
 -      elevator=       [IOSCHED]
 -                      Format: { "mq-deadline" | "kyber" | "bfq" }
 -                      See Documentation/block/deadline-iosched.rst,
 -                      Documentation/block/kyber-iosched.rst and
 -                      Documentation/block/bfq-iosched.rst for details.
 -
        elfcorehdr=[size[KMG]@]offset[KMG] [IA64,PPC,SH,X86,S390]
                        Specifies physical address of start of kernel core
                        image elf header and optionally the size. Generally
                        Note that using this option lowers the security
                        provided by tboot because it makes the system
                        vulnerable to DMA attacks.
 +              nobounce [Default off]
 +                      Disable bounce buffer for unstrusted devices such as
 +                      the Thunderbolt devices. This will treat the untrusted
 +                      devices as the trusted ones, hence might expose security
 +                      risks of DMA attacks.
  
        intel_idle.max_cstate=  [KNL,HW,ACPI,X86]
                        0       disables intel_idle and fall back on acpi_idle.
                          synchronously.
  
        iommu.passthrough=
 -                      [ARM64] Configure DMA to bypass the IOMMU by default.
 +                      [ARM64, X86] Configure DMA to bypass the IOMMU by default.
                        Format: { "0" | "1" }
                        0 - Use IOMMU translation for DMA.
                        1 - Bypass the IOMMU for DMA.
  
        machvec=        [IA-64] Force the use of a particular machine-vector
                        (machvec) in a generic kernel.
 -                      Example: machvec=hpzx1_swiotlb
 +                      Example: machvec=hpzx1
  
        machtype=       [Loongson] Share the same kernel image file between different
                         yeeloong laptop.
                        mem_encrypt=on:         Activate SME
                        mem_encrypt=off:        Do not activate SME
  
 -                      Refer to Documentation/virtual/kvm/amd-memory-encryption.rst
 +                      Refer to Documentation/virt/kvm/amd-memory-encryption.rst
                        for details on when memory encryption can be activated.
  
        mem_sleep_default=      [SUSPEND] Default system suspend mode:
                                expose users to several CPU vulnerabilities.
                                Equivalent to: nopti [X86,PPC]
                                               kpti=0 [ARM64]
 -                                             nospectre_v1 [PPC]
 +                                             nospectre_v1 [X86,PPC]
                                               nobp=0 [S390]
                                               nospectre_v2 [X86,PPC,S390,ARM64]
                                               spectre_v2_user=off [X86]
                        nosmt=force: Force disable SMT, cannot be undone
                                     via the sysfs control file.
  
 -      nospectre_v1    [PPC] Disable mitigations for Spectre Variant 1 (bounds
 -                      check bypass). With this option data leaks are possible
 -                      in the system.
 +      nospectre_v1    [X86,PPC] Disable mitigations for Spectre Variant 1
 +                      (bounds check bypass). With this option data leaks are
 +                      possible in the system.
  
        nospectre_v2    [X86,PPC_FSL_BOOK3E,ARM64] Disable all mitigations for
                        the Spectre variant 2 (indirect branch prediction)
                                specify the device is described above.
                                If <order of align> is not specified,
                                PAGE_SIZE is used as alignment.
-                               PCI-PCI bridge can be specified, if resource
+                               A PCI-PCI bridge can be specified if resource
                                windows need to be expanded.
                                To specify the alignment for several
                                instances of a device, the PCI vendor,
                                device, subvendor, and subdevice may be
-                               specified, e.g., 4096@pci:8086:9c22:103c:198f
+                               specified, e.g., 12@pci:8086:9c22:103c:198f
+                               for 4096-byte alignment.
                ecrc=           Enable/disable PCIe ECRC (transaction layer
                                end-to-end CRC checking).
                                bios: Use BIOS/firmware settings. This is the
                        RCU_BOOST is not set, valid values are 0-99 and
                        the default is zero (non-realtime operation).
  
 -      rcutree.rcu_nocb_leader_stride= [KNL]
 -                      Set the number of NOCB kthread groups, which
 -                      defaults to the square root of the number of
 -                      CPUs.  Larger numbers reduces the wakeup overhead
 -                      on the per-CPU grace-period kthreads, but increases
 -                      that same overhead on each group's leader.
 +      rcutree.rcu_nocb_gp_stride= [KNL]
 +                      Set the number of NOCB callback kthreads in
 +                      each group, which defaults to the square root
 +                      of the number of CPUs.  Larger numbers reduce
 +                      the wakeup overhead on the global grace-period
 +                      kthread, but increases that same overhead on
 +                      each group's NOCB grace-period kthread.
  
        rcutree.qhimark= [KNL]
                        Set threshold of queued RCU callbacks beyond which
        rcutorture.verbose= [KNL]
                        Enable additional printk() statements.
  
 +      rcupdate.rcu_cpu_stall_ftrace_dump= [KNL]
 +                      Dump ftrace buffer after reporting RCU CPU
 +                      stall warning.
 +
        rcupdate.rcu_cpu_stall_suppress= [KNL]
                        Suppress RCU CPU stall warning messages.
  
                        Run specified binary instead of /init from the ramdisk,
                        used for early userspace startup. See initrd.
  
 +      rdrand=         [X86]
 +                      force - Override the decision by the kernel to hide the
 +                              advertisement of RDRAND support (this affects
 +                              certain AMD processors because of buggy BIOS
 +                              support, specifically around the suspend/resume
 +                              path).
 +
        rdt=            [HW,X86,RDT]
                        Turn on/off individual RDT features. List is:
                        cmt, mbmtotal, mbmlocal, l3cat, l3cdp, l2cat, l2cdp,
                        /sys/power/pm_test). Only available when CONFIG_PM_DEBUG
                        is set. Default value is 5.
  
 +      svm=            [PPC]
 +                      Format: { on | off | y | n | 1 | 0 }
 +                      This parameter controls use of the Protected
 +                      Execution Facility on pSeries.
 +
        swapaccount=[0|1]
                        [KNL] Enable accounting of swap in memory resource
                        controller if no parameter or 1 is given or disable
                        A hex value specifying bitmask with supplemental xhci
                        host controller quirks. Meaning of each bit can be
                        consulted in header drivers/usb/host/xhci.h.
 +
 +      xmon            [PPC]
 +                      Format: { early | on | rw | ro | off }
 +                      Controls if xmon debugger is enabled. Default is off.
 +                      Passing only "xmon" is equivalent to "xmon=early".
 +                      early   Call xmon as early as possible on boot; xmon
 +                              debugger is called from setup_arch().
 +                      on      xmon debugger hooks will be installed so xmon
 +                              is only called on a kernel crash. Default mode,
 +                              i.e. either "ro" or "rw" mode, is controlled
 +                              with CONFIG_XMON_DEFAULT_RO_MODE.
 +                      rw      xmon debugger hooks will be installed so xmon
 +                              is called only on a kernel crash, mode is write,
 +                              meaning SPR registers, memory and, other data
 +                              can be written using xmon commands.
 +                      ro      same as "rw" option above but SPR registers,
 +                              memory, and other data can't be written using
 +                              xmon commands.
 +                      off     xmon is disabled.
index 8324a4ee6f06651f6b25d0bd1ddf476fa458d6f7,1aaa092540015d94e61157a06debd3cd0338cf87..7a813d0e6d634ee226b92e0bf5abfe7919dd9ea2
@@@ -11,20 -11,12 +11,20 @@@ Required properties
  - reg-names:
     - "ctrl" for the control register region
     - "config" for the config space region
- - interrupts: Interrupt specifier for the PCIe controler
+ - interrupts: Interrupt specifier for the PCIe controller
  - clocks: reference to the PCIe controller clocks
  - clock-names: mandatory if there is a second clock, in this case the
     name must be "core" for the first clock and "reg" for the second
     one
  
 +Optional properties:
 +- phys: phandle(s) to PHY node(s) following the generic PHY bindings.
 +      Either 1, 2 or 4 PHYs might be needed depending on the number of
 +      PCIe lanes.
 +- phy-names: names of the PHYs corresponding to the number of lanes.
 +      Must be "cp0-pcie0-x4-lane0-phy", "cp0-pcie0-x4-lane1-phy" for
 +      2 PHYs.
 +
  Example:
  
        pcie@f2600000 {
diff --combined MAINTAINERS
index 7ea0c11b8e8d5e203fb1d10ff4bfe9882e131ef3,d88e268271d7956f50abef9d7417677517d7c646..6ee4bb5f6d30962e6401ad3e97dd15a735fc6d6b
@@@ -183,7 -183,7 +183,7 @@@ M: Realtek linux nic maintainers <nic_s
  M:    Heiner Kallweit <hkallweit1@gmail.com>
  L:    netdev@vger.kernel.org
  S:    Maintained
 -F:    drivers/net/ethernet/realtek/r8169.c
 +F:    drivers/net/ethernet/realtek/r8169*
  
  8250/16?50 (AND CLONE UARTS) SERIAL DRIVER
  M:    Greg Kroah-Hartman <gregkh@linuxfoundation.org>
@@@ -517,6 -517,14 +517,6 @@@ W:        http://ez.analog.com/community/linux
  S:    Supported
  F:    drivers/video/backlight/adp8860_bl.c
  
 -ADS1015 HARDWARE MONITOR DRIVER
 -M:    Dirk Eibach <eibach@gdsys.de>
 -L:    linux-hwmon@vger.kernel.org
 -S:    Maintained
 -F:    Documentation/hwmon/ads1015.rst
 -F:    drivers/hwmon/ads1015.c
 -F:    include/linux/platform_data/ads1015.h
 -
  ADT746X FAN DRIVER
  M:    Colin Leroy <colin@colino.net>
  S:    Maintained
@@@ -641,12 -649,6 +641,12 @@@ M:       Lino Sanfilippo <LinoSanfilippo@gmx.
  S:    Maintained
  F:    drivers/net/ethernet/alacritech/*
  
 +FORCEDETH GIGABIT ETHERNET DRIVER
 +M:    Rain River <rain.1986.08.12@gmail.com>
 +L:    netdev@vger.kernel.org
 +S:    Maintained
 +F:    drivers/net/ethernet/nvidia/*
 +
  ALCATEL SPEEDTOUCH USB DRIVER
  M:    Duncan Sands <duncan.sands@free.fr>
  L:    linux-usb@vger.kernel.org
@@@ -664,7 -666,7 +664,7 @@@ ALI1563 I2C DRIVE
  M:    Rudolf Marek <r.marek@assembler.cz>
  L:    linux-i2c@vger.kernel.org
  S:    Maintained
 -F:    Documentation/i2c/busses/i2c-ali1563
 +F:    Documentation/i2c/busses/i2c-ali1563.rst
  F:    drivers/i2c/busses/i2c-ali1563.c
  
  ALLEGRO DVT VIDEO IP CORE DRIVER
@@@ -674,13 -676,6 +674,13 @@@ L:       linux-media@vger.kernel.or
  S:    Maintained
  F:    drivers/staging/media/allegro-dvt/
  
 +ALLWINNER CPUFREQ DRIVER
 +M:    Yangtao Li <tiny.windzz@gmail.com>
 +L:    linux-pm@vger.kernel.org
 +S:    Maintained
 +F:    Documentation/devicetree/bindings/opp/sun50i-nvmem-cpufreq.txt
 +F:    drivers/cpufreq/sun50i-cpufreq-nvmem.c
 +
  ALLWINNER SECURITY SYSTEM
  M:    Corentin Labbe <clabbe.montjoie@gmail.com>
  L:    linux-crypto@vger.kernel.org
@@@ -688,7 -683,7 +688,7 @@@ S: Maintaine
  F:    drivers/crypto/sunxi-ss/
  
  ALLWINNER VPU DRIVER
 -M:    Maxime Ripard <maxime.ripard@bootlin.com>
 +M:    Maxime Ripard <mripard@kernel.org>
  M:    Paul Kocialkowski <paul.kocialkowski@bootlin.com>
  L:    linux-media@vger.kernel.org
  S:    Maintained
@@@ -834,11 -829,17 +834,11 @@@ F:      drivers/iommu/amd_iommu*.[ch
  F:    include/linux/amd-iommu.h
  
  AMD KFD
 -M:    Oded Gabbay <oded.gabbay@gmail.com>
 -L:    dri-devel@lists.freedesktop.org
 -T:    git git://people.freedesktop.org/~gabbayo/linux.git
 -S:    Supported
 -F:    drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.c
 -F:    drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.h
 -F:    drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gfx_v7.c
 -F:    drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gfx_v8.c
 -F:    drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gfx_v9.c
 -F:    drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_fence.c
 -F:    drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c
 +M:    Felix Kuehling <Felix.Kuehling@amd.com>
 +L:    amd-gfx@lists.freedesktop.org
 +T:    git git://people.freedesktop.org/~agd5f/linux
 +S:    Supported
 +F:    drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd*.[ch]
  F:    drivers/gpu/drm/amd/amdkfd/
  F:    drivers/gpu/drm/amd/include/cik_structs.h
  F:    drivers/gpu/drm/amd/include/kgd_kfd_interface.h
@@@ -898,16 -899,15 +898,16 @@@ L:      linux-iio@vger.kernel.or
  W:    http://ez.analog.com/community/linux-device-drivers
  S:    Supported
  F:    drivers/iio/adc/ad7124.c
 -F:    Documentation/devicetree/bindings/iio/adc/adi,ad7124.txt
 +F:    Documentation/devicetree/bindings/iio/adc/adi,ad7124.yaml
  
  ANALOG DEVICES INC AD7606 DRIVER
  M:    Stefan Popa <stefan.popa@analog.com>
 +M:    Beniamin Bia <beniamin.bia@analog.com>
  L:    linux-iio@vger.kernel.org
  W:    http://ez.analog.com/community/linux-device-drivers
  S:    Supported
  F:    drivers/iio/adc/ad7606.c
 -F:    Documentation/devicetree/bindings/iio/adc/adi,ad7606.txt
 +F:    Documentation/devicetree/bindings/iio/adc/adi,ad7606.yaml
  
  ANALOG DEVICES INC AD7768-1 DRIVER
  M:    Stefan Popa <stefan.popa@analog.com>
@@@ -938,14 -938,6 +938,14 @@@ S:       Supporte
  F:    drivers/mux/adgs1408.c
  F:    Documentation/devicetree/bindings/mux/adi,adgs1408.txt
  
 +ANALOG DEVICES INC ADIN DRIVER
 +M:    Alexandru Ardelean <alexaundru.ardelean@analog.com>
 +L:    netdev@vger.kernel.org
 +W:    http://ez.analog.com/community/linux-device-drivers
 +S:    Supported
 +F:    drivers/net/phy/adin.c
 +F:    Documentation/devicetree/bindings/net/adi,adin.yaml
 +
  ANALOG DEVICES INC ADIS DRIVER LIBRARY
  M:    Alexandru Ardelean <alexandru.ardelean@analog.com>
  S:    Supported
@@@ -953,14 -945,6 +953,14 @@@ L:       linux-iio@vger.kernel.or
  F:    include/linux/iio/imu/adis.h
  F:    drivers/iio/imu/adis.c
  
 +ANALOG DEVICES INC ADIS16460 DRIVER
 +M:    Dragos Bogdan <dragos.bogdan@analog.com>
 +S:    Supported
 +L:    linux-iio@vger.kernel.org
 +W:    http://ez.analog.com/community/linux-device-drivers
 +F:    drivers/iio/imu/adis16460.c
 +F:    Documentation/devicetree/bindings/iio/imu/adi,adis16460.yaml
 +
  ANALOG DEVICES INC ADP5061 DRIVER
  M:    Stefan Popa <stefan.popa@analog.com>
  L:    linux-pm@vger.kernel.org
@@@ -1210,7 -1194,7 +1210,7 @@@ F:      include/uapi/linux/if_arcnet.
  
  ARM ARCHITECTED TIMER DRIVER
  M:    Mark Rutland <mark.rutland@arm.com>
 -M:    Marc Zyngier <marc.zyngier@arm.com>
 +M:    Marc Zyngier <maz@kernel.org>
  L:    linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
  S:    Maintained
  F:    arch/arm/include/asm/arch_timer.h
@@@ -1366,7 -1350,8 +1366,7 @@@ M:      Will Deacon <will@kernel.org
  R:    Robin Murphy <robin.murphy@arm.com>
  L:    linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
  S:    Maintained
 -F:    drivers/iommu/arm-smmu.c
 -F:    drivers/iommu/arm-smmu-v3.c
 +F:    drivers/iommu/arm-smmu*
  F:    drivers/iommu/io-pgtable-arm.c
  F:    drivers/iommu/io-pgtable-arm-v7s.c
  
@@@ -1394,7 -1379,7 +1394,7 @@@ F:      drivers/pinctrl/actions/
  F:    drivers/soc/actions/
  F:    include/dt-bindings/power/owl-*
  F:    include/linux/soc/actions/
 -F:    Documentation/devicetree/bindings/arm/actions.txt
 +F:    Documentation/devicetree/bindings/arm/actions.yaml
  F:    Documentation/devicetree/bindings/clock/actions,owl-cmu.txt
  F:    Documentation/devicetree/bindings/dma/owl-dma.txt
  F:    Documentation/devicetree/bindings/i2c/i2c-owl.txt
@@@ -1423,7 -1408,7 +1423,7 @@@ S:      Maintaine
  F:    drivers/clk/sunxi/
  
  ARM/Allwinner sunXi SoC support
 -M:    Maxime Ripard <maxime.ripard@bootlin.com>
 +M:    Maxime Ripard <mripard@kernel.org>
  M:    Chen-Yu Tsai <wens@csie.org>
  L:    linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
  S:    Maintained
@@@ -1436,14 -1421,6 +1436,14 @@@ F:    drivers/pinctrl/sunxi
  F:    drivers/soc/sunxi/
  T:    git git://git.kernel.org/pub/scm/linux/kernel/git/sunxi/linux.git
  
 +Allwinner A10 CSI driver
 +M:    Maxime Ripard <mripard@kernel.org>
 +L:    linux-media@vger.kernel.org
 +T:    git git://linuxtv.org/media_tree.git
 +F:    drivers/media/platform/sunxi/sun4i-csi/
 +F:    Documentation/devicetree/bindings/media/allwinner,sun4i-a10-csi.yaml
 +S:    Maintained
 +
  ARM/Amlogic Meson SoC CLOCK FRAMEWORK
  M:    Neil Armstrong <narmstrong@baylibre.com>
  M:    Jerome Brunet <jbrunet@baylibre.com>
@@@ -1466,7 -1443,6 +1466,7 @@@ F:      arch/arm64/boot/dts/amlogic
  F:    drivers/pinctrl/meson/
  F:    drivers/mmc/host/meson*
  F:    drivers/soc/amlogic/
 +F:    drivers/rtc/rtc-meson*
  N:    meson
  
  ARM/Amlogic Meson SoC Sound Drivers
@@@ -1495,7 -1471,6 +1495,7 @@@ F:      arch/arm/mach-artpe
  F:    arch/arm/boot/dts/artpec6*
  F:    drivers/clk/axis
  F:    drivers/crypto/axis
 +F:    drivers/mmc/host/usdhi6rol0.c
  F:    drivers/pinctrl/pinctrl-artpec*
  F:    Documentation/devicetree/bindings/pinctrl/axis,artpec6-pinctrl.txt
  
@@@ -1607,8 -1582,8 +1607,8 @@@ R:      Suzuki K Poulose <suzuki.poulose@arm
  L:    linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
  S:    Maintained
  F:    drivers/hwtracing/coresight/*
 -F:    Documentation/trace/coresight.txt
 -F:    Documentation/trace/coresight-cpu-debug.txt
 +F:    Documentation/trace/coresight.rst
 +F:    Documentation/trace/coresight-cpu-debug.rst
  F:    Documentation/devicetree/bindings/arm/coresight.txt
  F:    Documentation/devicetree/bindings/arm/coresight-cpu-debug.txt
  F:    Documentation/ABI/testing/sysfs-bus-coresight-devices-*
@@@ -1651,21 -1626,6 +1651,21 @@@ F:    drivers/clocksource/timer-atlas7.
  N:    [^a-z]sirf
  X:    drivers/gnss
  
 +ARM/CZ.NIC TURRIS MOX SUPPORT
 +M:    Marek Behun <marek.behun@nic.cz>
 +W:    http://mox.turris.cz
 +S:    Maintained
 +F:    Documentation/ABI/testing/debugfs-moxtet
 +F:    Documentation/ABI/testing/sysfs-bus-moxtet-devices
 +F:    Documentation/ABI/testing/sysfs-firmware-turris-mox-rwtm
 +F:    Documentation/devicetree/bindings/bus/moxtet.txt
 +F:    Documentation/devicetree/bindings/firmware/cznic,turris-mox-rwtm.txt
 +F:    Documentation/devicetree/bindings/gpio/gpio-moxtet.txt
 +F:    include/linux/moxtet.h
 +F:    drivers/bus/moxtet.c
 +F:    drivers/firmware/turris-mox-rwtm.c
 +F:    drivers/gpio/gpio-moxtet.c
 +
  ARM/EBSA110 MACHINE SUPPORT
  M:    Russell King <linux@armlinux.org.uk>
  L:    linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
@@@ -1789,11 -1749,20 +1789,11 @@@ L:   linux-arm-kernel@lists.infradead.or
  S:    Maintained
  F:    arch/arm/mach-pxa/colibri-pxa270-income.c
  
 -ARM/INTEL IOP13XX ARM ARCHITECTURE
 -M:    Lennert Buytenhek <kernel@wantstofly.org>
 -L:    linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
 -S:    Maintained
 -
  ARM/INTEL IOP32X ARM ARCHITECTURE
  M:    Lennert Buytenhek <kernel@wantstofly.org>
  L:    linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
  S:    Maintained
  
 -ARM/INTEL IOP33X ARM ARCHITECTURE
 -L:    linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
 -S:    Orphan
 -
  ARM/INTEL IQ81342EX MACHINE SUPPORT
  M:    Lennert Buytenhek <kernel@wantstofly.org>
  L:    linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
@@@ -1952,6 -1921,12 +1952,6 @@@ S:     Maintaine
  F:    drivers/phy/mediatek/
  F:    Documentation/devicetree/bindings/phy/phy-mtk-*
  
 -ARM/MICREL KS8695 ARCHITECTURE
 -M:    Greg Ungerer <gerg@uclinux.org>
 -L:    linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
 -F:    arch/arm/mach-ks8695/
 -S:    Odd Fixes
 -
  ARM/Microchip (AT91) SoC support
  M:    Nicolas Ferre <nicolas.ferre@microchip.com>
  M:    Alexandre Belloni <alexandre.belloni@bootlin.com>
@@@ -1993,7 -1968,6 +1993,7 @@@ F:      Documentation/devicetree/bindings/i2
  F:    arch/arm/mach-nomadik/
  F:    arch/arm/mach-u300/
  F:    arch/arm/mach-ux500/
 +F:    drivers/soc/ux500/
  F:    arch/arm/boot/dts/ste-*
  F:    drivers/clk/clk-nomadik.c
  F:    drivers/clk/clk-u300.c
@@@ -2037,6 -2011,22 +2037,6 @@@ F:     drivers/*/*npcm
  F:    Documentation/devicetree/bindings/*/*npcm*
  F:    Documentation/devicetree/bindings/*/*/*npcm*
  
 -ARM/NUVOTON W90X900 ARM ARCHITECTURE
 -M:    Wan ZongShun <mcuos.com@gmail.com>
 -L:    linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
 -W:    http://www.mcuos.com
 -S:    Maintained
 -F:    arch/arm/mach-w90x900/
 -F:    drivers/input/keyboard/w90p910_keypad.c
 -F:    drivers/input/touchscreen/w90p910_ts.c
 -F:    drivers/watchdog/nuc900_wdt.c
 -F:    drivers/net/ethernet/nuvoton/w90p910_ether.c
 -F:    drivers/mtd/nand/raw/nuc900_nand.c
 -F:    drivers/rtc/rtc-nuc900.c
 -F:    drivers/spi/spi-nuc900.c
 -F:    drivers/usb/host/ehci-w90x900.c
 -F:    drivers/video/fbdev/nuc900fb.c
 -
  ARM/OPENMOKO NEO FREERUNNER (GTA02) MACHINE SUPPORT
  L:    openmoko-kernel@lists.openmoko.org (subscribers-only)
  W:    http://wiki.openmoko.org/wiki/Neo_FreeRunner
@@@ -2161,16 -2151,14 +2161,16 @@@ M:   Andreas Färber <afaerber@suse.de
  L:    linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
  S:    Maintained
  F:    arch/arm64/boot/dts/realtek/
 -F:    Documentation/devicetree/bindings/arm/realtek.txt
 +F:    Documentation/devicetree/bindings/arm/realtek.yaml
  
  ARM/RENESAS ARM64 ARCHITECTURE
  M:    Simon Horman <horms@verge.net.au>
 +M:    Geert Uytterhoeven <geert+renesas@glider.be>
  M:    Magnus Damm <magnus.damm@gmail.com>
  L:    linux-renesas-soc@vger.kernel.org
  Q:    http://patchwork.kernel.org/project/linux-renesas-soc/list/
  T:    git git://git.kernel.org/pub/scm/linux/kernel/git/horms/renesas.git next
 +T:    git git://git.kernel.org/pub/scm/linux/kernel/git/geert/renesas-devel.git next
  S:    Supported
  F:    arch/arm64/boot/dts/renesas/
  F:    Documentation/devicetree/bindings/arm/renesas.yaml
@@@ -2229,9 -2217,8 +2229,9 @@@ F:      drivers/*/*s3c24
  F:    drivers/*/*/*s3c24*
  F:    drivers/*/*s3c64xx*
  F:    drivers/*/*s5pv210*
 -F:    drivers/memory/samsung/*
 -F:    drivers/soc/samsung/*
 +F:    drivers/memory/samsung/
 +F:    drivers/soc/samsung/
 +F:    include/linux/soc/samsung/
  F:    Documentation/arm/samsung/
  F:    Documentation/devicetree/bindings/arm/samsung/
  F:    Documentation/devicetree/bindings/sram/samsung-sram.txt
@@@ -2282,12 -2269,10 +2282,12 @@@ F:   drivers/media/platform/s5p-mfc
  
  ARM/SHMOBILE ARM ARCHITECTURE
  M:    Simon Horman <horms@verge.net.au>
 +M:    Geert Uytterhoeven <geert+renesas@glider.be>
  M:    Magnus Damm <magnus.damm@gmail.com>
  L:    linux-renesas-soc@vger.kernel.org
  Q:    http://patchwork.kernel.org/project/linux-renesas-soc/list/
  T:    git git://git.kernel.org/pub/scm/linux/kernel/git/horms/renesas.git next
 +T:    git git://git.kernel.org/pub/scm/linux/kernel/git/geert/renesas-devel.git next
  S:    Supported
  F:    arch/arm/boot/dts/emev2*
  F:    arch/arm/boot/dts/gr-peach*
@@@ -2926,7 -2911,6 +2926,7 @@@ BATMAN ADVANCE
  M:    Marek Lindner <mareklindner@neomailbox.ch>
  M:    Simon Wunderlich <sw@simonwunderlich.de>
  M:    Antonio Quartulli <a@unstable.cc>
 +M:    Sven Eckelmann <sven@narfation.org>
  L:    b.a.t.m.a.n@lists.open-mesh.org (moderated for non-subscribers)
  W:    https://www.open-mesh.org/
  B:    https://www.open-mesh.org/projects/batman-adv/issues
@@@ -3589,7 -3573,7 +3589,7 @@@ F:      Documentation/filesystems/caching/ca
  F:    fs/cachefiles/
  
  CADENCE MIPI-CSI2 BRIDGES
 -M:    Maxime Ripard <maxime.ripard@bootlin.com>
 +M:    Maxime Ripard <mripard@kernel.org>
  L:    linux-media@vger.kernel.org
  S:    Maintained
  F:    Documentation/devicetree/bindings/media/cdns,*.txt
@@@ -3647,12 -3631,9 +3647,12 @@@ S:    Maintaine
  F:    Documentation/devicetree/bindings/net/can/
  F:    drivers/net/can/
  F:    include/linux/can/dev.h
 +F:    include/linux/can/led.h
 +F:    include/linux/can/rx-offload.h
  F:    include/linux/can/platform/
  F:    include/uapi/linux/can/error.h
  F:    include/uapi/linux/can/netlink.h
 +F:    include/uapi/linux/can/vxcan.h
  
  CAN NETWORK LAYER
  M:    Oliver Hartkopp <socketcan@hartkopp.net>
@@@ -3665,23 -3646,11 +3665,23 @@@ S:   Maintaine
  F:    Documentation/networking/can.rst
  F:    net/can/
  F:    include/linux/can/core.h
 +F:    include/linux/can/skb.h
 +F:    include/net/netns/can.h
  F:    include/uapi/linux/can.h
  F:    include/uapi/linux/can/bcm.h
  F:    include/uapi/linux/can/raw.h
  F:    include/uapi/linux/can/gw.h
  
 +CAN-J1939 NETWORK LAYER
 +M:    Robin van der Gracht <robin@protonic.nl>
 +M:    Oleksij Rempel <o.rempel@pengutronix.de>
 +R:    Pengutronix Kernel Team <kernel@pengutronix.de>
 +L:    linux-can@vger.kernel.org
 +S:    Maintained
 +F:    Documentation/networking/j1939.txt
 +F:    net/can/j1939/
 +F:    include/uapi/linux/can/j1939.h
 +
  CAPABILITIES
  M:    Serge Hallyn <serge@hallyn.com>
  L:    linux-security-module@vger.kernel.org
@@@ -3831,9 -3800,14 +3831,9 @@@ F:     scripts/sign-file.
  F:    scripts/extract-cert.c
  
  CERTIFIED WIRELESS USB (WUSB) SUBSYSTEM:
 -L:    linux-usb@vger.kernel.org
 -S:    Orphan
 -F:    Documentation/usb/wusb-design-overview.rst
 -F:    Documentation/usb/wusb-cbaf
 -F:    drivers/usb/host/hwa-hc.c
 -F:    drivers/usb/host/whci/
 -F:    drivers/usb/wusbcore/
 -F:    include/linux/usb/wusb*
 +L:    devel@driverdev.osuosl.org
 +S:    Obsolete
 +F:    drivers/staging/wusbcore/
  
  CFAG12864B LCD DRIVER
  M:    Miguel Ojeda Sandonis <miguel.ojeda.sandonis@gmail.com>
@@@ -4125,7 -4099,7 +4125,7 @@@ L:      samba-technical@lists.samba.org (mod
  W:    http://linux-cifs.samba.org/
  T:    git git://git.samba.org/sfrench/cifs-2.6.git
  S:    Supported
 -F:    Documentation/filesystems/cifs/
 +F:    Documentation/admin-guide/cifs/
  F:    fs/cifs/
  
  COMPACTPCI HOTPLUG CORE
@@@ -4216,7 -4190,7 +4216,7 @@@ M:      Jens Axboe <axboe@kernel.dk
  L:    cgroups@vger.kernel.org
  L:    linux-block@vger.kernel.org
  T:    git git://git.kernel.dk/linux-block
 -F:    Documentation/cgroup-v1/blkio-controller.rst
 +F:    Documentation/admin-guide/cgroup-v1/blkio-controller.rst
  F:    block/blk-cgroup.c
  F:    include/linux/blk-cgroup.h
  F:    block/blk-throttle.c
@@@ -4312,14 -4286,6 +4312,14 @@@ S:    Supporte
  F:    drivers/cpuidle/cpuidle-exynos.c
  F:    arch/arm/mach-exynos/pm.c
  
 +CPUIDLE DRIVER - ARM PSCI
 +M:    Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
 +M:    Sudeep Holla <sudeep.holla@arm.com>
 +L:    linux-pm@vger.kernel.org
 +L:    linux-arm-kernel@lists.infradead.org
 +S:    Supported
 +F:    drivers/cpuidle/cpuidle-psci.c
 +
  CPU IDLE TIME MANAGEMENT FRAMEWORK
  M:    "Rafael J. Wysocki" <rjw@rjwysocki.net>
  M:    Daniel Lezcano <daniel.lezcano@linaro.org>
@@@ -4338,12 -4304,6 +4338,12 @@@ S:    Maintaine
  F:    Documentation/filesystems/cramfs.txt
  F:    fs/cramfs/
  
 +CREATIVE SB0540
 +M:    Bastien Nocera <hadess@hadess.net>
 +L:    linux-input@vger.kernel.org
 +S:    Maintained
 +F:    drivers/hid/hid-creative-sb0540.c
 +
  CRYPTO API
  M:    Herbert Xu <herbert@gondor.apana.org.au>
  M:    "David S. Miller" <davem@davemloft.net>
@@@ -4509,7 -4469,7 +4509,7 @@@ F:      arch/powerpc/platforms/powernv/pci-c
  F:    drivers/misc/cxl/
  F:    include/misc/cxl*
  F:    include/uapi/misc/cxl.h
 -F:    Documentation/powerpc/cxl.txt
 +F:    Documentation/powerpc/cxl.rst
  F:    Documentation/ABI/testing/sysfs-class-cxl
  
  CXLFLASH (IBM Coherent Accelerator Processor Interface CAPI Flash) SCSI DRIVER
@@@ -4520,7 -4480,7 +4520,7 @@@ L:      linux-scsi@vger.kernel.or
  S:    Supported
  F:    drivers/scsi/cxlflash/
  F:    include/uapi/scsi/cxlflash_ioctl.h
 -F:    Documentation/powerpc/cxlflash.txt
 +F:    Documentation/powerpc/cxlflash.rst
  
  CYBERPRO FB DRIVER
  M:    Russell King <linux@armlinux.org.uk>
@@@ -4987,9 -4947,7 +4987,9 @@@ M:      Jonathan Corbet <corbet@lwn.net
  L:    linux-doc@vger.kernel.org
  S:    Maintained
  F:    Documentation/
 +F:    scripts/documentation-file-ref-check
  F:    scripts/kernel-doc
 +F:    scripts/sphinx-pre-install
  X:    Documentation/ABI/
  X:    Documentation/firmware-guide/acpi/
  X:    Documentation/devicetree/
@@@ -5005,14 -4963,6 +5005,14 @@@ L:    linux-doc@vger.kernel.or
  S:    Maintained
  F:    Documentation/translations/it_IT
  
 +DOCUMENTATION SCRIPTS
 +M:    Mauro Carvalho Chehab <mchehab@kernel.org>
 +L:    linux-doc@vger.kernel.org
 +S:    Maintained
 +F:    scripts/documentation-file-ref-check
 +F:    scripts/sphinx-pre-install
 +F:    Documentation/sphinx/parse-headers.pl
 +
  DONGWOON DW9714 LENS VOICE COIL DRIVER
  M:    Sakari Ailus <sakari.ailus@linux.intel.com>
  L:    linux-media@vger.kernel.org
@@@ -5145,24 -5095,17 +5145,24 @@@ S:   Maintaine
  F:    drivers/gpu/drm/panel/panel-feiyang-fy07024di26a30d.c
  F:    Documentation/devicetree/bindings/display/panel/feiyang,fy07024di26a30d.txt
  
 +DRM DRIVER FOR GRAIN MEDIA GM12U320 PROJECTORS
 +M:    Hans de Goede <hdegoede@redhat.com>
 +T:    git git://anongit.freedesktop.org/drm/drm-misc
 +S:    Maintained
 +F:    drivers/gpu/drm/tiny/gm12u320.c
 +
  DRM DRIVER FOR ILITEK ILI9225 PANELS
  M:    David Lechner <david@lechnology.com>
 +T:    git git://anongit.freedesktop.org/drm/drm-misc
  S:    Maintained
 -F:    drivers/gpu/drm/tinydrm/ili9225.c
 +F:    drivers/gpu/drm/tiny/ili9225.c
  F:    Documentation/devicetree/bindings/display/ilitek,ili9225.txt
  
  DRM DRIVER FOR HX8357D PANELS
  M:    Eric Anholt <eric@anholt.net>
  T:    git git://anongit.freedesktop.org/drm/drm-misc
  S:    Maintained
 -F:    drivers/gpu/drm/tinydrm/hx8357d.c
 +F:    drivers/gpu/drm/tiny/hx8357d.c
  F:    Documentation/devicetree/bindings/display/himax,hx8357d.txt
  
  DRM DRIVER FOR INTEL I810 VIDEO CARDS
@@@ -5182,9 -5125,8 +5182,9 @@@ F:      drivers/gpu/drm/mgag200
  
  DRM DRIVER FOR MI0283QT
  M:    Noralf Trønnes <noralf@tronnes.org>
 +T:    git git://anongit.freedesktop.org/drm/drm-misc
  S:    Maintained
 -F:    drivers/gpu/drm/tinydrm/mi0283qt.c
 +F:    drivers/gpu/drm/tiny/mi0283qt.c
  F:    Documentation/devicetree/bindings/display/multi-inno,mi0283qt.txt
  
  DRM DRIVER FOR MSM ADRENO GPU
@@@ -5216,9 -5158,8 +5216,9 @@@ F:      Documentation/devicetree/bindings/di
  
  DRM DRIVER FOR PERVASIVE DISPLAYS REPAPER PANELS
  M:    Noralf Trønnes <noralf@tronnes.org>
 +T:    git git://anongit.freedesktop.org/drm/drm-misc
  S:    Maintained
 -F:    drivers/gpu/drm/tinydrm/repaper.c
 +F:    drivers/gpu/drm/tiny/repaper.c
  F:    Documentation/devicetree/bindings/display/repaper.txt
  
  DRM DRIVER FOR QEMU'S CIRRUS DEVICE
@@@ -5240,12 -5181,6 +5240,12 @@@ S:    Maintaine
  F:    drivers/gpu/drm/qxl/
  F:    include/uapi/drm/qxl_drm.h
  
 +DRM DRIVER FOR RAYDIUM RM67191 PANELS
 +M:    Robert Chiras <robert.chiras@nxp.com>
 +S:    Maintained
 +F:    drivers/gpu/drm/panel/panel-raydium-rm67191.c
 +F:    Documentation/devicetree/bindings/display/panel/raydium,rm67191.txt
 +
  DRM DRIVER FOR RAGE 128 VIDEO CARDS
  S:    Orphan / Obsolete
  F:    drivers/gpu/drm/r128/
@@@ -5253,7 -5188,6 +5253,7 @@@ F:      include/uapi/drm/r128_drm.
  
  DRM DRIVER FOR ROCKTECH JH057N00900 PANELS
  M:    Guido Günther <agx@sigxcpu.org>
 +R:    Purism Kernel Team <kernel@puri.sm>
  S:    Maintained
  F:    drivers/gpu/drm/panel/panel-rocktech-jh057n00900.c
  F:    Documentation/devicetree/bindings/display/panel/rocktech,jh057n00900.txt
@@@ -5276,16 -5210,14 +5276,16 @@@ F:   Documentation/devicetree/bindings/di
  
  DRM DRIVER FOR SITRONIX ST7586 PANELS
  M:    David Lechner <david@lechnology.com>
 +T:    git git://anongit.freedesktop.org/drm/drm-misc
  S:    Maintained
 -F:    drivers/gpu/drm/tinydrm/st7586.c
 +F:    drivers/gpu/drm/tiny/st7586.c
  F:    Documentation/devicetree/bindings/display/sitronix,st7586.txt
  
  DRM DRIVER FOR SITRONIX ST7735R PANELS
  M:    David Lechner <david@lechnology.com>
 +T:    git git://anongit.freedesktop.org/drm/drm-misc
  S:    Maintained
 -F:    drivers/gpu/drm/tinydrm/st7735r.c
 +F:    drivers/gpu/drm/tiny/st7735r.c
  F:    Documentation/devicetree/bindings/display/sitronix,st7735r.txt
  
  DRM DRIVER FOR ST-ERICSSON MCDE
@@@ -5304,7 -5236,7 +5304,7 @@@ M:      Linus Walleij <linus.walleij@linaro.
  T:    git git://anongit.freedesktop.org/drm/drm-misc
  S:    Maintained
  F:    drivers/gpu/drm/panel/panel-tpo-tpg110.c
 -F:    Documentation/devicetree/bindings/display/panel/tpo,tpg110.txt
 +F:    Documentation/devicetree/bindings/display/panel/tpo,tpg110.yaml
  
  DRM DRIVER FOR USB DISPLAYLINK VIDEO ADAPTERS
  M:    Dave Airlie <airlied@redhat.com>
@@@ -5359,7 -5291,7 +5359,7 @@@ F:      include/linux/vga
  
  DRM DRIVERS AND MISC GPU PATCHES
  M:    Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
 -M:    Maxime Ripard <maxime.ripard@bootlin.com>
 +M:    Maxime Ripard <mripard@kernel.org>
  M:    Sean Paul <sean@poorly.run>
  W:    https://01.org/linuxgraphics/gfx-docs/maintainer-tools/drm-misc.html
  S:    Maintained
@@@ -5372,7 -5304,7 +5372,7 @@@ F:      include/uapi/drm/drm
  F:    include/linux/vga*
  
  DRM DRIVERS FOR ALLWINNER A10
 -M:    Maxime Ripard  <maxime.ripard@bootlin.com>
 +M:    Maxime Ripard <mripard@kernel.org>
  L:    dri-devel@lists.freedesktop.org
  S:    Supported
  F:    drivers/gpu/drm/sun4i/
@@@ -5386,13 -5318,12 +5386,13 @@@ L:   linux-amlogic@lists.infradead.or
  W:    http://linux-meson.com/
  S:    Supported
  F:    drivers/gpu/drm/meson/
 -F:    Documentation/devicetree/bindings/display/amlogic,meson-vpu.txt
 -F:    Documentation/devicetree/bindings/display/amlogic,meson-dw-hdmi.txt
 +F:    Documentation/devicetree/bindings/display/amlogic,meson-vpu.yaml
 +F:    Documentation/devicetree/bindings/display/amlogic,meson-dw-hdmi.yaml
  F:    Documentation/gpu/meson.rst
  T:    git git://anongit.freedesktop.org/drm/drm-misc
  
  DRM DRIVERS FOR ATMEL HLCDC
 +M:    Sam Ravnborg <sam@ravnborg.org>
  M:    Boris Brezillon <bbrezillon@kernel.org>
  L:    dri-devel@lists.freedesktop.org
  S:    Supported
@@@ -5402,10 -5333,7 +5402,10 @@@ T:    git git://anongit.freedesktop.org/dr
  
  DRM DRIVERS FOR BRIDGE CHIPS
  M:    Andrzej Hajda <a.hajda@samsung.com>
 +M:    Neil Armstrong <narmstrong@baylibre.com>
  R:    Laurent Pinchart <Laurent.pinchart@ideasonboard.com>
 +R:    Jonas Karlman <jonas@kwiboo.se>
 +R:    Jernej Skrabec <jernej.skrabec@siol.net>
  S:    Maintained
  T:    git git://anongit.freedesktop.org/drm/drm-misc
  F:    drivers/gpu/drm/bridge/
@@@ -5593,6 -5521,14 +5593,6 @@@ F:     drivers/gpu/drm/panel
  F:    include/drm/drm_panel.h
  F:    Documentation/devicetree/bindings/display/panel/
  
 -DRM TINYDRM DRIVERS
 -M:    Noralf Trønnes <noralf@tronnes.org>
 -W:    https://github.com/notro/tinydrm/wiki/Development
 -T:    git git://anongit.freedesktop.org/drm/drm-misc
 -S:    Maintained
 -F:    drivers/gpu/drm/tinydrm/
 -F:    include/drm/tinydrm/
 -
  DRM DRIVERS FOR XEN
  M:    Oleksandr Andrushchenko <oleksandr_andrushchenko@epam.com>
  T:    git git://anongit.freedesktop.org/drm/drm-misc
@@@ -5618,6 -5554,12 +5618,6 @@@ T:     git git://linuxtv.org/media_tree.gi
  S:    Maintained
  F:    drivers/media/radio/dsbr100.c
  
 -DSCC4 DRIVER
 -M:    Francois Romieu <romieu@fr.zoreil.com>
 -L:    netdev@vger.kernel.org
 -S:    Maintained
 -F:    drivers/net/wan/dscc4.c
 -
  DT3155 MEDIA DRIVER
  M:    Hans Verkuil <hverkuil@xs4all.nl>
  L:    linux-media@vger.kernel.org
@@@ -5809,23 -5751,12 +5809,23 @@@ L:   linux-edac@vger.kernel.or
  S:    Maintained
  F:    drivers/edac/amd64_edac*
  
 +EDAC-ARMADA
 +M:    Jan Luebbe <jlu@pengutronix.de>
 +L:    linux-edac@vger.kernel.org
 +S:    Maintained
 +F:    drivers/edac/armada_xp_*
 +
  EDAC-AST2500
  M:    Stefan Schaeckeler <sschaeck@cisco.com>
  S:    Supported
  F:    drivers/edac/aspeed_edac.c
  F:    Documentation/devicetree/bindings/edac/aspeed-sdram-edac.txt
  
 +EDAC-BLUEFIELD
 +M:    Shravan Kumar Ramani <sramani@mellanox.com>
 +S:    Supported
 +F:    drivers/edac/bluefield_edac.c
 +
  EDAC-CALXEDA
  M:    Robert Richter <rric@kernel.org>
  L:    linux-edac@vger.kernel.org
@@@ -5850,11 -5781,10 +5850,11 @@@ F:   drivers/edac/thunderx_edac
  EDAC-CORE
  M:    Borislav Petkov <bp@alien8.de>
  M:    Mauro Carvalho Chehab <mchehab@kernel.org>
 +M:    Tony Luck <tony.luck@intel.com>
  R:    James Morse <james.morse@arm.com>
 +R:    Robert Richter <rrichter@marvell.com>
  L:    linux-edac@vger.kernel.org
 -T:    git git://git.kernel.org/pub/scm/linux/kernel/git/bp/bp.git for-next
 -T:    git git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-edac.git linux_next
 +T:    git git://git.kernel.org/pub/scm/linux/kernel/git/ras/ras.git edac-for-next
  S:    Supported
  F:    Documentation/admin-guide/ras.rst
  F:    Documentation/driver-api/edac.rst
@@@ -6104,13 -6034,6 +6104,13 @@@ T:    git git://git.kernel.org/pub/scm/lin
  F:    drivers/video/fbdev/s1d13xxxfb.c
  F:    include/video/s1d13xxxfb.h
  
 +EROFS FILE SYSTEM
 +M:    Gao Xiang <gaoxiang25@huawei.com>
 +M:    Chao Yu <yuchao0@huawei.com>
 +L:    linux-erofs@lists.ozlabs.org
 +S:    Maintained
 +F:    fs/erofs/
 +
  ERRSEQ ERROR TRACKING INFRASTRUCTURE
  M:    Jeff Layton <jlayton@kernel.org>
  S:    Maintained
@@@ -6138,7 -6061,7 +6138,7 @@@ M:      Florian Fainelli <f.fainelli@gmail.c
  M:    Heiner Kallweit <hkallweit1@gmail.com>
  L:    netdev@vger.kernel.org
  S:    Maintained
 -F:    Documentation/ABI/testing/sysfs-bus-mdio
 +F:    Documentation/ABI/testing/sysfs-class-net-phydev
  F:    Documentation/devicetree/bindings/net/ethernet-phy.yaml
  F:    Documentation/devicetree/bindings/net/mdio*
  F:    Documentation/networking/phy.rst
@@@ -6155,11 -6078,6 +6155,11 @@@ F:    include/trace/events/mdio.
  F:    include/uapi/linux/mdio.h
  F:    include/uapi/linux/mii.h
  
 +EXFAT FILE SYSTEM
 +M:    Valdis Kletnieks <valdis.kletnieks@vt.edu>
 +S:    Maintained
 +F:    drivers/staging/exfat/
 +
  EXT2 FILE SYSTEM
  M:    Jan Kara <jack@suse.com>
  L:    linux-ext4@vger.kernel.org
@@@ -6346,14 -6264,12 +6346,14 @@@ S:   Maintaine
  F:    drivers/hwmon/f75375s.c
  F:    include/linux/f75375s.h
  
 -FIREWIRE AUDIO DRIVERS
 +FIREWIRE AUDIO DRIVERS and IEC 61883-1/6 PACKET STREAMING ENGINE
  M:    Clemens Ladisch <clemens@ladisch.de>
 +M:    Takashi Sakamoto <o-takashi@sakamocchi.jp>
  L:    alsa-devel@alsa-project.org (moderated for non-subscribers)
  T:    git git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound.git
  S:    Maintained
  F:    sound/firewire/
 +F:    include/uapi/sound/firewire.h
  
  FIREWIRE MEDIA DRIVERS (firedtv)
  M:    Stefan Richter <stefanr@s5r6.in-berlin.de>
@@@ -6401,21 -6317,29 +6401,21 @@@ FLEXTIMER FTM-QUADDEC DRIVE
  M:    Patrick Havelange <patrick.havelange@essensium.com>
  L:    linux-iio@vger.kernel.org
  S:    Maintained
 -F:    Documentation/ABI/testing/sysfs-bus-counter-ftm-quadddec
 +F:    Documentation/ABI/testing/sysfs-bus-counter-ftm-quaddec
  F:    Documentation/devicetree/bindings/counter/ftm-quaddec.txt
  F:    drivers/counter/ftm-quaddec.c
  
  FLOPPY DRIVER
 -S:    Orphan
 +M:    Denis Efremov <efremov@linux.com>
 +S:    Odd Fixes
  L:    linux-block@vger.kernel.org
  F:    drivers/block/floppy.c
  
 -FMC SUBSYSTEM
 -M:    Alessandro Rubini <rubini@gnudd.com>
 -W:    http://www.ohwr.org/projects/fmc-bus
 -S:    Supported
 -F:    drivers/fmc/
 -F:    include/linux/fmc*.h
 -F:    include/linux/ipmi-fru.h
 -K:    fmc_d.*register
 -
  FPGA MANAGER FRAMEWORK
  M:    Moritz Fischer <mdf@kernel.org>
  L:    linux-fpga@vger.kernel.org
  S:    Maintained
 -T:    git git://git.kernel.org/pub/scm/linux/kernel/git/atull/linux-fpga.git
 +T:    git git://git.kernel.org/pub/scm/linux/kernel/git/mdf/linux-fpga.git
  Q:    http://patchwork.kernel.org/project/linux-fpga/list/
  F:    Documentation/fpga/
  F:    Documentation/driver-api/fpga/
@@@ -6448,7 -6372,7 +6448,7 @@@ FRAMEBUFFER LAYE
  M:    Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
  L:    dri-devel@lists.freedesktop.org
  L:    linux-fbdev@vger.kernel.org
 -T:    git git://github.com/bzolnier/linux.git
 +T:    git git://anongit.freedesktop.org/drm/drm-misc
  Q:    http://patchwork.kernel.org/project/linux-fbdev/list/
  S:    Maintained
  F:    Documentation/fb/
@@@ -6510,17 -6434,8 +6510,17 @@@ M:    Frank Li <Frank.li@nxp.com
  L:    linux-arm-kernel@lists.infradead.org
  S:    Maintained
  F:    drivers/perf/fsl_imx8_ddr_perf.c
 +F:    Documentation/admin-guide/perf/imx-ddr.rst
  F:    Documentation/devicetree/bindings/perf/fsl-imx-ddr.txt
  
 +FREESCALE IMX I2C DRIVER
 +M:    Oleksij Rempel <o.rempel@pengutronix.de>
 +R:    Pengutronix Kernel Team <kernel@pengutronix.de>
 +L:    linux-i2c@vger.kernel.org
 +S:    Maintained
 +F:    drivers/i2c/busses/i2c-imx.c
 +F:    Documentation/devicetree/bindings/i2c/i2c-imx.txt
 +
  FREESCALE IMX LPI2C DRIVER
  M:    Dong Aisheng <aisheng.dong@nxp.com>
  L:    linux-i2c@vger.kernel.org
@@@ -6683,7 -6598,6 +6683,7 @@@ T:      git git://git.kernel.org/pub/scm/fs/
  S:    Supported
  F:    fs/crypto/
  F:    include/linux/fscrypt*.h
 +F:    include/uapi/linux/fscrypt.h
  F:    Documentation/filesystems/fscrypt.rst
  
  FSI SUBSYSTEM
@@@ -6715,18 -6629,6 +6715,18 @@@ S:    Maintaine
  F:    fs/notify/
  F:    include/linux/fsnotify*.h
  
 +FSVERITY: READ-ONLY FILE-BASED AUTHENTICITY PROTECTION
 +M:    Eric Biggers <ebiggers@kernel.org>
 +M:    Theodore Y. Ts'o <tytso@mit.edu>
 +L:    linux-fscrypt@vger.kernel.org
 +Q:    https://patchwork.kernel.org/project/linux-fscrypt/list/
 +T:    git git://git.kernel.org/pub/scm/fs/fscrypt/fscrypt.git fsverity
 +S:    Supported
 +F:    fs/verity/
 +F:    include/linux/fsverity.h
 +F:    include/uapi/linux/fsverity.h
 +F:    Documentation/filesystems/fsverity.rst
 +
  FUJITSU LAPTOP EXTRAS
  M:    Jonathan Woithe <jwoithe@just42.net>
  L:    platform-driver-x86@vger.kernel.org
@@@ -6817,13 -6719,6 +6817,13 @@@ W:    https://linuxtv.or
  S:    Maintained
  F:    drivers/media/radio/radio-gemtek*
  
 +GENERIC ARCHITECTURE TOPOLOGY
 +M:    Sudeep Holla <sudeep.holla@arm.com>
 +L:    linux-kernel@vger.kernel.org
 +S:    Maintained
 +F:    drivers/base/arch_topology.c
 +F:    include/linux/arch_topology.h
 +
  GENERIC GPIO I2C DRIVER
  M:    Wolfram Sang <wsa+renesas@sang-engineering.com>
  S:    Supported
@@@ -6836,7 -6731,7 +6836,7 @@@ L:      linux-i2c@vger.kernel.or
  S:    Supported
  F:    drivers/i2c/muxes/i2c-mux-gpio.c
  F:    include/linux/platform_data/i2c-mux-gpio.h
 -F:    Documentation/i2c/muxes/i2c-mux-gpio
 +F:    Documentation/i2c/muxes/i2c-mux-gpio.rst
  
  GENERIC HDLC (WAN) DRIVERS
  M:    Krzysztof Halasa <khc@pm.waw.pl>
@@@ -6927,6 -6822,13 +6927,6 @@@ F:     Documentation/filesystems/gfs2*.tx
  F:    fs/gfs2/
  F:    include/uapi/linux/gfs2_ondisk.h
  
 -GIGASET ISDN DRIVERS
 -M:    Paul Bolle <pebolle@tiscali.nl>
 -L:    gigaset307x-common@lists.sourceforge.net
 -W:    http://gigaset307x.sourceforge.net/
 -S:    Odd Fixes
 -F:    drivers/staging/isdn/gigaset/
 -
  GNSS SUBSYSTEM
  M:    Johan Hovold <johan@kernel.org>
  T:    git git://git.kernel.org/pub/scm/linux/kernel/git/johan/gnss.git
@@@ -6954,7 -6856,7 +6954,7 @@@ R:      Sagi Shahar <sagis@google.com
  R:    Jon Olson <jonolson@google.com>
  L:    netdev@vger.kernel.org
  S:    Supported
 -F:    Documentation/networking/device_drivers/google/gve.txt
 +F:    Documentation/networking/device_drivers/google/gve.rst
  F:    drivers/net/ethernet/google
  
  GPD POCKET FAN DRIVER
@@@ -7080,9 -6982,6 +7080,9 @@@ M:      Alex Elder <elder@kernel.org
  M:    Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  S:    Maintained
  F:    drivers/staging/greybus/
 +F:    drivers/greybus/
 +F:    include/linux/greybus.h
 +F:    include/linux/greybus/
  L:    greybus-dev@lists.linaro.org (moderated for non-subscribers)
  
  GREYBUS UART PROTOCOLS DRIVERS
@@@ -7408,17 -7307,6 +7408,17 @@@ S:    Supporte
  F:    drivers/scsi/hisi_sas/
  F:    Documentation/devicetree/bindings/scsi/hisilicon-sas.txt
  
 +HISILICON QM AND ZIP Controller DRIVER
 +M:    Zhou Wang <wangzhou1@hisilicon.com>
 +L:    linux-crypto@vger.kernel.org
 +S:    Maintained
 +F:    drivers/crypto/hisilicon/qm.c
 +F:    drivers/crypto/hisilicon/qm.h
 +F:    drivers/crypto/hisilicon/sgl.c
 +F:    drivers/crypto/hisilicon/sgl.h
 +F:    drivers/crypto/hisilicon/zip/
 +F:    Documentation/ABI/testing/debugfs-hisi-zip
 +
  HMM - Heterogeneous Memory Management
  M:    Jérôme Glisse <jglisse@redhat.com>
  L:    linux-mm@kvack.org
@@@ -7562,12 -7450,11 +7562,12 @@@ F:   drivers/hid/hid-hyperv.
  F:    drivers/hv/
  F:    drivers/input/serio/hyperv-keyboard.c
  F:    drivers/pci/controller/pci-hyperv.c
 +F:    drivers/pci/controller/pci-hyperv-intf.c
  F:    drivers/net/hyperv/
  F:    drivers/scsi/storvsc_drv.c
  F:    drivers/uio/uio_hv_generic.c
  F:    drivers/video/fbdev/hyperv_fb.c
 -F:    drivers/iommu/hyperv_iommu.c
 +F:    drivers/iommu/hyperv-iommu.c
  F:    net/vmw_vsock/hyperv_transport.c
  F:    include/clocksource/hyperv_timer.h
  F:    include/linux/hyperv.h
@@@ -7600,14 -7487,14 +7600,14 @@@ I2C CONTROLLER DRIVER FOR NVIDIA GP
  M:    Ajay Gupta <ajayg@nvidia.com>
  L:    linux-i2c@vger.kernel.org
  S:    Maintained
 -F:    Documentation/i2c/busses/i2c-nvidia-gpu
 +F:    Documentation/i2c/busses/i2c-nvidia-gpu.rst
  F:    drivers/i2c/busses/i2c-nvidia-gpu.c
  
  I2C MUXES
  M:    Peter Rosin <peda@axentia.se>
  L:    linux-i2c@vger.kernel.org
  S:    Maintained
 -F:    Documentation/i2c/i2c-topology
 +F:    Documentation/i2c/i2c-topology.rst
  F:    Documentation/i2c/muxes/
  F:    Documentation/devicetree/bindings/i2c/i2c-mux*
  F:    Documentation/devicetree/bindings/i2c/i2c-arb*
@@@ -7620,15 -7507,15 +7620,15 @@@ I2C MV64XXX MARVELL AND ALLWINNER DRIVE
  M:    Gregory CLEMENT <gregory.clement@bootlin.com>
  L:    linux-i2c@vger.kernel.org
  S:    Maintained
 -F:    Documentation/devicetree/bindings/i2c/i2c-mv64xxx.txt
 +F:    Documentation/devicetree/bindings/i2c/marvell,mv64xxx-i2c.yaml
  F:    drivers/i2c/busses/i2c-mv64xxx.c
  
  I2C OVER PARALLEL PORT
  M:    Jean Delvare <jdelvare@suse.com>
  L:    linux-i2c@vger.kernel.org
  S:    Maintained
 -F:    Documentation/i2c/busses/i2c-parport
 -F:    Documentation/i2c/busses/i2c-parport-light
 +F:    Documentation/i2c/busses/i2c-parport.rst
 +F:    Documentation/i2c/busses/i2c-parport-light.rst
  F:    drivers/i2c/busses/i2c-parport.c
  F:    drivers/i2c/busses/i2c-parport-light.c
  
@@@ -7662,7 -7549,7 +7662,7 @@@ I2C-TAOS-EVM DRIVE
  M:    Jean Delvare <jdelvare@suse.com>
  L:    linux-i2c@vger.kernel.org
  S:    Maintained
 -F:    Documentation/i2c/busses/i2c-taos-evm
 +F:    Documentation/i2c/busses/i2c-taos-evm.rst
  F:    drivers/i2c/busses/i2c-taos-evm.c
  
  I2C-TINY-USB DRIVER
@@@ -7676,19 -7563,19 +7676,19 @@@ I2C/SMBUS CONTROLLER DRIVERS FOR P
  M:    Jean Delvare <jdelvare@suse.com>
  L:    linux-i2c@vger.kernel.org
  S:    Maintained
 -F:    Documentation/i2c/busses/i2c-ali1535
 -F:    Documentation/i2c/busses/i2c-ali1563
 -F:    Documentation/i2c/busses/i2c-ali15x3
 -F:    Documentation/i2c/busses/i2c-amd756
 -F:    Documentation/i2c/busses/i2c-amd8111
 -F:    Documentation/i2c/busses/i2c-i801
 -F:    Documentation/i2c/busses/i2c-nforce2
 -F:    Documentation/i2c/busses/i2c-piix4
 -F:    Documentation/i2c/busses/i2c-sis5595
 -F:    Documentation/i2c/busses/i2c-sis630
 -F:    Documentation/i2c/busses/i2c-sis96x
 -F:    Documentation/i2c/busses/i2c-via
 -F:    Documentation/i2c/busses/i2c-viapro
 +F:    Documentation/i2c/busses/i2c-ali1535.rst
 +F:    Documentation/i2c/busses/i2c-ali1563.rst
 +F:    Documentation/i2c/busses/i2c-ali15x3.rst
 +F:    Documentation/i2c/busses/i2c-amd756.rst
 +F:    Documentation/i2c/busses/i2c-amd8111.rst
 +F:    Documentation/i2c/busses/i2c-i801.rst
 +F:    Documentation/i2c/busses/i2c-nforce2.rst
 +F:    Documentation/i2c/busses/i2c-piix4.rst
 +F:    Documentation/i2c/busses/i2c-sis5595.rst
 +F:    Documentation/i2c/busses/i2c-sis630.rst
 +F:    Documentation/i2c/busses/i2c-sis96x.rst
 +F:    Documentation/i2c/busses/i2c-via.rst
 +F:    Documentation/i2c/busses/i2c-viapro.rst
  F:    drivers/i2c/busses/i2c-ali1535.c
  F:    drivers/i2c/busses/i2c-ali1563.c
  F:    drivers/i2c/busses/i2c-ali15x3.c
@@@ -7717,7 -7604,7 +7717,7 @@@ M:      Seth Heasley <seth.heasley@intel.com
  M:    Neil Horman <nhorman@tuxdriver.com>
  L:    linux-i2c@vger.kernel.org
  F:    drivers/i2c/busses/i2c-ismt.c
 -F:    Documentation/i2c/busses/i2c-ismt
 +F:    Documentation/i2c/busses/i2c-ismt.rst
  
  I2C/SMBUS STUB DRIVER
  M:    Jean Delvare <jdelvare@suse.com>
@@@ -7773,7 -7660,7 +7773,7 @@@ F:      drivers/crypto/nx/nx-aes
  F:    drivers/crypto/nx/nx-sha*
  F:    drivers/crypto/nx/nx.*
  F:    drivers/crypto/nx/nx_csbcpb.h
 -F:    drivers/crypto/nx/nx_debugfs.h
 +F:    drivers/crypto/nx/nx_debugfs.c
  
  IBM Power Linux RAID adapter
  M:    Brian King <brking@us.ibm.com>
@@@ -8157,7 -8044,6 +8157,7 @@@ S:      Maintaine
  F:    drivers/video/fbdev/i810/
  
  INTEL ASoC DRIVERS
 +M:    Cezary Rojewski <cezary.rojewski@intel.com>
  M:    Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
  M:    Liam Girdwood <liam.r.girdwood@linux.intel.com>
  M:    Jie Yang <yang.jie@linux.intel.com>
@@@ -8179,13 -8065,6 +8179,13 @@@ T:    git git://git.code.sf.net/p/intel-sa
  S:    Supported
  F:    drivers/scsi/isci/
  
 +INTEL CPU family model numbers
 +M:    Tony Luck <tony.luck@intel.com>
 +M:    x86@kernel.org
 +L:    linux-kernel@vger.kernel.org
 +S:    Supported
 +F:    arch/x86/include/asm/intel-family.h
 +
  INTEL DRM DRIVERS (excluding Poulsbo, Moorestown and derivative chipsets)
  M:    Jani Nikula <jani.nikula@linux.intel.com>
  M:    Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
@@@ -8430,17 -8309,6 +8430,17 @@@ F:    drivers/platform/x86/intel_speed_sel
  F:    tools/power/x86/intel-speed-select/
  F:    include/uapi/linux/isst_if.h
  
 +INTEL STRATIX10 FIRMWARE DRIVERS
 +M:    Richard Gong <richard.gong@linux.intel.com>
 +L:    linux-kernel@vger.kernel.org
 +S:    Maintained
 +F:    drivers/firmware/stratix10-rsu.c
 +F:    drivers/firmware/stratix10-svc.c
 +F:    include/linux/firmware/intel/stratix10-smc.h
 +F:    include/linux/firmware/intel/stratix10-svc-client.h
 +F:    Documentation/ABI/testing/sysfs-devices-platform-stratix10-rsu
 +F:    Documentation/devicetree/bindings/firmware/intel,stratix10-svc.txt
 +
  INTEL TELEMETRY DRIVER
  M:    Rajneesh Bhardwaj <rajneesh.bhardwaj@linux.intel.com>
  M:    "David E. Box" <david.e.box@linux.intel.com>
@@@ -8478,7 -8346,7 +8478,7 @@@ M:      linux-wimax@intel.co
  L:    wimax@linuxwimax.org (subscribers-only)
  S:    Supported
  W:    http://linuxwimax.org
 -F:    Documentation/wimax/README.i2400m
 +F:    Documentation/admin-guide/wimax/i2400m.rst
  F:    drivers/net/wimax/i2400m/
  F:    include/uapi/linux/wimax/i2400m.h
  
@@@ -8492,7 -8360,6 +8492,7 @@@ M:      Alexander Shishkin <alexander.shishk
  S:    Supported
  F:    Documentation/trace/intel_th.rst
  F:    drivers/hwtracing/intel_th/
 +F:    include/linux/intel_th.h
  
  INTEL(R) TRUSTED EXECUTION TECHNOLOGY (TXT)
  M:    Ning Sun <ning.sun@intel.com>
@@@ -8504,6 -8371,12 +8504,6 @@@ F:     Documentation/x86/intel_txt.rs
  F:    include/linux/tboot.h
  F:    arch/x86/kernel/tboot.c
  
 -INTEL-MID GPIO DRIVER
 -M:    David Cohen <david.a.cohen@linux.intel.com>
 -L:    linux-gpio@vger.kernel.org
 -S:    Maintained
 -F:    drivers/gpio/gpio-intel-mid.c
 -
  INTERCONNECT API
  M:    Georgi Djakov <georgi.djakov@linaro.org>
  L:    linux-pm@vger.kernel.org
@@@ -8528,6 -8401,12 +8528,6 @@@ L:     linux-mips@vger.kernel.or
  S:    Maintained
  F:    drivers/net/ethernet/sgi/ioc3-eth.c
  
 -IOC3 SERIAL DRIVER
 -M:    Pat Gefre <pfg@sgi.com>
 -L:    linux-serial@vger.kernel.org
 -S:    Maintained
 -F:    drivers/tty/serial/ioc3_serial.c
 -
  IOMAP FILESYSTEM LIBRARY
  M:    Christoph Hellwig <hch@infradead.org>
  M:    Darrick J. Wong <darrick.wong@oracle.com>
@@@ -8537,6 -8416,7 +8537,6 @@@ L:      linux-xfs@vger.kernel.or
  L:    linux-fsdevel@vger.kernel.org
  T:    git git://git.kernel.org/pub/scm/fs/xfs/xfs-linux.git
  S:    Supported
 -F:    fs/iomap.c
  F:    fs/iomap/
  F:    include/linux/iomap.h
  
@@@ -8561,6 -8441,11 +8561,6 @@@ S:     Maintaine
  F:    fs/io_uring.c
  F:    include/uapi/linux/io_uring.h
  
 -IP MASQUERADING
 -M:    Juanjo Ciarlante <jjciarla@raiz.uncu.edu.ar>
 -S:    Maintained
 -F:    net/ipv4/netfilter/ipt_MASQUERADE.c
 -
  IPMI SUBSYSTEM
  M:    Corey Minyard <minyard@acm.org>
  L:    openipmi-developer@lists.sourceforge.net (moderated for non-subscribers)
@@@ -8605,7 -8490,7 +8605,7 @@@ S:      Obsolet
  F:    include/uapi/linux/ipx.h
  
  IRQ DOMAINS (IRQ NUMBER MAPPING LIBRARY)
 -M:    Marc Zyngier <marc.zyngier@arm.com>
 +M:    Marc Zyngier <maz@kernel.org>
  S:    Maintained
  T:    git git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git irq/core
  F:    Documentation/IRQ-domain.txt
@@@ -8623,7 -8508,7 +8623,7 @@@ F:      kernel/irq
  IRQCHIP DRIVERS
  M:    Thomas Gleixner <tglx@linutronix.de>
  M:    Jason Cooper <jason@lakedaemon.net>
 -M:    Marc Zyngier <marc.zyngier@arm.com>
 +M:    Marc Zyngier <maz@kernel.org>
  L:    linux-kernel@vger.kernel.org
  S:    Maintained
  T:    git git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git irq/core
@@@ -8764,7 -8649,7 +8764,7 @@@ L:      jfs-discussion@lists.sourceforge.ne
  W:    http://jfs.sourceforge.net/
  T:    git git://github.com/kleikamp/linux-shaggy.git
  S:    Maintained
 -F:    Documentation/filesystems/jfs.txt
 +F:    Documentation/admin-guide/jfs.rst
  F:    fs/jfs/
  
  JME NETWORK DRIVER
@@@ -8923,7 -8808,7 +8923,7 @@@ L:      kvm@vger.kernel.or
  W:    http://www.linux-kvm.org
  T:    git git://git.kernel.org/pub/scm/virt/kvm/kvm.git
  S:    Supported
 -F:    Documentation/virtual/kvm/
 +F:    Documentation/virt/kvm/
  F:    include/trace/events/kvm.h
  F:    include/uapi/asm-generic/kvm*
  F:    include/uapi/linux/kvm*
@@@ -8934,11 -8819,19 +8934,11 @@@ F:   virt/kvm/
  F:    tools/kvm/
  F:    tools/testing/selftests/kvm/
  
 -KERNEL VIRTUAL MACHINE FOR AMD-V (KVM/amd)
 -M:    Joerg Roedel <joro@8bytes.org>
 -L:    kvm@vger.kernel.org
 -W:    http://www.linux-kvm.org/
 -S:    Maintained
 -F:    arch/x86/include/asm/svm.h
 -F:    arch/x86/kvm/svm.c
 -
  KERNEL VIRTUAL MACHINE FOR ARM/ARM64 (KVM/arm, KVM/arm64)
 -M:    Marc Zyngier <marc.zyngier@arm.com>
 +M:    Marc Zyngier <maz@kernel.org>
  R:    James Morse <james.morse@arm.com>
 -R:    Julien Thierry <julien.thierry@arm.com>
 -R:    Suzuki K Pouloze <suzuki.poulose@arm.com>
 +R:    Julien Thierry <julien.thierry.kdev@gmail.com>
 +R:    Suzuki K Poulose <suzuki.poulose@arm.com>
  L:    linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
  L:    kvmarm@lists.cs.columbia.edu
  T:    git git://git.kernel.org/pub/scm/linux/kernel/git/kvmarm/kvmarm.git
@@@ -8976,7 -8869,7 +8976,7 @@@ M:      Christian Borntraeger <borntraeger@d
  M:    Janosch Frank <frankja@linux.ibm.com>
  R:    David Hildenbrand <david@redhat.com>
  R:    Cornelia Huck <cohuck@redhat.com>
 -L:    linux-s390@vger.kernel.org
 +L:    kvm@vger.kernel.org
  W:    http://www.ibm.com/developerworks/linux/linux390/
  T:    git git://git.kernel.org/pub/scm/linux/kernel/git/kvms390/linux.git
  S:    Supported
@@@ -8991,11 -8884,6 +8991,11 @@@ F:    tools/testing/selftests/kvm/*/s390x
  KERNEL VIRTUAL MACHINE FOR X86 (KVM/x86)
  M:    Paolo Bonzini <pbonzini@redhat.com>
  M:    Radim Krčmář <rkrcmar@redhat.com>
 +R:    Sean Christopherson <sean.j.christopherson@intel.com>
 +R:    Vitaly Kuznetsov <vkuznets@redhat.com>
 +R:    Wanpeng Li <wanpengli@tencent.com>
 +R:    Jim Mattson <jmattson@google.com>
 +R:    Joerg Roedel <joro@8bytes.org>
  L:    kvm@vger.kernel.org
  W:    http://www.linux-kvm.org
  T:    git git://git.kernel.org/pub/scm/virt/kvm/kvm.git
@@@ -9003,12 -8891,8 +9003,12 @@@ S:    Supporte
  F:    arch/x86/kvm/
  F:    arch/x86/kvm/*/
  F:    arch/x86/include/uapi/asm/kvm*
 +F:    arch/x86/include/uapi/asm/vmx.h
 +F:    arch/x86/include/uapi/asm/svm.h
  F:    arch/x86/include/asm/kvm*
  F:    arch/x86/include/asm/pvclock-abi.h
 +F:    arch/x86/include/asm/svm.h
 +F:    arch/x86/include/asm/vmx.h
  F:    arch/x86/kernel/kvm.c
  F:    arch/x86/kernel/kvmclock.c
  
@@@ -9040,7 -8924,7 +9040,7 @@@ F:      security/keys/encrypted-keys
  
  KEYS-TRUSTED
  M:    James Bottomley <jejb@linux.ibm.com>
 -M:      Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
 +M:    Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
  M:    Mimi Zohar <zohar@linux.ibm.com>
  L:    linux-integrity@vger.kernel.org
  L:    keyrings@vger.kernel.org
@@@ -9107,7 -8991,7 +9107,7 @@@ F:      kernel/kprobes.
  KS0108 LCD CONTROLLER DRIVER
  M:    Miguel Ojeda Sandonis <miguel.ojeda.sandonis@gmail.com>
  S:    Maintained
 -F:    Documentation/auxdisplay/ks0108
 +F:    Documentation/admin-guide/auxdisplay/ks0108.rst
  F:    drivers/auxdisplay/ks0108.c
  F:    include/linux/ks0108.h
  
@@@ -9336,18 -9220,6 +9336,18 @@@ F:    include/linux/nd.
  F:    include/linux/libnvdimm.h
  F:    include/uapi/linux/ndctl.h
  
 +LICENSES and SPDX stuff
 +M:    Thomas Gleixner <tglx@linutronix.de>
 +M:    Greg Kroah-Hartman <gregkh@linuxfoundation.org>
 +L:    linux-spdx@vger.kernel.org
 +S:    Maintained
 +T:    git git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/spdx.git
 +F:    COPYING
 +F:    Documentation/process/license-rules.rst
 +F:    LICENSES/
 +F:    scripts/spdxcheck-test.sh
 +F:    scripts/spdxcheck.py
 +
  LIGHTNVM PLATFORM SUPPORT
  M:    Matias Bjorling <mb@lightnvm.io>
  W:    http://github/OpenChannelSSD
@@@ -9454,7 -9326,7 +9454,7 @@@ F:      drivers/misc/lkdtm/
  
  LINUX KERNEL MEMORY CONSISTENCY MODEL (LKMM)
  M:    Alan Stern <stern@rowland.harvard.edu>
 -M:    Andrea Parri <andrea.parri@amarulasolutions.com>
 +M:    Andrea Parri <parri.andrea@gmail.com>
  M:    Will Deacon <will@kernel.org>
  M:    Peter Zijlstra <peterz@infradead.org>
  M:    Boqun Feng <boqun.feng@gmail.com>
@@@ -9462,7 -9334,7 +9462,7 @@@ M:      Nicholas Piggin <npiggin@gmail.com
  M:    David Howells <dhowells@redhat.com>
  M:    Jade Alglave <j.alglave@ucl.ac.uk>
  M:    Luc Maranget <luc.maranget@inria.fr>
 -M:    "Paul E. McKenney" <paulmck@linux.ibm.com>
 +M:    "Paul E. McKenney" <paulmck@kernel.org>
  R:    Akira Yokosawa <akiyks@gmail.com>
  R:    Daniel Lustig <dlustig@nvidia.com>
  L:    linux-kernel@vger.kernel.org
@@@ -9696,7 -9568,7 +9696,7 @@@ F:      Documentation/networking/mac80211-in
  F:    include/net/mac80211.h
  F:    net/mac80211/
  F:    drivers/net/wireless/mac80211_hwsim.[ch]
 -F:    Documentation/networking/mac80211_hwsim/README
 +F:    Documentation/networking/mac80211_hwsim/mac80211_hwsim.rst
  
  MAILBOX API
  M:    Jassi Brar <jassisinghbrar@gmail.com>
@@@ -10145,8 -10017,8 +10145,8 @@@ L:   linux-media@vger.kernel.or
  L:    linux-renesas-soc@vger.kernel.org
  T:    git git://linuxtv.org/media_tree.git
  S:    Supported
 -F:    Documentation/devicetree/bindings/media/renesas,rcar-csi2.txt
 -F:    Documentation/devicetree/bindings/media/rcar_vin.txt
 +F:    Documentation/devicetree/bindings/media/renesas,csi2.txt
 +F:    Documentation/devicetree/bindings/media/renesas,vin.txt
  F:    drivers/media/platform/rcar-vin/
  
  MEDIA DRIVERS FOR RENESAS - VSP1
@@@ -10473,7 -10345,7 +10473,7 @@@ L:   linux-i2c@vger.kernel.or
  S:    Supported
  F:    drivers/i2c/busses/i2c-mlxcpld.c
  F:    drivers/i2c/muxes/i2c-mux-mlxcpld.c
 -F:    Documentation/i2c/busses/i2c-mlxcpld
 +F:    Documentation/i2c/busses/i2c-mlxcpld.rst
  
  MELLANOX MLXCPLD LED DRIVER
  M:    Vadim Pasternak <vadimp@mellanox.com>
@@@ -10491,7 -10363,7 +10491,7 @@@ F:   drivers/platform/x86/mlx-platform.
  
  MEMBARRIER SUPPORT
  M:    Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
 -M:    "Paul E. McKenney" <paulmck@linux.ibm.com>
 +M:    "Paul E. McKenney" <paulmck@kernel.org>
  L:    linux-kernel@vger.kernel.org
  S:    Supported
  F:    kernel/sched/membarrier.c
@@@ -10743,6 -10615,12 +10743,6 @@@ M:  Nicolas Ferre <nicolas.ferre@microch
  S:    Supported
  F:    drivers/power/reset/at91-sama5d2_shdwc.c
  
 -MICROCHIP SAMA5D2-COMPATIBLE PIOBU GPIO
 -M:    Andrei Stefanescu <andrei.stefanescu@microchip.com>
 -L:    linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
 -L:    linux-gpio@vger.kernel.org
 -F:    drivers/gpio/gpio-sama5d2-piobu.c
 -
  MICROCHIP SPI DRIVER
  M:    Nicolas Ferre <nicolas.ferre@microchip.com>
  S:    Supported
@@@ -10755,6 -10633,13 +10755,6 @@@ S:  Supporte
  F:    drivers/misc/atmel-ssc.c
  F:    include/linux/atmel-ssc.h
  
 -MICROCHIP TIMER COUNTER (TC) AND CLOCKSOURCE DRIVERS
 -M:    Nicolas Ferre <nicolas.ferre@microchip.com>
 -L:    linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
 -S:    Supported
 -F:    drivers/misc/atmel_tclib.c
 -F:    drivers/clocksource/tcb_clksrc.c
 -
  MICROCHIP USBA UDC DRIVER
  M:    Cristian Birsan <cristian.birsan@microchip.com>
  L:    linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
@@@ -11187,7 -11072,7 +11187,7 @@@ NET_FAILOVER MODUL
  M:    Sridhar Samudrala <sridhar.samudrala@intel.com>
  L:    netdev@vger.kernel.org
  S:    Supported
 -F:    driver/net/net_failover.c
 +F:    drivers/net/net_failover.c
  F:    include/net/net_failover.h
  F:    Documentation/networking/net_failover.rst
  
@@@ -11259,8 -11144,6 +11259,8 @@@ L:   netdev@vger.kernel.or
  S:    Maintained
  W:    https://fedorahosted.org/dropwatch/
  F:    net/core/drop_monitor.c
 +F:    include/uapi/linux/net_dropmon.h
 +F:    include/net/drop_monitor.h
  
  NETWORKING DRIVERS
  M:    "David S. Miller" <davem@davemloft.net>
@@@ -11399,7 -11282,6 +11399,7 @@@ M:   Aviad Yehezkel <aviadye@mellanox.com
  M:    Dave Watson <davejwatson@fb.com>
  M:    John Fastabend <john.fastabend@gmail.com>
  M:    Daniel Borkmann <daniel@iogearbox.net>
 +M:    Jakub Kicinski <jakub.kicinski@netronome.com>
  L:    netdev@vger.kernel.org
  S:    Maintained
  F:    net/tls/*
@@@ -11440,6 -11322,7 +11440,6 @@@ F:   include/net/nfc
  F:    include/uapi/linux/nfc.h
  F:    drivers/nfc/
  F:    include/linux/platform_data/nfcmrvl.h
 -F:    include/linux/platform_data/nxp-nci.h
  F:    Documentation/devicetree/bindings/net/nfc/
  
  NFS, SUNRPC, AND LOCKD CLIENTS
@@@ -11517,6 -11400,7 +11517,6 @@@ NOKIA N900 POWER SUPPLY DRIVER
  R:    Pali Rohár <pali.rohar@gmail.com>
  F:    include/linux/power/bq2415x_charger.h
  F:    include/linux/power/bq27xxx_battery.h
 -F:    include/linux/power/isp1704_charger.h
  F:    drivers/power/supply/bq2415x_charger.c
  F:    drivers/power/supply/bq27xxx_battery.c
  F:    drivers/power/supply/bq27xxx_battery_i2c.c
@@@ -11529,11 -11413,6 +11529,11 @@@ S: Maintaine
  T:    git git://git.kernel.org/pub/scm/linux/kernel/git/wtarreau/nolibc.git
  F:    tools/include/nolibc/
  
 +NSDEPS
 +M:    Matthias Maennich <maennich@google.com>
 +S:    Maintained
 +F:    scripts/nsdeps
 +
  NTB AMD DRIVER
  M:    Shyam Sundar S K <Shyam-sundar.S-k@amd.com>
  L:    linux-ntb@googlegroups.com
@@@ -11884,7 -11763,6 +11884,7 @@@ S:   Maintaine
  F:    arch/arm/mach-omap2/
  F:    arch/arm/plat-omap/
  F:    arch/arm/configs/omap2plus_defconfig
 +F:    drivers/bus/ti-sysc.c
  F:    drivers/i2c/busses/i2c-omap.c
  F:    drivers/irqchip/irq-omap-intc.c
  F:    drivers/mfd/*omap*.c
@@@ -11905,7 -11783,6 +11905,7 @@@ F:   drivers/regulator/tps65910-regulator
  F:    drivers/regulator/twl-regulator.c
  F:    drivers/regulator/twl6030-regulator.c
  F:    include/linux/platform_data/i2c-omap.h
 +F:    include/linux/platform_data/ti-sysc.h
  
  ONION OMEGA2+ BOARD
  M:    Harvey Hunt <harveyhuntnexus@gmail.com>
@@@ -11968,21 -11845,6 +11968,21 @@@ T: git git://linuxtv.org/media_tree.gi
  S:    Maintained
  F:    drivers/media/i2c/ov5647.c
  
 +OMNIVISION OV5670 SENSOR DRIVER
 +M:    Chiranjeevi Rapolu <chiranjeevi.rapolu@intel.com>
 +M:    Hyungwoo Yang <hyungwoo.yang@intel.com>
 +L:    linux-media@vger.kernel.org
 +T:    git git://linuxtv.org/media_tree.git
 +S:    Maintained
 +F:    drivers/media/i2c/ov5670.c
 +
 +OMNIVISION OV5675 SENSOR DRIVER
 +M:    Shawn Tu <shawnx.tu@intel.com>
 +L:    linux-media@vger.kernel.org
 +T:    git git://linuxtv.org/media_tree.git
 +S:    Maintained
 +F:    drivers/media/i2c/ov5675.c
 +
  OMNIVISION OV5695 SENSOR DRIVER
  M:    Shunqian Zheng <zhengsq@rock-chips.com>
  L:    linux-media@vger.kernel.org
@@@ -12104,7 -11966,7 +12104,7 @@@ M:   Andrew Lunn <andrew@lunn.ch
  L:    linux-i2c@vger.kernel.org
  S:    Maintained
  F:    Documentation/devicetree/bindings/i2c/i2c-ocores.txt
 -F:    Documentation/i2c/busses/i2c-ocores
 +F:    Documentation/i2c/busses/i2c-ocores.rst
  F:    drivers/i2c/busses/i2c-ocores.c
  F:    include/linux/platform_data/i2c-ocores.h
  
@@@ -12227,7 -12089,7 +12227,7 @@@ L:   netdev@vger.kernel.or
  S:    Supported
  F:    lib/packing.c
  F:    include/linux/packing.h
 -F:    Documentation/packing.txt
 +F:    Documentation/core-api/packing.rst
  
  PADATA PARALLEL EXECUTION MECHANISM
  M:    Steffen Klassert <steffen.klassert@secunet.com>
@@@ -12275,7 -12137,7 +12275,7 @@@ M:   Thomas Hellstrom <thellstrom@vmware.
  M:    "VMware, Inc." <pv-drivers@vmware.com>
  L:    virtualization@lists.linux-foundation.org
  S:    Supported
 -F:    Documentation/virtual/paravirt_ops.txt
 +F:    Documentation/virt/paravirt_ops.rst
  F:    arch/*/kernel/paravirt*
  F:    arch/*/include/asm/paravirt*.h
  F:    include/linux/hypervisor.h
@@@ -12532,7 -12394,7 +12532,7 @@@ F:   Documentation/PCI/pci-error-recovery
  F:    drivers/pci/pcie/aer.c
  F:    drivers/pci/pcie/dpc.c
  F:    drivers/pci/pcie/err.c
 -F:    Documentation/powerpc/eeh-pci-error-recovery.txt
 +F:    Documentation/powerpc/eeh-pci-error-recovery.rst
  F:    arch/powerpc/kernel/eeh*.c
  F:    arch/powerpc/platforms/*/eeh*.c
  F:    arch/powerpc/include/*/eeh*.h
@@@ -12580,16 -12442,18 +12580,18 @@@ F:        arch/x86/kernel/early-quirks.
  
  PCI NATIVE HOST BRIDGE AND ENDPOINT DRIVERS
  M:    Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
+ R:    Andrew Murray <andrew.murray@arm.com>
  L:    linux-pci@vger.kernel.org
  Q:    http://patchwork.ozlabs.org/project/linux-pci/list/
  T:    git git://git.kernel.org/pub/scm/linux/kernel/git/lpieralisi/pci.git/
  S:    Supported
  F:    drivers/pci/controller/
  
- PCIE DRIVER FOR ANNAPURNA LABS
+ PCIE DRIVER FOR AMAZON ANNAPURNA LABS
  M:    Jonathan Chocron <jonnyc@amazon.com>
  L:    linux-pci@vger.kernel.org
  S:    Maintained
+ F:    Documentation/devicetree/bindings/pci/pcie-al.txt
  F:    drivers/pci/controller/dwc/pcie-al.c
  
  PCIE DRIVER FOR AMLOGIC MESON
@@@ -12708,14 -12572,6 +12710,14 @@@ L: platform-driver-x86@vger.kernel.or
  S:    Maintained
  F:    drivers/platform/x86/peaq-wmi.c
  
 +PENSANDO ETHERNET DRIVERS
 +M:    Shannon Nelson <snelson@pensando.io>
 +M:    Pensando Drivers <drivers@pensando.io>
 +L:    netdev@vger.kernel.org
 +S:    Supported
 +F:    Documentation/networking/device_drivers/pensando/ionic.rst
 +F:    drivers/net/ethernet/pensando/
 +
  PER-CPU MEMORY ALLOCATOR
  M:    Dennis Zhou <dennis@kernel.org>
  M:    Tejun Heo <tj@kernel.org>
@@@ -12736,7 -12592,6 +12738,7 @@@ PERFORMANCE EVENTS SUBSYSTE
  M:    Peter Zijlstra <peterz@infradead.org>
  M:    Ingo Molnar <mingo@redhat.com>
  M:    Arnaldo Carvalho de Melo <acme@kernel.org>
 +R:    Mark Rutland <mark.rutland@arm.com>
  R:    Alexander Shishkin <alexander.shishkin@linux.intel.com>
  R:    Jiri Olsa <jolsa@redhat.com>
  R:    Namhyung Kim <namhyung@kernel.org>
@@@ -12769,12 -12624,6 +12771,12 @@@ S: Maintaine
  F:    Documentation/input/devices/pxrc.rst
  F:    drivers/input/joystick/pxrc.c
  
 +FLYSKY FSIA6B RC RECEIVER
 +M:    Markus Koch <markus@notsyncing.net>
 +L:    linux-input@vger.kernel.org
 +S:    Maintained
 +F:    drivers/input/joystick/fsia6b.c
 +
  PHONET PROTOCOL
  M:    Remi Denis-Courmont <courmisch@gmail.com>
  S:    Supported
@@@ -12832,7 -12681,6 +12834,7 @@@ L:   linux-arm-kernel@lists.infradead.or
  L:    linux-gpio@vger.kernel.org
  S:    Supported
  F:    drivers/pinctrl/pinctrl-at91*
 +F:    drivers/gpio/gpio-sama5d2-piobu.c
  
  PIN CONTROLLER - FREESCALE
  M:    Dong Aisheng <aisheng.dong@nxp.com>
@@@ -12929,12 -12777,6 +12931,12 @@@ F: drivers/i2c/busses/i2c-puv3.
  F:    drivers/video/fbdev/fb-puv3.c
  F:    drivers/rtc/rtc-puv3.c
  
 +PLANTOWER PMS7003 AIR POLLUTION SENSOR DRIVER
 +M:    Tomasz Duszynski <tduszyns@gmail.com>
 +S:    Maintained
 +F:    drivers/iio/chemical/pms7003.c
 +F:    Documentation/devicetree/bindings/iio/chemical/plantower,pms7003.yaml
 +
  PMBUS HARDWARE MONITORING DRIVERS
  M:    Guenter Roeck <linux@roeck-us.net>
  L:    linux-hwmon@vger.kernel.org
@@@ -13377,7 -13219,7 +13379,7 @@@ M:   Manish Chopra <manishc@marvell.com
  M:    GR-Linux-NIC-Dev@marvell.com
  L:    netdev@vger.kernel.org
  S:    Supported
 -F:    drivers/net/ethernet/qlogic/qlge/
 +F:    drivers/staging/qlge/
  
  QM1D1B0004 MEDIA DRIVER
  M:    Akihiro Tsukada <tskd08@gmail.com>
@@@ -13445,8 -13287,8 +13447,8 @@@ QUALCOMM CPUFREQ DRIVER MSM8996/APQ809
  M:    Ilia Lin <ilia.lin@kernel.org>
  L:    linux-pm@vger.kernel.org
  S:    Maintained
 -F:    Documentation/devicetree/bindings/opp/kryo-cpufreq.txt
 -F:    drivers/cpufreq/qcom-cpufreq-kryo.c
 +F:    Documentation/devicetree/bindings/opp/qcom-nvmem-cpufreq.txt
 +F:    drivers/cpufreq/qcom-cpufreq-nvmem.c
  
  QUALCOMM EMAC GIGABIT ETHERNET DRIVER
  M:    Timur Tabi <timur@kernel.org>
@@@ -13470,8 -13312,9 +13472,8 @@@ S:   Supporte
  F:    drivers/i2c/busses/i2c-qcom-geni.c
  
  QUALCOMM HEXAGON ARCHITECTURE
 -M:    Richard Kuo <rkuo@codeaurora.org>
 +M:    Brian Cain <bcain@codeaurora.org>
  L:    linux-hexagon@vger.kernel.org
 -T:    git git://git.kernel.org/pub/scm/linux/kernel/git/rkuo/linux-hexagon-kernel.git
  S:    Supported
  F:    arch/hexagon/
  
@@@ -13635,7 -13478,7 +13637,7 @@@ S:   Orpha
  F:    drivers/net/wireless/ray*
  
  RCUTORTURE TEST FRAMEWORK
 -M:    "Paul E. McKenney" <paulmck@linux.ibm.com>
 +M:    "Paul E. McKenney" <paulmck@kernel.org>
  M:    Josh Triplett <josh@joshtriplett.org>
  R:    Steven Rostedt <rostedt@goodmis.org>
  R:    Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
@@@ -13682,7 -13525,7 +13684,7 @@@ F:   arch/x86/include/asm/resctrl_sched.
  F:    Documentation/x86/resctrl*
  
  READ-COPY UPDATE (RCU)
 -M:    "Paul E. McKenney" <paulmck@linux.ibm.com>
 +M:    "Paul E. McKenney" <paulmck@kernel.org>
  M:    Josh Triplett <josh@joshtriplett.org>
  R:    Steven Rostedt <rostedt@goodmis.org>
  R:    Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
@@@ -13754,7 -13597,7 +13756,7 @@@ REMOTE PROCESSOR (REMOTEPROC) SUBSYSTE
  M:    Ohad Ben-Cohen <ohad@wizery.com>
  M:    Bjorn Andersson <bjorn.andersson@linaro.org>
  L:    linux-remoteproc@vger.kernel.org
 -T:    git git://git.kernel.org/pub/scm/linux/kernel/git/ohad/remoteproc.git
 +T:    git git://git.kernel.org/pub/scm/linux/kernel/git/andersson/remoteproc.git rproc-next
  S:    Maintained
  F:    Documentation/devicetree/bindings/remoteproc/
  F:    Documentation/ABI/testing/sysfs-class-remoteproc
@@@ -13767,7 -13610,7 +13769,7 @@@ REMOTE PROCESSOR MESSAGING (RPMSG) SUBS
  M:    Ohad Ben-Cohen <ohad@wizery.com>
  M:    Bjorn Andersson <bjorn.andersson@linaro.org>
  L:    linux-remoteproc@vger.kernel.org
 -T:    git git://git.kernel.org/pub/scm/linux/kernel/git/ohad/rpmsg.git
 +T:    git git://git.kernel.org/pub/scm/linux/kernel/git/andersson/remoteproc.git rpmsg-next
  S:    Maintained
  F:    drivers/rpmsg/
  F:    Documentation/rpmsg.txt
@@@ -13840,7 -13683,7 +13842,7 @@@ F:   include/linux/reset-controller.
  RESTARTABLE SEQUENCES SUPPORT
  M:    Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
  M:    Peter Zijlstra <peterz@infradead.org>
 -M:    "Paul E. McKenney" <paulmck@linux.ibm.com>
 +M:    "Paul E. McKenney" <paulmck@kernel.org>
  M:    Boqun Feng <boqun.feng@gmail.com>
  L:    linux-kernel@vger.kernel.org
  S:    Supported
@@@ -13884,7 -13727,6 +13886,7 @@@ F:   drivers/mtd/nand/raw/r852.
  F:    drivers/mtd/nand/raw/r852.h
  
  RISC-V ARCHITECTURE
 +M:    Paul Walmsley <paul.walmsley@sifive.com>
  M:    Palmer Dabbelt <palmer@sifive.com>
  M:    Albert Ou <aou@eecs.berkeley.edu>
  L:    linux-riscv@lists.infradead.org
@@@ -13903,8 -13745,7 +13905,8 @@@ F:   include/linux/hid-roccat
  F:    Documentation/ABI/*/sysfs-driver-hid-roccat*
  
  ROCKCHIP RASTER 2D GRAPHIC ACCELERATION UNIT DRIVER
 -M:    Jacob chen <jacob2.chen@rock-chips.com>
 +M:    Jacob Chen <jacob-chen@iotwrt.com>
 +M:    Ezequiel Garcia <ezequiel@collabora.com>
  L:    linux-media@vger.kernel.org
  S:    Maintained
  F:    drivers/media/platform/rockchip/rga/
@@@ -13914,7 -13755,7 +13916,7 @@@ HANTRO VPU CODEC DRIVE
  M:    Ezequiel Garcia <ezequiel@collabora.com>
  L:    linux-media@vger.kernel.org
  S:    Maintained
 -F:    drivers/staging/media/platform/hantro/
 +F:    drivers/staging/media/hantro/
  F:    Documentation/devicetree/bindings/media/rockchip-vpu.txt
  
  ROCKER DRIVER
@@@ -14108,6 -13949,7 +14110,6 @@@ F:   drivers/pci/hotplug/s390_pci_hpc.
  
  S390 VFIO-CCW DRIVER
  M:    Cornelia Huck <cohuck@redhat.com>
 -M:    Farhan Ali <alifm@linux.ibm.com>
  M:    Eric Farman <farman@linux.ibm.com>
  R:    Halil Pasic <pasic@linux.ibm.com>
  L:    linux-s390@vger.kernel.org
@@@ -14176,12 -14018,6 +14178,12 @@@ F: drivers/media/common/saa7146
  F:    drivers/media/pci/saa7146/
  F:    include/media/drv-intf/saa7146*
  
 +SAFESETID SECURITY MODULE
 +M:     Micah Morton <mortonm@chromium.org>
 +S:     Supported
 +F:     security/safesetid/
 +F:     Documentation/admin-guide/LSM/SafeSetID.rst
 +
  SAMSUNG AUDIO (ASoC) DRIVERS
  M:    Krzysztof Kozlowski <krzk@kernel.org>
  M:    Sangbeom Kim <sbkim73@samsung.com>
@@@ -14272,8 -14108,6 +14274,8 @@@ M:   Kamil Konieczny <k.konieczny@partner
  L:    linux-crypto@vger.kernel.org
  L:    linux-samsung-soc@vger.kernel.org
  S:    Maintained
 +F:    Documentation/devicetree/bindings/crypto/samsung-slimsss.txt
 +F:    Documentation/devicetree/bindings/crypto/samsung-sss.txt
  F:    drivers/crypto/s5p-sss.c
  
  SAMSUNG S5P/EXYNOS4 SOC SERIES CAMERA SUBSYSTEM DRIVERS
@@@ -14294,8 -14128,6 +14296,8 @@@ T:   git git://git.kernel.org/pub/scm/lin
  F:    drivers/clk/samsung/
  F:    include/dt-bindings/clock/exynos*.h
  F:    Documentation/devicetree/bindings/clock/exynos*.txt
 +F:    Documentation/devicetree/bindings/clock/samsung,s3c*
 +F:    Documentation/devicetree/bindings/clock/samsung,s5p*
  
  SAMSUNG SPI DRIVERS
  M:    Kukjin Kim <kgene@kernel.org>
@@@ -14346,12 -14178,6 +14348,12 @@@ F: drivers/watchdog/sc1200wdt.
  SCHEDULER
  M:    Ingo Molnar <mingo@redhat.com>
  M:    Peter Zijlstra <peterz@infradead.org>
 +M:    Juri Lelli <juri.lelli@redhat.com> (SCHED_DEADLINE)
 +M:    Vincent Guittot <vincent.guittot@linaro.org> (SCHED_NORMAL)
 +R:    Dietmar Eggemann <dietmar.eggemann@arm.com> (SCHED_NORMAL)
 +R:    Steven Rostedt <rostedt@goodmis.org> (SCHED_FIFO/SCHED_RR)
 +R:    Ben Segall <bsegall@google.com> (CONFIG_CFS_BANDWIDTH)
 +R:    Mel Gorman <mgorman@suse.de> (CONFIG_NUMA_BALANCING)
  L:    linux-kernel@vger.kernel.org
  T:    git git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git sched/core
  S:    Maintained
@@@ -14446,7 -14272,7 +14448,7 @@@ F:   net/sctp
  SCx200 CPU SUPPORT
  M:    Jim Cromie <jim.cromie@gmail.com>
  S:    Odd Fixes
 -F:    Documentation/i2c/busses/scx200_acb
 +F:    Documentation/i2c/busses/scx200_acb.rst
  F:    arch/x86/platform/scx200/
  F:    drivers/watchdog/scx200_wdt.c
  F:    drivers/i2c/busses/scx200*
@@@ -14632,7 -14458,6 +14634,7 @@@ F:   drivers/net/phy/phylink.
  F:    drivers/net/phy/sfp*
  F:    include/linux/phylink.h
  F:    include/linux/sfp.h
 +K:    phylink
  
  SGI GRU DRIVER
  M:    Dimitri Sivanich <sivanich@sgi.com>
@@@ -14887,7 -14712,7 +14889,7 @@@ F:   mm/sl?b
  
  SLEEPABLE READ-COPY UPDATE (SRCU)
  M:    Lai Jiangshan <jiangshanlai@gmail.com>
 -M:    "Paul E. McKenney" <paulmck@linux.ibm.com>
 +M:    "Paul E. McKenney" <paulmck@kernel.org>
  M:    Josh Triplett <josh@joshtriplett.org>
  R:    Steven Rostedt <rostedt@goodmis.org>
  R:    Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
@@@ -15038,9 -14863,9 +15040,9 @@@ F:   include/linux/arm_sdei.
  F:    include/uapi/linux/arm_sdei.h
  
  SOFTWARE RAID (Multiple Disks) SUPPORT
 -M:    Shaohua Li <shli@kernel.org>
 +M:    Song Liu <song@kernel.org>
  L:    linux-raid@vger.kernel.org
 -T:    git git://git.kernel.org/pub/scm/linux/kernel/git/shli/md.git
 +T:    git git://git.kernel.org/pub/scm/linux/kernel/git/song/md.git
  S:    Supported
  F:    drivers/md/Makefile
  F:    drivers/md/Kconfig
@@@ -15371,6 -15196,13 +15373,6 @@@ M:  H Hartley Sweeten <hsweeten@visionen
  S:    Odd Fixes
  F:    drivers/staging/comedi/
  
 -STAGING - EROFS FILE SYSTEM
 -M:    Gao Xiang <gaoxiang25@huawei.com>
 -M:    Chao Yu <yuchao0@huawei.com>
 -L:    linux-erofs@lists.ozlabs.org
 -S:    Maintained
 -F:    drivers/staging/erofs/
 -
  STAGING - FIELDBUS SUBSYSTEM
  M:    Sven Van Asbroeck <TheSven73@gmail.com>
  S:    Maintained
@@@ -15658,7 -15490,7 +15660,7 @@@ F:   Documentation/devicetree/bindings/gp
  SYNOPSYS DESIGNWARE AXI DMAC DRIVER
  M:    Eugeniy Paltsev <Eugeniy.Paltsev@synopsys.com>
  S:    Maintained
 -F:    drivers/dma/dwi-axi-dmac/
 +F:    drivers/dma/dw-axi-dmac/
  F:    Documentation/devicetree/bindings/dma/snps,dw-axi-dmac.txt
  
  SYNOPSYS DESIGNWARE DMAC DRIVER
@@@ -15715,7 -15547,6 +15717,7 @@@ F:   drivers/clk/clk-sc[mp]i.
  F:    drivers/cpufreq/sc[mp]i-cpufreq.c
  F:    drivers/firmware/arm_scpi.c
  F:    drivers/firmware/arm_scmi/
 +F:    drivers/reset/reset-scmi.c
  F:    include/linux/sc[mp]i_protocol.h
  
  SYSTEM RESET/SHUTDOWN DRIVERS
@@@ -16024,7 -15855,6 +16026,7 @@@ F:   drivers/firmware/ti_sci
  F:    include/linux/soc/ti/ti_sci_protocol.h
  F:    Documentation/devicetree/bindings/soc/ti/sci-pm-domain.txt
  F:    drivers/soc/ti/ti_sci_pm_domains.c
 +F:    include/dt-bindings/soc/ti,sci_pm_domain.h
  F:    Documentation/devicetree/bindings/reset/ti,sci-reset.txt
  F:    Documentation/devicetree/bindings/clock/ti,sci-clk.txt
  F:    drivers/clk/keystone/sci-clk.c
@@@ -16078,7 -15908,7 +16080,7 @@@ M:   Viresh Kumar <viresh.kumar@linaro.or
  M:    Javi Merino <javi.merino@kernel.org>
  L:    linux-pm@vger.kernel.org
  S:    Supported
 -F:    Documentation/thermal/cpu-cooling-api.rst
 +F:    Documentation/driver-api/thermal/cpu-cooling-api.rst
  F:    drivers/thermal/cpu_cooling.c
  F:    include/linux/cpu_cooling.h
  
@@@ -16250,7 -16080,7 +16252,7 @@@ S:   Maintaine
  F:    drivers/net/ethernet/ti/netcp*
  
  TI PCM3060 ASoC CODEC DRIVER
 -M:    Kirill Marinushkin <kmarinushkin@birdec.tech>
 +M:    Kirill Marinushkin <kmarinushkin@birdec.com>
  L:    alsa-devel@alsa-project.org (moderated for non-subscribers)
  S:    Maintained
  F:    Documentation/devicetree/bindings/sound/pcm3060.txt
@@@ -16379,7 -16209,7 +16381,7 @@@ F:   drivers/platform/x86/topstar-laptop.
  
  TORTURE-TEST MODULES
  M:    Davidlohr Bueso <dave@stgolabs.net>
 -M:    "Paul E. McKenney" <paulmck@linux.ibm.com>
 +M:    "Paul E. McKenney" <paulmck@kernel.org>
  M:    Josh Triplett <josh@joshtriplett.org>
  L:    linux-kernel@vger.kernel.org
  S:    Supported
@@@ -16601,7 -16431,7 +16603,7 @@@ F:   drivers/hid/hid-udraw-ps3.
  UFS FILESYSTEM
  M:    Evgeniy Dushistov <dushistov@mail.ru>
  S:    Maintained
 -F:    Documentation/filesystems/ufs.txt
 +F:    Documentation/admin-guide/ufs.rst
  F:    fs/ufs/
  
  UHID USERSPACE HID IO DRIVER:
@@@ -16619,9 -16449,11 +16621,9 @@@ F:  drivers/usb/common/ulpi.
  F:    include/linux/ulpi/
  
  ULTRA-WIDEBAND (UWB) SUBSYSTEM:
 -L:    linux-usb@vger.kernel.org
 -S:    Orphan
 -F:    drivers/uwb/
 -F:    include/linux/uwb.h
 -F:    include/linux/uwb/
 +L:    devel@driverdev.osuosl.org
 +S:    Obsolete
 +F:    drivers/staging/uwb/
  
  UNICODE SUBSYSTEM:
  M:    Gabriel Krisman Bertazi <krisman@collabora.com>
@@@ -17024,7 -16856,7 +17026,7 @@@ W:   http://user-mode-linux.sourceforge.n
  Q:    https://patchwork.ozlabs.org/project/linux-um/list/
  T:    git git://git.kernel.org/pub/scm/linux/kernel/git/rw/uml.git
  S:    Maintained
 -F:    Documentation/virtual/uml/
 +F:    Documentation/virt/uml/
  F:    arch/um/
  F:    arch/x86/um/
  F:    fs/hostfs/
@@@ -17293,7 -17125,7 +17295,7 @@@ F:   drivers/virtio/virtio_input.
  F:    include/uapi/linux/virtio_input.h
  
  VIRTIO IOMMU DRIVER
 -M:    Jean-Philippe Brucker <jean-philippe.brucker@arm.com>
 +M:    Jean-Philippe Brucker <jean-philippe@linaro.org>
  L:    virtualization@lists.linux-foundation.org
  S:    Maintained
  F:    drivers/iommu/virtio-iommu.c
@@@ -17342,6 -17174,7 +17344,6 @@@ F:   drivers/vme
  F:    include/linux/vme*
  
  VMWARE BALLOON DRIVER
 -M:    Julien Freche <jfreche@vmware.com>
  M:    Nadav Amit <namit@vmware.com>
  M:    "VMware, Inc." <pv-drivers@vmware.com>
  L:    linux-kernel@vger.kernel.org
@@@ -17354,7 -17187,6 +17356,7 @@@ M:   "VMware, Inc." <pv-drivers@vmware.co
  L:    virtualization@lists.linux-foundation.org
  S:    Supported
  F:    arch/x86/kernel/cpu/vmware.c
 +F:    arch/x86/include/asm/vmware.h
  
  VMWARE PVRDMA DRIVER
  M:    Adit Ranadive <aditr@vmware.com>
@@@ -17404,7 -17236,6 +17406,7 @@@ F:   Documentation/power/regulator
  F:    drivers/regulator/
  F:    include/dt-bindings/regulator/
  F:    include/linux/regulator/
 +K:    regulator_get_optional
  
  VRF
  M:    David Ahern <dsa@cumulusnetworks.com>
@@@ -17519,7 -17350,7 +17521,7 @@@ M:   linux-wimax@intel.co
  L:    wimax@linuxwimax.org (subscribers-only)
  S:    Supported
  W:    http://linuxwimax.org
 -F:    Documentation/wimax/README.wimax
 +F:    Documentation/admin-guide/wimax/wimax.rst
  F:    include/linux/wimax/debug.h
  F:    include/net/wimax.h
  F:    include/uapi/linux/wimax.h
@@@ -17673,7 -17504,7 +17675,7 @@@ M:   Darren Hart <dvhart@infradead.org
  M:    Andy Shevchenko <andy@infradead.org>
  L:    platform-driver-x86@vger.kernel.org
  T:    git git://git.infradead.org/linux-platform-drivers-x86.git
 -S:    Maintained
 +S:    Odd Fixes
  F:    drivers/platform/x86/
  F:    drivers/platform/olpc/
  
@@@ -17726,6 -17557,7 +17728,6 @@@ M:   Jakub Kicinski <jakub.kicinski@netro
  M:    Jesper Dangaard Brouer <hawk@kernel.org>
  M:    John Fastabend <john.fastabend@gmail.com>
  L:    netdev@vger.kernel.org
 -L:    xdp-newbies@vger.kernel.org
  L:    bpf@vger.kernel.org
  S:    Supported
  F:    net/core/xdp.c
@@@ -17788,7 -17620,7 +17790,7 @@@ F:   Documentation/ABI/testing/sysfs-hype
  
  XEN NETWORK BACKEND DRIVER
  M:    Wei Liu <wei.liu@kernel.org>
 -M:    Paul Durrant <paul.durrant@citrix.com>
 +M:    Paul Durrant <paul@xen.org>
  L:    xen-devel@lists.xenproject.org (moderated for non-subscribers)
  L:    netdev@vger.kernel.org
  S:    Supported
@@@ -17841,7 -17673,8 +17843,7 @@@ F:   include/uapi/linux/dqblk_xfs.
  F:    include/uapi/linux/fsmap.h
  
  XILINX AXI ETHERNET DRIVER
 -M:    Anirudha Sarangi <anirudh@xilinx.com>
 -M:    John Linn <John.Linn@xilinx.com>
 +M:    Radhey Shyam Pandey <radhey.shyam.pandey@xilinx.com>
  S:    Maintained
  F:    drivers/net/ethernet/xilinx/xilinx_axienet*
  
@@@ -17861,17 -17694,6 +17863,17 @@@ F: Documentation/devicetree/bindings/me
  F:    drivers/media/platform/xilinx/
  F:    include/uapi/linux/xilinx-v4l2-controls.h
  
 +XILINX SD-FEC IP CORES
 +M:    Derek Kiernan <derek.kiernan@xilinx.com>
 +M:    Dragan Cvetic <dragan.cvetic@xilinx.com>
 +S:    Maintained
 +F:    Documentation/devicetree/bindings/misc/xlnx,sd-fec.txt
 +F:    Documentation/misc-devices/xilinx_sdfec.rst
 +F:    drivers/misc/xilinx_sdfec.c
 +F:    drivers/misc/Kconfig
 +F:    drivers/misc/Makefile
 +F:    include/uapi/misc/xilinx_sdfec.h
 +
  XILLYBUS DRIVER
  M:    Eli Billauer <eli.billauer@gmail.com>
  L:    linux-kernel@vger.kernel.org
@@@ -17981,6 -17803,14 +17983,6 @@@ S:  Maintaine
  F:    mm/zpool.c
  F:    include/linux/zpool.h
  
 -ZR36067 VIDEO FOR LINUX DRIVER
 -L:    mjpeg-users@lists.sourceforge.net
 -L:    linux-media@vger.kernel.org
 -W:    http://mjpeg.sourceforge.net/driver-zoran/
 -T:    hg https://linuxtv.org/hg/v4l-dvb
 -S:    Odd Fixes
 -F:    drivers/staging/media/zoran/
 -
  ZRAM COMPRESSED RAM BLOCK DEVICE DRVIER
  M:    Minchan Kim <minchan@kernel.org>
  M:    Nitin Gupta <ngupta@vflare.org>
index 124a7e2d8442f0d30ae3be6494683d0522dddf3c,119c597ca8679417c44cef0bf79c774775af5c54..337919366dc85ff92a1eca9d6ded42fe59bf8fdf
                        #size-cells = <0>;
                        reg = <0x0 0x2180000 0x0 0x10000>;
                        interrupts = <0 56 IRQ_TYPE_LEVEL_HIGH>;
 -                      clocks = <&clockgen 4 0>;
 +                      clocks = <&clockgen 4 3>;
                        status = "disabled";
                };
  
                        #size-cells = <0>;
                        reg = <0x0 0x2190000 0x0 0x10000>;
                        interrupts = <0 57 IRQ_TYPE_LEVEL_HIGH>;
 -                      clocks = <&clockgen 4 0>;
 +                      clocks = <&clockgen 4 3>;
                        status = "disabled";
                };
  
                        #address-cells = <3>;
                        #size-cells = <2>;
                        device_type = "pci";
-                       num-lanes = <4>;
                        num-viewport = <2>;
                        bus-range = <0x0 0xff>;
                        ranges = <0x81000000 0x0 0x00000000 0x40 0x00010000 0x0 0x00010000   /* downstream I/O */
index d1469b0747c75092bdace963a0d3bceffe2f7913,ce48a2323337c67f5179a41ca9dfc07409fc4fcc..c676d0771762fcbc69c96f3f05b693b0909836e1
                        #thermal-sensor-cells = <1>;
                };
  
 +              dspi: spi@2100000 {
 +                      compatible = "fsl,ls1088a-dspi",
 +                                   "fsl,ls1021a-v1.0-dspi";
 +                      #address-cells = <1>;
 +                      #size-cells = <0>;
 +                      reg = <0x0 0x2100000 0x0 0x10000>;
 +                      interrupts = <GIC_SPI 26 IRQ_TYPE_LEVEL_HIGH>;
 +                      clock-names = "dspi";
 +                      clocks = <&clockgen 4 1>;
 +                      spi-num-chipselects = <6>;
 +                      status = "disabled";
 +              };
 +
                duart0: serial@21c0500 {
                        compatible = "fsl,ns16550", "ns16550a";
                        reg = <0x0 0x21c0500 0x0 0x100>;
                };
  
                gpio0: gpio@2300000 {
 -                      compatible = "fsl,qoriq-gpio";
 +                      compatible = "fsl,ls1088a-gpio", "fsl,qoriq-gpio";
                        reg = <0x0 0x2300000 0x0 0x10000>;
                        interrupts = <0 36 IRQ_TYPE_LEVEL_HIGH>;
 +                      little-endian;
                        gpio-controller;
                        #gpio-cells = <2>;
                        interrupt-controller;
                };
  
                gpio1: gpio@2310000 {
 -                      compatible = "fsl,qoriq-gpio";
 +                      compatible = "fsl,ls1088a-gpio", "fsl,qoriq-gpio";
                        reg = <0x0 0x2310000 0x0 0x10000>;
                        interrupts = <0 36 IRQ_TYPE_LEVEL_HIGH>;
 +                      little-endian;
                        gpio-controller;
                        #gpio-cells = <2>;
                        interrupt-controller;
                };
  
                gpio2: gpio@2320000 {
 -                      compatible = "fsl,qoriq-gpio";
 +                      compatible = "fsl,ls1088a-gpio", "fsl,qoriq-gpio";
                        reg = <0x0 0x2320000 0x0 0x10000>;
                        interrupts = <0 37 IRQ_TYPE_LEVEL_HIGH>;
 +                      little-endian;
                        gpio-controller;
                        #gpio-cells = <2>;
                        interrupt-controller;
                };
  
                gpio3: gpio@2330000 {
 -                      compatible = "fsl,qoriq-gpio";
 +                      compatible = "fsl,ls1088a-gpio", "fsl,qoriq-gpio";
                        reg = <0x0 0x2330000 0x0 0x10000>;
                        interrupts = <0 37 IRQ_TYPE_LEVEL_HIGH>;
 +                      little-endian;
                        gpio-controller;
                        #gpio-cells = <2>;
                        interrupt-controller;
                        #size-cells = <0>;
                        reg = <0x0 0x2000000 0x0 0x10000>;
                        interrupts = <0 34 IRQ_TYPE_LEVEL_HIGH>;
 -                      clocks = <&clockgen 4 3>;
 +                      clocks = <&clockgen 4 7>;
                        status = "disabled";
                };
  
                        #size-cells = <0>;
                        reg = <0x0 0x2010000 0x0 0x10000>;
                        interrupts = <0 34 IRQ_TYPE_LEVEL_HIGH>;
 -                      clocks = <&clockgen 4 3>;
 +                      clocks = <&clockgen 4 7>;
                        status = "disabled";
                };
  
                        #size-cells = <0>;
                        reg = <0x0 0x2020000 0x0 0x10000>;
                        interrupts = <0 35 IRQ_TYPE_LEVEL_HIGH>;
 -                      clocks = <&clockgen 4 3>;
 +                      clocks = <&clockgen 4 7>;
                        status = "disabled";
                };
  
                        #size-cells = <0>;
                        reg = <0x0 0x2030000 0x0 0x10000>;
                        interrupts = <0 35 IRQ_TYPE_LEVEL_HIGH>;
 -                      clocks = <&clockgen 4 3>;
 +                      clocks = <&clockgen 4 7>;
                        status = "disabled";
                };
  
                        #size-cells = <2>;
                        device_type = "pci";
                        dma-coherent;
-                       num-lanes = <4>;
                        num-viewport = <256>;
                        bus-range = <0x0 0xff>;
                        ranges = <0x81000000 0x0 0x00000000 0x20 0x00010000 0x0 0x00010000   /* downstream I/O */
                        #size-cells = <2>;
                        device_type = "pci";
                        dma-coherent;
-                       num-lanes = <4>;
                        num-viewport = <6>;
                        bus-range = <0x0 0xff>;
                        ranges = <0x81000000 0x0 0x00000000 0x28 0x00010000 0x0 0x00010000   /* downstream I/O */
                        #size-cells = <2>;
                        device_type = "pci";
                        dma-coherent;
-                       num-lanes = <8>;
                        num-viewport = <6>;
                        bus-range = <0x0 0xff>;
                        ranges = <0x81000000 0x0 0x00000000 0x30 0x00010000 0x0 0x00010000   /* downstream I/O */
                                     <GIC_SPI 209 IRQ_TYPE_LEVEL_HIGH>;
                };
  
 +              console@8340020 {
 +                      compatible = "fsl,dpaa2-console";
 +                      reg = <0x00000000 0x08340020 0 0x2>;
 +              };
 +
                ptp-timer@8b95000 {
                        compatible = "fsl,dpaa2-ptp";
                        reg = <0x0 0x8b95000 0x0 0x100>;
index 64101c9962ce1ee6e7063ebd7b573bef4652193b,d4993a2b404f1147c5cb3904631f0f86442608a1..7a0be8eaa84a25f3dd517fd6b5262b6687acfe58
                        };
                };
  
 +              console@8340020 {
 +                      compatible = "fsl,dpaa2-console";
 +                      reg = <0x00000000 0x08340020 0 0x2>;
 +              };
 +
                ptp-timer@8b95000 {
                        compatible = "fsl,dpaa2-ptp";
                        reg = <0x0 0x8b95000 0x0 0x100>;
                        #size-cells = <2>;
                        device_type = "pci";
                        dma-coherent;
-                       num-lanes = <4>;
                        num-viewport = <6>;
                        bus-range = <0x0 0xff>;
                        msi-parent = <&its>;
                        #size-cells = <2>;
                        device_type = "pci";
                        dma-coherent;
-                       num-lanes = <4>;
                        num-viewport = <6>;
                        bus-range = <0x0 0xff>;
                        msi-parent = <&its>;
                        #size-cells = <2>;
                        device_type = "pci";
                        dma-coherent;
-                       num-lanes = <8>;
                        num-viewport = <256>;
                        bus-range = <0x0 0xff>;
                        msi-parent = <&its>;
                        #size-cells = <2>;
                        device_type = "pci";
                        dma-coherent;
-                       num-lanes = <4>;
                        num-viewport = <6>;
                        bus-range = <0x0 0xff>;
                        msi-parent = <&its>;
index 6d52cf5ce20ec646d633e6c34e70a833fd52a6ca,57e8aea98969efaaa881d86cb5627756cafa04e4..25aa400e2e3c23b9087e40a3bb3a3f4d8b9a69db
@@@ -14,7 -14,6 +14,6 @@@
  #include <linux/module.h>
  #include <linux/kernel.h>
  #include <linux/pci.h>
- #include <linux/pci-aspm.h>
  #include <linux/netdevice.h>
  #include <linux/etherdevice.h>
  #include <linux/ethtool.h>
@@@ -2030,22 -2029,23 +2029,22 @@@ jme_map_tx_skb(struct jme_adapter *jme
        bool hidma = jme->dev->features & NETIF_F_HIGHDMA;
        int i, nr_frags = skb_shinfo(skb)->nr_frags;
        int mask = jme->tx_ring_mask;
 -      const struct skb_frag_struct *frag;
        u32 len;
        int ret = 0;
  
        for (i = 0 ; i < nr_frags ; ++i) {
 -              frag = &skb_shinfo(skb)->frags[i];
 +              const skb_frag_t *frag = &skb_shinfo(skb)->frags[i];
 +
                ctxdesc = txdesc + ((idx + i + 2) & (mask));
                ctxbi = txbi + ((idx + i + 2) & (mask));
  
                ret = jme_fill_tx_map(jme->pdev, ctxdesc, ctxbi,
 -                              skb_frag_page(frag),
 -                              frag->page_offset, skb_frag_size(frag), hidma);
 +                                    skb_frag_page(frag), skb_frag_off(frag),
 +                                    skb_frag_size(frag), hidma);
                if (ret) {
                        jme_drop_tx_map(jme, idx, i);
                        goto out;
                }
 -
        }
  
        len = skb_is_nonlinear(skb) ? skb_headlen(skb) : skb->len;
@@@ -3192,7 -3192,8 +3191,7 @@@ jme_shutdown(struct pci_dev *pdev
  static int
  jme_suspend(struct device *dev)
  {
 -      struct pci_dev *pdev = to_pci_dev(dev);
 -      struct net_device *netdev = pci_get_drvdata(pdev);
 +      struct net_device *netdev = dev_get_drvdata(dev);
        struct jme_adapter *jme = netdev_priv(netdev);
  
        if (!netif_running(netdev))
  static int
  jme_resume(struct device *dev)
  {
 -      struct pci_dev *pdev = to_pci_dev(dev);
 -      struct net_device *netdev = pci_get_drvdata(pdev);
 +      struct net_device *netdev = dev_get_drvdata(dev);
        struct jme_adapter *jme = netdev_priv(netdev);
  
        if (!netif_running(netdev))
index 0ef01db1f8b854a26ce08fc78db77be3abbdbdbc,a6d8e7f5fde700738436519924d0622cb9c12a6d..74f81fe03810c419279a7b200190fdbbd3c99ed6
@@@ -28,7 -28,6 +28,6 @@@
  #include <linux/dma-mapping.h>
  #include <linux/pm_runtime.h>
  #include <linux/prefetch.h>
- #include <linux/pci-aspm.h>
  #include <linux/ipv6.h>
  #include <net/ip6_checksum.h>
  
  #define FIRMWARE_8168H_2      "rtl_nic/rtl8168h-2.fw"
  #define FIRMWARE_8107E_1      "rtl_nic/rtl8107e-1.fw"
  #define FIRMWARE_8107E_2      "rtl_nic/rtl8107e-2.fw"
 +#define FIRMWARE_8125A_3      "rtl_nic/rtl8125a-3.fw"
  
  #define R8169_MSG_DEFAULT \
        (NETIF_MSG_DRV | NETIF_MSG_PROBE | NETIF_MSG_IFUP | NETIF_MSG_IFDOWN)
  
  /* Maximum number of multicast addresses to filter (vs. Rx-all-multicast).
     The RTL chips use a 64 element hash table based on the Ethernet CRC. */
 -static const int multicast_filter_limit = 32;
 +#define       MC_FILTER_LIMIT 32
  
  #define TX_DMA_BURST  7       /* Maximum PCI burst, '7' is unlimited */
  #define InterFrameGap 0x03    /* 3 means InterFrameGap = the shortest one */
@@@ -136,8 -134,6 +135,8 @@@ enum mac_version 
        RTL_GIGA_MAC_VER_49,
        RTL_GIGA_MAC_VER_50,
        RTL_GIGA_MAC_VER_51,
 +      RTL_GIGA_MAC_VER_60,
 +      RTL_GIGA_MAC_VER_61,
        RTL_GIGA_MAC_NONE
  };
  
@@@ -203,8 -199,6 +202,8 @@@ static const struct 
        [RTL_GIGA_MAC_VER_49] = {"RTL8168ep/8111ep"                     },
        [RTL_GIGA_MAC_VER_50] = {"RTL8168ep/8111ep"                     },
        [RTL_GIGA_MAC_VER_51] = {"RTL8168ep/8111ep"                     },
 +      [RTL_GIGA_MAC_VER_60] = {"RTL8125"                              },
 +      [RTL_GIGA_MAC_VER_61] = {"RTL8125",             FIRMWARE_8125A_3},
  };
  
  static const struct pci_device_id rtl8169_pci_tbl[] = {
        { PCI_VDEVICE(USR,      0x0116) },
        { PCI_VENDOR_ID_LINKSYS, 0x1032, PCI_ANY_ID, 0x0024 },
        { 0x0001, 0x8168, PCI_ANY_ID, 0x2410 },
 +      { PCI_VDEVICE(REALTEK,  0x8125) },
 +      { PCI_VDEVICE(REALTEK,  0x3000) },
        {}
  };
  
@@@ -278,6 -270,7 +277,6 @@@ enum rtl_registers 
        Config3         = 0x54,
        Config4         = 0x55,
        Config5         = 0x56,
 -      MultiIntr       = 0x5c,
        PHYAR           = 0x60,
        PHYstatus       = 0x6c,
        RxMaxSize       = 0xda,
@@@ -391,19 -384,6 +390,19 @@@ enum rtl8168_registers 
  #define EARLY_TALLY_EN                        (1 << 16)
  };
  
 +enum rtl8125_registers {
 +      IntrMask_8125           = 0x38,
 +      IntrStatus_8125         = 0x3c,
 +      TxPoll_8125             = 0x90,
 +      MAC0_BKP                = 0x19e0,
 +};
 +
 +#define RX_VLAN_INNER_8125    BIT(22)
 +#define RX_VLAN_OUTER_8125    BIT(23)
 +#define RX_VLAN_8125          (RX_VLAN_INNER_8125 | RX_VLAN_OUTER_8125)
 +
 +#define RX_FETCH_DFLT_8125    (8 << 27)
 +
  enum rtl_register_content {
        /* InterruptStatusBits */
        SYSErr          = 0x8000,
@@@ -558,11 -538,11 +557,11 @@@ enum rtl_tx_desc_bit_1 
        TD1_GTSENV4     = (1 << 26),            /* Giant Send for IPv4 */
        TD1_GTSENV6     = (1 << 25),            /* Giant Send for IPv6 */
  #define GTTCPHO_SHIFT                 18
 -#define GTTCPHO_MAX                   0x7fU
 +#define GTTCPHO_MAX                   0x7f
  
        /* Second doubleword. */
  #define TCPHO_SHIFT                   18
 -#define TCPHO_MAX                     0x3ffU
 +#define TCPHO_MAX                     0x3ff
  #define TD1_MSS_SHIFT                 18      /* MSS position (11 bits) */
        TD1_IPv6_CS     = (1 << 28),            /* Calculate IPv6 checksum */
        TD1_IPv4_CS     = (1 << 29),            /* Calculate IPv4 checksum */
@@@ -588,11 -568,6 +587,11 @@@ enum rtl_rx_desc_bit 
  
  #define RsvdMask      0x3fffc000
  
 +#define RTL_GSO_MAX_SIZE_V1   32000
 +#define RTL_GSO_MAX_SEGS_V1   24
 +#define RTL_GSO_MAX_SIZE_V2   64000
 +#define RTL_GSO_MAX_SEGS_V2   64
 +
  struct TxDesc {
        __le32 opts1;
        __le32 opts2;
@@@ -662,10 -637,10 +661,10 @@@ struct rtl8169_private 
        struct RxDesc *RxDescArray;     /* 256-aligned Rx descriptor ring */
        dma_addr_t TxPhyAddr;
        dma_addr_t RxPhyAddr;
 -      void *Rx_databuff[NUM_RX_DESC]; /* Rx data buffers */
 +      struct page *Rx_databuff[NUM_RX_DESC];  /* Rx data buffers */
        struct ring_info tx_skb[NUM_TX_DESC];   /* Tx data buffers */
        u16 cp_cmd;
 -      u16 irq_mask;
 +      u32 irq_mask;
        struct clk *clk;
  
        struct {
@@@ -715,7 -690,6 +714,7 @@@ MODULE_FIRMWARE(FIRMWARE_8168H_1)
  MODULE_FIRMWARE(FIRMWARE_8168H_2);
  MODULE_FIRMWARE(FIRMWARE_8107E_1);
  MODULE_FIRMWARE(FIRMWARE_8107E_2);
 +MODULE_FIRMWARE(FIRMWARE_8125A_3);
  
  static inline struct device *tp_to_dev(struct rtl8169_private *tp)
  {
@@@ -748,33 -722,12 +747,33 @@@ static void rtl_tx_performance_tweak(st
                                           PCI_EXP_DEVCTL_READRQ, force);
  }
  
 +static bool rtl_is_8125(struct rtl8169_private *tp)
 +{
 +      return tp->mac_version >= RTL_GIGA_MAC_VER_60;
 +}
 +
  static bool rtl_is_8168evl_up(struct rtl8169_private *tp)
  {
        return tp->mac_version >= RTL_GIGA_MAC_VER_34 &&
 +             tp->mac_version != RTL_GIGA_MAC_VER_39 &&
 +             tp->mac_version <= RTL_GIGA_MAC_VER_51;
 +}
 +
 +static bool rtl_supports_eee(struct rtl8169_private *tp)
 +{
 +      return tp->mac_version >= RTL_GIGA_MAC_VER_34 &&
 +             tp->mac_version != RTL_GIGA_MAC_VER_37 &&
               tp->mac_version != RTL_GIGA_MAC_VER_39;
  }
  
 +static void rtl_read_mac_from_reg(struct rtl8169_private *tp, u8 *mac, int reg)
 +{
 +      int i;
 +
 +      for (i = 0; i < ETH_ALEN; i++)
 +              mac[i] = RTL_R8(tp, reg + i);
 +}
 +
  struct rtl_cond {
        bool (*check)(struct rtl8169_private *);
        const char *msg;
@@@ -892,14 -845,6 +891,14 @@@ static u16 r8168_mac_ocp_read(struct rt
        return RTL_R32(tp, OCPDR);
  }
  
 +static void r8168_mac_ocp_modify(struct rtl8169_private *tp, u32 reg, u16 mask,
 +                               u16 set)
 +{
 +      u16 data = r8168_mac_ocp_read(tp, reg);
 +
 +      r8168_mac_ocp_write(tp, reg, (data & ~mask) | set);
 +}
 +
  #define OCP_STD_PHY_BASE      0xa400
  
  static void r8168g_mdio_write(struct rtl8169_private *tp, int reg, int value)
@@@ -1049,7 -994,7 +1048,7 @@@ static void rtl_writephy(struct rtl8169
        case RTL_GIGA_MAC_VER_31:
                r8168dp_2_mdio_write(tp, location, val);
                break;
 -      case RTL_GIGA_MAC_VER_40 ... RTL_GIGA_MAC_VER_51:
 +      case RTL_GIGA_MAC_VER_40 ... RTL_GIGA_MAC_VER_61:
                r8168g_mdio_write(tp, location, val);
                break;
        default:
@@@ -1066,7 -1011,7 +1065,7 @@@ static int rtl_readphy(struct rtl8169_p
        case RTL_GIGA_MAC_VER_28:
        case RTL_GIGA_MAC_VER_31:
                return r8168dp_2_mdio_read(tp, location);
 -      case RTL_GIGA_MAC_VER_40 ... RTL_GIGA_MAC_VER_51:
 +      case RTL_GIGA_MAC_VER_40 ... RTL_GIGA_MAC_VER_61:
                return r8168g_mdio_read(tp, location);
        default:
                return r8169_mdio_read(tp, location);
@@@ -1348,28 -1293,14 +1347,28 @@@ static u8 rtl8168d_efuse_read(struct rt
                RTL_R32(tp, EFUSEAR) & EFUSEAR_DATA_MASK : ~0;
  }
  
 -static void rtl_ack_events(struct rtl8169_private *tp, u16 bits)
 +static u32 rtl_get_events(struct rtl8169_private *tp)
  {
 -      RTL_W16(tp, IntrStatus, bits);
 +      if (rtl_is_8125(tp))
 +              return RTL_R32(tp, IntrStatus_8125);
 +      else
 +              return RTL_R16(tp, IntrStatus);
 +}
 +
 +static void rtl_ack_events(struct rtl8169_private *tp, u32 bits)
 +{
 +      if (rtl_is_8125(tp))
 +              RTL_W32(tp, IntrStatus_8125, bits);
 +      else
 +              RTL_W16(tp, IntrStatus, bits);
  }
  
  static void rtl_irq_disable(struct rtl8169_private *tp)
  {
 -      RTL_W16(tp, IntrMask, 0);
 +      if (rtl_is_8125(tp))
 +              RTL_W32(tp, IntrMask_8125, 0);
 +      else
 +              RTL_W16(tp, IntrMask, 0);
        tp->irq_enabled = 0;
  }
  
  static void rtl_irq_enable(struct rtl8169_private *tp)
  {
        tp->irq_enabled = 1;
 -      RTL_W16(tp, IntrMask, tp->irq_mask);
 +      if (rtl_is_8125(tp))
 +              RTL_W32(tp, IntrMask_8125, tp->irq_mask);
 +      else
 +              RTL_W16(tp, IntrMask, tp->irq_mask);
  }
  
  static void rtl8169_irq_mask_and_ack(struct rtl8169_private *tp)
  {
        rtl_irq_disable(tp);
 -      rtl_ack_events(tp, 0xffff);
 +      rtl_ack_events(tp, 0xffffffff);
        /* PCI commit */
        RTL_R8(tp, ChipCmd);
  }
@@@ -1448,6 -1376,7 +1447,6 @@@ static void rtl8169_get_wol(struct net_
  
  static void __rtl8169_set_wol(struct rtl8169_private *tp, u32 wolopts)
  {
 -      unsigned int i, tmp;
        static const struct {
                u32 opt;
                u16 reg;
                { WAKE_ANY,   Config5, LanWake },
                { WAKE_MAGIC, Config3, MagicPacket }
        };
 +      unsigned int i, tmp = ARRAY_SIZE(cfg);
        u8 options;
  
        rtl_unlock_config_regs(tp);
  
        if (rtl_is_8168evl_up(tp)) {
 -              tmp = ARRAY_SIZE(cfg) - 1;
 +              tmp--;
                if (wolopts & WAKE_MAGIC)
                        rtl_eri_set_bits(tp, 0x0dc, ERIAR_MASK_0100,
                                         MagicPacket_v2);
                else
                        rtl_eri_clear_bits(tp, 0x0dc, ERIAR_MASK_0100,
                                           MagicPacket_v2);
 -      } else {
 -              tmp = ARRAY_SIZE(cfg);
 +      } else if (rtl_is_8125(tp)) {
 +              tmp--;
 +              if (wolopts & WAKE_MAGIC)
 +                      r8168_mac_ocp_modify(tp, 0xc0b6, 0, BIT(0));
 +              else
 +                      r8168_mac_ocp_modify(tp, 0xc0b6, BIT(0), 0);
        }
  
        for (i = 0; i < tmp; i++) {
        }
  
        switch (tp->mac_version) {
 -      case RTL_GIGA_MAC_VER_02 ... RTL_GIGA_MAC_VER_17:
 +      case RTL_GIGA_MAC_VER_02 ... RTL_GIGA_MAC_VER_06:
                options = RTL_R8(tp, Config1) & ~PMEnable;
                if (wolopts)
                        options |= PMEnable;
                RTL_W8(tp, Config1, options);
                break;
 -      default:
 +      case RTL_GIGA_MAC_VER_34:
 +      case RTL_GIGA_MAC_VER_37:
 +      case RTL_GIGA_MAC_VER_39 ... RTL_GIGA_MAC_VER_51:
                options = RTL_R8(tp, Config2) & ~PME_SIGNAL;
                if (wolopts)
                        options |= PME_SIGNAL;
                RTL_W8(tp, Config2, options);
                break;
 +      default:
 +              break;
        }
  
        rtl_lock_config_regs(tp);
@@@ -1584,13 -1504,6 +1583,13 @@@ static int rtl8169_set_features(struct 
        else
                rx_config &= ~(AcceptErr | AcceptRunt);
  
 +      if (rtl_is_8125(tp)) {
 +              if (features & NETIF_F_HW_VLAN_CTAG_RX)
 +                      rx_config |= RX_VLAN_8125;
 +              else
 +                      rx_config &= ~RX_VLAN_8125;
 +      }
 +
        RTL_W32(tp, RxConfig, rx_config);
  
        if (features & NETIF_F_RXCSUM)
        else
                tp->cp_cmd &= ~RxChkSum;
  
 -      if (features & NETIF_F_HW_VLAN_CTAG_RX)
 -              tp->cp_cmd |= RxVlan;
 -      else
 -              tp->cp_cmd &= ~RxVlan;
 +      if (!rtl_is_8125(tp)) {
 +              if (features & NETIF_F_HW_VLAN_CTAG_RX)
 +                      tp->cp_cmd |= RxVlan;
 +              else
 +                      tp->cp_cmd &= ~RxVlan;
 +      }
  
        RTL_W16(tp, CPlusCmd, tp->cp_cmd);
        RTL_R16(tp, CPlusCmd);
@@@ -1902,9 -1813,6 +1901,9 @@@ static int rtl_get_coalesce(struct net_
        int i;
        u16 w;
  
 +      if (rtl_is_8125(tp))
 +              return -EOPNOTSUPP;
 +
        memset(ec, 0, sizeof(*ec));
  
        /* get rx/tx scale corresponding to current speed and CPlusCmd[0:1] */
@@@ -1973,9 -1881,6 +1972,9 @@@ static int rtl_set_coalesce(struct net_
        u16 w = 0, cp01;
        int i;
  
 +      if (rtl_is_8125(tp))
 +              return -EOPNOTSUPP;
 +
        scale = rtl_coalesce_choose_scale(dev,
                        max(p[0].usecs, p[1].usecs) * 1000, &cp01);
        if (IS_ERR(scale))
        return 0;
  }
  
 -static int rtl_get_eee_supp(struct rtl8169_private *tp)
 -{
 -      struct phy_device *phydev = tp->phydev;
 -      int ret;
 -
 -      switch (tp->mac_version) {
 -      case RTL_GIGA_MAC_VER_34:
 -      case RTL_GIGA_MAC_VER_35:
 -      case RTL_GIGA_MAC_VER_36:
 -      case RTL_GIGA_MAC_VER_38:
 -              ret = phy_read_mmd(phydev, MDIO_MMD_PCS, MDIO_PCS_EEE_ABLE);
 -              break;
 -      case RTL_GIGA_MAC_VER_40 ... RTL_GIGA_MAC_VER_51:
 -              ret = phy_read_paged(phydev, 0x0a5c, 0x12);
 -              break;
 -      default:
 -              ret = -EPROTONOSUPPORT;
 -              break;
 -      }
 -
 -      return ret;
 -}
 -
 -static int rtl_get_eee_lpadv(struct rtl8169_private *tp)
 -{
 -      struct phy_device *phydev = tp->phydev;
 -      int ret;
 -
 -      switch (tp->mac_version) {
 -      case RTL_GIGA_MAC_VER_34:
 -      case RTL_GIGA_MAC_VER_35:
 -      case RTL_GIGA_MAC_VER_36:
 -      case RTL_GIGA_MAC_VER_38:
 -              ret = phy_read_mmd(phydev, MDIO_MMD_AN, MDIO_AN_EEE_LPABLE);
 -              break;
 -      case RTL_GIGA_MAC_VER_40 ... RTL_GIGA_MAC_VER_51:
 -              ret = phy_read_paged(phydev, 0x0a5d, 0x11);
 -              break;
 -      default:
 -              ret = -EPROTONOSUPPORT;
 -              break;
 -      }
 -
 -      return ret;
 -}
 -
 -static int rtl_get_eee_adv(struct rtl8169_private *tp)
 -{
 -      struct phy_device *phydev = tp->phydev;
 -      int ret;
 -
 -      switch (tp->mac_version) {
 -      case RTL_GIGA_MAC_VER_34:
 -      case RTL_GIGA_MAC_VER_35:
 -      case RTL_GIGA_MAC_VER_36:
 -      case RTL_GIGA_MAC_VER_38:
 -              ret = phy_read_mmd(phydev, MDIO_MMD_AN, MDIO_AN_EEE_ADV);
 -              break;
 -      case RTL_GIGA_MAC_VER_40 ... RTL_GIGA_MAC_VER_51:
 -              ret = phy_read_paged(phydev, 0x0a5d, 0x10);
 -              break;
 -      default:
 -              ret = -EPROTONOSUPPORT;
 -              break;
 -      }
 -
 -      return ret;
 -}
 -
 -static int rtl_set_eee_adv(struct rtl8169_private *tp, int val)
 -{
 -      struct phy_device *phydev = tp->phydev;
 -      int ret = 0;
 -
 -      switch (tp->mac_version) {
 -      case RTL_GIGA_MAC_VER_34:
 -      case RTL_GIGA_MAC_VER_35:
 -      case RTL_GIGA_MAC_VER_36:
 -      case RTL_GIGA_MAC_VER_38:
 -              ret = phy_write_mmd(phydev, MDIO_MMD_AN, MDIO_AN_EEE_ADV, val);
 -              break;
 -      case RTL_GIGA_MAC_VER_40 ... RTL_GIGA_MAC_VER_51:
 -              phy_write_paged(phydev, 0x0a5d, 0x10, val);
 -              break;
 -      default:
 -              ret = -EPROTONOSUPPORT;
 -              break;
 -      }
 -
 -      return ret;
 -}
 -
  static int rtl8169_get_eee(struct net_device *dev, struct ethtool_eee *data)
  {
        struct rtl8169_private *tp = netdev_priv(dev);
        struct device *d = tp_to_dev(tp);
        int ret;
  
 +      if (!rtl_supports_eee(tp))
 +              return -EOPNOTSUPP;
 +
        pm_runtime_get_noresume(d);
  
        if (!pm_runtime_active(d)) {
                ret = -EOPNOTSUPP;
 -              goto out;
 +      } else {
 +              ret = phy_ethtool_get_eee(tp->phydev, data);
        }
  
 -      /* Get Supported EEE */
 -      ret = rtl_get_eee_supp(tp);
 -      if (ret < 0)
 -              goto out;
 -      data->supported = mmd_eee_cap_to_ethtool_sup_t(ret);
 -
 -      /* Get advertisement EEE */
 -      ret = rtl_get_eee_adv(tp);
 -      if (ret < 0)
 -              goto out;
 -      data->advertised = mmd_eee_adv_to_ethtool_adv_t(ret);
 -      data->eee_enabled = !!data->advertised;
 -
 -      /* Get LP advertisement EEE */
 -      ret = rtl_get_eee_lpadv(tp);
 -      if (ret < 0)
 -              goto out;
 -      data->lp_advertised = mmd_eee_adv_to_ethtool_adv_t(ret);
 -      data->eee_active = !!(data->advertised & data->lp_advertised);
 -out:
        pm_runtime_put_noidle(d);
 -      return ret < 0 ? ret : 0;
 +
 +      return ret;
  }
  
  static int rtl8169_set_eee(struct net_device *dev, struct ethtool_eee *data)
  {
        struct rtl8169_private *tp = netdev_priv(dev);
        struct device *d = tp_to_dev(tp);
 -      int old_adv, adv = 0, cap, ret;
 +      int ret;
 +
 +      if (!rtl_supports_eee(tp))
 +              return -EOPNOTSUPP;
  
        pm_runtime_get_noresume(d);
  
 -      if (!dev->phydev || !pm_runtime_active(d)) {
 +      if (!pm_runtime_active(d)) {
                ret = -EOPNOTSUPP;
                goto out;
        }
                goto out;
        }
  
 -      /* Get Supported EEE */
 -      ret = rtl_get_eee_supp(tp);
 -      if (ret < 0)
 -              goto out;
 -      cap = ret;
 -
 -      ret = rtl_get_eee_adv(tp);
 -      if (ret < 0)
 -              goto out;
 -      old_adv = ret;
 -
 -      if (data->eee_enabled) {
 -              adv = !data->advertised ? cap :
 -                    ethtool_adv_to_mmd_eee_adv_t(data->advertised) & cap;
 -              /* Mask prohibited EEE modes */
 -              adv &= ~dev->phydev->eee_broken_modes;
 -      }
 -
 -      if (old_adv != adv) {
 -              ret = rtl_set_eee_adv(tp, adv);
 -              if (ret < 0)
 -                      goto out;
 -
 -              /* Restart autonegotiation so the new modes get sent to the
 -               * link partner.
 -               */
 -              ret = phy_restart_aneg(dev->phydev);
 -      }
 -
 +      ret = phy_ethtool_set_eee(tp->phydev, data);
  out:
        pm_runtime_put_noidle(d);
 -      return ret < 0 ? ret : 0;
 +      return ret;
  }
  
  static const struct ethtool_ops rtl8169_ethtool_ops = {
  
  static void rtl_enable_eee(struct rtl8169_private *tp)
  {
 -      int supported = rtl_get_eee_supp(tp);
 +      struct phy_device *phydev = tp->phydev;
 +      int supported = phy_read_mmd(phydev, MDIO_MMD_PCS, MDIO_PCS_EEE_ABLE);
  
        if (supported > 0)
 -              rtl_set_eee_adv(tp, supported);
 +              phy_write_mmd(phydev, MDIO_MMD_AN, MDIO_AN_EEE_ADV, supported);
  }
  
  static void rtl8169_get_mac_version(struct rtl8169_private *tp)
                u16 val;
                u16 mac_version;
        } mac_info[] = {
 +              /* 8125 family. */
 +              { 0x7cf, 0x608, RTL_GIGA_MAC_VER_60 },
 +              { 0x7c8, 0x608, RTL_GIGA_MAC_VER_61 },
 +
                /* 8168EP family. */
                { 0x7cf, 0x502, RTL_GIGA_MAC_VER_51 },
                { 0x7cf, 0x501, RTL_GIGA_MAC_VER_50 },
@@@ -2271,12 -2303,6 +2270,12 @@@ static void rtl8168_config_eee_mac(stru
        rtl_eri_set_bits(tp, 0x1b0, ERIAR_MASK_1111, 0x0003);
  }
  
 +static void rtl8125_config_eee_mac(struct rtl8169_private *tp)
 +{
 +      r8168_mac_ocp_modify(tp, 0xe040, 0, BIT(1) | BIT(0));
 +      r8168_mac_ocp_modify(tp, 0xeb62, 0, BIT(2) | BIT(1));
 +}
 +
  static void rtl8168f_config_eee_phy(struct rtl8169_private *tp)
  {
        struct phy_device *phydev = tp->phydev;
@@@ -2297,26 -2323,6 +2296,26 @@@ static void rtl8168g_config_eee_phy(str
        phy_modify_paged(tp->phydev, 0x0a43, 0x11, 0, BIT(4));
  }
  
 +static void rtl8168h_config_eee_phy(struct rtl8169_private *tp)
 +{
 +      struct phy_device *phydev = tp->phydev;
 +
 +      rtl8168g_config_eee_phy(tp);
 +
 +      phy_modify_paged(phydev, 0xa4a, 0x11, 0x0000, 0x0200);
 +      phy_modify_paged(phydev, 0xa42, 0x14, 0x0000, 0x0080);
 +}
 +
 +static void rtl8125_config_eee_phy(struct rtl8169_private *tp)
 +{
 +      struct phy_device *phydev = tp->phydev;
 +
 +      rtl8168h_config_eee_phy(tp);
 +
 +      phy_modify_paged(phydev, 0xa6d, 0x12, 0x0001, 0x0000);
 +      phy_modify_paged(phydev, 0xa6d, 0x14, 0x0010, 0x0000);
 +}
 +
  static void rtl8169s_hw_phy_config(struct rtl8169_private *tp)
  {
        static const struct phy_reg phy_reg_init[] = {
@@@ -3244,9 -3250,9 +3243,9 @@@ static void rtl8168g_1_hw_phy_config(st
  
        ret = phy_read_paged(tp->phydev, 0x0a46, 0x13);
        if (ret & BIT(8))
 -              phy_modify_paged(tp->phydev, 0x0c41, 0x12, 0, BIT(1));
 +              phy_modify_paged(tp->phydev, 0x0c41, 0x15, 0, BIT(1));
        else
 -              phy_modify_paged(tp->phydev, 0x0c41, 0x12, BIT(1), 0);
 +              phy_modify_paged(tp->phydev, 0x0c41, 0x15, BIT(1), 0);
  
        /* Enable PHY auto speed down */
        phy_modify_paged(tp->phydev, 0x0a44, 0x11, 0, BIT(3) | BIT(2));
@@@ -3384,7 -3390,7 +3383,7 @@@ static void rtl8168h_1_hw_phy_config(st
        phy_modify_paged(tp->phydev, 0x0a44, 0x11, BIT(7), 0);
  
        rtl8168g_disable_aldps(tp);
 -      rtl8168g_config_eee_phy(tp);
 +      rtl8168h_config_eee_phy(tp);
        rtl_enable_eee(tp);
  }
  
@@@ -3637,134 -3643,6 +3636,134 @@@ static void rtl8106e_hw_phy_config(stru
        rtl_eri_write(tp, 0x1d0, ERIAR_MASK_0011, 0x0000);
  }
  
 +static void rtl8125_1_hw_phy_config(struct rtl8169_private *tp)
 +{
 +      struct phy_device *phydev = tp->phydev;
 +
 +      phy_modify_paged(phydev, 0xad4, 0x10, 0x03ff, 0x0084);
 +      phy_modify_paged(phydev, 0xad4, 0x17, 0x0000, 0x0010);
 +      phy_modify_paged(phydev, 0xad1, 0x13, 0x03ff, 0x0006);
 +      phy_modify_paged(phydev, 0xad3, 0x11, 0x003f, 0x0006);
 +      phy_modify_paged(phydev, 0xac0, 0x14, 0x0000, 0x1100);
 +      phy_modify_paged(phydev, 0xac8, 0x15, 0xf000, 0x7000);
 +      phy_modify_paged(phydev, 0xad1, 0x14, 0x0000, 0x0400);
 +      phy_modify_paged(phydev, 0xad1, 0x15, 0x0000, 0x03ff);
 +      phy_modify_paged(phydev, 0xad1, 0x16, 0x0000, 0x03ff);
 +
 +      phy_write(phydev, 0x1f, 0x0a43);
 +      phy_write(phydev, 0x13, 0x80ea);
 +      phy_modify(phydev, 0x14, 0xff00, 0xc400);
 +      phy_write(phydev, 0x13, 0x80eb);
 +      phy_modify(phydev, 0x14, 0x0700, 0x0300);
 +      phy_write(phydev, 0x13, 0x80f8);
 +      phy_modify(phydev, 0x14, 0xff00, 0x1c00);
 +      phy_write(phydev, 0x13, 0x80f1);
 +      phy_modify(phydev, 0x14, 0xff00, 0x3000);
 +      phy_write(phydev, 0x13, 0x80fe);
 +      phy_modify(phydev, 0x14, 0xff00, 0xa500);
 +      phy_write(phydev, 0x13, 0x8102);
 +      phy_modify(phydev, 0x14, 0xff00, 0x5000);
 +      phy_write(phydev, 0x13, 0x8105);
 +      phy_modify(phydev, 0x14, 0xff00, 0x3300);
 +      phy_write(phydev, 0x13, 0x8100);
 +      phy_modify(phydev, 0x14, 0xff00, 0x7000);
 +      phy_write(phydev, 0x13, 0x8104);
 +      phy_modify(phydev, 0x14, 0xff00, 0xf000);
 +      phy_write(phydev, 0x13, 0x8106);
 +      phy_modify(phydev, 0x14, 0xff00, 0x6500);
 +      phy_write(phydev, 0x13, 0x80dc);
 +      phy_modify(phydev, 0x14, 0xff00, 0xed00);
 +      phy_write(phydev, 0x13, 0x80df);
 +      phy_set_bits(phydev, 0x14, BIT(8));
 +      phy_write(phydev, 0x13, 0x80e1);
 +      phy_clear_bits(phydev, 0x14, BIT(8));
 +      phy_write(phydev, 0x1f, 0x0000);
 +
 +      phy_modify_paged(phydev, 0xbf0, 0x13, 0x003f, 0x0038);
 +      phy_write_paged(phydev, 0xa43, 0x13, 0x819f);
 +      phy_write_paged(phydev, 0xa43, 0x14, 0xd0b6);
 +
 +      phy_write_paged(phydev, 0xbc3, 0x12, 0x5555);
 +      phy_modify_paged(phydev, 0xbf0, 0x15, 0x0e00, 0x0a00);
 +      phy_modify_paged(phydev, 0xa5c, 0x10, 0x0400, 0x0000);
 +      phy_modify_paged(phydev, 0xa44, 0x11, 0x0000, 0x0800);
 +
 +      rtl8125_config_eee_phy(tp);
 +      rtl_enable_eee(tp);
 +}
 +
 +static void rtl8125_2_hw_phy_config(struct rtl8169_private *tp)
 +{
 +      struct phy_device *phydev = tp->phydev;
 +      int i;
 +
 +      phy_modify_paged(phydev, 0xad4, 0x17, 0x0000, 0x0010);
 +      phy_modify_paged(phydev, 0xad1, 0x13, 0x03ff, 0x03ff);
 +      phy_modify_paged(phydev, 0xad3, 0x11, 0x003f, 0x0006);
 +      phy_modify_paged(phydev, 0xac0, 0x14, 0x1100, 0x0000);
 +      phy_modify_paged(phydev, 0xacc, 0x10, 0x0003, 0x0002);
 +      phy_modify_paged(phydev, 0xad4, 0x10, 0x00e7, 0x0044);
 +      phy_modify_paged(phydev, 0xac1, 0x12, 0x0080, 0x0000);
 +      phy_modify_paged(phydev, 0xac8, 0x10, 0x0300, 0x0000);
 +      phy_modify_paged(phydev, 0xac5, 0x17, 0x0007, 0x0002);
 +      phy_write_paged(phydev, 0xad4, 0x16, 0x00a8);
 +      phy_write_paged(phydev, 0xac5, 0x16, 0x01ff);
 +      phy_modify_paged(phydev, 0xac8, 0x15, 0x00f0, 0x0030);
 +
 +      phy_write(phydev, 0x1f, 0x0b87);
 +      phy_write(phydev, 0x16, 0x80a2);
 +      phy_write(phydev, 0x17, 0x0153);
 +      phy_write(phydev, 0x16, 0x809c);
 +      phy_write(phydev, 0x17, 0x0153);
 +      phy_write(phydev, 0x1f, 0x0000);
 +
 +      phy_write(phydev, 0x1f, 0x0a43);
 +      phy_write(phydev, 0x13, 0x81B3);
 +      phy_write(phydev, 0x14, 0x0043);
 +      phy_write(phydev, 0x14, 0x00A7);
 +      phy_write(phydev, 0x14, 0x00D6);
 +      phy_write(phydev, 0x14, 0x00EC);
 +      phy_write(phydev, 0x14, 0x00F6);
 +      phy_write(phydev, 0x14, 0x00FB);
 +      phy_write(phydev, 0x14, 0x00FD);
 +      phy_write(phydev, 0x14, 0x00FF);
 +      phy_write(phydev, 0x14, 0x00BB);
 +      phy_write(phydev, 0x14, 0x0058);
 +      phy_write(phydev, 0x14, 0x0029);
 +      phy_write(phydev, 0x14, 0x0013);
 +      phy_write(phydev, 0x14, 0x0009);
 +      phy_write(phydev, 0x14, 0x0004);
 +      phy_write(phydev, 0x14, 0x0002);
 +      for (i = 0; i < 25; i++)
 +              phy_write(phydev, 0x14, 0x0000);
 +
 +      phy_write(phydev, 0x13, 0x8257);
 +      phy_write(phydev, 0x14, 0x020F);
 +
 +      phy_write(phydev, 0x13, 0x80EA);
 +      phy_write(phydev, 0x14, 0x7843);
 +      phy_write(phydev, 0x1f, 0x0000);
 +
 +      rtl_apply_firmware(tp);
 +
 +      phy_modify_paged(phydev, 0xd06, 0x14, 0x0000, 0x2000);
 +
 +      phy_write(phydev, 0x1f, 0x0a43);
 +      phy_write(phydev, 0x13, 0x81a2);
 +      phy_set_bits(phydev, 0x14, BIT(8));
 +      phy_write(phydev, 0x1f, 0x0000);
 +
 +      phy_modify_paged(phydev, 0xb54, 0x16, 0xff00, 0xdb00);
 +      phy_modify_paged(phydev, 0xa45, 0x12, 0x0001, 0x0000);
 +      phy_modify_paged(phydev, 0xa5d, 0x12, 0x0000, 0x0020);
 +      phy_modify_paged(phydev, 0xad4, 0x17, 0x0010, 0x0000);
 +      phy_modify_paged(phydev, 0xa86, 0x15, 0x0001, 0x0000);
 +      phy_modify_paged(phydev, 0xa44, 0x11, 0x0000, 0x0800);
 +
 +      rtl8125_config_eee_phy(tp);
 +      rtl_enable_eee(tp);
 +}
 +
  static void rtl_hw_phy_config(struct net_device *dev)
  {
        static const rtl_generic_fct phy_configs[] = {
                [RTL_GIGA_MAC_VER_49] = rtl8168ep_1_hw_phy_config,
                [RTL_GIGA_MAC_VER_50] = rtl8168ep_2_hw_phy_config,
                [RTL_GIGA_MAC_VER_51] = rtl8168ep_2_hw_phy_config,
 +              [RTL_GIGA_MAC_VER_60] = rtl8125_1_hw_phy_config,
 +              [RTL_GIGA_MAC_VER_61] = rtl8125_2_hw_phy_config,
        };
        struct rtl8169_private *tp = netdev_priv(dev);
  
@@@ -3949,8 -3825,6 +3948,8 @@@ static void rtl_pll_power_down(struct r
        case RTL_GIGA_MAC_VER_48:
        case RTL_GIGA_MAC_VER_50:
        case RTL_GIGA_MAC_VER_51:
 +      case RTL_GIGA_MAC_VER_60:
 +      case RTL_GIGA_MAC_VER_61:
                RTL_W8(tp, PMCH, RTL_R8(tp, PMCH) & ~0x80);
                break;
        case RTL_GIGA_MAC_VER_40:
@@@ -3980,8 -3854,6 +3979,8 @@@ static void rtl_pll_power_up(struct rtl
        case RTL_GIGA_MAC_VER_48:
        case RTL_GIGA_MAC_VER_50:
        case RTL_GIGA_MAC_VER_51:
 +      case RTL_GIGA_MAC_VER_60:
 +      case RTL_GIGA_MAC_VER_61:
                RTL_W8(tp, PMCH, RTL_R8(tp, PMCH) | 0xc0);
                break;
        case RTL_GIGA_MAC_VER_40:
@@@ -4014,10 -3886,6 +4013,10 @@@ static void rtl_init_rxcfg(struct rtl81
        case RTL_GIGA_MAC_VER_40 ... RTL_GIGA_MAC_VER_51:
                RTL_W32(tp, RxConfig, RX128_INT_EN | RX_MULTI_EN | RX_DMA_BURST | RX_EARLY_OFF);
                break;
 +      case RTL_GIGA_MAC_VER_60 ... RTL_GIGA_MAC_VER_61:
 +              RTL_W32(tp, RxConfig, RX_FETCH_DFLT_8125 | RX_VLAN_8125 |
 +                                    RX_DMA_BURST);
 +              break;
        default:
                RTL_W32(tp, RxConfig, RX128_INT_EN | RX_DMA_BURST);
                break;
@@@ -4277,46 -4145,54 +4276,46 @@@ static void rtl8169_set_magic_reg(struc
  
  static void rtl_set_rx_mode(struct net_device *dev)
  {
 +      u32 rx_mode = AcceptBroadcast | AcceptMyPhys | AcceptMulticast;
 +      /* Multicast hash filter */
 +      u32 mc_filter[2] = { 0xffffffff, 0xffffffff };
        struct rtl8169_private *tp = netdev_priv(dev);
 -      u32 mc_filter[2];       /* Multicast hash filter */
 -      int rx_mode;
 -      u32 tmp = 0;
 +      u32 tmp;
  
        if (dev->flags & IFF_PROMISC) {
                /* Unconditionally log net taps. */
                netif_notice(tp, link, dev, "Promiscuous mode enabled\n");
 -              rx_mode =
 -                  AcceptBroadcast | AcceptMulticast | AcceptMyPhys |
 -                  AcceptAllPhys;
 -              mc_filter[1] = mc_filter[0] = 0xffffffff;
 -      } else if ((netdev_mc_count(dev) > multicast_filter_limit) ||
 -                 (dev->flags & IFF_ALLMULTI)) {
 -              /* Too many to filter perfectly -- accept all multicasts. */
 -              rx_mode = AcceptBroadcast | AcceptMulticast | AcceptMyPhys;
 -              mc_filter[1] = mc_filter[0] = 0xffffffff;
 +              rx_mode |= AcceptAllPhys;
 +      } else if (netdev_mc_count(dev) > MC_FILTER_LIMIT ||
 +                 dev->flags & IFF_ALLMULTI ||
 +                 tp->mac_version == RTL_GIGA_MAC_VER_35) {
 +              /* accept all multicasts */
 +      } else if (netdev_mc_empty(dev)) {
 +              rx_mode &= ~AcceptMulticast;
        } else {
                struct netdev_hw_addr *ha;
  
 -              rx_mode = AcceptBroadcast | AcceptMyPhys;
                mc_filter[1] = mc_filter[0] = 0;
                netdev_for_each_mc_addr(ha, dev) {
 -                      int bit_nr = ether_crc(ETH_ALEN, ha->addr) >> 26;
 -                      mc_filter[bit_nr >> 5] |= 1 << (bit_nr & 31);
 -                      rx_mode |= AcceptMulticast;
 +                      u32 bit_nr = ether_crc(ETH_ALEN, ha->addr) >> 26;
 +                      mc_filter[bit_nr >> 5] |= BIT(bit_nr & 31);
 +              }
 +
 +              if (tp->mac_version > RTL_GIGA_MAC_VER_06) {
 +                      tmp = mc_filter[0];
 +                      mc_filter[0] = swab32(mc_filter[1]);
 +                      mc_filter[1] = swab32(tmp);
                }
        }
  
        if (dev->features & NETIF_F_RXALL)
                rx_mode |= (AcceptErr | AcceptRunt);
  
 -      tmp = (RTL_R32(tp, RxConfig) & ~RX_CONFIG_ACCEPT_MASK) | rx_mode;
 -
 -      if (tp->mac_version > RTL_GIGA_MAC_VER_06) {
 -              u32 data = mc_filter[0];
 -
 -              mc_filter[0] = swab32(mc_filter[1]);
 -              mc_filter[1] = swab32(data);
 -      }
 -
 -      if (tp->mac_version == RTL_GIGA_MAC_VER_35)
 -              mc_filter[1] = mc_filter[0] = 0xffffffff;
 -
        RTL_W32(tp, MAR0 + 4, mc_filter[1]);
        RTL_W32(tp, MAR0 + 0, mc_filter[0]);
  
 -      RTL_W32(tp, RxConfig, tmp);
 +      tmp = RTL_R32(tp, RxConfig);
 +      RTL_W32(tp, RxConfig, (tmp & ~RX_CONFIG_ACCEPT_MASK) | rx_mode);
  }
  
  DECLARE_RTL_COND(rtl_csiar_cond)
@@@ -4530,7 -4406,7 +4529,7 @@@ static void rtl_hw_start_8168c_2(struc
  {
        static const struct ephy_info e_info_8168c_2[] = {
                { 0x01, 0,      0x0001 },
 -              { 0x03, 0x0400, 0x0220 }
 +              { 0x03, 0x0400, 0x0020 }
        };
  
        rtl_set_def_aspm_entry_latency(tp);
@@@ -4577,8 -4453,7 +4576,8 @@@ static void rtl_hw_start_8168d_4(struc
        static const struct ephy_info e_info_8168d_4[] = {
                { 0x0b, 0x0000, 0x0048 },
                { 0x19, 0x0020, 0x0050 },
 -              { 0x0c, 0x0100, 0x0020 }
 +              { 0x0c, 0x0100, 0x0020 },
 +              { 0x10, 0x0004, 0x0000 },
        };
  
        rtl_set_def_aspm_entry_latency(tp);
@@@ -4628,9 -4503,7 +4627,9 @@@ static void rtl_hw_start_8168e_2(struc
  {
        static const struct ephy_info e_info_8168e_2[] = {
                { 0x09, 0x0000, 0x0080 },
 -              { 0x19, 0x0000, 0x0224 }
 +              { 0x19, 0x0000, 0x0224 },
 +              { 0x00, 0x0000, 0x0004 },
 +              { 0x0c, 0x3df0, 0x0200 },
        };
  
        rtl_set_def_aspm_entry_latency(tp);
@@@ -4692,9 -4565,7 +4691,9 @@@ static void rtl_hw_start_8168f_1(struc
                { 0x06, 0x00c0, 0x0020 },
                { 0x08, 0x0001, 0x0002 },
                { 0x09, 0x0000, 0x0080 },
 -              { 0x19, 0x0000, 0x0224 }
 +              { 0x19, 0x0000, 0x0224 },
 +              { 0x00, 0x0000, 0x0004 },
 +              { 0x0c, 0x3df0, 0x0200 },
        };
  
        rtl_hw_start_8168f(tp);
@@@ -4709,9 -4580,8 +4708,9 @@@ static void rtl_hw_start_8411(struct rt
        static const struct ephy_info e_info_8168f_1[] = {
                { 0x06, 0x00c0, 0x0020 },
                { 0x0f, 0xffff, 0x5200 },
 -              { 0x1e, 0x0000, 0x4000 },
 -              { 0x19, 0x0000, 0x0224 }
 +              { 0x19, 0x0000, 0x0224 },
 +              { 0x00, 0x0000, 0x0004 },
 +              { 0x0c, 0x3df0, 0x0200 },
        };
  
        rtl_hw_start_8168f(tp);
@@@ -4750,8 -4620,8 +4749,8 @@@ static void rtl_hw_start_8168g(struct r
  static void rtl_hw_start_8168g_1(struct rtl8169_private *tp)
  {
        static const struct ephy_info e_info_8168g_1[] = {
 -              { 0x00, 0x0000, 0x0008 },
 -              { 0x0c, 0x37d0, 0x0820 },
 +              { 0x00, 0x0008, 0x0000 },
 +              { 0x0c, 0x3ff0, 0x0820 },
                { 0x1e, 0x0000, 0x0001 },
                { 0x19, 0x8000, 0x0000 }
        };
  static void rtl_hw_start_8168g_2(struct rtl8169_private *tp)
  {
        static const struct ephy_info e_info_8168g_2[] = {
 -              { 0x00, 0x0000, 0x0008 },
 -              { 0x0c, 0x3df0, 0x0200 },
 -              { 0x19, 0xffff, 0xfc00 },
 -              { 0x1e, 0xffff, 0x20eb }
 +              { 0x00, 0x0008, 0x0000 },
 +              { 0x0c, 0x3ff0, 0x0820 },
 +              { 0x19, 0xffff, 0x7c00 },
 +              { 0x1e, 0xffff, 0x20eb },
 +              { 0x0d, 0xffff, 0x1666 },
 +              { 0x00, 0xffff, 0x10a3 },
 +              { 0x06, 0xffff, 0xf050 },
 +              { 0x04, 0x0000, 0x0010 },
 +              { 0x1d, 0x4000, 0x0000 },
        };
  
        rtl_hw_start_8168g(tp);
  static void rtl_hw_start_8411_2(struct rtl8169_private *tp)
  {
        static const struct ephy_info e_info_8411_2[] = {
 -              { 0x00, 0x0000, 0x0008 },
 -              { 0x0c, 0x3df0, 0x0200 },
 -              { 0x0f, 0xffff, 0x5200 },
 -              { 0x19, 0x0020, 0x0000 },
 -              { 0x1e, 0x0000, 0x2000 }
 +              { 0x00, 0x0008, 0x0000 },
 +              { 0x0c, 0x37d0, 0x0820 },
 +              { 0x1e, 0x0000, 0x0001 },
 +              { 0x19, 0x8021, 0x0000 },
 +              { 0x1e, 0x0000, 0x2000 },
 +              { 0x0d, 0x0100, 0x0200 },
 +              { 0x00, 0x0000, 0x0080 },
 +              { 0x06, 0x0000, 0x0010 },
 +              { 0x04, 0x0000, 0x0010 },
 +              { 0x1d, 0x0000, 0x4000 },
        };
  
        rtl_hw_start_8168g(tp);
  
  static void rtl_hw_start_8168h_1(struct rtl8169_private *tp)
  {
 -      int rg_saw_cnt;
 -      u32 data;
        static const struct ephy_info e_info_8168h_1[] = {
                { 0x1e, 0x0800, 0x0001 },
                { 0x1d, 0x0000, 0x0800 },
                { 0x05, 0xffff, 0x2089 },
                { 0x06, 0xffff, 0x5881 },
 -              { 0x04, 0xffff, 0x154a },
 +              { 0x04, 0xffff, 0x854a },
                { 0x01, 0xffff, 0x068b }
        };
 +      int rg_saw_cnt;
  
        /* disable aspm and clock request before access ephy */
        rtl_hw_aspm_clkreq_enable(tp, false);
  
                sw_cnt_1ms_ini = 16000000/rg_saw_cnt;
                sw_cnt_1ms_ini &= 0x0fff;
 -              data = r8168_mac_ocp_read(tp, 0xd412);
 -              data &= ~0x0fff;
 -              data |= sw_cnt_1ms_ini;
 -              r8168_mac_ocp_write(tp, 0xd412, data);
 +              r8168_mac_ocp_modify(tp, 0xd412, 0x0fff, sw_cnt_1ms_ini);
        }
  
 -      data = r8168_mac_ocp_read(tp, 0xe056);
 -      data &= ~0xf0;
 -      data |= 0x70;
 -      r8168_mac_ocp_write(tp, 0xe056, data);
 -
 -      data = r8168_mac_ocp_read(tp, 0xe052);
 -      data &= ~0x6000;
 -      data |= 0x8008;
 -      r8168_mac_ocp_write(tp, 0xe052, data);
 -
 -      data = r8168_mac_ocp_read(tp, 0xe0d6);
 -      data &= ~0x01ff;
 -      data |= 0x017f;
 -      r8168_mac_ocp_write(tp, 0xe0d6, data);
 -
 -      data = r8168_mac_ocp_read(tp, 0xd420);
 -      data &= ~0x0fff;
 -      data |= 0x047f;
 -      r8168_mac_ocp_write(tp, 0xd420, data);
 +      r8168_mac_ocp_modify(tp, 0xe056, 0x00f0, 0x0070);
 +      r8168_mac_ocp_modify(tp, 0xe052, 0x6000, 0x8008);
 +      r8168_mac_ocp_modify(tp, 0xe0d6, 0x01ff, 0x017f);
 +      r8168_mac_ocp_modify(tp, 0xd420, 0x0fff, 0x047f);
  
        r8168_mac_ocp_write(tp, 0xe63e, 0x0001);
        r8168_mac_ocp_write(tp, 0xe63e, 0x0000);
@@@ -5089,11 -4968,12 +5088,11 @@@ static void rtl_hw_start_8168ep_2(struc
  
  static void rtl_hw_start_8168ep_3(struct rtl8169_private *tp)
  {
 -      u32 data;
        static const struct ephy_info e_info_8168ep_3[] = {
 -              { 0x00, 0xffff, 0x10a3 },
 -              { 0x19, 0xffff, 0x7c00 },
 -              { 0x1e, 0xffff, 0x20eb },
 -              { 0x0d, 0xffff, 0x1666 }
 +              { 0x00, 0x0000, 0x0080 },
 +              { 0x0d, 0x0100, 0x0200 },
 +              { 0x19, 0x8021, 0x0000 },
 +              { 0x1e, 0x0000, 0x2000 },
        };
  
        /* disable aspm and clock request before access ephy */
        RTL_W8(tp, DLLPR, RTL_R8(tp, DLLPR) & ~PFM_EN);
        RTL_W8(tp, MISC_1, RTL_R8(tp, MISC_1) & ~PFM_D3COLD_EN);
  
 -      data = r8168_mac_ocp_read(tp, 0xd3e2);
 -      data &= 0xf000;
 -      data |= 0x0271;
 -      r8168_mac_ocp_write(tp, 0xd3e2, data);
 -
 -      data = r8168_mac_ocp_read(tp, 0xd3e4);
 -      data &= 0xff00;
 -      r8168_mac_ocp_write(tp, 0xd3e4, data);
 -
 -      data = r8168_mac_ocp_read(tp, 0xe860);
 -      data |= 0x0080;
 -      r8168_mac_ocp_write(tp, 0xe860, data);
 +      r8168_mac_ocp_modify(tp, 0xd3e2, 0x0fff, 0x0271);
 +      r8168_mac_ocp_modify(tp, 0xd3e4, 0x00ff, 0x0000);
 +      r8168_mac_ocp_modify(tp, 0xe860, 0x0000, 0x0080);
  
        rtl_hw_aspm_clkreq_enable(tp, true);
  }
@@@ -5235,128 -5124,6 +5234,128 @@@ static void rtl_hw_start_8106(struct rt
        rtl_hw_aspm_clkreq_enable(tp, true);
  }
  
 +DECLARE_RTL_COND(rtl_mac_ocp_e00e_cond)
 +{
 +      return r8168_mac_ocp_read(tp, 0xe00e) & BIT(13);
 +}
 +
 +static void rtl_hw_start_8125_common(struct rtl8169_private *tp)
 +{
 +      rtl_pcie_state_l2l3_disable(tp);
 +
 +      RTL_W16(tp, 0x382, 0x221b);
 +      RTL_W8(tp, 0x4500, 0);
 +      RTL_W16(tp, 0x4800, 0);
 +
 +      /* disable UPS */
 +      r8168_mac_ocp_modify(tp, 0xd40a, 0x0010, 0x0000);
 +
 +      RTL_W8(tp, Config1, RTL_R8(tp, Config1) & ~0x10);
 +
 +      r8168_mac_ocp_write(tp, 0xc140, 0xffff);
 +      r8168_mac_ocp_write(tp, 0xc142, 0xffff);
 +
 +      r8168_mac_ocp_modify(tp, 0xd3e2, 0x0fff, 0x03a9);
 +      r8168_mac_ocp_modify(tp, 0xd3e4, 0x00ff, 0x0000);
 +      r8168_mac_ocp_modify(tp, 0xe860, 0x0000, 0x0080);
 +
 +      /* disable new tx descriptor format */
 +      r8168_mac_ocp_modify(tp, 0xeb58, 0x0001, 0x0000);
 +
 +      r8168_mac_ocp_modify(tp, 0xe614, 0x0700, 0x0400);
 +      r8168_mac_ocp_modify(tp, 0xe63e, 0x0c30, 0x0020);
 +      r8168_mac_ocp_modify(tp, 0xc0b4, 0x0000, 0x000c);
 +      r8168_mac_ocp_modify(tp, 0xeb6a, 0x00ff, 0x0033);
 +      r8168_mac_ocp_modify(tp, 0xeb50, 0x03e0, 0x0040);
 +      r8168_mac_ocp_modify(tp, 0xe056, 0x00f0, 0x0030);
 +      r8168_mac_ocp_modify(tp, 0xe040, 0x1000, 0x0000);
 +      r8168_mac_ocp_modify(tp, 0xe0c0, 0x4f0f, 0x4403);
 +      r8168_mac_ocp_modify(tp, 0xe052, 0x0080, 0x0067);
 +      r8168_mac_ocp_modify(tp, 0xc0ac, 0x0080, 0x1f00);
 +      r8168_mac_ocp_modify(tp, 0xd430, 0x0fff, 0x047f);
 +      r8168_mac_ocp_modify(tp, 0xe84c, 0x0000, 0x00c0);
 +      r8168_mac_ocp_modify(tp, 0xea1c, 0x0004, 0x0000);
 +      r8168_mac_ocp_modify(tp, 0xeb54, 0x0000, 0x0001);
 +      udelay(1);
 +      r8168_mac_ocp_modify(tp, 0xeb54, 0x0001, 0x0000);
 +      RTL_W16(tp, 0x1880, RTL_R16(tp, 0x1880) & ~0x0030);
 +
 +      r8168_mac_ocp_write(tp, 0xe098, 0xc302);
 +
 +      rtl_udelay_loop_wait_low(tp, &rtl_mac_ocp_e00e_cond, 1000, 10);
 +
 +      rtl8125_config_eee_mac(tp);
 +
 +      RTL_W32(tp, MISC, RTL_R32(tp, MISC) & ~RXDV_GATED_EN);
 +      udelay(10);
 +}
 +
 +static void rtl_hw_start_8125_1(struct rtl8169_private *tp)
 +{
 +      static const struct ephy_info e_info_8125_1[] = {
 +              { 0x01, 0xffff, 0xa812 },
 +              { 0x09, 0xffff, 0x520c },
 +              { 0x04, 0xffff, 0xd000 },
 +              { 0x0d, 0xffff, 0xf702 },
 +              { 0x0a, 0xffff, 0x8653 },
 +              { 0x06, 0xffff, 0x001e },
 +              { 0x08, 0xffff, 0x3595 },
 +              { 0x20, 0xffff, 0x9455 },
 +              { 0x21, 0xffff, 0x99ff },
 +              { 0x02, 0xffff, 0x6046 },
 +              { 0x29, 0xffff, 0xfe00 },
 +              { 0x23, 0xffff, 0xab62 },
 +
 +              { 0x41, 0xffff, 0xa80c },
 +              { 0x49, 0xffff, 0x520c },
 +              { 0x44, 0xffff, 0xd000 },
 +              { 0x4d, 0xffff, 0xf702 },
 +              { 0x4a, 0xffff, 0x8653 },
 +              { 0x46, 0xffff, 0x001e },
 +              { 0x48, 0xffff, 0x3595 },
 +              { 0x60, 0xffff, 0x9455 },
 +              { 0x61, 0xffff, 0x99ff },
 +              { 0x42, 0xffff, 0x6046 },
 +              { 0x69, 0xffff, 0xfe00 },
 +              { 0x63, 0xffff, 0xab62 },
 +      };
 +
 +      rtl_set_def_aspm_entry_latency(tp);
 +
 +      /* disable aspm and clock request before access ephy */
 +      rtl_hw_aspm_clkreq_enable(tp, false);
 +      rtl_ephy_init(tp, e_info_8125_1);
 +
 +      rtl_hw_start_8125_common(tp);
 +}
 +
 +static void rtl_hw_start_8125_2(struct rtl8169_private *tp)
 +{
 +      static const struct ephy_info e_info_8125_2[] = {
 +              { 0x04, 0xffff, 0xd000 },
 +              { 0x0a, 0xffff, 0x8653 },
 +              { 0x23, 0xffff, 0xab66 },
 +              { 0x20, 0xffff, 0x9455 },
 +              { 0x21, 0xffff, 0x99ff },
 +              { 0x29, 0xffff, 0xfe04 },
 +
 +              { 0x44, 0xffff, 0xd000 },
 +              { 0x4a, 0xffff, 0x8653 },
 +              { 0x63, 0xffff, 0xab66 },
 +              { 0x60, 0xffff, 0x9455 },
 +              { 0x61, 0xffff, 0x99ff },
 +              { 0x69, 0xffff, 0xfe04 },
 +      };
 +
 +      rtl_set_def_aspm_entry_latency(tp);
 +
 +      /* disable aspm and clock request before access ephy */
 +      rtl_hw_aspm_clkreq_enable(tp, false);
 +      rtl_ephy_init(tp, e_info_8125_2);
 +
 +      rtl_hw_start_8125_common(tp);
 +}
 +
  static void rtl_hw_config(struct rtl8169_private *tp)
  {
        static const rtl_generic_fct hw_configs[] = {
                [RTL_GIGA_MAC_VER_49] = rtl_hw_start_8168ep_1,
                [RTL_GIGA_MAC_VER_50] = rtl_hw_start_8168ep_2,
                [RTL_GIGA_MAC_VER_51] = rtl_hw_start_8168ep_3,
 +              [RTL_GIGA_MAC_VER_60] = rtl_hw_start_8125_1,
 +              [RTL_GIGA_MAC_VER_61] = rtl_hw_start_8125_2,
        };
  
        if (hw_configs[tp->mac_version])
                hw_configs[tp->mac_version](tp);
  }
  
 +static void rtl_hw_start_8125(struct rtl8169_private *tp)
 +{
 +      int i;
 +
 +      /* disable interrupt coalescing */
 +      for (i = 0xa00; i < 0xb00; i += 4)
 +              RTL_W32(tp, i, 0);
 +
 +      rtl_hw_config(tp);
 +}
 +
  static void rtl_hw_start_8168(struct rtl8169_private *tp)
  {
        if (tp->mac_version == RTL_GIGA_MAC_VER_13 ||
                RTL_W8(tp, MaxTxPacketSize, TxPacketMax);
  
        rtl_hw_config(tp);
 +
 +      /* disable interrupt coalescing */
 +      RTL_W16(tp, IntrMitigate, 0x0000);
  }
  
  static void rtl_hw_start_8169(struct rtl8169_private *tp)
        rtl8169_set_magic_reg(tp, tp->mac_version);
  
        RTL_W32(tp, RxMissed, 0);
 +
 +      /* disable interrupt coalescing */
 +      RTL_W16(tp, IntrMitigate, 0x0000);
  }
  
  static void rtl_hw_start(struct  rtl8169_private *tp)
  
        if (tp->mac_version <= RTL_GIGA_MAC_VER_06)
                rtl_hw_start_8169(tp);
 +      else if (rtl_is_8125(tp))
 +              rtl_hw_start_8125(tp);
        else
                rtl_hw_start_8168(tp);
  
        rtl_set_rx_tx_desc_registers(tp);
        rtl_lock_config_regs(tp);
  
 -      /* disable interrupt coalescing */
 -      RTL_W16(tp, IntrMitigate, 0x0000);
        /* Initially a 10 us delay. Turned it into a PCI commit. - FR */
 -      RTL_R8(tp, IntrMask);
 +      RTL_R16(tp, CPlusCmd);
        RTL_W8(tp, ChipCmd, CmdTxEnb | CmdRxEnb);
        rtl_init_rxcfg(tp);
        rtl_set_tx_config_registers(tp);
 -
        rtl_set_rx_mode(tp->dev);
 -      /* no early-rx interrupts */
 -      RTL_W16(tp, MultiIntr, RTL_R16(tp, MultiIntr) & 0xf000);
        rtl_irq_enable(tp);
  }
  
@@@ -5516,6 -5267,17 +5515,6 @@@ static inline void rtl8169_make_unusabl
        desc->opts1 &= ~cpu_to_le32(DescOwn | RsvdMask);
  }
  
 -static void rtl8169_free_rx_databuff(struct rtl8169_private *tp,
 -                                   void **data_buff, struct RxDesc *desc)
 -{
 -      dma_unmap_single(tp_to_dev(tp), le64_to_cpu(desc->addr),
 -                       R8169_RX_BUF_SIZE, DMA_FROM_DEVICE);
 -
 -      kfree(*data_buff);
 -      *data_buff = NULL;
 -      rtl8169_make_unusable_by_asic(desc);
 -}
 -
  static inline void rtl8169_mark_to_asic(struct RxDesc *desc)
  {
        u32 eor = le32_to_cpu(desc->opts1) & RingEnd;
        desc->opts1 = cpu_to_le32(DescOwn | eor | R8169_RX_BUF_SIZE);
  }
  
 -static struct sk_buff *rtl8169_alloc_rx_data(struct rtl8169_private *tp,
 -                                           struct RxDesc *desc)
 +static struct page *rtl8169_alloc_rx_data(struct rtl8169_private *tp,
 +                                        struct RxDesc *desc)
  {
 -      void *data;
 -      dma_addr_t mapping;
        struct device *d = tp_to_dev(tp);
        int node = dev_to_node(d);
 +      dma_addr_t mapping;
 +      struct page *data;
  
 -      data = kmalloc_node(R8169_RX_BUF_SIZE, GFP_KERNEL, node);
 +      data = alloc_pages_node(node, GFP_KERNEL, get_order(R8169_RX_BUF_SIZE));
        if (!data)
                return NULL;
  
 -      /* Memory should be properly aligned, but better check. */
 -      if (!IS_ALIGNED((unsigned long)data, 8)) {
 -              netdev_err_once(tp->dev, "RX buffer not 8-byte-aligned\n");
 -              goto err_out;
 -      }
 -
 -      mapping = dma_map_single(d, data, R8169_RX_BUF_SIZE, DMA_FROM_DEVICE);
 +      mapping = dma_map_page(d, data, 0, R8169_RX_BUF_SIZE, DMA_FROM_DEVICE);
        if (unlikely(dma_mapping_error(d, mapping))) {
                if (net_ratelimit())
                        netif_err(tp, drv, tp->dev, "Failed to map RX DMA!\n");
 -              goto err_out;
 +              __free_pages(data, get_order(R8169_RX_BUF_SIZE));
 +              return NULL;
        }
  
        desc->addr = cpu_to_le64(mapping);
        rtl8169_mark_to_asic(desc);
 -      return data;
  
 -err_out:
 -      kfree(data);
 -      return NULL;
 +      return data;
  }
  
  static void rtl8169_rx_clear(struct rtl8169_private *tp)
  {
        unsigned int i;
  
 -      for (i = 0; i < NUM_RX_DESC; i++) {
 -              if (tp->Rx_databuff[i]) {
 -                      rtl8169_free_rx_databuff(tp, tp->Rx_databuff + i,
 -                                          tp->RxDescArray + i);
 -              }
 +      for (i = 0; i < NUM_RX_DESC && tp->Rx_databuff[i]; i++) {
 +              dma_unmap_page(tp_to_dev(tp),
 +                             le64_to_cpu(tp->RxDescArray[i].addr),
 +                             R8169_RX_BUF_SIZE, DMA_FROM_DEVICE);
 +              __free_pages(tp->Rx_databuff[i], get_order(R8169_RX_BUF_SIZE));
 +              tp->Rx_databuff[i] = NULL;
 +              rtl8169_make_unusable_by_asic(tp->RxDescArray + i);
        }
  }
  
@@@ -5576,7 -5344,7 +5575,7 @@@ static int rtl8169_rx_fill(struct rtl81
        unsigned int i;
  
        for (i = 0; i < NUM_RX_DESC; i++) {
 -              void *data;
 +              struct page *data;
  
                data = rtl8169_alloc_rx_data(tp, tp->RxDescArray + i);
                if (!data) {
@@@ -5738,6 -5506,44 +5737,6 @@@ static bool rtl_test_hw_pad_bug(struct 
        return skb->len < ETH_ZLEN && tp->mac_version == RTL_GIGA_MAC_VER_34;
  }
  
 -static netdev_tx_t rtl8169_start_xmit(struct sk_buff *skb,
 -                                    struct net_device *dev);
 -/* r8169_csum_workaround()
 - * The hw limites the value the transport offset. When the offset is out of the
 - * range, calculate the checksum by sw.
 - */
 -static void r8169_csum_workaround(struct rtl8169_private *tp,
 -                                struct sk_buff *skb)
 -{
 -      if (skb_is_gso(skb)) {
 -              netdev_features_t features = tp->dev->features;
 -              struct sk_buff *segs, *nskb;
 -
 -              features &= ~(NETIF_F_SG | NETIF_F_IPV6_CSUM | NETIF_F_TSO6);
 -              segs = skb_gso_segment(skb, features);
 -              if (IS_ERR(segs) || !segs)
 -                      goto drop;
 -
 -              do {
 -                      nskb = segs;
 -                      segs = segs->next;
 -                      nskb->next = NULL;
 -                      rtl8169_start_xmit(nskb, tp->dev);
 -              } while (segs);
 -
 -              dev_consume_skb_any(skb);
 -      } else if (skb->ip_summed == CHECKSUM_PARTIAL) {
 -              if (skb_checksum_help(skb) < 0)
 -                      goto drop;
 -
 -              rtl8169_start_xmit(skb, tp->dev);
 -      } else {
 -drop:
 -              tp->dev->stats.tx_dropped++;
 -              dev_kfree_skb_any(skb);
 -      }
 -}
 -
  /* msdn_giant_send_check()
   * According to the document of microsoft, the TCP Pseudo Header excludes the
   * packet length for IPv6 TCP large packets.
@@@ -5787,6 -5593,13 +5786,6 @@@ static bool rtl8169_tso_csum_v2(struct 
        u32 mss = skb_shinfo(skb)->gso_size;
  
        if (mss) {
 -              if (transport_offset > GTTCPHO_MAX) {
 -                      netif_warn(tp, tx_err, tp->dev,
 -                                 "Invalid transport offset 0x%x for TSO\n",
 -                                 transport_offset);
 -                      return false;
 -              }
 -
                switch (vlan_get_protocol(skb)) {
                case htons(ETH_P_IP):
                        opts[0] |= TD1_GTSENV4;
        } else if (skb->ip_summed == CHECKSUM_PARTIAL) {
                u8 ip_protocol;
  
 -              if (unlikely(rtl_test_hw_pad_bug(tp, skb)))
 -                      return !(skb_checksum_help(skb) || eth_skb_pad(skb));
 -
 -              if (transport_offset > TCPHO_MAX) {
 -                      netif_warn(tp, tx_err, tp->dev,
 -                                 "Invalid transport offset 0x%x\n",
 -                                 transport_offset);
 -                      return false;
 -              }
 -
                switch (vlan_get_protocol(skb)) {
                case htons(ETH_P_IP):
                        opts[1] |= TD1_IPv4_CS;
@@@ -5862,14 -5685,6 +5861,14 @@@ static bool rtl_chip_supports_csum_v2(s
        }
  }
  
 +static void rtl8169_doorbell(struct rtl8169_private *tp)
 +{
 +      if (rtl_is_8125(tp))
 +              RTL_W16(tp, TxPoll_8125, BIT(0));
 +      else
 +              RTL_W8(tp, TxPoll, NPQ);
 +}
 +
  static netdev_tx_t rtl8169_start_xmit(struct sk_buff *skb,
                                      struct net_device *dev)
  {
        struct device *d = tp_to_dev(tp);
        dma_addr_t mapping;
        u32 opts[2], len;
 +      bool stop_queue;
 +      bool door_bell;
        int frags;
  
        if (unlikely(!rtl_tx_slots_avail(tp, skb_shinfo(skb)->nr_frags))) {
        opts[0] = DescOwn;
  
        if (rtl_chip_supports_csum_v2(tp)) {
 -              if (!rtl8169_tso_csum_v2(tp, skb, opts)) {
 -                      r8169_csum_workaround(tp, skb);
 -                      return NETDEV_TX_OK;
 -              }
 +              if (!rtl8169_tso_csum_v2(tp, skb, opts))
 +                      goto err_dma_0;
        } else {
                rtl8169_tso_csum_v1(skb, opts);
        }
  
        txd->opts2 = cpu_to_le32(opts[1]);
  
 -      netdev_sent_queue(dev, skb->len);
 -
        skb_tx_timestamp(skb);
  
        /* Force memory writes to complete before releasing descriptor */
        dma_wmb();
  
 +      door_bell = __netdev_sent_queue(dev, skb->len, netdev_xmit_more());
 +
        txd->opts1 = rtl8169_get_txd_opts1(opts[0], len, entry);
  
        /* Force all memory writes to complete before notifying device */
  
        tp->cur_tx += frags + 1;
  
 -      RTL_W8(tp, TxPoll, NPQ);
 -
 -      if (!rtl_tx_slots_avail(tp, MAX_SKB_FRAGS)) {
 +      stop_queue = !rtl_tx_slots_avail(tp, MAX_SKB_FRAGS);
 +      if (unlikely(stop_queue)) {
                /* Avoid wrongly optimistic queue wake-up: rtl_tx thread must
                 * not miss a ring update when it notices a stopped queue.
                 */
                smp_wmb();
                netif_stop_queue(dev);
 +              door_bell = true;
 +      }
 +
 +      if (door_bell)
 +              rtl8169_doorbell(tp);
 +
 +      if (unlikely(stop_queue)) {
                /* Sync with rtl_tx:
                 * - publish queue status and cur_tx ring index (write barrier)
                 * - refresh dirty_tx ring index (read barrier).
@@@ -5979,39 -5788,6 +5978,39 @@@ err_stop_0
        return NETDEV_TX_BUSY;
  }
  
 +static netdev_features_t rtl8169_features_check(struct sk_buff *skb,
 +                                              struct net_device *dev,
 +                                              netdev_features_t features)
 +{
 +      int transport_offset = skb_transport_offset(skb);
 +      struct rtl8169_private *tp = netdev_priv(dev);
 +
 +      if (skb_is_gso(skb)) {
 +              if (transport_offset > GTTCPHO_MAX &&
 +                  rtl_chip_supports_csum_v2(tp))
 +                      features &= ~NETIF_F_ALL_TSO;
 +      } else if (skb->ip_summed == CHECKSUM_PARTIAL) {
 +              if (skb->len < ETH_ZLEN) {
 +                      switch (tp->mac_version) {
 +                      case RTL_GIGA_MAC_VER_11:
 +                      case RTL_GIGA_MAC_VER_12:
 +                      case RTL_GIGA_MAC_VER_17:
 +                      case RTL_GIGA_MAC_VER_34:
 +                              features &= ~NETIF_F_CSUM_MASK;
 +                              break;
 +                      default:
 +                              break;
 +                      }
 +              }
 +
 +              if (transport_offset > TCPHO_MAX &&
 +                  rtl_chip_supports_csum_v2(tp))
 +                      features &= ~NETIF_F_CSUM_MASK;
 +      }
 +
 +      return vlan_features_check(skb, features);
 +}
 +
  static void rtl8169_pcierr_interrupt(struct net_device *dev)
  {
        struct rtl8169_private *tp = netdev_priv(dev);
@@@ -6073,7 -5849,7 +6072,7 @@@ static void rtl_tx(struct net_device *d
  
                rtl8169_unmap_tx_skb(tp_to_dev(tp), tx_skb,
                                     tp->TxDescArray + entry);
 -              if (status & LastFrag) {
 +              if (tx_skb->skb) {
                        pkts_compl++;
                        bytes_compl += tx_skb->skb->len;
                        napi_consume_skb(tx_skb->skb, budget);
                 * it is slow enough). -- FR
                 */
                if (tp->cur_tx != dirty_tx)
 -                      RTL_W8(tp, TxPoll, NPQ);
 +                      rtl8169_doorbell(tp);
        }
  }
  
@@@ -6131,6 -5907,23 +6130,6 @@@ static inline void rtl8169_rx_csum(stru
                skb_checksum_none_assert(skb);
  }
  
 -static struct sk_buff *rtl8169_try_rx_copy(void *data,
 -                                         struct rtl8169_private *tp,
 -                                         int pkt_size,
 -                                         dma_addr_t addr)
 -{
 -      struct sk_buff *skb;
 -      struct device *d = tp_to_dev(tp);
 -
 -      dma_sync_single_for_cpu(d, addr, pkt_size, DMA_FROM_DEVICE);
 -      prefetch(data);
 -      skb = napi_alloc_skb(&tp->napi, pkt_size);
 -      if (skb)
 -              skb_copy_to_linear_data(skb, data, pkt_size);
 -
 -      return skb;
 -}
 -
  static int rtl_rx(struct net_device *dev, struct rtl8169_private *tp, u32 budget)
  {
        unsigned int cur_rx, rx_left;
  
        for (rx_left = min(budget, NUM_RX_DESC); rx_left > 0; rx_left--, cur_rx++) {
                unsigned int entry = cur_rx % NUM_RX_DESC;
 +              const void *rx_buf = page_address(tp->Rx_databuff[entry]);
                struct RxDesc *desc = tp->RxDescArray + entry;
                u32 status;
  
                                goto process_pkt;
                        }
                } else {
 +                      unsigned int pkt_size;
                        struct sk_buff *skb;
 -                      dma_addr_t addr;
 -                      int pkt_size;
  
  process_pkt:
 -                      addr = le64_to_cpu(desc->addr);
 +                      pkt_size = status & GENMASK(13, 0);
                        if (likely(!(dev->features & NETIF_F_RXFCS)))
 -                              pkt_size = (status & 0x00003fff) - 4;
 -                      else
 -                              pkt_size = status & 0x00003fff;
 -
 +                              pkt_size -= ETH_FCS_LEN;
                        /*
                         * The driver does not support incoming fragmented
                         * frames. They are seen as a symptom of over-mtu
                                goto release_descriptor;
                        }
  
 -                      skb = rtl8169_try_rx_copy(tp->Rx_databuff[entry],
 -                                                tp, pkt_size, addr);
 -                      if (!skb) {
 +                      skb = napi_alloc_skb(&tp->napi, pkt_size);
 +                      if (unlikely(!skb)) {
                                dev->stats.rx_dropped++;
                                goto release_descriptor;
                        }
  
 +                      dma_sync_single_for_cpu(tp_to_dev(tp),
 +                                              le64_to_cpu(desc->addr),
 +                                              pkt_size, DMA_FROM_DEVICE);
 +                      prefetch(rx_buf);
 +                      skb_copy_to_linear_data(skb, rx_buf, pkt_size);
 +                      skb->tail += pkt_size;
 +                      skb->len = pkt_size;
 +
 +                      dma_sync_single_for_device(tp_to_dev(tp),
 +                                                 le64_to_cpu(desc->addr),
 +                                                 pkt_size, DMA_FROM_DEVICE);
 +
                        rtl8169_rx_csum(skb, status);
 -                      skb_put(skb, pkt_size);
                        skb->protocol = eth_type_trans(skb, dev);
  
                        rtl8169_rx_vlan_tag(desc, skb);
@@@ -6232,10 -6018,9 +6231,10 @@@ release_descriptor
  static irqreturn_t rtl8169_interrupt(int irq, void *dev_instance)
  {
        struct rtl8169_private *tp = dev_instance;
 -      u16 status = RTL_R16(tp, IntrStatus);
 +      u32 status = rtl_get_events(tp);
  
 -      if (!tp->irq_enabled || status == 0xffff || !(status & tp->irq_mask))
 +      if (!tp->irq_enabled || (status & 0xffff) == 0xffff ||
 +          !(status & tp->irq_mask))
                return IRQ_NONE;
  
        if (unlikely(status & SYSErr)) {
@@@ -6350,7 -6135,10 +6349,7 @@@ static int r8169_phy_connect(struct rtl
        if (ret)
                return ret;
  
 -      if (tp->supports_gmii)
 -              phy_remove_link_mode(phydev,
 -                                   ETHTOOL_LINK_MODE_1000baseT_Half_BIT);
 -      else
 +      if (!tp->supports_gmii)
                phy_set_max_speed(phydev, SPEED_100);
  
        phy_support_asym_pause(phydev);
@@@ -6545,7 -6333,7 +6544,7 @@@ rtl8169_get_stats64(struct net_device *
        stats->multicast        = dev->stats.multicast;
  
        /*
 -       * Fetch additonal counter values missing in stats collected by driver
 +       * Fetch additional counter values missing in stats collected by driver
         * from tally counters.
         */
        if (pm_runtime_active(&pdev->dev))
@@@ -6769,7 -6557,6 +6768,7 @@@ static const struct net_device_ops rtl_
        .ndo_stop               = rtl8169_close,
        .ndo_get_stats64        = rtl8169_get_stats64,
        .ndo_start_xmit         = rtl8169_start_xmit,
 +      .ndo_features_check     = rtl8169_features_check,
        .ndo_tx_timeout         = rtl8169_tx_timeout,
        .ndo_validate_addr      = eth_validate_addr,
        .ndo_change_mtu         = rtl8169_change_mtu,
@@@ -6801,18 -6588,13 +6800,18 @@@ static int rtl_alloc_irq(struct rtl8169
  {
        unsigned int flags;
  
 -      if (tp->mac_version <= RTL_GIGA_MAC_VER_06) {
 +      switch (tp->mac_version) {
 +      case RTL_GIGA_MAC_VER_02 ... RTL_GIGA_MAC_VER_06:
                rtl_unlock_config_regs(tp);
                RTL_W8(tp, Config2, RTL_R8(tp, Config2) & ~MSIEnable);
                rtl_lock_config_regs(tp);
 +              /* fall through */
 +      case RTL_GIGA_MAC_VER_07 ... RTL_GIGA_MAC_VER_24:
                flags = PCI_IRQ_LEGACY;
 -      } else {
 +              break;
 +      default:
                flags = PCI_IRQ_ALL_TYPES;
 +              break;
        }
  
        return pci_alloc_irq_vectors(tp->pci_dev, 1, 1, flags);
@@@ -6833,8 -6615,6 +6832,8 @@@ static void rtl_read_mac_address(struc
                value = rtl_eri_read(tp, 0xe4);
                mac_addr[4] = (value >>  0) & 0xff;
                mac_addr[5] = (value >>  8) & 0xff;
 +      } else if (rtl_is_8125(tp)) {
 +              rtl_read_mac_from_reg(tp, mac_addr, MAC0_BKP);
        }
  }
  
@@@ -6908,6 -6688,8 +6907,6 @@@ static int r8169_mdio_register(struct r
  
  static void rtl_hw_init_8168g(struct rtl8169_private *tp)
  {
 -      u32 data;
 -
        tp->ocp_base = OCP_STD_PHY_BASE;
  
        RTL_W32(tp, MISC, RTL_R32(tp, MISC) | RXDV_GATED_EN);
        msleep(1);
        RTL_W8(tp, MCU, RTL_R8(tp, MCU) & ~NOW_IS_OOB);
  
 -      data = r8168_mac_ocp_read(tp, 0xe8de);
 -      data &= ~(1 << 14);
 -      r8168_mac_ocp_write(tp, 0xe8de, data);
 +      r8168_mac_ocp_modify(tp, 0xe8de, BIT(14), 0);
 +
 +      if (!rtl_udelay_loop_wait_high(tp, &rtl_link_list_ready_cond, 100, 42))
 +              return;
 +
 +      r8168_mac_ocp_modify(tp, 0xe8de, 0, BIT(15));
 +
 +      rtl_udelay_loop_wait_high(tp, &rtl_link_list_ready_cond, 100, 42);
 +}
 +
 +static void rtl_hw_init_8125(struct rtl8169_private *tp)
 +{
 +      tp->ocp_base = OCP_STD_PHY_BASE;
 +
 +      RTL_W32(tp, MISC, RTL_R32(tp, MISC) | RXDV_GATED_EN);
 +
 +      if (!rtl_udelay_loop_wait_high(tp, &rtl_rxtx_empty_cond, 100, 42))
 +              return;
 +
 +      RTL_W8(tp, ChipCmd, RTL_R8(tp, ChipCmd) & ~(CmdTxEnb | CmdRxEnb));
 +      msleep(1);
 +      RTL_W8(tp, MCU, RTL_R8(tp, MCU) & ~NOW_IS_OOB);
 +
 +      r8168_mac_ocp_modify(tp, 0xe8de, BIT(14), 0);
  
        if (!rtl_udelay_loop_wait_high(tp, &rtl_link_list_ready_cond, 100, 42))
                return;
  
 -      data = r8168_mac_ocp_read(tp, 0xe8de);
 -      data |= (1 << 15);
 -      r8168_mac_ocp_write(tp, 0xe8de, data);
 +      r8168_mac_ocp_write(tp, 0xc0aa, 0x07d0);
 +      r8168_mac_ocp_write(tp, 0xc0a6, 0x0150);
 +      r8168_mac_ocp_write(tp, 0xc01e, 0x5555);
  
        rtl_udelay_loop_wait_high(tp, &rtl_link_list_ready_cond, 100, 42);
  }
@@@ -6966,9 -6727,6 +6965,9 @@@ static void rtl_hw_initialize(struct rt
        case RTL_GIGA_MAC_VER_40 ... RTL_GIGA_MAC_VER_48:
                rtl_hw_init_8168g(tp);
                break;
 +      case RTL_GIGA_MAC_VER_60 ... RTL_GIGA_MAC_VER_61:
 +              rtl_hw_init_8125(tp);
 +              break;
        default:
                break;
        }
@@@ -7032,7 -6790,7 +7031,7 @@@ static void rtl_init_mac_address(struc
  {
        struct net_device *dev = tp->dev;
        u8 *mac_addr = dev->dev_addr;
 -      int rc, i;
 +      int rc;
  
        rc = eth_platform_get_mac_address(tp_to_dev(tp), mac_addr);
        if (!rc)
        if (is_valid_ether_addr(mac_addr))
                goto done;
  
 -      for (i = 0; i < ETH_ALEN; i++)
 -              mac_addr[i] = RTL_R8(tp, MAC0 + i);
 +      rtl_read_mac_from_reg(tp, mac_addr, MAC0);
        if (is_valid_ether_addr(mac_addr))
                goto done;
  
@@@ -7154,9 -6913,11 +7153,9 @@@ static int rtl_init_one(struct pci_dev 
  
        netif_napi_add(dev, &tp->napi, rtl8169_poll, NAPI_POLL_WEIGHT);
  
 -      /* don't enable SG, IP_CSUM and TSO by default - it might not work
 -       * properly for all devices */
 -      dev->features |= NETIF_F_RXCSUM |
 -              NETIF_F_HW_VLAN_CTAG_TX | NETIF_F_HW_VLAN_CTAG_RX;
 -
 +      dev->features |= NETIF_F_SG | NETIF_F_IP_CSUM | NETIF_F_TSO |
 +              NETIF_F_RXCSUM | NETIF_F_HW_VLAN_CTAG_TX |
 +              NETIF_F_HW_VLAN_CTAG_RX;
        dev->hw_features = NETIF_F_SG | NETIF_F_IP_CSUM | NETIF_F_TSO |
                NETIF_F_RXCSUM | NETIF_F_HW_VLAN_CTAG_TX |
                NETIF_F_HW_VLAN_CTAG_RX;
                NETIF_F_HIGHDMA;
        dev->priv_flags |= IFF_LIVE_ADDR_CHANGE;
  
 -      tp->cp_cmd |= RxChkSum | RxVlan;
 -
 +      tp->cp_cmd |= RxChkSum;
 +      /* RTL8125 uses register RxConfig for VLAN offloading config */
 +      if (!rtl_is_8125(tp))
 +              tp->cp_cmd |= RxVlan;
        /*
         * Pretend we are using VLANs; This bypasses a nasty bug where
         * Interrupts stop flowing on high load on 8110SCd controllers.
                /* Disallow toggling */
                dev->hw_features &= ~NETIF_F_HW_VLAN_CTAG_RX;
  
 -      if (rtl_chip_supports_csum_v2(tp))
 +      if (rtl_chip_supports_csum_v2(tp)) {
                dev->hw_features |= NETIF_F_IPV6_CSUM | NETIF_F_TSO6;
 +              dev->features |= NETIF_F_IPV6_CSUM | NETIF_F_TSO6;
 +              dev->gso_max_size = RTL_GSO_MAX_SIZE_V2;
 +              dev->gso_max_segs = RTL_GSO_MAX_SEGS_V2;
 +      } else {
 +              dev->gso_max_size = RTL_GSO_MAX_SIZE_V1;
 +              dev->gso_max_segs = RTL_GSO_MAX_SEGS_V1;
 +      }
 +
 +      /* RTL8168e-vl has a HW issue with TSO */
 +      if (tp->mac_version == RTL_GIGA_MAC_VER_34) {
 +              dev->vlan_features &= ~(NETIF_F_ALL_TSO | NETIF_F_SG);
 +              dev->hw_features &= ~(NETIF_F_ALL_TSO | NETIF_F_SG);
 +              dev->features &= ~(NETIF_F_ALL_TSO | NETIF_F_SG);
 +      }
  
        dev->hw_features |= NETIF_F_RXALL;
        dev->hw_features |= NETIF_F_RXFCS;
index 5ab87a8dc9070d4d137f4833f097f9d64d9d1f61,4c308e33ee21b2f73b9b39ba7ee7f1637660fef4..f8a1f985a1d85e0dd70a60a2cda12c5975714fe0
   *
   *****************************************************************************/
  #include <linux/pci.h>
- #include <linux/pci-aspm.h>
  #include <linux/interrupt.h>
  #include <linux/debugfs.h>
  #include <linux/sched.h>
  #include <linux/bitops.h>
  #include <linux/gfp.h>
  #include <linux/vmalloc.h>
 -#include <linux/pm_runtime.h>
  #include <linux/module.h>
  #include <linux/wait.h>
  
@@@ -184,8 -184,8 +183,8 @@@ out
  static void iwl_trans_pcie_sw_reset(struct iwl_trans *trans)
  {
        /* Reset entire device - do controller reset (results in SHRD_HW_RST) */
 -      iwl_set_bit(trans, trans->cfg->csr->addr_sw_reset,
 -                  BIT(trans->cfg->csr->flag_sw_reset));
 +      iwl_set_bit(trans, trans->trans_cfg->csr->addr_sw_reset,
 +                  BIT(trans->trans_cfg->csr->flag_sw_reset));
        usleep_range(5000, 6000);
  }
  
@@@ -215,7 -215,8 +214,7 @@@ static void iwl_pcie_alloc_fw_monitor_b
        for (power = max_power; power >= min_power; power--) {
                size = BIT(power);
                cpu_addr = dma_alloc_coherent(trans->dev, size, &phys,
 -                                            GFP_KERNEL | __GFP_NOWARN |
 -                                            __GFP_ZERO | __GFP_COMP);
 +                                            GFP_KERNEL | __GFP_NOWARN);
                if (!cpu_addr)
                        continue;
  
@@@ -341,7 -342,7 +340,7 @@@ static int iwl_pcie_apm_init(struct iwl
         */
  
        /* Disable L0S exit timer (platform NMI Work/Around) */
 -      if (trans->cfg->device_family < IWL_DEVICE_FAMILY_8000)
 +      if (trans->trans_cfg->device_family < IWL_DEVICE_FAMILY_8000)
                iwl_set_bit(trans, CSR_GIO_CHICKEN_BITS,
                            CSR_GIO_CHICKEN_BITS_REG_BIT_DIS_L0S_EXIT_TIMER);
  
        iwl_pcie_apm_config(trans);
  
        /* Configure analog phase-lock-loop before activating to D0A */
 -      if (trans->cfg->base_params->pll_cfg)
 +      if (trans->trans_cfg->base_params->pll_cfg)
                iwl_set_bit(trans, CSR_ANA_PLL_CFG, CSR50_ANA_PLL_CFG_VAL);
  
 -      ret = iwl_finish_nic_init(trans);
 +      ret = iwl_finish_nic_init(trans, trans->trans_cfg);
        if (ret)
                return ret;
  
@@@ -440,7 -441,7 +439,7 @@@ static void iwl_pcie_apm_lp_xtal_enable
  
        iwl_trans_pcie_sw_reset(trans);
  
 -      ret = iwl_finish_nic_init(trans);
 +      ret = iwl_finish_nic_init(trans, trans->trans_cfg);
        if (WARN_ON(ret)) {
                /* Release XTAL ON request */
                __iwl_trans_pcie_clear_bit(trans, CSR_GP_CNTRL,
         * D0A* (powered-up Active) --> D0U* (Uninitialized) state.
         */
        iwl_clear_bit(trans, CSR_GP_CNTRL,
 -                    BIT(trans->cfg->csr->flag_init_done));
 +                    BIT(trans->trans_cfg->csr->flag_init_done));
  
        /* Activates XTAL resources monitor */
        __iwl_trans_pcie_set_bit(trans, CSR_MONITOR_CFG_REG,
@@@ -512,12 -513,12 +511,12 @@@ void iwl_pcie_apm_stop_master(struct iw
        int ret;
  
        /* stop device's busmaster DMA activity */
 -      iwl_set_bit(trans, trans->cfg->csr->addr_sw_reset,
 -                  BIT(trans->cfg->csr->flag_stop_master));
 +      iwl_set_bit(trans, trans->trans_cfg->csr->addr_sw_reset,
 +                  BIT(trans->trans_cfg->csr->flag_stop_master));
  
 -      ret = iwl_poll_bit(trans, trans->cfg->csr->addr_sw_reset,
 -                         BIT(trans->cfg->csr->flag_master_dis),
 -                         BIT(trans->cfg->csr->flag_master_dis), 100);
 +      ret = iwl_poll_bit(trans, trans->trans_cfg->csr->addr_sw_reset,
 +                         BIT(trans->trans_cfg->csr->flag_master_dis),
 +                         BIT(trans->trans_cfg->csr->flag_master_dis), 100);
        if (ret < 0)
                IWL_WARN(trans, "Master Disable Timed Out, 100 usec\n");
  
@@@ -533,11 -534,10 +532,11 @@@ static void iwl_pcie_apm_stop(struct iw
                        iwl_pcie_apm_init(trans);
  
                /* inform ME that we are leaving */
 -              if (trans->cfg->device_family == IWL_DEVICE_FAMILY_7000)
 +              if (trans->trans_cfg->device_family == IWL_DEVICE_FAMILY_7000)
                        iwl_set_bits_prph(trans, APMG_PCIDEV_STT_REG,
                                          APMG_PCIDEV_STT_VAL_WAKE_ME);
 -              else if (trans->cfg->device_family >= IWL_DEVICE_FAMILY_8000) {
 +              else if (trans->trans_cfg->device_family >=
 +                       IWL_DEVICE_FAMILY_8000) {
                        iwl_set_bit(trans, CSR_DBG_LINK_PWR_MGMT_REG,
                                    CSR_RESET_LINK_PWR_MGMT_DISABLED);
                        iwl_set_bit(trans, CSR_HW_IF_CONFIG_REG,
         * D0A* (powered-up Active) --> D0U* (Uninitialized) state.
         */
        iwl_clear_bit(trans, CSR_GP_CNTRL,
 -                    BIT(trans->cfg->csr->flag_init_done));
 +                    BIT(trans->trans_cfg->csr->flag_init_done));
  }
  
  static int iwl_pcie_nic_init(struct iwl_trans *trans)
        if (iwl_pcie_tx_init(trans))
                return -ENOMEM;
  
 -      if (trans->cfg->base_params->shadow_reg_enable) {
 +      if (trans->trans_cfg->base_params->shadow_reg_enable) {
                /* enable shadow regs in HW */
                iwl_set_bit(trans, CSR_MAC_SHADOW_REG_CTRL, 0x800FFFFF);
                IWL_DEBUG_INFO(trans, "Enabling shadow registers in device\n");
@@@ -832,7 -832,7 +831,7 @@@ static int iwl_pcie_load_cpu_sections_8
  
        iwl_enable_interrupts(trans);
  
 -      if (trans->cfg->use_tfh) {
 +      if (trans->trans_cfg->use_tfh) {
                if (cpu == 1)
                        iwl_write_prph(trans, UREG_UCODE_LOAD_STATUS,
                                       0xFFFF);
@@@ -897,12 -897,12 +896,12 @@@ void iwl_pcie_apply_destination(struct 
        const struct iwl_fw_dbg_dest_tlv_v1 *dest = trans->dbg.dest_tlv;
        int i;
  
 -      if (trans->dbg.ini_valid) {
 +      if (iwl_trans_dbg_ini_valid(trans)) {
                if (!trans->dbg.num_blocks)
                        return;
  
                IWL_DEBUG_FW(trans,
 -                           "WRT: applying DRAM buffer[0] destination\n");
 +                           "WRT: Applying DRAM buffer[0] destination\n");
                iwl_write_umac_prph(trans, MON_BUFF_BASE_ADDR_VER2,
                                    trans->dbg.fw_mon[0].physical >>
                                    MON_BUFF_SHIFT_VER2);
@@@ -964,7 -964,7 +963,7 @@@ monitor
                iwl_write_prph(trans, le32_to_cpu(dest->base_reg),
                               trans->dbg.fw_mon[0].physical >>
                               dest->base_shift);
 -              if (trans->cfg->device_family >= IWL_DEVICE_FAMILY_8000)
 +              if (trans->trans_cfg->device_family >= IWL_DEVICE_FAMILY_8000)
                        iwl_write_prph(trans, le32_to_cpu(dest->end_reg),
                                       (trans->dbg.fw_mon[0].physical +
                                        trans->dbg.fw_mon[0].size - 256) >>
@@@ -1006,7 -1006,7 +1005,7 @@@ static int iwl_pcie_load_given_ucode(st
  
        /* supported for 7000 only for the moment */
        if (iwlwifi_mod_params.fw_monitor &&
 -          trans->cfg->device_family == IWL_DEVICE_FAMILY_7000) {
 +          trans->trans_cfg->device_family == IWL_DEVICE_FAMILY_7000) {
                iwl_pcie_alloc_fw_monitor(trans, 0);
  
                if (trans->dbg.fw_mon[0].size) {
@@@ -1135,7 -1135,7 +1134,7 @@@ static void iwl_pcie_map_non_rx_causes(
        struct iwl_trans_pcie *trans_pcie =  IWL_TRANS_GET_PCIE_TRANS(trans);
        int val = trans_pcie->def_irq | MSIX_NON_AUTO_CLEAR_CAUSE;
        int i, arr_size =
 -              (trans->cfg->device_family != IWL_DEVICE_FAMILY_22560) ?
 +              (trans->trans_cfg->device_family != IWL_DEVICE_FAMILY_22560) ?
                ARRAY_SIZE(causes_list) : ARRAY_SIZE(causes_list_v2);
  
        /*
         */
        for (i = 0; i < arr_size; i++) {
                struct iwl_causes_list *causes =
 -                      (trans->cfg->device_family != IWL_DEVICE_FAMILY_22560) ?
 +                      (trans->trans_cfg->device_family !=
 +                       IWL_DEVICE_FAMILY_22560) ?
                        causes_list : causes_list_v2;
  
                iwl_write8(trans, CSR_MSIX_IVAR(causes[i].addr), val);
@@@ -1190,7 -1189,7 +1189,7 @@@ void iwl_pcie_conf_msix_hw(struct iwl_t
        struct iwl_trans *trans = trans_pcie->trans;
  
        if (!trans_pcie->msix_enabled) {
 -              if (trans->cfg->mq_rx_supported &&
 +              if (trans->trans_cfg->mq_rx_supported &&
                    test_bit(STATUS_DEVICE_ENABLED, &trans->status))
                        iwl_write_umac_prph(trans, UREG_CHICK,
                                            UREG_CHICK_MSI_ENABLE);
@@@ -1231,7 -1230,7 +1230,7 @@@ static void iwl_pcie_init_msix(struct i
        trans_pcie->hw_mask = trans_pcie->hw_init_mask;
  }
  
 -static void _iwl_trans_pcie_stop_device(struct iwl_trans *trans, bool low_power)
 +static void _iwl_trans_pcie_stop_device(struct iwl_trans *trans)
  {
        struct iwl_trans_pcie *trans_pcie = IWL_TRANS_GET_PCIE_TRANS(trans);
  
  
        trans_pcie->is_down = true;
  
 -      /* Stop dbgc before stopping device */
 -      iwl_fw_dbg_stop_recording(trans, NULL);
 -
        /* tell the device to stop sending interrupts */
        iwl_disable_interrupts(trans);
  
  
        /* Make sure (redundant) we've released our request to stay awake */
        iwl_clear_bit(trans, CSR_GP_CNTRL,
 -                    BIT(trans->cfg->csr->flag_mac_access_req));
 +                    BIT(trans->trans_cfg->csr->flag_mac_access_req));
  
        /* Stop the device, and put it in low power state */
        iwl_pcie_apm_stop(trans, false);
@@@ -1398,7 -1400,7 +1397,7 @@@ static int iwl_trans_pcie_start_fw(stru
        iwl_write32(trans, CSR_UCODE_DRV_GP1_CLR, CSR_UCODE_SW_BIT_RFKILL);
  
        /* Load the given image to the HW */
 -      if (trans->cfg->device_family >= IWL_DEVICE_FAMILY_8000)
 +      if (trans->trans_cfg->device_family >= IWL_DEVICE_FAMILY_8000)
                ret = iwl_pcie_load_given_ucode_8000(trans, fw);
        else
                ret = iwl_pcie_load_given_ucode(trans, fw);
@@@ -1448,7 -1450,7 +1447,7 @@@ void iwl_trans_pcie_handle_stop_rfkill(
                iwl_trans_pcie_rf_kill(trans, hw_rfkill);
  }
  
 -static void iwl_trans_pcie_stop_device(struct iwl_trans *trans, bool low_power)
 +static void iwl_trans_pcie_stop_device(struct iwl_trans *trans)
  {
        struct iwl_trans_pcie *trans_pcie = IWL_TRANS_GET_PCIE_TRANS(trans);
        bool was_in_rfkill;
        mutex_lock(&trans_pcie->mutex);
        trans_pcie->opmode_down = true;
        was_in_rfkill = test_bit(STATUS_RFKILL_OPMODE, &trans->status);
 -      _iwl_trans_pcie_stop_device(trans, low_power);
 +      _iwl_trans_pcie_stop_device(trans);
        iwl_trans_pcie_handle_stop_rfkill(trans, was_in_rfkill);
        mutex_unlock(&trans_pcie->mutex);
  }
@@@ -1471,16 -1473,22 +1470,16 @@@ void iwl_trans_pcie_rf_kill(struct iwl_
        IWL_WARN(trans, "reporting RF_KILL (radio %s)\n",
                 state ? "disabled" : "enabled");
        if (iwl_op_mode_hw_rf_kill(trans->op_mode, state)) {
 -              if (trans->cfg->gen2)
 -                      _iwl_trans_pcie_gen2_stop_device(trans, true);
 +              if (trans->trans_cfg->gen2)
 +                      _iwl_trans_pcie_gen2_stop_device(trans);
                else
 -                      _iwl_trans_pcie_stop_device(trans, true);
 +                      _iwl_trans_pcie_stop_device(trans);
        }
  }
  
 -static void iwl_trans_pcie_d3_suspend(struct iwl_trans *trans, bool test,
 -                                    bool reset)
 +void iwl_pcie_d3_complete_suspend(struct iwl_trans *trans,
 +                                bool test, bool reset)
  {
 -      if (!reset) {
 -              /* Enable persistence mode to avoid reset */
 -              iwl_set_bit(trans, CSR_HW_IF_CONFIG_REG,
 -                          CSR_HW_IF_CONFIG_REG_PERSIST_MODE);
 -      }
 -
        iwl_disable_interrupts(trans);
  
        /*
        iwl_pcie_synchronize_irqs(trans);
  
        iwl_clear_bit(trans, CSR_GP_CNTRL,
 -                    BIT(trans->cfg->csr->flag_mac_access_req));
 +                    BIT(trans->trans_cfg->csr->flag_mac_access_req));
        iwl_clear_bit(trans, CSR_GP_CNTRL,
 -                    BIT(trans->cfg->csr->flag_init_done));
 +                    BIT(trans->trans_cfg->csr->flag_init_done));
  
        if (reset) {
                /*
        iwl_pcie_set_pwr(trans, true);
  }
  
 +static int iwl_trans_pcie_d3_suspend(struct iwl_trans *trans, bool test,
 +                                   bool reset)
 +{
 +      int ret;
 +      struct iwl_trans_pcie *trans_pcie =  IWL_TRANS_GET_PCIE_TRANS(trans);
 +
 +      /*
 +       * Family IWL_DEVICE_FAMILY_AX210 and above persist mode is set by FW.
 +       */
 +      if (!reset && trans->trans_cfg->device_family < IWL_DEVICE_FAMILY_AX210) {
 +              /* Enable persistence mode to avoid reset */
 +              iwl_set_bit(trans, CSR_HW_IF_CONFIG_REG,
 +                          CSR_HW_IF_CONFIG_REG_PERSIST_MODE);
 +      }
 +
 +      if (trans->trans_cfg->device_family >= IWL_DEVICE_FAMILY_AX210) {
 +              iwl_write_umac_prph(trans, UREG_DOORBELL_TO_ISR6,
 +                                  UREG_DOORBELL_TO_ISR6_SUSPEND);
 +
 +              ret = wait_event_timeout(trans_pcie->sx_waitq,
 +                                       trans_pcie->sx_complete, 2 * HZ);
 +              /*
 +               * Invalidate it toward resume.
 +               */
 +              trans_pcie->sx_complete = false;
 +
 +              if (!ret) {
 +                      IWL_ERR(trans, "Timeout entering D3\n");
 +                      return -ETIMEDOUT;
 +              }
 +      }
 +      iwl_pcie_d3_complete_suspend(trans, test, reset);
 +
 +      return 0;
 +}
 +
  static int iwl_trans_pcie_d3_resume(struct iwl_trans *trans,
                                    enum iwl_d3_status *status,
                                    bool test,  bool reset)
        if (test) {
                iwl_enable_interrupts(trans);
                *status = IWL_D3_STATUS_ALIVE;
 -              return 0;
 +              goto out;
        }
  
        iwl_set_bit(trans, CSR_GP_CNTRL,
 -                  BIT(trans->cfg->csr->flag_mac_access_req));
 +                  BIT(trans->trans_cfg->csr->flag_mac_access_req));
  
 -      ret = iwl_finish_nic_init(trans);
 +      ret = iwl_finish_nic_init(trans, trans->trans_cfg);
        if (ret)
                return ret;
  
  
        if (!reset) {
                iwl_clear_bit(trans, CSR_GP_CNTRL,
 -                            BIT(trans->cfg->csr->flag_mac_access_req));
 +                            BIT(trans->trans_cfg->csr->flag_mac_access_req));
        } else {
                iwl_trans_pcie_tx_reset(trans);
  
        else
                *status = IWL_D3_STATUS_ALIVE;
  
 +out:
 +      if (*status == IWL_D3_STATUS_ALIVE &&
 +          trans->trans_cfg->device_family >= IWL_DEVICE_FAMILY_AX210) {
 +              trans_pcie->sx_complete = false;
 +              iwl_write_umac_prph(trans, UREG_DOORBELL_TO_ISR6,
 +                                  UREG_DOORBELL_TO_ISR6_RESUME);
 +
 +              ret = wait_event_timeout(trans_pcie->sx_waitq,
 +                                       trans_pcie->sx_complete, 2 * HZ);
 +              /*
 +               * Invalidate it toward next suspend.
 +               */
 +              trans_pcie->sx_complete = false;
 +
 +              if (!ret) {
 +                      IWL_ERR(trans, "Timeout exiting D3\n");
 +                      return -ETIMEDOUT;
 +              }
 +      }
        return 0;
  }
  
 -static void iwl_pcie_set_interrupt_capa(struct pci_dev *pdev,
 -                                      struct iwl_trans *trans)
 +static void
 +iwl_pcie_set_interrupt_capa(struct pci_dev *pdev,
 +                          struct iwl_trans *trans,
 +                          const struct iwl_cfg_trans_params *cfg_trans)
  {
        struct iwl_trans_pcie *trans_pcie = IWL_TRANS_GET_PCIE_TRANS(trans);
        int max_irqs, num_irqs, i, ret;
        u16 pci_cmd;
  
 -      if (!trans->cfg->mq_rx_supported)
 +      if (!cfg_trans->mq_rx_supported)
                goto enable_msi;
  
        max_irqs = min_t(u32, num_online_cpus() + 2, IWL_MAX_RX_HW_QUEUES);
@@@ -1757,7 -1708,7 +1756,7 @@@ static int iwl_trans_pcie_clear_persist
  {
        u32 hpm, wprot;
  
 -      switch (trans->cfg->device_family) {
 +      switch (trans->trans_cfg->device_family) {
        case IWL_DEVICE_FAMILY_9000:
                wprot = PREG_PRPH_WPROT_9000;
                break;
        return 0;
  }
  
 -static int _iwl_trans_pcie_start_hw(struct iwl_trans *trans, bool low_power)
 +static int _iwl_trans_pcie_start_hw(struct iwl_trans *trans)
  {
        struct iwl_trans_pcie *trans_pcie = IWL_TRANS_GET_PCIE_TRANS(trans);
        int err;
        /* ...rfkill can call stop_device and set it false if needed */
        iwl_pcie_check_hw_rf_kill(trans);
  
 -      /* Make sure we sync here, because we'll need full access later */
 -      if (low_power)
 -              pm_runtime_resume(trans->dev);
 -
        return 0;
  }
  
 -static int iwl_trans_pcie_start_hw(struct iwl_trans *trans, bool low_power)
 +static int iwl_trans_pcie_start_hw(struct iwl_trans *trans)
  {
        struct iwl_trans_pcie *trans_pcie = IWL_TRANS_GET_PCIE_TRANS(trans);
        int ret;
  
        mutex_lock(&trans_pcie->mutex);
 -      ret = _iwl_trans_pcie_start_hw(trans, low_power);
 +      ret = _iwl_trans_pcie_start_hw(trans);
        mutex_unlock(&trans_pcie->mutex);
  
        return ret;
@@@ -1872,7 -1827,7 +1871,7 @@@ static u32 iwl_trans_pcie_read32(struc
  
  static u32 iwl_trans_pcie_prph_msk(struct iwl_trans *trans)
  {
 -      if (trans->cfg->device_family >= IWL_DEVICE_FAMILY_22560)
 +      if (trans->trans_cfg->device_family >= IWL_DEVICE_FAMILY_22560)
                return 0x00FFFFFF;
        else
                return 0x000FFFFF;
@@@ -1943,7 -1898,7 +1942,7 @@@ void iwl_trans_pcie_free(struct iwl_tra
  
        iwl_pcie_synchronize_irqs(trans);
  
 -      if (trans->cfg->gen2)
 +      if (trans->trans_cfg->gen2)
                iwl_pcie_gen2_tx_free(trans);
        else
                iwl_pcie_tx_free(trans);
@@@ -2025,8 -1980,8 +2024,8 @@@ static bool iwl_trans_pcie_grab_nic_acc
  
        /* this bit wakes up the NIC */
        __iwl_trans_pcie_set_bit(trans, CSR_GP_CNTRL,
 -                               BIT(trans->cfg->csr->flag_mac_access_req));
 -      if (trans->cfg->device_family >= IWL_DEVICE_FAMILY_8000)
 +                               BIT(trans->trans_cfg->csr->flag_mac_access_req));
 +      if (trans->trans_cfg->device_family >= IWL_DEVICE_FAMILY_8000)
                udelay(2);
  
        /*
         * and do not save/restore SRAM when power cycling.
         */
        ret = iwl_poll_bit(trans, CSR_GP_CNTRL,
 -                         BIT(trans->cfg->csr->flag_val_mac_access_en),
 -                         (BIT(trans->cfg->csr->flag_mac_clock_ready) |
 +                         BIT(trans->trans_cfg->csr->flag_val_mac_access_en),
 +                         (BIT(trans->trans_cfg->csr->flag_mac_clock_ready) |
                            CSR_GP_CNTRL_REG_FLAG_GOING_TO_SLEEP), 15000);
        if (unlikely(ret < 0)) {
                u32 cntrl = iwl_read32(trans, CSR_GP_CNTRL);
@@@ -2133,7 -2088,7 +2132,7 @@@ static void iwl_trans_pcie_release_nic_
                goto out;
  
        __iwl_trans_pcie_clear_bit(trans, CSR_GP_CNTRL,
 -                                 BIT(trans->cfg->csr->flag_mac_access_req));
 +                                 BIT(trans->trans_cfg->csr->flag_mac_access_req));
        /*
         * Above we read the CSR_GP_CNTRL register, which will flush
         * any previous writes, but we need the write that clears the
@@@ -2240,7 -2195,7 +2239,7 @@@ static void iwl_trans_pcie_block_txq_pt
        struct iwl_trans_pcie *trans_pcie = IWL_TRANS_GET_PCIE_TRANS(trans);
        int i;
  
 -      for (i = 0; i < trans->cfg->base_params->num_of_queues; i++) {
 +      for (i = 0; i < trans->trans_cfg->base_params->num_of_queues; i++) {
                struct iwl_txq *txq = trans_pcie->txq[i];
  
                if (i == trans_pcie->cmd_queue)
@@@ -2271,7 -2226,7 +2270,7 @@@ void iwl_trans_pcie_log_scd_error(struc
        bool active;
        u8 fifo;
  
 -      if (trans->cfg->use_tfh) {
 +      if (trans->trans_cfg->use_tfh) {
                IWL_ERR(trans, "Queue %d is stuck %d %d\n", txq_id,
                        txq->read_ptr, txq->write_ptr);
                /* TODO: access new SCD registers and dump them */
                jiffies_to_msecs(txq->wd_timeout),
                txq->read_ptr, txq->write_ptr,
                iwl_read_prph(trans, SCD_QUEUE_RDPTR(txq_id)) &
 -                      (trans->cfg->base_params->max_tfd_queue_size - 1),
 -              iwl_read_prph(trans, SCD_QUEUE_WRPTR(txq_id)) &
 -                      (trans->cfg->base_params->max_tfd_queue_size - 1),
 -              iwl_read_direct32(trans, FH_TX_TRB_REG(fifo)));
 +                      (trans->trans_cfg->base_params->max_tfd_queue_size - 1),
 +                      iwl_read_prph(trans, SCD_QUEUE_WRPTR(txq_id)) &
 +                      (trans->trans_cfg->base_params->max_tfd_queue_size - 1),
 +                      iwl_read_direct32(trans, FH_TX_TRB_REG(fifo)));
  }
  
  static int iwl_trans_pcie_rxq_dma_data(struct iwl_trans *trans, int queue,
@@@ -2379,9 -2334,7 +2378,9 @@@ static int iwl_trans_pcie_wait_txqs_emp
        int ret = 0;
  
        /* waiting for all the tx frames complete might take a while */
 -      for (cnt = 0; cnt < trans->cfg->base_params->num_of_queues; cnt++) {
 +      for (cnt = 0;
 +           cnt < trans->trans_cfg->base_params->num_of_queues;
 +           cnt++) {
  
                if (cnt == trans_pcie->cmd_queue)
                        continue;
@@@ -2409,6 -2362,37 +2408,6 @@@ static void iwl_trans_pcie_set_bits_mas
        spin_unlock_irqrestore(&trans_pcie->reg_lock, flags);
  }
  
 -static void iwl_trans_pcie_ref(struct iwl_trans *trans)
 -{
 -      struct iwl_trans_pcie *trans_pcie = IWL_TRANS_GET_PCIE_TRANS(trans);
 -
 -      if (iwlwifi_mod_params.d0i3_disable)
 -              return;
 -
 -      pm_runtime_get(&trans_pcie->pci_dev->dev);
 -
 -#ifdef CONFIG_PM
 -      IWL_DEBUG_RPM(trans, "runtime usage count: %d\n",
 -                    atomic_read(&trans_pcie->pci_dev->dev.power.usage_count));
 -#endif /* CONFIG_PM */
 -}
 -
 -static void iwl_trans_pcie_unref(struct iwl_trans *trans)
 -{
 -      struct iwl_trans_pcie *trans_pcie = IWL_TRANS_GET_PCIE_TRANS(trans);
 -
 -      if (iwlwifi_mod_params.d0i3_disable)
 -              return;
 -
 -      pm_runtime_mark_last_busy(&trans_pcie->pci_dev->dev);
 -      pm_runtime_put_autosuspend(&trans_pcie->pci_dev->dev);
 -
 -#ifdef CONFIG_PM
 -      IWL_DEBUG_RPM(trans, "runtime usage count: %d\n",
 -                    atomic_read(&trans_pcie->pci_dev->dev.power.usage_count));
 -#endif /* CONFIG_PM */
 -}
 -
  static const char *get_csr_string(int cmd)
  {
  #define IWL_CMD(x) case x: return #x
@@@ -2525,8 -2509,7 +2524,8 @@@ static ssize_t iwl_dbgfs_tx_queue_read(
        int ret;
        size_t bufsz;
  
 -      bufsz = sizeof(char) * 75 * trans->cfg->base_params->num_of_queues;
 +      bufsz = sizeof(char) * 75 *
 +              trans->trans_cfg->base_params->num_of_queues;
  
        if (!trans_pcie->txq_memory)
                return -EAGAIN;
        if (!buf)
                return -ENOMEM;
  
 -      for (cnt = 0; cnt < trans->cfg->base_params->num_of_queues; cnt++) {
 +      for (cnt = 0;
 +           cnt < trans->trans_cfg->base_params->num_of_queues;
 +           cnt++) {
                txq = trans_pcie->txq[cnt];
                pos += scnprintf(buf + pos, bufsz - pos,
                                "hwq %.2d: read=%u write=%u use=%d stop=%d need_update=%d frozen=%d%s\n",
@@@ -3007,7 -2988,7 +3006,7 @@@ static u32 iwl_trans_pcie_fh_regs_dump(
        (*data)->len = cpu_to_le32(fh_regs_len);
        val = (void *)(*data)->data;
  
 -      if (!trans->cfg->gen2)
 +      if (!trans->trans_cfg->gen2)
                for (i = FH_MEM_LOWER_BOUND; i < FH_MEM_UPPER_BOUND;
                     i += sizeof(u32))
                        *val++ = cpu_to_le32(iwl_trans_pcie_read32(trans, i));
@@@ -3055,7 -3036,7 +3054,7 @@@ iwl_trans_pcie_dump_pointers(struct iwl
  {
        u32 base, base_high, write_ptr, write_ptr_val, wrap_cnt;
  
 -      if (trans->cfg->device_family >= IWL_DEVICE_FAMILY_AX210) {
 +      if (trans->trans_cfg->device_family >= IWL_DEVICE_FAMILY_AX210) {
                base = DBGC_CUR_DBGBUF_BASE_ADDR_LSB;
                base_high = DBGC_CUR_DBGBUF_BASE_ADDR_MSB;
                write_ptr = DBGC_CUR_DBGBUF_STATUS;
                cpu_to_le32(iwl_read_prph(trans, wrap_cnt));
        fw_mon_data->fw_mon_base_ptr =
                cpu_to_le32(iwl_read_prph(trans, base));
 -      if (trans->cfg->device_family >= IWL_DEVICE_FAMILY_AX210) {
 +      if (trans->trans_cfg->device_family >= IWL_DEVICE_FAMILY_AX210) {
                fw_mon_data->fw_mon_base_high_ptr =
                        cpu_to_le32(iwl_read_prph(trans, base_high));
                write_ptr_val &= DBGC_CUR_DBGBUF_STATUS_OFFSET_MSK;
@@@ -3092,8 -3073,8 +3091,8 @@@ iwl_trans_pcie_dump_monitor(struct iwl_
  
        if (trans->dbg.dest_tlv ||
            (trans->dbg.num_blocks &&
 -           (trans->cfg->device_family == IWL_DEVICE_FAMILY_7000 ||
 -            trans->cfg->device_family >= IWL_DEVICE_FAMILY_AX210))) {
 +           (trans->trans_cfg->device_family == IWL_DEVICE_FAMILY_7000 ||
 +            trans->trans_cfg->device_family >= IWL_DEVICE_FAMILY_AX210))) {
                struct iwl_fw_error_dump_fw_mon *fw_mon_data;
  
                (*data)->type = cpu_to_le32(IWL_FW_ERROR_DUMP_FW_MONITOR);
@@@ -3176,7 -3157,7 +3175,7 @@@ static int iwl_trans_get_fw_monitor_len
                              trans->dbg.dest_tlv->end_shift;
  
                        /* Make "end" point to the actual end */
 -                      if (trans->cfg->device_family >=
 +                      if (trans->trans_cfg->device_family >=
                            IWL_DEVICE_FAMILY_8000 ||
                            trans->dbg.dest_tlv->monitor_mode == MARBH_MODE)
                                end += (1 << trans->dbg.dest_tlv->end_shift);
@@@ -3202,7 -3183,7 +3201,7 @@@ static struct iwl_trans_dump_dat
        u32 len, num_rbs = 0, monitor_len = 0;
        int i, ptr;
        bool dump_rbs = test_bit(STATUS_FW_ERROR, &trans->status) &&
 -                      !trans->cfg->mq_rx_supported &&
 +                      !trans->trans_cfg->mq_rx_supported &&
                        dump_mask & BIT(IWL_FW_ERROR_DUMP_RB);
  
        if (!dump_mask)
  
        /* FH registers */
        if (dump_mask & BIT(IWL_FW_ERROR_DUMP_FH_REGS)) {
 -              if (trans->cfg->gen2)
 +              if (trans->trans_cfg->gen2)
                        len += sizeof(*data) +
                               (iwl_umac_prph(trans, FH_MEM_UPPER_BOUND_GEN2) -
                                iwl_umac_prph(trans, FH_MEM_LOWER_BOUND_GEN2));
        }
  
        /* Paged memory for gen2 HW */
 -      if (trans->cfg->gen2 && dump_mask & BIT(IWL_FW_ERROR_DUMP_PAGING))
 +      if (trans->trans_cfg->gen2 && dump_mask & BIT(IWL_FW_ERROR_DUMP_PAGING))
                for (i = 0; i < trans->init_dram.paging_cnt; i++)
                        len += sizeof(*data) +
                               sizeof(struct iwl_fw_error_dump_paging) +
                len += iwl_trans_pcie_dump_rbs(trans, &data, num_rbs);
  
        /* Paged memory for gen2 HW */
 -      if (trans->cfg->gen2 && dump_mask & BIT(IWL_FW_ERROR_DUMP_PAGING)) {
 +      if (trans->trans_cfg->gen2 &&
 +          dump_mask & BIT(IWL_FW_ERROR_DUMP_PAGING)) {
                for (i = 0; i < trans->init_dram.paging_cnt; i++) {
                        struct iwl_fw_error_dump_paging *paging;
                        u32 page_len = trans->init_dram.paging[i].size;
  #ifdef CONFIG_PM_SLEEP
  static int iwl_trans_pcie_suspend(struct iwl_trans *trans)
  {
 -      if (trans->runtime_pm_mode == IWL_PLAT_PM_MODE_D0I3 &&
 -          (trans->system_pm_mode == IWL_PLAT_PM_MODE_D0I3))
 -              return iwl_pci_fw_enter_d0i3(trans);
 -
        return 0;
  }
  
  static void iwl_trans_pcie_resume(struct iwl_trans *trans)
  {
 -      if (trans->runtime_pm_mode == IWL_PLAT_PM_MODE_D0I3 &&
 -          (trans->system_pm_mode == IWL_PLAT_PM_MODE_D0I3))
 -              iwl_pci_fw_exit_d0i3(trans);
  }
  #endif /* CONFIG_PM_SLEEP */
  
        .grab_nic_access = iwl_trans_pcie_grab_nic_access,              \
        .release_nic_access = iwl_trans_pcie_release_nic_access,        \
        .set_bits_mask = iwl_trans_pcie_set_bits_mask,                  \
 -      .ref = iwl_trans_pcie_ref,                                      \
 -      .unref = iwl_trans_pcie_unref,                                  \
        .dump_data = iwl_trans_pcie_dump_data,                          \
        .d3_suspend = iwl_trans_pcie_d3_suspend,                        \
        .d3_resume = iwl_trans_pcie_d3_resume,                          \
@@@ -3410,8 -3399,6 +3409,8 @@@ static const struct iwl_trans_ops trans
        .tx = iwl_trans_pcie_gen2_tx,
        .reclaim = iwl_trans_pcie_reclaim,
  
 +      .set_q_ptrs = iwl_trans_pcie_set_q_ptrs,
 +
        .txq_alloc = iwl_trans_pcie_dyn_txq_alloc,
        .txq_free = iwl_trans_pcie_dyn_txq_free,
        .wait_txq_empty = iwl_trans_pcie_wait_txq_empty,
  };
  
  struct iwl_trans *iwl_trans_pcie_alloc(struct pci_dev *pdev,
 -                                     const struct pci_device_id *ent,
 -                                     const struct iwl_cfg *cfg)
 +                             const struct pci_device_id *ent,
 +                             const struct iwl_cfg_trans_params *cfg_trans)
  {
        struct iwl_trans_pcie *trans_pcie;
        struct iwl_trans *trans;
        if (ret)
                return ERR_PTR(ret);
  
 -      if (cfg->gen2)
 +      if (cfg_trans->gen2)
                trans = iwl_trans_alloc(sizeof(struct iwl_trans_pcie),
 -                                      &pdev->dev, cfg, &trans_ops_pcie_gen2);
 +                                      &pdev->dev, &trans_ops_pcie_gen2);
        else
                trans = iwl_trans_alloc(sizeof(struct iwl_trans_pcie),
 -                                      &pdev->dev, cfg, &trans_ops_pcie);
 +                                      &pdev->dev, &trans_ops_pcie);
 +
        if (!trans)
                return ERR_PTR(-ENOMEM);
  
        }
        trans_pcie->debug_rfkill = -1;
  
 -      if (!cfg->base_params->pcie_l1_allowed) {
 +      if (!cfg_trans->base_params->pcie_l1_allowed) {
                /*
                 * W/A - seems to solve weird behavior. We need to remove this
                 * if we don't want to stay in L1 all the time. This wastes a
  
        trans_pcie->def_rx_queue = 0;
  
 -      if (cfg->use_tfh) {
 +      if (cfg_trans->use_tfh) {
                addr_size = 64;
                trans_pcie->max_tbs = IWL_TFH_NUM_TBS;
                trans_pcie->tfd_size = sizeof(struct iwl_tfh_tfd);
         * "dash" value). To keep hw_rev backwards compatible - we'll store it
         * in the old format.
         */
 -      if (trans->cfg->device_family >= IWL_DEVICE_FAMILY_8000) {
 -              unsigned long flags;
 -
 +      if (cfg_trans->device_family >= IWL_DEVICE_FAMILY_8000) {
                trans->hw_rev = (trans->hw_rev & 0xfff0) |
                                (CSR_HW_REV_STEP(trans->hw_rev << 2) << 2);
  
                 * in-order to recognize C step driver should read chip version
                 * id located at the AUX bus MISC address space.
                 */
 -              ret = iwl_finish_nic_init(trans);
 +              ret = iwl_finish_nic_init(trans, cfg_trans);
                if (ret)
                        goto out_no_pci;
  
 -              if (iwl_trans_grab_nic_access(trans, &flags)) {
 -                      u32 hw_step;
 -
 -                      hw_step = iwl_read_umac_prph_no_grab(trans,
 -                                                           WFPM_CTRL_REG);
 -                      hw_step |= ENABLE_WFPM;
 -                      iwl_write_umac_prph_no_grab(trans, WFPM_CTRL_REG,
 -                                                  hw_step);
 -                      hw_step = iwl_read_prph_no_grab(trans,
 -                                                      CNVI_AUX_MISC_CHIP);
 -                      hw_step = (hw_step >> HW_STEP_LOCATION_BITS) & 0xF;
 -                      if (hw_step == 0x3)
 -                              trans->hw_rev = (trans->hw_rev & 0xFFFFFFF3) |
 -                                              (SILICON_C_STEP << 2);
 -                      iwl_trans_release_nic_access(trans, &flags);
 -              }
        }
  
        IWL_DEBUG_INFO(trans, "HW REV: 0x%0x\n", trans->hw_rev);
  
 -#if IS_ENABLED(CONFIG_IWLMVM)
 -      trans->hw_rf_id = iwl_read32(trans, CSR_HW_RF_ID);
 -
 -      if (cfg == &iwlax210_2ax_cfg_so_hr_a0) {
 -              if (trans->hw_rev == CSR_HW_REV_TYPE_TY) {
 -                      trans->cfg = &iwlax210_2ax_cfg_ty_gf_a0;
 -              } else if (CSR_HW_RF_ID_TYPE_CHIP_ID(trans->hw_rf_id) ==
 -                         CSR_HW_RF_ID_TYPE_CHIP_ID(CSR_HW_RF_ID_TYPE_JF)) {
 -                      trans->cfg = &iwlax210_2ax_cfg_so_jf_a0;
 -              } else if (CSR_HW_RF_ID_TYPE_CHIP_ID(trans->hw_rf_id) ==
 -                         CSR_HW_RF_ID_TYPE_CHIP_ID(CSR_HW_RF_ID_TYPE_GF)) {
 -                      trans->cfg = &iwlax211_2ax_cfg_so_gf_a0;
 -              } else if (CSR_HW_RF_ID_TYPE_CHIP_ID(trans->hw_rf_id) ==
 -                         CSR_HW_RF_ID_TYPE_CHIP_ID(CSR_HW_RF_ID_TYPE_GF4)) {
 -                      trans->cfg = &iwlax411_2ax_cfg_so_gf4_a0;
 -              }
 -      } else if (cfg == &iwl_ax101_cfg_qu_hr) {
 -              if ((CSR_HW_RF_ID_TYPE_CHIP_ID(trans->hw_rf_id) ==
 -                   CSR_HW_RF_ID_TYPE_CHIP_ID(CSR_HW_RF_ID_TYPE_HR) &&
 -                   trans->hw_rev == CSR_HW_REV_TYPE_QNJ_B0) ||
 -                  (CSR_HW_RF_ID_TYPE_CHIP_ID(trans->hw_rf_id) ==
 -                   CSR_HW_RF_ID_TYPE_CHIP_ID(CSR_HW_RF_ID_TYPE_HR1))) {
 -                      trans->cfg = &iwl22000_2ax_cfg_qnj_hr_b0;
 -              } else if (CSR_HW_RF_ID_TYPE_CHIP_ID(trans->hw_rf_id) ==
 -                  CSR_HW_RF_ID_TYPE_CHIP_ID(CSR_HW_RF_ID_TYPE_HR)) {
 -                      trans->cfg = &iwl_ax101_cfg_qu_hr;
 -              } else if (CSR_HW_RF_ID_TYPE_CHIP_ID(trans->hw_rf_id) ==
 -                         CSR_HW_RF_ID_TYPE_CHIP_ID(CSR_HW_RF_ID_TYPE_JF)) {
 -                      trans->cfg = &iwl22000_2ax_cfg_jf;
 -              } else if (CSR_HW_RF_ID_TYPE_CHIP_ID(trans->hw_rf_id) ==
 -                         CSR_HW_RF_ID_TYPE_CHIP_ID(CSR_HW_RF_ID_TYPE_HRCDB)) {
 -                      IWL_ERR(trans, "RF ID HRCDB is not supported\n");
 -                      ret = -EINVAL;
 -                      goto out_no_pci;
 -              } else {
 -                      IWL_ERR(trans, "Unrecognized RF ID 0x%08x\n",
 -                              CSR_HW_RF_ID_TYPE_CHIP_ID(trans->hw_rf_id));
 -                      ret = -EINVAL;
 -                      goto out_no_pci;
 -              }
 -      } else if (CSR_HW_RF_ID_TYPE_CHIP_ID(trans->hw_rf_id) ==
 -                 CSR_HW_RF_ID_TYPE_CHIP_ID(CSR_HW_RF_ID_TYPE_HR) &&
 -                 ((trans->cfg != &iwl_ax200_cfg_cc &&
 -                   trans->cfg != &killer1650x_2ax_cfg &&
 -                   trans->cfg != &killer1650w_2ax_cfg &&
 -                   trans->cfg != &iwl_ax201_cfg_quz_hr) ||
 -                  trans->hw_rev == CSR_HW_REV_TYPE_QNJ_B0)) {
 -              u32 hw_status;
 -
 -              hw_status = iwl_read_prph(trans, UMAG_GEN_HW_STATUS);
 -              if (CSR_HW_RF_STEP(trans->hw_rf_id) == SILICON_B_STEP)
 -                      /*
 -                      * b step fw is the same for physical card and fpga
 -                      */
 -                      trans->cfg = &iwl22000_2ax_cfg_qnj_hr_b0;
 -              else if ((hw_status & UMAG_GEN_HW_IS_FPGA) &&
 -                       CSR_HW_RF_STEP(trans->hw_rf_id) == SILICON_A_STEP) {
 -                      trans->cfg = &iwl22000_2ax_cfg_qnj_hr_a0_f0;
 -              } else {
 -                      /*
 -                      * a step no FPGA
 -                      */
 -                      trans->cfg = &iwl22000_2ac_cfg_hr;
 -              }
 -      }
 -#endif
 -
 -      iwl_pcie_set_interrupt_capa(pdev, trans);
 +      iwl_pcie_set_interrupt_capa(pdev, trans, cfg_trans);
        trans->hw_id = (pdev->device << 16) + pdev->subsystem_device;
        snprintf(trans->hw_id_str, sizeof(trans->hw_id_str),
                 "PCI ID: 0x%04X:0x%04X", pdev->device, pdev->subsystem_device);
        /* Initialize the wait queue for commands */
        init_waitqueue_head(&trans_pcie->wait_command_queue);
  
 -      init_waitqueue_head(&trans_pcie->d0i3_waitq);
 +      init_waitqueue_head(&trans_pcie->sx_waitq);
  
        if (trans_pcie->msix_enabled) {
                ret = iwl_pcie_init_msix_handler(pdev, trans_pcie);
                                                   WQ_HIGHPRI | WQ_UNBOUND, 1);
        INIT_WORK(&trans_pcie->rba.rx_alloc, iwl_pcie_rx_allocator_work);
  
 -#ifdef CONFIG_IWLWIFI_PCIE_RTPM
 -      trans->runtime_pm_mode = IWL_PLAT_PM_MODE_D0I3;
 -#else
 -      trans->runtime_pm_mode = IWL_PLAT_PM_MODE_DISABLED;
 -#endif /* CONFIG_IWLWIFI_PCIE_RTPM */
 -
  #ifdef CONFIG_IWLWIFI_DEBUGFS
        trans_pcie->fw_mon_data.state = IWL_FW_MON_DBGFS_STATE_CLOSED;
        mutex_init(&trans_pcie->fw_mon_data.mutex);
diff --combined drivers/nvme/host/pci.c
index 6b4d7b064b38a6624d517306ca1f1d7a8cecf6fe,2348b15f6bd0dfccf00ebd7f542f3541eb97cfc8..c0808f9eb8ab694a5fc027d884b71d7f3cd5bd6e
@@@ -28,8 -28,8 +28,8 @@@
  #include "trace.h"
  #include "nvme.h"
  
 -#define SQ_SIZE(depth)                (depth * sizeof(struct nvme_command))
 -#define CQ_SIZE(depth)                (depth * sizeof(struct nvme_completion))
 +#define SQ_SIZE(q)    ((q)->q_depth << (q)->sqes)
 +#define CQ_SIZE(q)    ((q)->q_depth * sizeof(struct nvme_completion))
  
  #define SGES_PER_PAGE (PAGE_SIZE / sizeof(struct nvme_sgl_desc))
  
@@@ -100,7 -100,6 +100,7 @@@ struct nvme_dev 
        unsigned io_queues[HCTX_MAX_TYPES];
        unsigned int num_vecs;
        int q_depth;
 +      int io_sqes;
        u32 db_stride;
        void __iomem *bar;
        unsigned long bar_mapped_size;
@@@ -163,7 -162,7 +163,7 @@@ static inline struct nvme_dev *to_nvme_
  struct nvme_queue {
        struct nvme_dev *dev;
        spinlock_t sq_lock;
 -      struct nvme_command *sq_cmds;
 +      void *sq_cmds;
         /* only used for poll queues: */
        spinlock_t cq_poll_lock ____cacheline_aligned_in_smp;
        volatile struct nvme_completion *cqes;
        u16 last_cq_head;
        u16 qid;
        u8 cq_phase;
 +      u8 sqes;
        unsigned long flags;
  #define NVMEQ_ENABLED         0
  #define NVMEQ_SQ_CMB          1
@@@ -490,8 -488,7 +490,8 @@@ static void nvme_submit_cmd(struct nvme
                            bool write_sq)
  {
        spin_lock(&nvmeq->sq_lock);
 -      memcpy(&nvmeq->sq_cmds[nvmeq->sq_tail], cmd, sizeof(*cmd));
 +      memcpy(nvmeq->sq_cmds + (nvmeq->sq_tail << nvmeq->sqes),
 +             cmd, sizeof(*cmd));
        if (++nvmeq->sq_tail == nvmeq->q_depth)
                nvmeq->sq_tail = 0;
        nvme_write_sq_db(nvmeq, write_sq);
@@@ -537,20 -534,23 +537,22 @@@ static inline bool nvme_pci_use_sgls(st
  static void nvme_unmap_data(struct nvme_dev *dev, struct request *req)
  {
        struct nvme_iod *iod = blk_mq_rq_to_pdu(req);
 -      enum dma_data_direction dma_dir = rq_data_dir(req) ?
 -                      DMA_TO_DEVICE : DMA_FROM_DEVICE;
        const int last_prp = dev->ctrl.page_size / sizeof(__le64) - 1;
        dma_addr_t dma_addr = iod->first_dma, next_dma_addr;
        int i;
  
        if (iod->dma_len) {
 -              dma_unmap_page(dev->dev, dma_addr, iod->dma_len, dma_dir);
 +              dma_unmap_page(dev->dev, dma_addr, iod->dma_len,
 +                             rq_dma_dir(req));
                return;
        }
  
        WARN_ON_ONCE(!iod->nents);
  
-       /* P2PDMA requests do not need to be unmapped */
-       if (!is_pci_p2pdma_page(sg_page(iod->sg)))
+       if (is_pci_p2pdma_page(sg_page(iod->sg)))
+               pci_p2pdma_unmap_sg(dev->dev, iod->sg, iod->nents,
+                                   rq_dma_dir(req));
+       else
                dma_unmap_sg(dev->dev, iod->sg, iod->nents, rq_dma_dir(req));
  
  
@@@ -834,8 -834,8 +836,8 @@@ static blk_status_t nvme_map_data(struc
                goto out;
  
        if (is_pci_p2pdma_page(sg_page(iod->sg)))
-               nr_mapped = pci_p2pdma_map_sg(dev->dev, iod->sg, iod->nents,
-                                             rq_dma_dir(req));
+               nr_mapped = pci_p2pdma_map_sg_attrs(dev->dev, iod->sg,
+                               iod->nents, rq_dma_dir(req), DMA_ATTR_NO_WARN);
        else
                nr_mapped = dma_map_sg_attrs(dev->dev, iod->sg, iod->nents,
                                             rq_dma_dir(req), DMA_ATTR_NO_WARN);
@@@ -1346,16 -1346,16 +1348,16 @@@ static enum blk_eh_timer_return nvme_ti
  
  static void nvme_free_queue(struct nvme_queue *nvmeq)
  {
 -      dma_free_coherent(nvmeq->dev->dev, CQ_SIZE(nvmeq->q_depth),
 +      dma_free_coherent(nvmeq->dev->dev, CQ_SIZE(nvmeq),
                                (void *)nvmeq->cqes, nvmeq->cq_dma_addr);
        if (!nvmeq->sq_cmds)
                return;
  
        if (test_and_clear_bit(NVMEQ_SQ_CMB, &nvmeq->flags)) {
                pci_free_p2pmem(to_pci_dev(nvmeq->dev->dev),
 -                              nvmeq->sq_cmds, SQ_SIZE(nvmeq->q_depth));
 +                              nvmeq->sq_cmds, SQ_SIZE(nvmeq));
        } else {
 -              dma_free_coherent(nvmeq->dev->dev, SQ_SIZE(nvmeq->q_depth),
 +              dma_free_coherent(nvmeq->dev->dev, SQ_SIZE(nvmeq),
                                nvmeq->sq_cmds, nvmeq->sq_dma_addr);
        }
  }
@@@ -1405,7 -1405,7 +1407,7 @@@ static void nvme_disable_admin_queue(st
        if (shutdown)
                nvme_shutdown_ctrl(&dev->ctrl);
        else
 -              nvme_disable_ctrl(&dev->ctrl, dev->ctrl.cap);
 +              nvme_disable_ctrl(&dev->ctrl);
  
        nvme_poll_irqdisable(nvmeq, -1);
  }
@@@ -1435,12 -1435,12 +1437,12 @@@ static int nvme_cmb_qdepth(struct nvme_
  }
  
  static int nvme_alloc_sq_cmds(struct nvme_dev *dev, struct nvme_queue *nvmeq,
 -                              int qid, int depth)
 +                              int qid)
  {
        struct pci_dev *pdev = to_pci_dev(dev->dev);
  
        if (qid && dev->cmb_use_sqes && (dev->cmbsz & NVME_CMBSZ_SQS)) {
 -              nvmeq->sq_cmds = pci_alloc_p2pmem(pdev, SQ_SIZE(depth));
 +              nvmeq->sq_cmds = pci_alloc_p2pmem(pdev, SQ_SIZE(nvmeq));
                if (nvmeq->sq_cmds) {
                        nvmeq->sq_dma_addr = pci_p2pmem_virt_to_bus(pdev,
                                                        nvmeq->sq_cmds);
                                return 0;
                        }
  
 -                      pci_free_p2pmem(pdev, nvmeq->sq_cmds, SQ_SIZE(depth));
 +                      pci_free_p2pmem(pdev, nvmeq->sq_cmds, SQ_SIZE(nvmeq));
                }
        }
  
 -      nvmeq->sq_cmds = dma_alloc_coherent(dev->dev, SQ_SIZE(depth),
 +      nvmeq->sq_cmds = dma_alloc_coherent(dev->dev, SQ_SIZE(nvmeq),
                                &nvmeq->sq_dma_addr, GFP_KERNEL);
        if (!nvmeq->sq_cmds)
                return -ENOMEM;
@@@ -1467,14 -1467,12 +1469,14 @@@ static int nvme_alloc_queue(struct nvme
        if (dev->ctrl.queue_count > qid)
                return 0;
  
 -      nvmeq->cqes = dma_alloc_coherent(dev->dev, CQ_SIZE(depth),
 +      nvmeq->sqes = qid ? dev->io_sqes : NVME_ADM_SQES;
 +      nvmeq->q_depth = depth;
 +      nvmeq->cqes = dma_alloc_coherent(dev->dev, CQ_SIZE(nvmeq),
                                         &nvmeq->cq_dma_addr, GFP_KERNEL);
        if (!nvmeq->cqes)
                goto free_nvmeq;
  
 -      if (nvme_alloc_sq_cmds(dev, nvmeq, qid, depth))
 +      if (nvme_alloc_sq_cmds(dev, nvmeq, qid))
                goto free_cqdma;
  
        nvmeq->dev = dev;
        nvmeq->cq_head = 0;
        nvmeq->cq_phase = 1;
        nvmeq->q_db = &dev->dbs[qid * 2 * dev->db_stride];
 -      nvmeq->q_depth = depth;
        nvmeq->qid = qid;
        dev->ctrl.queue_count++;
  
        return 0;
  
   free_cqdma:
 -      dma_free_coherent(dev->dev, CQ_SIZE(depth), (void *)nvmeq->cqes,
 -                                                      nvmeq->cq_dma_addr);
 +      dma_free_coherent(dev->dev, CQ_SIZE(nvmeq), (void *)nvmeq->cqes,
 +                        nvmeq->cq_dma_addr);
   free_nvmeq:
        return -ENOMEM;
  }
@@@ -1518,7 -1517,7 +1520,7 @@@ static void nvme_init_queue(struct nvme
        nvmeq->cq_head = 0;
        nvmeq->cq_phase = 1;
        nvmeq->q_db = &dev->dbs[qid * 2 * dev->db_stride];
 -      memset((void *)nvmeq->cqes, 0, CQ_SIZE(nvmeq->q_depth));
 +      memset((void *)nvmeq->cqes, 0, CQ_SIZE(nvmeq));
        nvme_dbbuf_init(dev, nvmeq, qid);
        dev->online_queues++;
        wmb(); /* ensure the first interrupt sees the initialization */
@@@ -1555,6 -1554,7 +1557,6 @@@ static int nvme_create_queue(struct nvm
        nvme_init_queue(nvmeq, qid);
  
        if (!polled) {
 -              nvmeq->cq_vector = vector;
                result = queue_request_irq(nvmeq);
                if (result < 0)
                        goto release_sq;
@@@ -1681,7 -1681,7 +1683,7 @@@ static int nvme_pci_configure_admin_que
            (readl(dev->bar + NVME_REG_CSTS) & NVME_CSTS_NSSRO))
                writel(NVME_CSTS_NSSRO, dev->bar + NVME_REG_CSTS);
  
 -      result = nvme_disable_ctrl(&dev->ctrl, dev->ctrl.cap);
 +      result = nvme_disable_ctrl(&dev->ctrl);
        if (result < 0)
                return result;
  
        lo_hi_writeq(nvmeq->sq_dma_addr, dev->bar + NVME_REG_ASQ);
        lo_hi_writeq(nvmeq->cq_dma_addr, dev->bar + NVME_REG_ACQ);
  
 -      result = nvme_enable_ctrl(&dev->ctrl, dev->ctrl.cap);
 +      result = nvme_enable_ctrl(&dev->ctrl);
        if (result)
                return result;
  
@@@ -2079,13 -2079,6 +2081,13 @@@ static int nvme_setup_irqs(struct nvme_
        dev->io_queues[HCTX_TYPE_DEFAULT] = 1;
        dev->io_queues[HCTX_TYPE_READ] = 0;
  
 +      /*
 +       * Some Apple controllers require all queues to use the
 +       * first vector.
 +       */
 +      if (dev->ctrl.quirks & NVME_QUIRK_SINGLE_VECTOR)
 +              irq_queues = 1;
 +
        return pci_alloc_irq_vectors_affinity(pdev, 1, irq_queues,
                              PCI_IRQ_ALL_TYPES | PCI_IRQ_AFFINITY, &affd);
  }
@@@ -2104,14 -2097,6 +2106,14 @@@ static int nvme_setup_io_queues(struct 
        unsigned long size;
  
        nr_io_queues = max_io_queues();
 +
 +      /*
 +       * If tags are shared with admin queue (Apple bug), then
 +       * make sure we only use one IO queue.
 +       */
 +      if (dev->ctrl.quirks & NVME_QUIRK_SHARED_TAGS)
 +              nr_io_queues = 1;
 +
        result = nvme_set_queue_count(&dev->ctrl, &nr_io_queues);
        if (result < 0)
                return result;
@@@ -2271,7 -2256,9 +2273,7 @@@ static int nvme_dev_add(struct nvme_de
        if (!dev->ctrl.tagset) {
                dev->tagset.ops = &nvme_mq_ops;
                dev->tagset.nr_hw_queues = dev->online_queues - 1;
 -              dev->tagset.nr_maps = 1; /* default */
 -              if (dev->io_queues[HCTX_TYPE_READ])
 -                      dev->tagset.nr_maps++;
 +              dev->tagset.nr_maps = 2; /* default + read */
                if (dev->io_queues[HCTX_TYPE_POLL])
                        dev->tagset.nr_maps++;
                dev->tagset.timeout = NVME_IO_TIMEOUT;
                dev->tagset.flags = BLK_MQ_F_SHOULD_MERGE;
                dev->tagset.driver_data = dev;
  
 +              /*
 +               * Some Apple controllers requires tags to be unique
 +               * across admin and IO queue, so reserve the first 32
 +               * tags of the IO queue.
 +               */
 +              if (dev->ctrl.quirks & NVME_QUIRK_SHARED_TAGS)
 +                      dev->tagset.reserved_tags = NVME_AQ_DEPTH;
 +
                ret = blk_mq_alloc_tag_set(&dev->tagset);
                if (ret) {
                        dev_warn(dev->ctrl.device,
@@@ -2339,20 -2318,9 +2341,20 @@@ static int nvme_pci_enable(struct nvme_
  
        dev->q_depth = min_t(int, NVME_CAP_MQES(dev->ctrl.cap) + 1,
                                io_queue_depth);
 +      dev->ctrl.sqsize = dev->q_depth - 1; /* 0's based queue depth */
        dev->db_stride = 1 << NVME_CAP_STRIDE(dev->ctrl.cap);
        dev->dbs = dev->bar + 4096;
  
 +      /*
 +       * Some Apple controllers require a non-standard SQE size.
 +       * Interestingly they also seem to ignore the CC:IOSQES register
 +       * so we don't bother updating it here.
 +       */
 +      if (dev->ctrl.quirks & NVME_QUIRK_128_BYTES_SQES)
 +              dev->io_sqes = 7;
 +      else
 +              dev->io_sqes = NVME_NVM_IOSQES;
 +
        /*
         * Temporary fix for the Apple controller found in the MacBook8,1 and
         * some MacBook7,1 to avoid controller resets and data loss.
                          "set queue depth=%u\n", dev->q_depth);
        }
  
 +      /*
 +       * Controllers with the shared tags quirk need the IO queue to be
 +       * big enough so that we get 32 tags for the admin queue
 +       */
 +      if ((dev->ctrl.quirks & NVME_QUIRK_SHARED_TAGS) &&
 +          (dev->q_depth < (NVME_AQ_DEPTH + 2))) {
 +              dev->q_depth = NVME_AQ_DEPTH + 2;
 +              dev_warn(dev->ctrl.device, "IO queue depth clamped to %d\n",
 +                       dev->q_depth);
 +      }
 +
 +
        nvme_map_cmb(dev);
  
        pci_enable_pcie_error_reporting(pdev);
@@@ -2449,8 -2405,6 +2451,8 @@@ static void nvme_dev_disable(struct nvm
  
        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);
 +      blk_mq_tagset_wait_completed_request(&dev->tagset);
 +      blk_mq_tagset_wait_completed_request(&dev->admin_tagset);
  
        /*
         * The driver will not be starting up queues again if shutting down so
@@@ -2745,7 -2699,7 +2747,7 @@@ static void nvme_async_probe(void *data
  {
        struct nvme_dev *dev = data;
  
 -      nvme_reset_ctrl_sync(&dev->ctrl);
 +      flush_work(&dev->ctrl.reset_work);
        flush_work(&dev->ctrl.scan_work);
        nvme_put_ctrl(&dev->ctrl);
  }
@@@ -2811,7 -2765,6 +2813,7 @@@ static int nvme_probe(struct pci_dev *p
  
        dev_info(dev->ctrl.device, "pci function %s\n", dev_name(&pdev->dev));
  
 +      nvme_reset_ctrl(&dev->ctrl);
        nvme_get_ctrl(&dev->ctrl);
        async_schedule(nvme_async_probe, dev);
  
@@@ -2897,7 -2850,7 +2899,7 @@@ static int nvme_resume(struct device *d
        struct nvme_dev *ndev = pci_get_drvdata(to_pci_dev(dev));
        struct nvme_ctrl *ctrl = &ndev->ctrl;
  
 -      if (pm_resume_via_firmware() || !ctrl->npss ||
 +      if (ndev->last_ps == U32_MAX ||
            nvme_set_power_state(ctrl, ndev->last_ps) != 0)
                nvme_reset_ctrl(ctrl);
        return 0;
@@@ -2910,8 -2863,6 +2912,8 @@@ static int nvme_suspend(struct device *
        struct nvme_ctrl *ctrl = &ndev->ctrl;
        int ret = -EBUSY;
  
 +      ndev->last_ps = U32_MAX;
 +
        /*
         * The platform does not remove power for a kernel managed suspend so
         * use host managed nvme power settings for lowest idle power if
         * shutdown.  But if the firmware is involved after the suspend or the
         * device does not support any non-default power states, shut down the
         * device fully.
 +       *
 +       * If ASPM is not enabled for the device, shut down the device and allow
 +       * the PCI bus layer to put it into D3 in order to take the PCIe link
 +       * down, so as to allow the platform to achieve its minimum low-power
 +       * state (which may not be possible if the link is up).
         */
 -      if (pm_suspend_via_firmware() || !ctrl->npss) {
 +      if (pm_suspend_via_firmware() || !ctrl->npss ||
 +          !pcie_aspm_enabled(pdev) ||
 +          (ndev->ctrl.quirks & NVME_QUIRK_SIMPLE_SUSPEND)) {
                nvme_dev_disable(ndev, true);
                return 0;
        }
            ctrl->state != NVME_CTRL_ADMIN_ONLY)
                goto unfreeze;
  
 -      ndev->last_ps = 0;
        ret = nvme_get_power_state(ctrl, &ndev->last_ps);
        if (ret < 0)
                goto unfreeze;
@@@ -3086,15 -3031,9 +3088,15 @@@ static const struct pci_device_id nvme_
                .driver_data = NVME_QUIRK_LIGHTNVM, },
        { PCI_DEVICE(0x1d1d, 0x2601),   /* CNEX Granby */
                .driver_data = NVME_QUIRK_LIGHTNVM, },
 +      { PCI_DEVICE(0x10ec, 0x5762),   /* ADATA SX6000LNP */
 +              .driver_data = NVME_QUIRK_IGNORE_DEV_SUBNQN, },
        { PCI_DEVICE_CLASS(PCI_CLASS_STORAGE_EXPRESS, 0xffffff) },
        { PCI_DEVICE(PCI_VENDOR_ID_APPLE, 0x2001) },
        { PCI_DEVICE(PCI_VENDOR_ID_APPLE, 0x2003) },
 +      { PCI_DEVICE(PCI_VENDOR_ID_APPLE, 0x2005),
 +              .driver_data = NVME_QUIRK_SINGLE_VECTOR |
 +                              NVME_QUIRK_128_BYTES_SQES |
 +                              NVME_QUIRK_SHARED_TAGS },
        { 0, }
  };
  MODULE_DEVICE_TABLE(pci, nvme_id_table);
diff --combined drivers/pci/Kconfig
index c313de96a3573071c199b9b86640e1f838105e7c,a5017b66bd9d51c8e62317595efbe348ae1740d3..a304f5ea11b90b2cffe1b2eec9cc605dc14b1d34
@@@ -52,7 -52,7 +52,7 @@@ config PCI_MS
           If you don't know what to do here, say Y.
  
  config PCI_MSI_IRQ_DOMAIN
-       def_bool ARC || ARM || ARM64 || X86
+       def_bool ARC || ARM || ARM64 || X86 || RISCV
        depends on PCI_MSI
        select GENERIC_MSI_IRQ_DOMAIN
  
@@@ -170,7 -170,7 +170,7 @@@ config PCI_P2PDM
  
          Many PCIe root complexes do not support P2P transactions and
          it's hard to tell which support it at all, so at this time,
-         P2P DMA transations must be between devices behind the same root
+         P2P DMA transactions must be between devices behind the same root
          port.
  
          If unsure, say N.
@@@ -181,8 -181,7 +181,8 @@@ config PCI_LABE
  
  config PCI_HYPERV
          tristate "Hyper-V PCI Frontend"
-         depends on X86 && HYPERV && PCI_MSI && PCI_MSI_IRQ_DOMAIN && X86_64
+         depends on X86_64 && HYPERV && PCI_MSI && PCI_MSI_IRQ_DOMAIN && SYSFS
 +      select PCI_HYPERV_INTERFACE
          help
            The PCI device frontend driver allows the kernel to import arbitrary
            PCI devices from a PCI backend to support PCI driver domains.
index 0ca73c851e0fb767eb1e3984a0d82c4fc8421453,3a56de6b2ec2ca20e348cd083fad8574c6a5a4b9..f1f300218fab8659629ba466b044ceeb06c96bce
@@@ -365,39 -365,6 +365,39 @@@ struct pci_delete_interrupt 
        struct tran_int_desc int_desc;
  } __packed;
  
 +/*
 + * Note: the VM must pass a valid block id, wslot and bytes_requested.
 + */
 +struct pci_read_block {
 +      struct pci_message message_type;
 +      u32 block_id;
 +      union win_slot_encoding wslot;
 +      u32 bytes_requested;
 +} __packed;
 +
 +struct pci_read_block_response {
 +      struct vmpacket_descriptor hdr;
 +      u32 status;
 +      u8 bytes[HV_CONFIG_BLOCK_SIZE_MAX];
 +} __packed;
 +
 +/*
 + * Note: the VM must pass a valid block id, wslot and byte_count.
 + */
 +struct pci_write_block {
 +      struct pci_message message_type;
 +      u32 block_id;
 +      union win_slot_encoding wslot;
 +      u32 byte_count;
 +      u8 bytes[HV_CONFIG_BLOCK_SIZE_MAX];
 +} __packed;
 +
 +struct pci_dev_inval_block {
 +      struct pci_incoming_message incoming;
 +      union win_slot_encoding wslot;
 +      u64 block_mask;
 +} __packed;
 +
  struct pci_dev_incoming {
        struct pci_incoming_message incoming;
        union win_slot_encoding wslot;
@@@ -532,9 -499,6 +532,9 @@@ struct hv_pci_dev 
        struct hv_pcibus_device *hbus;
        struct work_struct wrk;
  
 +      void (*block_invalidate)(void *context, u64 block_mask);
 +      void *invalidate_context;
 +
        /*
         * What would be observed if one wrote 0xFFFFFFFF to a BAR and then
         * read it back, for each of the BAR offsets within config space.
@@@ -853,253 -817,6 +853,253 @@@ static struct pci_ops hv_pcifront_ops 
        .write = hv_pcifront_write_config,
  };
  
 +/*
 + * Paravirtual backchannel
 + *
 + * Hyper-V SR-IOV provides a backchannel mechanism in software for
 + * communication between a VF driver and a PF driver.  These
 + * "configuration blocks" are similar in concept to PCI configuration space,
 + * but instead of doing reads and writes in 32-bit chunks through a very slow
 + * path, packets of up to 128 bytes can be sent or received asynchronously.
 + *
 + * Nearly every SR-IOV device contains just such a communications channel in
 + * hardware, so using this one in software is usually optional.  Using the
 + * software channel, however, allows driver implementers to leverage software
 + * tools that fuzz the communications channel looking for vulnerabilities.
 + *
 + * The usage model for these packets puts the responsibility for reading or
 + * writing on the VF driver.  The VF driver sends a read or a write packet,
 + * indicating which "block" is being referred to by number.
 + *
 + * If the PF driver wishes to initiate communication, it can "invalidate" one or
 + * more of the first 64 blocks.  This invalidation is delivered via a callback
 + * supplied by the VF driver by this driver.
 + *
 + * No protocol is implied, except that supplied by the PF and VF drivers.
 + */
 +
 +struct hv_read_config_compl {
 +      struct hv_pci_compl comp_pkt;
 +      void *buf;
 +      unsigned int len;
 +      unsigned int bytes_returned;
 +};
 +
 +/**
 + * hv_pci_read_config_compl() - Invoked when a response packet
 + * for a read config block operation arrives.
 + * @context:          Identifies the read config operation
 + * @resp:             The response packet itself
 + * @resp_packet_size: Size in bytes of the response packet
 + */
 +static void hv_pci_read_config_compl(void *context, struct pci_response *resp,
 +                                   int resp_packet_size)
 +{
 +      struct hv_read_config_compl *comp = context;
 +      struct pci_read_block_response *read_resp =
 +              (struct pci_read_block_response *)resp;
 +      unsigned int data_len, hdr_len;
 +
 +      hdr_len = offsetof(struct pci_read_block_response, bytes);
 +      if (resp_packet_size < hdr_len) {
 +              comp->comp_pkt.completion_status = -1;
 +              goto out;
 +      }
 +
 +      data_len = resp_packet_size - hdr_len;
 +      if (data_len > 0 && read_resp->status == 0) {
 +              comp->bytes_returned = min(comp->len, data_len);
 +              memcpy(comp->buf, read_resp->bytes, comp->bytes_returned);
 +      } else {
 +              comp->bytes_returned = 0;
 +      }
 +
 +      comp->comp_pkt.completion_status = read_resp->status;
 +out:
 +      complete(&comp->comp_pkt.host_event);
 +}
 +
 +/**
 + * hv_read_config_block() - Sends a read config block request to
 + * the back-end driver running in the Hyper-V parent partition.
 + * @pdev:             The PCI driver's representation for this device.
 + * @buf:              Buffer into which the config block will be copied.
 + * @len:              Size in bytes of buf.
 + * @block_id:         Identifies the config block which has been requested.
 + * @bytes_returned:   Size which came back from the back-end driver.
 + *
 + * Return: 0 on success, -errno on failure
 + */
 +int hv_read_config_block(struct pci_dev *pdev, void *buf, unsigned int len,
 +                       unsigned int block_id, unsigned int *bytes_returned)
 +{
 +      struct hv_pcibus_device *hbus =
 +              container_of(pdev->bus->sysdata, struct hv_pcibus_device,
 +                           sysdata);
 +      struct {
 +              struct pci_packet pkt;
 +              char buf[sizeof(struct pci_read_block)];
 +      } pkt;
 +      struct hv_read_config_compl comp_pkt;
 +      struct pci_read_block *read_blk;
 +      int ret;
 +
 +      if (len == 0 || len > HV_CONFIG_BLOCK_SIZE_MAX)
 +              return -EINVAL;
 +
 +      init_completion(&comp_pkt.comp_pkt.host_event);
 +      comp_pkt.buf = buf;
 +      comp_pkt.len = len;
 +
 +      memset(&pkt, 0, sizeof(pkt));
 +      pkt.pkt.completion_func = hv_pci_read_config_compl;
 +      pkt.pkt.compl_ctxt = &comp_pkt;
 +      read_blk = (struct pci_read_block *)&pkt.pkt.message;
 +      read_blk->message_type.type = PCI_READ_BLOCK;
 +      read_blk->wslot.slot = devfn_to_wslot(pdev->devfn);
 +      read_blk->block_id = block_id;
 +      read_blk->bytes_requested = len;
 +
 +      ret = vmbus_sendpacket(hbus->hdev->channel, read_blk,
 +                             sizeof(*read_blk), (unsigned long)&pkt.pkt,
 +                             VM_PKT_DATA_INBAND,
 +                             VMBUS_DATA_PACKET_FLAG_COMPLETION_REQUESTED);
 +      if (ret)
 +              return ret;
 +
 +      ret = wait_for_response(hbus->hdev, &comp_pkt.comp_pkt.host_event);
 +      if (ret)
 +              return ret;
 +
 +      if (comp_pkt.comp_pkt.completion_status != 0 ||
 +          comp_pkt.bytes_returned == 0) {
 +              dev_err(&hbus->hdev->device,
 +                      "Read Config Block failed: 0x%x, bytes_returned=%d\n",
 +                      comp_pkt.comp_pkt.completion_status,
 +                      comp_pkt.bytes_returned);
 +              return -EIO;
 +      }
 +
 +      *bytes_returned = comp_pkt.bytes_returned;
 +      return 0;
 +}
 +
 +/**
 + * hv_pci_write_config_compl() - Invoked when a response packet for a write
 + * config block operation arrives.
 + * @context:          Identifies the write config operation
 + * @resp:             The response packet itself
 + * @resp_packet_size: Size in bytes of the response packet
 + */
 +static void hv_pci_write_config_compl(void *context, struct pci_response *resp,
 +                                    int resp_packet_size)
 +{
 +      struct hv_pci_compl *comp_pkt = context;
 +
 +      comp_pkt->completion_status = resp->status;
 +      complete(&comp_pkt->host_event);
 +}
 +
 +/**
 + * hv_write_config_block() - Sends a write config block request to the
 + * back-end driver running in the Hyper-V parent partition.
 + * @pdev:             The PCI driver's representation for this device.
 + * @buf:              Buffer from which the config block will be copied.
 + * @len:              Size in bytes of buf.
 + * @block_id:         Identifies the config block which is being written.
 + *
 + * Return: 0 on success, -errno on failure
 + */
 +int hv_write_config_block(struct pci_dev *pdev, void *buf, unsigned int len,
 +                        unsigned int block_id)
 +{
 +      struct hv_pcibus_device *hbus =
 +              container_of(pdev->bus->sysdata, struct hv_pcibus_device,
 +                           sysdata);
 +      struct {
 +              struct pci_packet pkt;
 +              char buf[sizeof(struct pci_write_block)];
 +              u32 reserved;
 +      } pkt;
 +      struct hv_pci_compl comp_pkt;
 +      struct pci_write_block *write_blk;
 +      u32 pkt_size;
 +      int ret;
 +
 +      if (len == 0 || len > HV_CONFIG_BLOCK_SIZE_MAX)
 +              return -EINVAL;
 +
 +      init_completion(&comp_pkt.host_event);
 +
 +      memset(&pkt, 0, sizeof(pkt));
 +      pkt.pkt.completion_func = hv_pci_write_config_compl;
 +      pkt.pkt.compl_ctxt = &comp_pkt;
 +      write_blk = (struct pci_write_block *)&pkt.pkt.message;
 +      write_blk->message_type.type = PCI_WRITE_BLOCK;
 +      write_blk->wslot.slot = devfn_to_wslot(pdev->devfn);
 +      write_blk->block_id = block_id;
 +      write_blk->byte_count = len;
 +      memcpy(write_blk->bytes, buf, len);
 +      pkt_size = offsetof(struct pci_write_block, bytes) + len;
 +      /*
 +       * This quirk is required on some hosts shipped around 2018, because
 +       * these hosts don't check the pkt_size correctly (new hosts have been
 +       * fixed since early 2019). The quirk is also safe on very old hosts
 +       * and new hosts, because, on them, what really matters is the length
 +       * specified in write_blk->byte_count.
 +       */
 +      pkt_size += sizeof(pkt.reserved);
 +
 +      ret = vmbus_sendpacket(hbus->hdev->channel, write_blk, pkt_size,
 +                             (unsigned long)&pkt.pkt, VM_PKT_DATA_INBAND,
 +                             VMBUS_DATA_PACKET_FLAG_COMPLETION_REQUESTED);
 +      if (ret)
 +              return ret;
 +
 +      ret = wait_for_response(hbus->hdev, &comp_pkt.host_event);
 +      if (ret)
 +              return ret;
 +
 +      if (comp_pkt.completion_status != 0) {
 +              dev_err(&hbus->hdev->device,
 +                      "Write Config Block failed: 0x%x\n",
 +                      comp_pkt.completion_status);
 +              return -EIO;
 +      }
 +
 +      return 0;
 +}
 +
 +/**
 + * hv_register_block_invalidate() - Invoked when a config block invalidation
 + * arrives from the back-end driver.
 + * @pdev:             The PCI driver's representation for this device.
 + * @context:          Identifies the device.
 + * @block_invalidate: Identifies all of the blocks being invalidated.
 + *
 + * Return: 0 on success, -errno on failure
 + */
 +int hv_register_block_invalidate(struct pci_dev *pdev, void *context,
 +                               void (*block_invalidate)(void *context,
 +                                                        u64 block_mask))
 +{
 +      struct hv_pcibus_device *hbus =
 +              container_of(pdev->bus->sysdata, struct hv_pcibus_device,
 +                           sysdata);
 +      struct hv_pci_dev *hpdev;
 +
 +      hpdev = get_pcichild_wslot(hbus, devfn_to_wslot(pdev->devfn));
 +      if (!hpdev)
 +              return -ENODEV;
 +
 +      hpdev->block_invalidate = block_invalidate;
 +      hpdev->invalidate_context = context;
 +
 +      put_pcichild(hpdev);
 +      return 0;
 +
 +}
 +
  /* Interrupt management hooks */
  static void hv_int_desc_free(struct hv_pci_dev *hpdev,
                             struct tran_int_desc *int_desc)
@@@ -2251,7 -1968,6 +2251,7 @@@ static void hv_pci_onchannelcallback(vo
        struct pci_response *response;
        struct pci_incoming_message *new_message;
        struct pci_bus_relations *bus_rel;
 +      struct pci_dev_inval_block *inval;
        struct pci_dev_incoming *dev_message;
        struct hv_pci_dev *hpdev;
  
                                }
                                break;
  
 +                      case PCI_INVALIDATE_BLOCK:
 +
 +                              inval = (struct pci_dev_inval_block *)buffer;
 +                              hpdev = get_pcichild_wslot(hbus,
 +                                                         inval->wslot.slot);
 +                              if (hpdev) {
 +                                      if (hpdev->block_invalidate) {
 +                                              hpdev->block_invalidate(
 +                                                  hpdev->invalidate_context,
 +                                                  inval->block_mask);
 +                                      }
 +                                      put_pcichild(hpdev);
 +                              }
 +                              break;
 +
                        default:
                                dev_warn(&hbus->hdev->device,
                                        "Unimplemented protocol message %x\n",
@@@ -2809,6 -2510,48 +2809,48 @@@ static void put_hvpcibus(struct hv_pcib
                complete(&hbus->remove_event);
  }
  
+ #define HVPCI_DOM_MAP_SIZE (64 * 1024)
+ static DECLARE_BITMAP(hvpci_dom_map, HVPCI_DOM_MAP_SIZE);
+ /*
+  * PCI domain number 0 is used by emulated devices on Gen1 VMs, so define 0
+  * as invalid for passthrough PCI devices of this driver.
+  */
+ #define HVPCI_DOM_INVALID 0
+ /**
+  * hv_get_dom_num() - Get a valid PCI domain number
+  * Check if the PCI domain number is in use, and return another number if
+  * it is in use.
+  *
+  * @dom: Requested domain number
+  *
+  * return: domain number on success, HVPCI_DOM_INVALID on failure
+  */
+ static u16 hv_get_dom_num(u16 dom)
+ {
+       unsigned int i;
+       if (test_and_set_bit(dom, hvpci_dom_map) == 0)
+               return dom;
+       for_each_clear_bit(i, hvpci_dom_map, HVPCI_DOM_MAP_SIZE) {
+               if (test_and_set_bit(i, hvpci_dom_map) == 0)
+                       return i;
+       }
+       return HVPCI_DOM_INVALID;
+ }
+ /**
+  * hv_put_dom_num() - Mark the PCI domain number as free
+  * @dom: Domain number to be freed
+  */
+ static void hv_put_dom_num(u16 dom)
+ {
+       clear_bit(dom, hvpci_dom_map);
+ }
  /**
   * hv_pci_probe() - New VMBus channel probe, for a root PCI bus
   * @hdev:     VMBus's tracking struct for this root PCI bus
@@@ -2820,7 -2563,7 +2862,8 @@@ static int hv_pci_probe(struct hv_devic
                        const struct hv_vmbus_device_id *dev_id)
  {
        struct hv_pcibus_device *hbus;
+       u16 dom_req, dom;
 +      char *name;
        int ret;
  
        /*
        hbus->state = hv_pcibus_init;
  
        /*
-        * The PCI bus "domain" is what is called "segment" in ACPI and
-        * other specs.  Pull it from the instance ID, to get something
-        * unique.  Bytes 8 and 9 are what is used in Windows guests, so
-        * do the same thing for consistency.  Note that, since this code
-        * only runs in a Hyper-V VM, Hyper-V can (and does) guarantee
-        * that (1) the only domain in use for something that looks like
-        * a physical PCI bus (which is actually emulated by the
-        * hypervisor) is domain 0 and (2) there will be no overlap
-        * between domains derived from these instance IDs in the same
-        * VM.
+        * The PCI bus "domain" is what is called "segment" in ACPI and other
+        * specs. Pull it from the instance ID, to get something usually
+        * unique. In rare cases of collision, we will find out another number
+        * not in use.
+        *
+        * Note that, since this code only runs in a Hyper-V VM, Hyper-V
+        * together with this guest driver can guarantee that (1) The only
+        * domain used by Gen1 VMs for something that looks like a physical
+        * PCI bus (which is actually emulated by the hypervisor) is domain 0.
+        * (2) There will be no overlap between domains (after fixing possible
+        * collisions) in the same VM.
         */
-       hbus->sysdata.domain = hdev->dev_instance.b[9] |
-                              hdev->dev_instance.b[8] << 8;
+       dom_req = hdev->dev_instance.b[5] << 8 | hdev->dev_instance.b[4];
+       dom = hv_get_dom_num(dom_req);
+       if (dom == HVPCI_DOM_INVALID) {
+               dev_err(&hdev->device,
+                       "Unable to use dom# 0x%hx or other numbers", dom_req);
+               ret = -EINVAL;
+               goto free_bus;
+       }
+       if (dom != dom_req)
+               dev_info(&hdev->device,
+                        "PCI dom# 0x%hx has collision, using 0x%hx",
+                        dom_req, dom);
+       hbus->sysdata.domain = dom;
  
        hbus->hdev = hdev;
        refcount_set(&hbus->remove_lock, 1);
                                           hbus->sysdata.domain);
        if (!hbus->wq) {
                ret = -ENOMEM;
-               goto free_bus;
+               goto free_dom;
        }
  
        ret = vmbus_open(hdev->channel, pci_ring_size, pci_ring_size, NULL, 0,
                goto free_config;
        }
  
 -      hbus->sysdata.fwnode = irq_domain_alloc_fwnode(hbus);
 +      name = kasprintf(GFP_KERNEL, "%pUL", &hdev->dev_instance);
 +      if (!name) {
 +              ret = -ENOMEM;
 +              goto unmap;
 +      }
 +
 +      hbus->sysdata.fwnode = irq_domain_alloc_named_fwnode(name);
 +      kfree(name);
        if (!hbus->sysdata.fwnode) {
                ret = -ENOMEM;
                goto unmap;
@@@ -2946,6 -2697,8 +3004,8 @@@ close
        vmbus_close(hdev->channel);
  destroy_wq:
        destroy_workqueue(hbus->wq);
+ free_dom:
+       hv_put_dom_num(hbus->sysdata.domain);
  free_bus:
        free_page((unsigned long)hbus);
        return ret;
@@@ -3008,8 -2761,8 +3068,8 @@@ static int hv_pci_remove(struct hv_devi
                /* Remove the bus from PCI's point of view. */
                pci_lock_rescan_remove();
                pci_stop_root_bus(hbus->pci_bus);
-               pci_remove_root_bus(hbus->pci_bus);
                hv_pci_remove_slots(hbus);
+               pci_remove_root_bus(hbus->pci_bus);
                pci_unlock_rescan_remove();
                hbus->state = hv_pcibus_removed;
        }
        put_hvpcibus(hbus);
        wait_for_completion(&hbus->remove_event);
        destroy_workqueue(hbus->wq);
+       hv_put_dom_num(hbus->sysdata.domain);
        free_page((unsigned long)hbus);
        return 0;
  }
@@@ -3050,19 -2806,13 +3113,22 @@@ static struct hv_driver hv_pci_drv = 
  static void __exit exit_hv_pci_drv(void)
  {
        vmbus_driver_unregister(&hv_pci_drv);
 +
 +      hvpci_block_ops.read_block = NULL;
 +      hvpci_block_ops.write_block = NULL;
 +      hvpci_block_ops.reg_blk_invalidate = NULL;
  }
  
  static int __init init_hv_pci_drv(void)
  {
+       /* Set the invalid domain number's bit, so it will not be used */
+       set_bit(HVPCI_DOM_INVALID, hvpci_dom_map);
 +      /* Initialize PCI block r/w interface */
 +      hvpci_block_ops.read_block = hv_read_config_block;
 +      hvpci_block_ops.write_block = hv_write_config_block;
 +      hvpci_block_ops.reg_blk_invalidate = hv_register_block_invalidate;
 +
        return vmbus_driver_register(&hv_pci_drv);
  }
  
index c3899ee1db9950a6bd519cd725014d1af225912d,d34a3baf9b3a7c5a4a23eaab80baef864d568dc8..18627bb21e9ec57201bdea0a168f0df3ed8cc72a
@@@ -230,7 -230,7 +230,7 @@@ static int rpaphp_check_drc_props_v2(st
        struct of_drc_info drc;
        const __be32 *value;
        char cell_drc_name[MAX_DRC_NAME_LEN];
 -      int j, fndit;
 +      int j;
  
        info = of_find_property(dn->parent, "ibm,drc-info", NULL);
        if (info == NULL)
  
                /* Should now know end of current entry */
  
 -              if (my_index > drc.last_drc_index)
 -                      continue;
 -
 -              fndit = 1;
 -              break;
 +              /* Found it */
 +              if (my_index <= drc.last_drc_index) {
 +                      sprintf(cell_drc_name, "%s%d", drc.drc_name_prefix,
 +                              my_index);
 +                      break;
 +              }
        }
 -      /* Found it */
 -
 -      if (fndit)
 -              sprintf(cell_drc_name, "%s%d", drc.drc_name_prefix, 
 -                      my_index);
  
        if (((drc_name == NULL) ||
             (drc_name && !strcmp(drc_name, cell_drc_name))) &&
@@@ -408,7 -412,6 +408,6 @@@ static void __exit cleanup_slots(void
                pci_hp_deregister(&slot->hotplug_slot);
                dealloc_slot_struct(slot);
        }
-       return;
  }
  
  static int __init rpaphp_init(void)
diff --combined drivers/pci/pci.c
index 1b27b5af3d552f8622b075c80dd365561347ec6e,80fe2d24fa37afaccc1dc7ea2309e92f8940d660..e7982af9a5d86efd738640fbe08dba01e4704155
@@@ -890,8 -890,8 +890,8 @@@ static int pci_raw_set_power_state(stru
  
        pci_read_config_word(dev, dev->pm_cap + PCI_PM_CTRL, &pmcsr);
        dev->current_state = (pmcsr & PCI_PM_CTRL_STATE_MASK);
-       if (dev->current_state != state && printk_ratelimit())
-               pci_info(dev, "Refused to change power state, currently in D%d\n",
+       if (dev->current_state != state)
+               pci_info_ratelimited(dev, "Refused to change power state, currently in D%d\n",
                         dev->current_state);
  
        /*
@@@ -1025,15 -1025,10 +1025,15 @@@ static void __pci_start_power_transitio
        if (state == PCI_D0) {
                pci_platform_power_transition(dev, PCI_D0);
                /*
 -               * Mandatory power management transition delays are
 -               * handled in the PCIe portdrv resume hooks.
 +               * Mandatory power management transition delays, see
 +               * PCI Express Base Specification Revision 2.0 Section
 +               * 6.6.1: Conventional Reset.  Do not delay for
 +               * devices powered on/off by corresponding bridge,
 +               * because have already delayed for the bridge.
                 */
                if (dev->runtime_d3cold) {
 +                      if (dev->d3cold_delay && !dev->imm_ready)
 +                              msleep(dev->d3cold_delay);
                        /*
                         * When powering on a bridge from D3cold, the
                         * whole hierarchy may be powered on into
@@@ -1443,7 -1438,7 +1443,7 @@@ static void pci_restore_rebar_state(str
                pci_read_config_dword(pdev, pos + PCI_REBAR_CTRL, &ctrl);
                bar_idx = ctrl & PCI_REBAR_CTRL_BAR_IDX;
                res = pdev->resource + bar_idx;
-               size = order_base_2((resource_size(res) >> 20) | 1) - 1;
+               size = ilog2(resource_size(res)) - 20;
                ctrl &= ~PCI_REBAR_CTRL_BAR_SIZE;
                ctrl |= size << PCI_REBAR_CTRL_BAR_SHIFT;
                pci_write_config_dword(pdev, pos + PCI_REBAR_CTRL, ctrl);
@@@ -3581,7 -3576,7 +3581,7 @@@ int pci_enable_atomic_ops_to_root(struc
                }
  
                /* Ensure upstream ports don't block AtomicOps on egress */
-               if (!bridge->has_secondary_link) {
+               if (pci_pcie_type(bridge) == PCI_EXP_TYPE_UPSTREAM) {
                        pcie_capability_read_dword(bridge, PCI_EXP_DEVCTL2,
                                                   &ctl2);
                        if (ctl2 & PCI_EXP_DEVCTL2_ATOMIC_EGRESS_BLOCK)
@@@ -4607,14 -4602,16 +4607,14 @@@ static int pci_pm_reset(struct pci_dev 
  
        return pci_dev_wait(dev, "PM D3->D0", PCIE_RESET_READY_POLL_MS);
  }
 -
  /**
 - * pcie_wait_for_link_delay - Wait until link is active or inactive
 + * pcie_wait_for_link - Wait until link is active or inactive
   * @pdev: Bridge device
   * @active: waiting for active or inactive?
 - * @delay: Delay to wait after link has become active (in ms)
   *
   * Use this to wait till link becomes active or inactive.
   */
 -bool pcie_wait_for_link_delay(struct pci_dev *pdev, bool active, int delay)
 +bool pcie_wait_for_link(struct pci_dev *pdev, bool active)
  {
        int timeout = 1000;
        bool ret;
                timeout -= 10;
        }
        if (active && ret)
 -              msleep(delay);
 +              msleep(100);
        else if (ret != active)
                pci_info(pdev, "Data Link Layer Link Active not %s in 1000 msec\n",
                        active ? "set" : "cleared");
        return ret == active;
  }
  
 -/**
 - * pcie_wait_for_link - Wait until link is active or inactive
 - * @pdev: Bridge device
 - * @active: waiting for active or inactive?
 - *
 - * Use this to wait till link becomes active or inactive.
 - */
 -bool pcie_wait_for_link(struct pci_dev *pdev, bool active)
 -{
 -      return pcie_wait_for_link_delay(pdev, active, 100);
 -}
 -
  void pci_reset_secondary_bus(struct pci_dev *dev)
  {
        u16 ctrl;
@@@ -5923,8 -5932,19 +5923,19 @@@ resource_size_t __weak pcibios_default_
        return 0;
  }
  
- #define RESOURCE_ALIGNMENT_PARAM_SIZE COMMAND_LINE_SIZE
- static char resource_alignment_param[RESOURCE_ALIGNMENT_PARAM_SIZE] = {0};
+ /*
+  * Arches that don't want to expose struct resource to userland as-is in
+  * sysfs and /proc can implement their own pci_resource_to_user().
+  */
+ void __weak pci_resource_to_user(const struct pci_dev *dev, int bar,
+                                const struct resource *rsrc,
+                                resource_size_t *start, resource_size_t *end)
+ {
+       *start = rsrc->start;
+       *end = rsrc->end;
+ }
+ static char *resource_alignment_param;
  static DEFINE_SPINLOCK(resource_alignment_lock);
  
  /**
@@@ -5945,7 -5965,7 +5956,7 @@@ static resource_size_t pci_specified_re
  
        spin_lock(&resource_alignment_lock);
        p = resource_alignment_param;
-       if (!*p && !align)
+       if (!p || !*p)
                goto out;
        if (pci_has_flag(PCI_PROBE_ONLY)) {
                align = 0;
@@@ -6109,35 -6129,41 +6120,41 @@@ void pci_reassigndev_resource_alignment
        }
  }
  
- static ssize_t pci_set_resource_alignment_param(const char *buf, size_t count)
+ static ssize_t resource_alignment_show(struct bus_type *bus, char *buf)
  {
-       if (count > RESOURCE_ALIGNMENT_PARAM_SIZE - 1)
-               count = RESOURCE_ALIGNMENT_PARAM_SIZE - 1;
-       spin_lock(&resource_alignment_lock);
-       strncpy(resource_alignment_param, buf, count);
-       resource_alignment_param[count] = '\0';
-       spin_unlock(&resource_alignment_lock);
-       return count;
- }
+       size_t count = 0;
  
- static ssize_t pci_get_resource_alignment_param(char *buf, size_t size)
- {
-       size_t count;
        spin_lock(&resource_alignment_lock);
-       count = snprintf(buf, size, "%s", resource_alignment_param);
+       if (resource_alignment_param)
+               count = snprintf(buf, PAGE_SIZE, "%s", resource_alignment_param);
        spin_unlock(&resource_alignment_lock);
-       return count;
- }
  
- static ssize_t resource_alignment_show(struct bus_type *bus, char *buf)
- {
-       return pci_get_resource_alignment_param(buf, PAGE_SIZE);
+       /*
+        * When set by the command line, resource_alignment_param will not
+        * have a trailing line feed, which is ugly. So conditionally add
+        * it here.
+        */
+       if (count >= 2 && buf[count - 2] != '\n' && count < PAGE_SIZE - 1) {
+               buf[count - 1] = '\n';
+               buf[count++] = 0;
+       }
+       return count;
  }
  
  static ssize_t resource_alignment_store(struct bus_type *bus,
                                        const char *buf, size_t count)
  {
-       return pci_set_resource_alignment_param(buf, count);
+       char *param = kstrndup(buf, count, GFP_KERNEL);
+       if (!param)
+               return -ENOMEM;
+       spin_lock(&resource_alignment_lock);
+       kfree(resource_alignment_param);
+       resource_alignment_param = param;
+       spin_unlock(&resource_alignment_lock);
+       return count;
  }
  
  static BUS_ATTR_RW(resource_alignment);
@@@ -6266,8 -6292,7 +6283,7 @@@ static int __init pci_setup(char *str
                        } else if (!strncmp(str, "cbmemsize=", 10)) {
                                pci_cardbus_mem_size = memparse(str + 10, &str);
                        } else if (!strncmp(str, "resource_alignment=", 19)) {
-                               pci_set_resource_alignment_param(str + 19,
-                                                       strlen(str + 19));
+                               resource_alignment_param = str + 19;
                        } else if (!strncmp(str, "ecrc=", 5)) {
                                pcie_ecrc_get_policy(str + 5);
                        } else if (!strncmp(str, "hpiosize=", 9)) {
  early_param("pci", pci_setup);
  
  /*
-  * 'disable_acs_redir_param' is initialized in pci_setup(), above, to point
-  * to data in the __initdata section which will be freed after the init
-  * sequence is complete. We can't allocate memory in pci_setup() because some
-  * architectures do not have any memory allocation service available during
-  * an early_param() call. So we allocate memory and copy the variable here
-  * before the init section is freed.
+  * 'resource_alignment_param' and 'disable_acs_redir_param' are initialized
+  * in pci_setup(), above, to point to data in the __initdata section which
+  * will be freed after the init sequence is complete. We can't allocate memory
+  * in pci_setup() because some architectures do not have any memory allocation
+  * service available during an early_param() call. So we allocate memory and
+  * copy the variable here before the init section is freed.
+  *
   */
  static int __init pci_realloc_setup_params(void)
  {
+       resource_alignment_param = kstrdup(resource_alignment_param,
+                                          GFP_KERNEL);
        disable_acs_redir_param = kstrdup(disable_acs_redir_param, GFP_KERNEL);
  
        return 0;
diff --combined drivers/pci/pci.h
index d22d1b80770198c5b3fa334b563efd90ae2e7e47,0113343cfd1e7eae8adf7595e93a876786d96ef4..3f6947ee3324a9854ff275501732441d045ab581
@@@ -39,6 -39,11 +39,11 @@@ int pci_probe_reset_function(struct pci
  int pci_bridge_secondary_bus_reset(struct pci_dev *dev);
  int pci_bus_error_reset(struct pci_dev *dev);
  
+ #define PCI_PM_D2_DELAY         200
+ #define PCI_PM_D3_WAIT          10
+ #define PCI_PM_D3COLD_WAIT      100
+ #define PCI_PM_BUS_WAIT         50
  /**
   * struct pci_platform_pm_ops - Firmware PM callbacks
   *
@@@ -84,6 -89,8 +89,8 @@@ void pci_power_up(struct pci_dev *dev)
  void pci_disable_enabled_device(struct pci_dev *dev);
  int pci_finish_runtime_suspend(struct pci_dev *dev);
  void pcie_clear_root_pme_status(struct pci_dev *dev);
+ bool pci_check_pme_status(struct pci_dev *dev);
+ void pci_pme_wakeup_bus(struct pci_bus *bus);
  int __pci_pme_wakeup(struct pci_dev *dev, void *ign);
  void pci_pme_restore(struct pci_dev *dev);
  bool pci_dev_need_resume(struct pci_dev *dev);
@@@ -118,11 -125,25 +125,25 @@@ static inline bool pci_power_manageable
        return !pci_has_subordinate(pci_dev) || pci_dev->bridge_d3;
  }
  
+ static inline bool pcie_downstream_port(const struct pci_dev *dev)
+ {
+       int type = pci_pcie_type(dev);
+       return type == PCI_EXP_TYPE_ROOT_PORT ||
+              type == PCI_EXP_TYPE_DOWNSTREAM ||
+              type == PCI_EXP_TYPE_PCIE_BRIDGE;
+ }
  int pci_vpd_init(struct pci_dev *dev);
  void pci_vpd_release(struct pci_dev *dev);
  void pcie_vpd_create_sysfs_dev_files(struct pci_dev *dev);
  void pcie_vpd_remove_sysfs_dev_files(struct pci_dev *dev);
  
+ /* PCI Virtual Channel */
+ int pci_save_vc_state(struct pci_dev *dev);
+ void pci_restore_vc_state(struct pci_dev *dev);
+ void pci_allocate_vc_save_buffers(struct pci_dev *dev);
  /* PCI /proc functions */
  #ifdef CONFIG_PROC_FS
  int pci_proc_attach_device(struct pci_dev *dev);
@@@ -196,6 -217,9 +217,9 @@@ extern const struct attribute_group *pc
  extern const struct device_type pci_dev_type;
  extern const struct attribute_group *pci_bus_groups[];
  
+ extern unsigned long pci_hotplug_io_size;
+ extern unsigned long pci_hotplug_mem_size;
+ extern unsigned long pci_hotplug_bus_size;
  
  /**
   * pci_match_one_device - Tell if a PCI device structure has a matching
@@@ -236,6 -260,9 +260,9 @@@ enum pci_bar_type 
        pci_bar_mem64,          /* A 64-bit memory BAR */
  };
  
+ struct device *pci_get_host_bridge_device(struct pci_dev *dev);
+ void pci_put_host_bridge_device(struct device *dev);
  int pci_configure_extended_tags(struct pci_dev *dev, void *ign);
  bool pci_bus_read_dev_vendor_id(struct pci_bus *bus, int devfn, u32 *pl,
                                int crs_timeout);
@@@ -256,6 -283,8 +283,8 @@@ bool pci_bus_clip_resource(struct pci_d
  
  void pci_reassigndev_resource_alignment(struct pci_dev *dev);
  void pci_disable_bridge_window(struct pci_dev *dev);
+ struct pci_bus *pci_bus_get(struct pci_bus *bus);
+ void pci_bus_put(struct pci_bus *bus);
  
  /* PCIe link information */
  #define PCIE_SPEED2STR(speed) \
@@@ -279,6 -308,7 +308,7 @@@ u32 pcie_bandwidth_capable(struct pci_d
                           enum pcie_link_width *width);
  void __pcie_print_link_status(struct pci_dev *dev, bool verbose);
  void pcie_report_downtraining(struct pci_dev *dev);
+ void pcie_update_link_speed(struct pci_bus *bus, u16 link_status);
  
  /* Single Root I/O Virtualization */
  struct pci_sriov {
@@@ -418,11 -448,12 +448,12 @@@ static inline void pci_restore_dpc_stat
  #endif
  
  #ifdef CONFIG_PCI_ATS
+ /* Address Translation Service */
+ void pci_ats_init(struct pci_dev *dev);
  void pci_restore_ats_state(struct pci_dev *dev);
  #else
- static inline void pci_restore_ats_state(struct pci_dev *dev)
- {
- }
+ static inline void pci_ats_init(struct pci_dev *d) { }
+ static inline void pci_restore_ats_state(struct pci_dev *dev) { }
  #endif /* CONFIG_PCI_ATS */
  
  #ifdef CONFIG_PCI_IOV
@@@ -433,7 -464,7 +464,7 @@@ void pci_iov_update_resource(struct pci
  resource_size_t pci_sriov_resource_alignment(struct pci_dev *dev, int resno);
  void pci_restore_iov_state(struct pci_dev *dev);
  int pci_iov_bus_range(struct pci_bus *bus);
+ extern const struct attribute_group sriov_dev_attr_group;
  #else
  static inline int pci_iov_init(struct pci_dev *dev)
  {
@@@ -497,6 -528,7 +528,6 @@@ static inline int pci_dev_specific_disa
  void pcie_do_recovery(struct pci_dev *dev, enum pci_channel_state state,
                      u32 service);
  
 -bool pcie_wait_for_link_delay(struct pci_dev *pdev, bool active, int delay);
  bool pcie_wait_for_link(struct pci_dev *pdev, bool active);
  #ifdef CONFIG_PCIEASPM
  void pcie_aspm_init_link_state(struct pci_dev *pdev);
@@@ -518,10 -550,21 +549,21 @@@ static inline void pcie_aspm_create_sys
  static inline void pcie_aspm_remove_sysfs_dev_files(struct pci_dev *pdev) { }
  #endif
  
+ #ifdef CONFIG_PCIE_ECRC
+ void pcie_set_ecrc_checking(struct pci_dev *dev);
+ void pcie_ecrc_get_policy(char *str);
+ #else
+ static inline void pcie_set_ecrc_checking(struct pci_dev *dev) { }
+ static inline void pcie_ecrc_get_policy(char *str) { }
+ #endif
  #ifdef CONFIG_PCIE_PTM
  void pci_ptm_init(struct pci_dev *dev);
+ int pci_enable_ptm(struct pci_dev *dev, u8 *granularity);
  #else
  static inline void pci_ptm_init(struct pci_dev *dev) { }
+ static inline int pci_enable_ptm(struct pci_dev *dev, u8 *granularity)
+ { return -EINVAL; }
  #endif
  
  struct pci_dev_reset_methods {
@@@ -558,6 -601,10 +600,10 @@@ struct device_node
  int of_pci_parse_bus_range(struct device_node *node, struct resource *res);
  int of_get_pci_domain_nr(struct device_node *node);
  int of_pci_get_max_link_speed(struct device_node *node);
+ void pci_set_of_node(struct pci_dev *dev);
+ void pci_release_of_node(struct pci_dev *dev);
+ void pci_set_bus_of_node(struct pci_bus *bus);
+ void pci_release_bus_of_node(struct pci_bus *bus);
  
  #else
  static inline int
@@@ -577,6 -624,11 +623,11 @@@ of_pci_get_max_link_speed(struct device
  {
        return -EINVAL;
  }
+ static inline void pci_set_of_node(struct pci_dev *dev) { }
+ static inline void pci_release_of_node(struct pci_dev *dev) { }
+ static inline void pci_set_bus_of_node(struct pci_bus *bus) { }
+ static inline void pci_release_bus_of_node(struct pci_bus *bus) { }
  #endif /* CONFIG_OF */
  
  #if defined(CONFIG_OF_ADDRESS)
@@@ -607,4 -659,13 +658,13 @@@ static inline void pci_aer_clear_fatal_
  static inline void pci_aer_clear_device_status(struct pci_dev *dev) { }
  #endif
  
+ #ifdef CONFIG_ACPI
+ int pci_acpi_program_hp_params(struct pci_dev *dev);
+ #else
+ static inline int pci_acpi_program_hp_params(struct pci_dev *dev)
+ {
+       return -ENODEV;
+ }
+ #endif
  #endif /* DRIVERS_PCI_H */
diff --combined drivers/pci/pcie/aspm.c
index 464f8f92653f461e907e3a77062658e1a33a57ec,55a6951cedd167d2a26e983eef993dbb555fdb20..652ef23bba35ae66fb70a211f9d904bc3af9caed
@@@ -18,7 -18,6 +18,6 @@@
  #include <linux/slab.h>
  #include <linux/jiffies.h>
  #include <linux/delay.h>
- #include <linux/pci-aspm.h>
  #include "../pci.h"
  
  #ifdef MODULE_PARAM_PREFIX
@@@ -913,10 -912,10 +912,10 @@@ void pcie_aspm_init_link_state(struct p
  
        /*
         * We allocate pcie_link_state for the component on the upstream
-        * end of a Link, so there's nothing to do unless this device has a
-        * Link on its secondary side.
+        * end of a Link, so there's nothing to do unless this device is
+        * downstream port.
         */
-       if (!pdev->has_secondary_link)
+       if (!pcie_downstream_port(pdev))
                return;
  
        /* VIA has a strange chipset, root port is under a bridge */
@@@ -1070,7 -1069,7 +1069,7 @@@ static int __pci_disable_link_state(str
        if (!pci_is_pcie(pdev))
                return 0;
  
-       if (pdev->has_secondary_link)
+       if (pcie_downstream_port(pdev))
                parent = pdev;
        if (!parent || !parent->link_state)
                return -EINVAL;
@@@ -1170,26 -1169,6 +1169,26 @@@ static int pcie_aspm_get_policy(char *b
  module_param_call(policy, pcie_aspm_set_policy, pcie_aspm_get_policy,
        NULL, 0644);
  
 +/**
 + * pcie_aspm_enabled - Check if PCIe ASPM has been enabled for a device.
 + * @pdev: Target device.
 + */
 +bool pcie_aspm_enabled(struct pci_dev *pdev)
 +{
 +      struct pci_dev *bridge = pci_upstream_bridge(pdev);
 +      bool ret;
 +
 +      if (!bridge)
 +              return false;
 +
 +      mutex_lock(&aspm_lock);
 +      ret = bridge->link_state ? !!bridge->link_state->aspm_enabled : false;
 +      mutex_unlock(&aspm_lock);
 +
 +      return ret;
 +}
 +EXPORT_SYMBOL_GPL(pcie_aspm_enabled);
 +
  #ifdef CONFIG_PCIEASPM_DEBUG
  static ssize_t link_state_show(struct device *dev,
                struct device_attribute *attr,
diff --combined drivers/pci/probe.c
index dbeeb385fb9fc4cf2d9d4aceaa26c30fb6d20f47,3bfa57d58402bd8a09a5a346025fa9edb03015e3..3d5271a7a849dbffb8ea80f515f87dbf7e33f04f
@@@ -64,6 -64,11 +64,6 @@@ static struct resource *get_pci_domain_
        return &r->res;
  }
  
 -static int find_anything(struct device *dev, const void *data)
 -{
 -      return 1;
 -}
 -
  /*
   * Some device drivers need know if PCI is initiated.
   * Basically, we think PCI is not initiated when there
@@@ -74,7 -79,7 +74,7 @@@ int no_pci_devices(void
        struct device *dev;
        int no_devices;
  
 -      dev = bus_find_device(&pci_bus_type, NULL, NULL, find_anything);
 +      dev = bus_find_next_device(&pci_bus_type, NULL);
        no_devices = (dev == NULL);
        put_device(dev);
        return no_devices;
@@@ -1426,26 -1431,38 +1426,38 @@@ void set_pcie_port_type(struct pci_dev 
        pci_read_config_word(pdev, pos + PCI_EXP_DEVCAP, &reg16);
        pdev->pcie_mpss = reg16 & PCI_EXP_DEVCAP_PAYLOAD;
  
+       parent = pci_upstream_bridge(pdev);
+       if (!parent)
+               return;
        /*
-        * A Root Port or a PCI-to-PCIe bridge is always the upstream end
-        * of a Link.  No PCIe component has two Links.  Two Links are
-        * connected by a Switch that has a Port on each Link and internal
-        * logic to connect the two Ports.
+        * Some systems do not identify their upstream/downstream ports
+        * correctly so detect impossible configurations here and correct
+        * the port type accordingly.
         */
        type = pci_pcie_type(pdev);
-       if (type == PCI_EXP_TYPE_ROOT_PORT ||
-           type == PCI_EXP_TYPE_PCIE_BRIDGE)
-               pdev->has_secondary_link = 1;
-       else if (type == PCI_EXP_TYPE_UPSTREAM ||
-                type == PCI_EXP_TYPE_DOWNSTREAM) {
-               parent = pci_upstream_bridge(pdev);
+       if (type == PCI_EXP_TYPE_DOWNSTREAM) {
                /*
-                * Usually there's an upstream device (Root Port or Switch
-                * Downstream Port), but we can't assume one exists.
+                * If pdev claims to be downstream port but the parent
+                * device is also downstream port assume pdev is actually
+                * upstream port.
                 */
-               if (parent && !parent->has_secondary_link)
-                       pdev->has_secondary_link = 1;
+               if (pcie_downstream_port(parent)) {
+                       pci_info(pdev, "claims to be downstream port but is acting as upstream port, correcting type\n");
+                       pdev->pcie_flags_reg &= ~PCI_EXP_FLAGS_TYPE;
+                       pdev->pcie_flags_reg |= PCI_EXP_TYPE_UPSTREAM;
+               }
+       } else if (type == PCI_EXP_TYPE_UPSTREAM) {
+               /*
+                * If pdev claims to be upstream port but the parent
+                * device is also upstream port assume pdev is actually
+                * downstream port.
+                */
+               if (pci_pcie_type(parent) == PCI_EXP_TYPE_UPSTREAM) {
+                       pci_info(pdev, "claims to be upstream port but is acting as downstream port, correcting type\n");
+                       pdev->pcie_flags_reg &= ~PCI_EXP_FLAGS_TYPE;
+                       pdev->pcie_flags_reg |= PCI_EXP_TYPE_DOWNSTREAM;
+               }
        }
  }
  
@@@ -1915,275 -1932,6 +1927,6 @@@ static void pci_configure_mps(struct pc
                 p_mps, mps, mpss);
  }
  
- static struct hpp_type0 pci_default_type0 = {
-       .revision = 1,
-       .cache_line_size = 8,
-       .latency_timer = 0x40,
-       .enable_serr = 0,
-       .enable_perr = 0,
- };
- static void program_hpp_type0(struct pci_dev *dev, struct hpp_type0 *hpp)
- {
-       u16 pci_cmd, pci_bctl;
-       if (!hpp)
-               hpp = &pci_default_type0;
-       if (hpp->revision > 1) {
-               pci_warn(dev, "PCI settings rev %d not supported; using defaults\n",
-                        hpp->revision);
-               hpp = &pci_default_type0;
-       }
-       pci_write_config_byte(dev, PCI_CACHE_LINE_SIZE, hpp->cache_line_size);
-       pci_write_config_byte(dev, PCI_LATENCY_TIMER, hpp->latency_timer);
-       pci_read_config_word(dev, PCI_COMMAND, &pci_cmd);
-       if (hpp->enable_serr)
-               pci_cmd |= PCI_COMMAND_SERR;
-       if (hpp->enable_perr)
-               pci_cmd |= PCI_COMMAND_PARITY;
-       pci_write_config_word(dev, PCI_COMMAND, pci_cmd);
-       /* Program bridge control value */
-       if ((dev->class >> 8) == PCI_CLASS_BRIDGE_PCI) {
-               pci_write_config_byte(dev, PCI_SEC_LATENCY_TIMER,
-                                     hpp->latency_timer);
-               pci_read_config_word(dev, PCI_BRIDGE_CONTROL, &pci_bctl);
-               if (hpp->enable_perr)
-                       pci_bctl |= PCI_BRIDGE_CTL_PARITY;
-               pci_write_config_word(dev, PCI_BRIDGE_CONTROL, pci_bctl);
-       }
- }
- static void program_hpp_type1(struct pci_dev *dev, struct hpp_type1 *hpp)
- {
-       int pos;
-       if (!hpp)
-               return;
-       pos = pci_find_capability(dev, PCI_CAP_ID_PCIX);
-       if (!pos)
-               return;
-       pci_warn(dev, "PCI-X settings not supported\n");
- }
- static bool pcie_root_rcb_set(struct pci_dev *dev)
- {
-       struct pci_dev *rp = pcie_find_root_port(dev);
-       u16 lnkctl;
-       if (!rp)
-               return false;
-       pcie_capability_read_word(rp, PCI_EXP_LNKCTL, &lnkctl);
-       if (lnkctl & PCI_EXP_LNKCTL_RCB)
-               return true;
-       return false;
- }
- static void program_hpp_type2(struct pci_dev *dev, struct hpp_type2 *hpp)
- {
-       int pos;
-       u32 reg32;
-       if (!hpp)
-               return;
-       if (!pci_is_pcie(dev))
-               return;
-       if (hpp->revision > 1) {
-               pci_warn(dev, "PCIe settings rev %d not supported\n",
-                        hpp->revision);
-               return;
-       }
-       /*
-        * Don't allow _HPX to change MPS or MRRS settings.  We manage
-        * those to make sure they're consistent with the rest of the
-        * platform.
-        */
-       hpp->pci_exp_devctl_and |= PCI_EXP_DEVCTL_PAYLOAD |
-                                   PCI_EXP_DEVCTL_READRQ;
-       hpp->pci_exp_devctl_or &= ~(PCI_EXP_DEVCTL_PAYLOAD |
-                                   PCI_EXP_DEVCTL_READRQ);
-       /* Initialize Device Control Register */
-       pcie_capability_clear_and_set_word(dev, PCI_EXP_DEVCTL,
-                       ~hpp->pci_exp_devctl_and, hpp->pci_exp_devctl_or);
-       /* Initialize Link Control Register */
-       if (pcie_cap_has_lnkctl(dev)) {
-               /*
-                * If the Root Port supports Read Completion Boundary of
-                * 128, set RCB to 128.  Otherwise, clear it.
-                */
-               hpp->pci_exp_lnkctl_and |= PCI_EXP_LNKCTL_RCB;
-               hpp->pci_exp_lnkctl_or &= ~PCI_EXP_LNKCTL_RCB;
-               if (pcie_root_rcb_set(dev))
-                       hpp->pci_exp_lnkctl_or |= PCI_EXP_LNKCTL_RCB;
-               pcie_capability_clear_and_set_word(dev, PCI_EXP_LNKCTL,
-                       ~hpp->pci_exp_lnkctl_and, hpp->pci_exp_lnkctl_or);
-       }
-       /* Find Advanced Error Reporting Enhanced Capability */
-       pos = pci_find_ext_capability(dev, PCI_EXT_CAP_ID_ERR);
-       if (!pos)
-               return;
-       /* Initialize Uncorrectable Error Mask Register */
-       pci_read_config_dword(dev, pos + PCI_ERR_UNCOR_MASK, &reg32);
-       reg32 = (reg32 & hpp->unc_err_mask_and) | hpp->unc_err_mask_or;
-       pci_write_config_dword(dev, pos + PCI_ERR_UNCOR_MASK, reg32);
-       /* Initialize Uncorrectable Error Severity Register */
-       pci_read_config_dword(dev, pos + PCI_ERR_UNCOR_SEVER, &reg32);
-       reg32 = (reg32 & hpp->unc_err_sever_and) | hpp->unc_err_sever_or;
-       pci_write_config_dword(dev, pos + PCI_ERR_UNCOR_SEVER, reg32);
-       /* Initialize Correctable Error Mask Register */
-       pci_read_config_dword(dev, pos + PCI_ERR_COR_MASK, &reg32);
-       reg32 = (reg32 & hpp->cor_err_mask_and) | hpp->cor_err_mask_or;
-       pci_write_config_dword(dev, pos + PCI_ERR_COR_MASK, reg32);
-       /* Initialize Advanced Error Capabilities and Control Register */
-       pci_read_config_dword(dev, pos + PCI_ERR_CAP, &reg32);
-       reg32 = (reg32 & hpp->adv_err_cap_and) | hpp->adv_err_cap_or;
-       /* Don't enable ECRC generation or checking if unsupported */
-       if (!(reg32 & PCI_ERR_CAP_ECRC_GENC))
-               reg32 &= ~PCI_ERR_CAP_ECRC_GENE;
-       if (!(reg32 & PCI_ERR_CAP_ECRC_CHKC))
-               reg32 &= ~PCI_ERR_CAP_ECRC_CHKE;
-       pci_write_config_dword(dev, pos + PCI_ERR_CAP, reg32);
-       /*
-        * FIXME: The following two registers are not supported yet.
-        *
-        *   o Secondary Uncorrectable Error Severity Register
-        *   o Secondary Uncorrectable Error Mask Register
-        */
- }
- static u16 hpx3_device_type(struct pci_dev *dev)
- {
-       u16 pcie_type = pci_pcie_type(dev);
-       const int pcie_to_hpx3_type[] = {
-               [PCI_EXP_TYPE_ENDPOINT]    = HPX_TYPE_ENDPOINT,
-               [PCI_EXP_TYPE_LEG_END]     = HPX_TYPE_LEG_END,
-               [PCI_EXP_TYPE_RC_END]      = HPX_TYPE_RC_END,
-               [PCI_EXP_TYPE_RC_EC]       = HPX_TYPE_RC_EC,
-               [PCI_EXP_TYPE_ROOT_PORT]   = HPX_TYPE_ROOT_PORT,
-               [PCI_EXP_TYPE_UPSTREAM]    = HPX_TYPE_UPSTREAM,
-               [PCI_EXP_TYPE_DOWNSTREAM]  = HPX_TYPE_DOWNSTREAM,
-               [PCI_EXP_TYPE_PCI_BRIDGE]  = HPX_TYPE_PCI_BRIDGE,
-               [PCI_EXP_TYPE_PCIE_BRIDGE] = HPX_TYPE_PCIE_BRIDGE,
-       };
-       if (pcie_type >= ARRAY_SIZE(pcie_to_hpx3_type))
-               return 0;
-       return pcie_to_hpx3_type[pcie_type];
- }
- static u8 hpx3_function_type(struct pci_dev *dev)
- {
-       if (dev->is_virtfn)
-               return HPX_FN_SRIOV_VIRT;
-       else if (pci_find_ext_capability(dev, PCI_EXT_CAP_ID_SRIOV) > 0)
-               return HPX_FN_SRIOV_PHYS;
-       else
-               return HPX_FN_NORMAL;
- }
- static bool hpx3_cap_ver_matches(u8 pcie_cap_id, u8 hpx3_cap_id)
- {
-       u8 cap_ver = hpx3_cap_id & 0xf;
-       if ((hpx3_cap_id & BIT(4)) && cap_ver >= pcie_cap_id)
-               return true;
-       else if (cap_ver == pcie_cap_id)
-               return true;
-       return false;
- }
- static void program_hpx_type3_register(struct pci_dev *dev,
-                                      const struct hpx_type3 *reg)
- {
-       u32 match_reg, write_reg, header, orig_value;
-       u16 pos;
-       if (!(hpx3_device_type(dev) & reg->device_type))
-               return;
-       if (!(hpx3_function_type(dev) & reg->function_type))
-               return;
-       switch (reg->config_space_location) {
-       case HPX_CFG_PCICFG:
-               pos = 0;
-               break;
-       case HPX_CFG_PCIE_CAP:
-               pos = pci_find_capability(dev, reg->pci_exp_cap_id);
-               if (pos == 0)
-                       return;
-               break;
-       case HPX_CFG_PCIE_CAP_EXT:
-               pos = pci_find_ext_capability(dev, reg->pci_exp_cap_id);
-               if (pos == 0)
-                       return;
-               pci_read_config_dword(dev, pos, &header);
-               if (!hpx3_cap_ver_matches(PCI_EXT_CAP_VER(header),
-                                         reg->pci_exp_cap_ver))
-                       return;
-               break;
-       case HPX_CFG_VEND_CAP:  /* Fall through */
-       case HPX_CFG_DVSEC:     /* Fall through */
-       default:
-               pci_warn(dev, "Encountered _HPX type 3 with unsupported config space location");
-               return;
-       }
-       pci_read_config_dword(dev, pos + reg->match_offset, &match_reg);
-       if ((match_reg & reg->match_mask_and) != reg->match_value)
-               return;
-       pci_read_config_dword(dev, pos + reg->reg_offset, &write_reg);
-       orig_value = write_reg;
-       write_reg &= reg->reg_mask_and;
-       write_reg |= reg->reg_mask_or;
-       if (orig_value == write_reg)
-               return;
-       pci_write_config_dword(dev, pos + reg->reg_offset, write_reg);
-       pci_dbg(dev, "Applied _HPX3 at [0x%x]: 0x%08x -> 0x%08x",
-               pos, orig_value, write_reg);
- }
- static void program_hpx_type3(struct pci_dev *dev, struct hpx_type3 *hpx3)
- {
-       if (!hpx3)
-               return;
-       if (!pci_is_pcie(dev))
-               return;
-       program_hpx_type3_register(dev, hpx3);
- }
  int pci_configure_extended_tags(struct pci_dev *dev, void *ign)
  {
        struct pci_host_bridge *host;
@@@ -2364,13 -2112,6 +2107,6 @@@ static void pci_configure_serr(struct p
  
  static void pci_configure_device(struct pci_dev *dev)
  {
-       static const struct hotplug_program_ops hp_ops = {
-               .program_type0 = program_hpp_type0,
-               .program_type1 = program_hpp_type1,
-               .program_type2 = program_hpp_type2,
-               .program_type3 = program_hpx_type3,
-       };
        pci_configure_mps(dev);
        pci_configure_extended_tags(dev, NULL);
        pci_configure_relaxed_ordering(dev);
        pci_configure_eetlp_prefix(dev);
        pci_configure_serr(dev);
  
-       pci_acpi_program_hp_params(dev, &hp_ops);
+       pci_acpi_program_hp_params(dev);
  }
  
  static void pci_release_capabilities(struct pci_dev *dev)
@@@ -2759,12 -2500,8 +2495,8 @@@ static int only_one_child(struct pci_bu
         * A PCIe Downstream Port normally leads to a Link with only Device
         * 0 on it (PCIe spec r3.1, sec 7.3.1).  As an optimization, scan
         * only for Device 0 in that situation.
-        *
-        * Checking has_secondary_link is a hack to identify Downstream
-        * Ports because sometimes Switches are configured such that the
-        * PCIe Port Type labels are backwards.
         */
-       if (bridge && pci_is_pcie(bridge) && bridge->has_secondary_link)
+       if (bridge && pci_is_pcie(bridge) && pcie_downstream_port(bridge))
                return 1;
  
        return 0;
diff --combined drivers/pci/quirks.c
index 44c4ae1abd00557e080bf9ca37458c31a7ba7504,304d98e0a96dda685823d474bfcd6c8532e242f1..320255e5e8f8963d2edaa6c3824c85203d080b34
@@@ -20,7 -20,6 +20,6 @@@
  #include <linux/delay.h>
  #include <linux/acpi.h>
  #include <linux/dmi.h>
- #include <linux/pci-aspm.h>
  #include <linux/ioport.h>
  #include <linux/sched.h>
  #include <linux/ktime.h>
@@@ -2592,6 -2591,59 +2591,59 @@@ DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_N
                        PCI_DEVICE_ID_NVIDIA_NVENET_15,
                        nvenet_msi_disable);
  
+ /*
+  * PCIe spec r4.0 sec 7.7.1.2 and sec 7.7.2.2 say that if MSI/MSI-X is enabled,
+  * then the device can't use INTx interrupts. Tegra's PCIe root ports don't
+  * generate MSI interrupts for PME and AER events instead only INTx interrupts
+  * are generated. Though Tegra's PCIe root ports can generate MSI interrupts
+  * for other events, since PCIe specificiation doesn't support using a mix of
+  * INTx and MSI/MSI-X, it is required to disable MSI interrupts to avoid port
+  * service drivers registering their respective ISRs for MSIs.
+  */
+ static void pci_quirk_nvidia_tegra_disable_rp_msi(struct pci_dev *dev)
+ {
+       dev->no_msi = 1;
+ }
+ DECLARE_PCI_FIXUP_CLASS_EARLY(PCI_VENDOR_ID_NVIDIA, 0x1ad0,
+                             PCI_CLASS_BRIDGE_PCI, 8,
+                             pci_quirk_nvidia_tegra_disable_rp_msi);
+ DECLARE_PCI_FIXUP_CLASS_EARLY(PCI_VENDOR_ID_NVIDIA, 0x1ad1,
+                             PCI_CLASS_BRIDGE_PCI, 8,
+                             pci_quirk_nvidia_tegra_disable_rp_msi);
+ DECLARE_PCI_FIXUP_CLASS_EARLY(PCI_VENDOR_ID_NVIDIA, 0x1ad2,
+                             PCI_CLASS_BRIDGE_PCI, 8,
+                             pci_quirk_nvidia_tegra_disable_rp_msi);
+ DECLARE_PCI_FIXUP_CLASS_EARLY(PCI_VENDOR_ID_NVIDIA, 0x0bf0,
+                             PCI_CLASS_BRIDGE_PCI, 8,
+                             pci_quirk_nvidia_tegra_disable_rp_msi);
+ DECLARE_PCI_FIXUP_CLASS_EARLY(PCI_VENDOR_ID_NVIDIA, 0x0bf1,
+                             PCI_CLASS_BRIDGE_PCI, 8,
+                             pci_quirk_nvidia_tegra_disable_rp_msi);
+ DECLARE_PCI_FIXUP_CLASS_EARLY(PCI_VENDOR_ID_NVIDIA, 0x0e1c,
+                             PCI_CLASS_BRIDGE_PCI, 8,
+                             pci_quirk_nvidia_tegra_disable_rp_msi);
+ DECLARE_PCI_FIXUP_CLASS_EARLY(PCI_VENDOR_ID_NVIDIA, 0x0e1d,
+                             PCI_CLASS_BRIDGE_PCI, 8,
+                             pci_quirk_nvidia_tegra_disable_rp_msi);
+ DECLARE_PCI_FIXUP_CLASS_EARLY(PCI_VENDOR_ID_NVIDIA, 0x0e12,
+                             PCI_CLASS_BRIDGE_PCI, 8,
+                             pci_quirk_nvidia_tegra_disable_rp_msi);
+ DECLARE_PCI_FIXUP_CLASS_EARLY(PCI_VENDOR_ID_NVIDIA, 0x0e13,
+                             PCI_CLASS_BRIDGE_PCI, 8,
+                             pci_quirk_nvidia_tegra_disable_rp_msi);
+ DECLARE_PCI_FIXUP_CLASS_EARLY(PCI_VENDOR_ID_NVIDIA, 0x0fae,
+                             PCI_CLASS_BRIDGE_PCI, 8,
+                             pci_quirk_nvidia_tegra_disable_rp_msi);
+ DECLARE_PCI_FIXUP_CLASS_EARLY(PCI_VENDOR_ID_NVIDIA, 0x0faf,
+                             PCI_CLASS_BRIDGE_PCI, 8,
+                             pci_quirk_nvidia_tegra_disable_rp_msi);
+ DECLARE_PCI_FIXUP_CLASS_EARLY(PCI_VENDOR_ID_NVIDIA, 0x10e5,
+                             PCI_CLASS_BRIDGE_PCI, 8,
+                             pci_quirk_nvidia_tegra_disable_rp_msi);
+ DECLARE_PCI_FIXUP_CLASS_EARLY(PCI_VENDOR_ID_NVIDIA, 0x10e6,
+                             PCI_CLASS_BRIDGE_PCI, 8,
+                             pci_quirk_nvidia_tegra_disable_rp_msi);
  /*
   * Some versions of the MCP55 bridge from Nvidia have a legacy IRQ routing
   * config register.  This register controls the routing of legacy
@@@ -2925,6 -2977,24 +2977,24 @@@ DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_A
                        quirk_msi_intx_disable_qca_bug);
  DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_ATTANSIC, 0xe091,
                        quirk_msi_intx_disable_qca_bug);
+ /*
+  * Amazon's Annapurna Labs 1c36:0031 Root Ports don't support MSI-X, so it
+  * should be disabled on platforms where the device (mistakenly) advertises it.
+  *
+  * Notice that this quirk also disables MSI (which may work, but hasn't been
+  * tested), since currently there is no standard way to disable only MSI-X.
+  *
+  * The 0031 device id is reused for other non Root Port device types,
+  * therefore the quirk is registered for the PCI_CLASS_BRIDGE_PCI class.
+  */
+ static void quirk_al_msi_disable(struct pci_dev *dev)
+ {
+       dev->no_msi = 1;
+       pci_warn(dev, "Disabling MSI/MSI-X\n");
+ }
+ DECLARE_PCI_FIXUP_CLASS_FINAL(PCI_VENDOR_ID_AMAZON_ANNAPURNA_LABS, 0x0031,
+                             PCI_CLASS_BRIDGE_PCI, 8, quirk_al_msi_disable);
  #endif /* CONFIG_PCI_MSI */
  
  /*
@@@ -4366,6 -4436,24 +4436,24 @@@ static int pci_quirk_qcom_rp_acs(struc
        return ret;
  }
  
+ static int pci_quirk_al_acs(struct pci_dev *dev, u16 acs_flags)
+ {
+       if (pci_pcie_type(dev) != PCI_EXP_TYPE_ROOT_PORT)
+               return -ENOTTY;
+       /*
+        * Amazon's Annapurna Labs root ports don't include an ACS capability,
+        * but do include ACS-like functionality. The hardware doesn't support
+        * peer-to-peer transactions via the root port and each has a unique
+        * segment number.
+        *
+        * Additionally, the root ports cannot send traffic to each other.
+        */
+       acs_flags &= ~(PCI_ACS_SV | PCI_ACS_RR | PCI_ACS_CR | PCI_ACS_UF);
+       return acs_flags ? 0 : 1;
+ }
  /*
   * Sunrise Point PCH root ports implement ACS, but unfortunately as shown in
   * the datasheet (Intel 100 Series Chipset Family PCH Datasheet, Vol. 2,
@@@ -4466,6 -4554,19 +4554,19 @@@ static int pci_quirk_mf_endpoint_acs(st
        return acs_flags ? 0 : 1;
  }
  
+ static int pci_quirk_brcm_acs(struct pci_dev *dev, u16 acs_flags)
+ {
+       /*
+        * iProc PAXB Root Ports don't advertise an ACS capability, but
+        * they do not allow peer-to-peer transactions between Root Ports.
+        * Allow each Root Port to be in a separate IOMMU group by masking
+        * SV/RR/CR/UF bits.
+        */
+       acs_flags &= ~(PCI_ACS_SV | PCI_ACS_RR | PCI_ACS_CR | PCI_ACS_UF);
+       return acs_flags ? 0 : 1;
+ }
  static const struct pci_dev_acs_enabled {
        u16 vendor;
        u16 device;
        { PCI_VENDOR_ID_AMPERE, 0xE00A, pci_quirk_xgene_acs },
        { PCI_VENDOR_ID_AMPERE, 0xE00B, pci_quirk_xgene_acs },
        { PCI_VENDOR_ID_AMPERE, 0xE00C, pci_quirk_xgene_acs },
+       { PCI_VENDOR_ID_BROADCOM, 0xD714, pci_quirk_brcm_acs },
+       /* Amazon Annapurna Labs */
+       { PCI_VENDOR_ID_AMAZON_ANNAPURNA_LABS, 0x0031, pci_quirk_al_acs },
        { 0 }
  };
  
@@@ -5256,7 -5360,7 +5360,7 @@@ static void quirk_reset_lenovo_thinkpad
         */
        if (ioread32(map + 0x2240c) & 0x2) {
                pci_info(pdev, FW_BUG "GPU left initialized by EFI, resetting\n");
 -              ret = pci_reset_function(pdev);
 +              ret = pci_reset_bus(pdev);
                if (ret < 0)
                        pci_err(pdev, "Failed to reset GPU: %d\n", ret);
        }
diff --combined drivers/scsi/hpsa.c
index 1bb6aada93fab71e26f0e6c44569ae470a8c9e8b,148663373f7d31961e471f594d2dcd342df7e5e9..ac39ed79ccaa15cebf9a3b7d86230130f4d5b076
@@@ -21,7 -21,6 +21,6 @@@
  #include <linux/interrupt.h>
  #include <linux/types.h>
  #include <linux/pci.h>
- #include <linux/pci-aspm.h>
  #include <linux/kernel.h>
  #include <linux/slab.h>
  #include <linux/delay.h>
@@@ -2334,8 -2333,6 +2333,8 @@@ static int handle_ioaccel_mode2_error(s
        case IOACCEL2_SERV_RESPONSE_COMPLETE:
                switch (c2->error_data.status) {
                case IOACCEL2_STATUS_SR_TASK_COMP_GOOD:
 +                      if (cmd)
 +                              cmd->result = 0;
                        break;
                case IOACCEL2_STATUS_SR_TASK_COMP_CHK_COND:
                        cmd->result |= SAM_STAT_CHECK_CONDITION;
@@@ -2485,10 -2482,8 +2484,10 @@@ static void process_ioaccel2_completion
  
        /* check for good status */
        if (likely(c2->error_data.serv_response == 0 &&
 -                      c2->error_data.status == 0))
 +                      c2->error_data.status == 0)) {
 +              cmd->result = 0;
                return hpsa_cmd_free_and_done(h, c, cmd);
 +      }
  
        /*
         * Any RAID offload error results in retry which will use
@@@ -5657,12 -5652,6 +5656,12 @@@ static int hpsa_scsi_queue_command(stru
        if (c == NULL)
                return SCSI_MLQUEUE_DEVICE_BUSY;
  
 +      /*
 +       * This is necessary because the SML doesn't zero out this field during
 +       * error recovery.
 +       */
 +      cmd->result = 0;
 +
        /*
         * Call alternate submit routine for I/O accelerated commands.
         * Retries always go down the normal I/O path.
@@@ -6091,6 -6080,8 +6090,6 @@@ static struct CommandList *cmd_tagged_a
                if (idx != h->last_collision_tag) { /* Print once per tag */
                        dev_warn(&h->pdev->dev,
                                "%s: tag collision (tag=%d)\n", __func__, idx);
 -                      if (c->scsi_cmd != NULL)
 -                              scsi_print_command(c->scsi_cmd);
                        if (scmd)
                                scsi_print_command(scmd);
                        h->last_collision_tag = idx;
@@@ -7806,7 -7797,7 +7805,7 @@@ static void hpsa_free_pci_init(struct c
        hpsa_disable_interrupt_mode(h);         /* pci_init 2 */
        /*
         * call pci_disable_device before pci_release_regions per
 -       * Documentation/PCI/pci.rst
 +       * Documentation/driver-api/pci/pci.rst
         */
        pci_disable_device(h->pdev);            /* pci_init 1 */
        pci_release_regions(h->pdev);           /* pci_init 2 */
@@@ -7889,7 -7880,7 +7888,7 @@@ clean2: /* intmode+region, pci *
  clean1:
        /*
         * call pci_disable_device before pci_release_regions per
 -       * Documentation/PCI/pci.rst
 +       * Documentation/driver-api/pci/pci.rst
         */
        pci_disable_device(h->pdev);
        pci_release_regions(h->pdev);
index d0c2f8d6f2a2f893358fb2fc11882f6bf1f7bc18,27fdbc1654463d0d6d50781f976771270d8005f8..c8e512ba6d39877bf2eed9b3814710238d7d9876
@@@ -51,7 -51,6 +51,6 @@@
  #include <linux/workqueue.h>
  #include <linux/delay.h>
  #include <linux/pci.h>
- #include <linux/pci-aspm.h>
  #include <linux/interrupt.h>
  #include <linux/aer.h>
  #include <linux/raid_class.h>
@@@ -155,10 -154,6 +154,10 @@@ static int prot_mask = -1
  module_param(prot_mask, int, 0444);
  MODULE_PARM_DESC(prot_mask, " host protection capabilities mask, def=7 ");
  
 +static bool enable_sdev_max_qd;
 +module_param(enable_sdev_max_qd, bool, 0444);
 +MODULE_PARM_DESC(enable_sdev_max_qd,
 +      "Enable sdev max qd as can_queue, def=disabled(0)");
  
  /* raid transport support */
  static struct raid_template *mpt3sas_raid_template;
@@@ -1156,11 -1151,6 +1155,11 @@@ _scsih_pcie_device_add(struct MPT3SAS_A
        list_add_tail(&pcie_device->list, &ioc->pcie_device_list);
        spin_unlock_irqrestore(&ioc->pcie_device_lock, flags);
  
 +      if (pcie_device->access_status ==
 +          MPI26_PCIEDEV0_ASTATUS_DEVICE_BLOCKED) {
 +              clear_bit(pcie_device->handle, ioc->pend_os_device_add);
 +              return;
 +      }
        if (scsi_add_device(ioc->shost, PCIE_CHANNEL, pcie_device->id, 0)) {
                _scsih_pcie_device_remove(ioc, pcie_device);
        } else if (!pcie_device->starget) {
@@@ -1205,9 -1195,7 +1204,9 @@@ _scsih_pcie_device_init_add(struct MPT3
        spin_lock_irqsave(&ioc->pcie_device_lock, flags);
        pcie_device_get(pcie_device);
        list_add_tail(&pcie_device->list, &ioc->pcie_device_init_list);
 -      _scsih_determine_boot_device(ioc, pcie_device, PCIE_CHANNEL);
 +      if (pcie_device->access_status !=
 +          MPI26_PCIEDEV0_ASTATUS_DEVICE_BLOCKED)
 +              _scsih_determine_boot_device(ioc, pcie_device, PCIE_CHANNEL);
        spin_unlock_irqrestore(&ioc->pcie_device_lock, flags);
  }
  /**
@@@ -1444,20 -1432,17 +1443,20 @@@ _scsih_is_end_device(u32 device_info
  }
  
  /**
 - * _scsih_is_nvme_device - determines if device is an nvme device
 + * _scsih_is_nvme_pciescsi_device - determines if
 + *                    device is an pcie nvme/scsi device
   * @device_info: bitfield providing information about the device.
   * Context: none
   *
 - * Return: 1 if nvme device.
 + * Returns 1 if device is pcie device type nvme/scsi.
   */
  static int
 -_scsih_is_nvme_device(u32 device_info)
 +_scsih_is_nvme_pciescsi_device(u32 device_info)
  {
 -      if ((device_info & MPI26_PCIE_DEVINFO_MASK_DEVICE_TYPE)
 -                                      == MPI26_PCIE_DEVINFO_NVME)
 +      if (((device_info & MPI26_PCIE_DEVINFO_MASK_DEVICE_TYPE)
 +          == MPI26_PCIE_DEVINFO_NVME) ||
 +          ((device_info & MPI26_PCIE_DEVINFO_MASK_DEVICE_TYPE)
 +          == MPI26_PCIE_DEVINFO_SCSI))
                return 1;
        else
                return 0;
@@@ -1523,13 -1508,7 +1522,13 @@@ scsih_change_queue_depth(struct scsi_de
  
        max_depth = shost->can_queue;
  
 -      /* limit max device queue for SATA to 32 */
 +      /*
 +       * limit max device queue for SATA to 32 if enable_sdev_max_qd
 +       * is disabled.
 +       */
 +      if (ioc->enable_sdev_max_qd)
 +              goto not_sata;
 +
        sas_device_priv_data = sdev->hostdata;
        if (!sas_device_priv_data)
                goto not_sata;
        return scsi_change_queue_depth(sdev, qdepth);
  }
  
 +/**
 + * mpt3sas_scsih_change_queue_depth - setting device queue depth
 + * @sdev: scsi device struct
 + * @qdepth: requested queue depth
 + *
 + * Returns nothing.
 + */
 +void
 +mpt3sas_scsih_change_queue_depth(struct scsi_device *sdev, int qdepth)
 +{
 +      struct Scsi_Host *shost = sdev->host;
 +      struct MPT3SAS_ADAPTER *ioc = shost_priv(shost);
 +
 +      if (ioc->enable_sdev_max_qd)
 +              qdepth = shost->can_queue;
 +
 +      scsih_change_queue_depth(sdev, qdepth);
 +}
 +
  /**
   * scsih_target_alloc - target add routine
   * @starget: scsi target struct
@@@ -2335,7 -2295,7 +2334,7 @@@ scsih_slave_configure(struct scsi_devic
                                                MPT3SAS_RAID_MAX_SECTORS);
                }
  
 -              scsih_change_queue_depth(sdev, qdepth);
 +              mpt3sas_scsih_change_queue_depth(sdev, qdepth);
  
                /* raid transport support */
                if (!ioc->is_warpdrive)
  
                pcie_device_put(pcie_device);
                spin_unlock_irqrestore(&ioc->pcie_device_lock, flags);
 -              scsih_change_queue_depth(sdev, qdepth);
 +              mpt3sas_scsih_change_queue_depth(sdev, qdepth);
                /* Enable QUEUE_FLAG_NOMERGES flag, so that IOs won't be
                 ** merged and can eliminate holes created during merging
                 ** operation.
                _scsih_display_sata_capabilities(ioc, handle, sdev);
  
  
 -      scsih_change_queue_depth(sdev, qdepth);
 +      mpt3sas_scsih_change_queue_depth(sdev, qdepth);
  
        if (ssp_target) {
                sas_read_port_mode_page(sdev);
@@@ -2911,8 -2871,7 +2910,8 @@@ scsih_abort(struct scsi_cmnd *scmd
  
        handle = sas_device_priv_data->sas_target->handle;
        pcie_device = mpt3sas_get_pdev_by_handle(ioc, handle);
 -      if (pcie_device && (!ioc->tm_custom_handling))
 +      if (pcie_device && (!ioc->tm_custom_handling) &&
 +          (!(mpt3sas_scsih_is_pcie_scsi_device(pcie_device->device_info))))
                timeout = ioc->nvme_abort_timeout;
        r = mpt3sas_scsih_issue_locked_tm(ioc, handle, scmd->device->lun,
                MPI2_SCSITASKMGMT_TASKTYPE_ABORT_TASK,
@@@ -2983,13 -2942,11 +2982,13 @@@ scsih_dev_reset(struct scsi_cmnd *scmd
  
        pcie_device = mpt3sas_get_pdev_by_handle(ioc, handle);
  
 -      if (pcie_device && (!ioc->tm_custom_handling)) {
 +      if (pcie_device && (!ioc->tm_custom_handling) &&
 +          (!(mpt3sas_scsih_is_pcie_scsi_device(pcie_device->device_info)))) {
                tr_timeout = pcie_device->reset_timeout;
                tr_method = MPI26_SCSITASKMGMT_MSGFLAGS_PROTOCOL_LVL_RST_PCIE;
        } else
                tr_method = MPI2_SCSITASKMGMT_MSGFLAGS_LINK_RESET;
 +
        r = mpt3sas_scsih_issue_locked_tm(ioc, handle, scmd->device->lun,
                MPI2_SCSITASKMGMT_TASKTYPE_LOGICAL_UNIT_RESET, 0, 0,
                tr_timeout, tr_method);
@@@ -3062,8 -3019,7 +3061,8 @@@ scsih_target_reset(struct scsi_cmnd *sc
  
        pcie_device = mpt3sas_get_pdev_by_handle(ioc, handle);
  
 -      if (pcie_device && (!ioc->tm_custom_handling)) {
 +      if (pcie_device && (!ioc->tm_custom_handling) &&
 +          (!(mpt3sas_scsih_is_pcie_scsi_device(pcie_device->device_info)))) {
                tr_timeout = pcie_device->reset_timeout;
                tr_method = MPI26_SCSITASKMGMT_MSGFLAGS_PROTOCOL_LVL_RST_PCIE;
        } else
@@@ -3641,9 -3597,7 +3640,9 @@@ _scsih_tm_tr_send(struct MPT3SAS_ADAPTE
                        sas_address = pcie_device->wwid;
                }
                spin_unlock_irqrestore(&ioc->pcie_device_lock, flags);
 -              if (pcie_device && (!ioc->tm_custom_handling))
 +              if (pcie_device && (!ioc->tm_custom_handling) &&
 +                  (!(mpt3sas_scsih_is_pcie_scsi_device(
 +                  pcie_device->device_info))))
                        tr_method =
                            MPI26_SCSITASKMGMT_MSGFLAGS_PROTOCOL_LVL_RST_PCIE;
                else
@@@ -4699,8 -4653,11 +4698,8 @@@ scsih_qcmd(struct Scsi_Host *shost, str
         * since we're lockless at this point
         */
        do {
 -              if (test_bit(0, &sas_device_priv_data->ata_command_pending)) {
 -                      scmd->result = SAM_STAT_BUSY;
 -                      scmd->scsi_done(scmd);
 -                      return 0;
 -              }
 +              if (test_bit(0, &sas_device_priv_data->ata_command_pending))
 +                      return SCSI_MLQUEUE_DEVICE_BUSY;
        } while (_scsih_set_satl_pending(scmd, true));
  
        if (scmd->sc_data_direction == DMA_FROM_DEVICE)
@@@ -6498,17 -6455,24 +6497,17 @@@ _scsih_sas_device_status_change_event_d
  /**
   * _scsih_sas_device_status_change_event - handle device status change
   * @ioc: per adapter object
 - * @fw_event: The fw_event_work object
 + * @event_data: The fw event
   * Context: user.
   */
  static void
  _scsih_sas_device_status_change_event(struct MPT3SAS_ADAPTER *ioc,
 -      struct fw_event_work *fw_event)
 +      Mpi2EventDataSasDeviceStatusChange_t *event_data)
  {
        struct MPT3SAS_TARGET *target_priv_data;
        struct _sas_device *sas_device;
        u64 sas_address;
        unsigned long flags;
 -      Mpi2EventDataSasDeviceStatusChange_t *event_data =
 -              (Mpi2EventDataSasDeviceStatusChange_t *)
 -              fw_event->event_data;
 -
 -      if (ioc->logging_level & MPT_DEBUG_EVENT_WORK_TASK)
 -              _scsih_sas_device_status_change_event_debug(ioc,
 -                   event_data);
  
        /* In MPI Revision K (0xC), the internal device reset complete was
         * implemented, so avoid setting tm_busy flag for older firmware.
        else
                target_priv_data->tm_busy = 0;
  
 +      if (ioc->logging_level & MPT_DEBUG_EVENT_WORK_TASK)
 +              ioc_info(ioc,
 +                  "%s tm_busy flag for handle(0x%04x)\n",
 +                  (target_priv_data->tm_busy == 1) ? "Enable" : "Disable",
 +                  target_priv_data->handle);
 +
  out:
        if (sas_device)
                sas_device_put(sas_device);
@@@ -6580,11 -6538,6 +6579,11 @@@ _scsih_check_pcie_access_status(struct 
                break;
        case MPI26_PCIEDEV0_ASTATUS_DEVICE_BLOCKED:
                desc = "PCIe device blocked";
 +              ioc_info(ioc,
 +                  "Device with Access Status (%s): wwid(0x%016llx), "
 +                  "handle(0x%04x)\n ll only be added to the internal list",
 +                  desc, (u64)wwid, handle);
 +              rc = 0;
                break;
        case MPI26_PCIEDEV0_ASTATUS_MEMORY_SPACE_ACCESS_FAILED:
                desc = "PCIe device mem space access failed";
@@@ -6689,8 -6642,7 +6688,8 @@@ _scsih_pcie_device_remove_from_sml(stru
                         pcie_device->enclosure_level,
                         pcie_device->connector_name);
  
 -      if (pcie_device->starget)
 +      if (pcie_device->starget && (pcie_device->access_status !=
 +                              MPI26_PCIEDEV0_ASTATUS_DEVICE_BLOCKED))
                scsi_remove_target(&pcie_device->starget->dev);
        dewtprintk(ioc,
                   ioc_info(ioc, "%s: exit: handle(0x%04x), wwid(0x%016llx)\n",
@@@ -6741,7 -6693,7 +6740,7 @@@ _scsih_pcie_check_device(struct MPT3SAS
  
        /* check if this is end device */
        device_info = le32_to_cpu(pcie_device_pg0.DeviceInfo);
 -      if (!(_scsih_is_nvme_device(device_info)))
 +      if (!(_scsih_is_nvme_pciescsi_device(device_info)))
                return;
  
        wwid = le64_to_cpu(pcie_device_pg0.WWID);
        if (unlikely(pcie_device->handle != handle)) {
                starget = pcie_device->starget;
                sas_target_priv_data = starget->hostdata;
 +              pcie_device->access_status = pcie_device_pg0.AccessStatus;
                starget_printk(KERN_INFO, starget,
                    "handle changed from(0x%04x) to (0x%04x)!!!\n",
                    pcie_device->handle, handle);
@@@ -6851,8 -6802,7 +6850,8 @@@ _scsih_pcie_add_device(struct MPT3SAS_A
            pcie_device_pg0.AccessStatus))
                return 0;
  
 -      if (!(_scsih_is_nvme_device(le32_to_cpu(pcie_device_pg0.DeviceInfo))))
 +      if (!(_scsih_is_nvme_pciescsi_device(le32_to_cpu
 +          (pcie_device_pg0.DeviceInfo))))
                return 0;
  
        pcie_device = mpt3sas_get_pdev_by_wwid(ioc, wwid);
                return 0;
        }
  
 +      /* PCIe Device Page 2 contains read-only information about a
 +       * specific NVMe device; therefore, this page is only
 +       * valid for NVMe devices and skip for pcie devices of type scsi.
 +       */
 +      if (!(mpt3sas_scsih_is_pcie_scsi_device(
 +              le32_to_cpu(pcie_device_pg0.DeviceInfo)))) {
 +              if (mpt3sas_config_get_pcie_device_pg2(ioc, &mpi_reply,
 +                  &pcie_device_pg2, MPI2_SAS_DEVICE_PGAD_FORM_HANDLE,
 +                  handle)) {
 +                      ioc_err(ioc,
 +                          "failure at %s:%d/%s()!\n", __FILE__,
 +                          __LINE__, __func__);
 +                      return 0;
 +              }
 +
 +              ioc_status = le16_to_cpu(mpi_reply.IOCStatus) &
 +                                      MPI2_IOCSTATUS_MASK;
 +              if (ioc_status != MPI2_IOCSTATUS_SUCCESS) {
 +                      ioc_err(ioc,
 +                          "failure at %s:%d/%s()!\n", __FILE__,
 +                          __LINE__, __func__);
 +                      return 0;
 +              }
 +      }
 +
        pcie_device = kzalloc(sizeof(struct _pcie_device), GFP_KERNEL);
        if (!pcie_device) {
                ioc_err(ioc, "failure at %s:%d/%s()!\n",
        pcie_device->id = ioc->pcie_target_id++;
        pcie_device->channel = PCIE_CHANNEL;
        pcie_device->handle = handle;
 +      pcie_device->access_status = pcie_device_pg0.AccessStatus;
        pcie_device->device_info = le32_to_cpu(pcie_device_pg0.DeviceInfo);
        pcie_device->wwid = wwid;
        pcie_device->port_num = pcie_device_pg0.PortNum;
                            le64_to_cpu(enclosure_dev->pg0.EnclosureLogicalID);
        }
        /* TODO -- Add device name once FW supports it */
 -      if (mpt3sas_config_get_pcie_device_pg2(ioc, &mpi_reply,
 -              &pcie_device_pg2, MPI2_SAS_DEVICE_PGAD_FORM_HANDLE, handle)) {
 -              ioc_err(ioc, "failure at %s:%d/%s()!\n",
 -                      __FILE__, __LINE__, __func__);
 -              kfree(pcie_device);
 -              return 0;
 -      }
 -
 -      ioc_status = le16_to_cpu(mpi_reply.IOCStatus) & MPI2_IOCSTATUS_MASK;
 -      if (ioc_status != MPI2_IOCSTATUS_SUCCESS) {
 -              ioc_err(ioc, "failure at %s:%d/%s()!\n",
 -                      __FILE__, __LINE__, __func__);
 -              kfree(pcie_device);
 -              return 0;
 -      }
 -      pcie_device->nvme_mdts =
 -              le32_to_cpu(pcie_device_pg2.MaximumDataTransferSize);
 -      if (pcie_device_pg2.ControllerResetTO)
 -              pcie_device->reset_timeout =
 -                      pcie_device_pg2.ControllerResetTO;
 -      else
 +      if (!(mpt3sas_scsih_is_pcie_scsi_device(
 +          le32_to_cpu(pcie_device_pg0.DeviceInfo)))) {
 +              pcie_device->nvme_mdts =
 +                  le32_to_cpu(pcie_device_pg2.MaximumDataTransferSize);
 +              if (pcie_device_pg2.ControllerResetTO)
 +                      pcie_device->reset_timeout =
 +                          pcie_device_pg2.ControllerResetTO;
 +              else
 +                      pcie_device->reset_timeout = 30;
 +      } else
                pcie_device->reset_timeout = 30;
  
        if (ioc->wait_for_discovery_to_complete)
@@@ -8571,8 -8506,6 +8570,8 @@@ _scsih_mark_responding_pcie_device(stru
                if ((pcie_device->wwid == le64_to_cpu(pcie_device_pg0->WWID))
                    && (pcie_device->slot == le16_to_cpu(
                    pcie_device_pg0->Slot))) {
 +                      pcie_device->access_status =
 +                                      pcie_device_pg0->AccessStatus;
                        pcie_device->responding = 1;
                        starget = pcie_device->starget;
                        if (starget && starget->hostdata) {
@@@ -8660,7 -8593,7 +8659,7 @@@ _scsih_search_responding_pcie_devices(s
                }
                handle = le16_to_cpu(pcie_device_pg0.DevHandle);
                device_info = le32_to_cpu(pcie_device_pg0.DeviceInfo);
 -              if (!(_scsih_is_nvme_device(device_info)))
 +              if (!(_scsih_is_nvme_pciescsi_device(device_info)))
                        continue;
                _scsih_mark_responding_pcie_device(ioc, &pcie_device_pg0);
        }
@@@ -9241,7 -9174,7 +9240,7 @@@ _scsih_scan_for_devices_after_reset(str
                        break;
                }
                handle = le16_to_cpu(pcie_device_pg0.DevHandle);
 -              if (!(_scsih_is_nvme_device(
 +              if (!(_scsih_is_nvme_pciescsi_device(
                        le32_to_cpu(pcie_device_pg0.DeviceInfo))))
                        continue;
                pcie_device = mpt3sas_get_pdev_by_wwid(ioc,
@@@ -9374,10 -9307,7 +9373,10 @@@ _mpt3sas_fw_work(struct MPT3SAS_ADAPTE
                _scsih_sas_topology_change_event(ioc, fw_event);
                break;
        case MPI2_EVENT_SAS_DEVICE_STATUS_CHANGE:
 -              _scsih_sas_device_status_change_event(ioc, fw_event);
 +              if (ioc->logging_level & MPT_DEBUG_EVENT_WORK_TASK)
 +                      _scsih_sas_device_status_change_event_debug(ioc,
 +                          (Mpi2EventDataSasDeviceStatusChange_t *)
 +                          fw_event->event_data);
                break;
        case MPI2_EVENT_SAS_DISCOVERY:
                _scsih_sas_discovery_event(ioc, fw_event);
@@@ -9550,10 -9480,6 +9549,10 @@@ mpt3sas_scsih_event_callback(struct MPT
                break;
        }
        case MPI2_EVENT_SAS_DEVICE_STATUS_CHANGE:
 +              _scsih_sas_device_status_change_event(ioc,
 +                  (Mpi2EventDataSasDeviceStatusChange_t *)
 +                  mpi_reply->EventData);
 +              break;
        case MPI2_EVENT_IR_OPERATION_STATUS:
        case MPI2_EVENT_SAS_DISCOVERY:
        case MPI2_EVENT_SAS_DEVICE_DISCOVERY_ERROR:
@@@ -10112,12 -10038,6 +10111,12 @@@ _scsih_probe_pcie(struct MPT3SAS_ADAPTE
                        pcie_device_put(pcie_device);
                        continue;
                }
 +              if (pcie_device->access_status ==
 +                  MPI26_PCIEDEV0_ASTATUS_DEVICE_BLOCKED) {
 +                      pcie_device_make_active(ioc, pcie_device);
 +                      pcie_device_put(pcie_device);
 +                      continue;
 +              }
                rc = scsi_add_device(ioc->shost, PCIE_CHANNEL,
                        pcie_device->id, 0);
                if (rc) {
@@@ -10532,13 -10452,6 +10531,13 @@@ _scsih_probe(struct pci_dev *pdev, cons
        ioc->tm_sas_control_cb_idx = tm_sas_control_cb_idx;
        ioc->logging_level = logging_level;
        ioc->schedule_dead_ioc_flush_running_cmds = &_scsih_flush_running_cmds;
 +      /*
 +       * Enable MEMORY MOVE support flag.
 +       */
 +      ioc->drv_support_bitmap |= MPT_DRV_SUPPORT_BITMAP_MEMMOVE;
 +
 +      ioc->enable_sdev_max_qd = enable_sdev_max_qd;
 +
        /* misc semaphores and spin locks */
        mutex_init(&ioc->reset_in_progress_mutex);
        /* initializing pci_access_mutex lock */
diff --combined include/linux/memremap.h
index fb2a0bd826b9091f5b04934d7f6f4561e87ec43b,b459518ce4755db0b640d7076784cf49782e55b8..bef51e35d8d24b1ece4a0626359b1d36df97a342
@@@ -109,9 -109,9 +109,8 @@@ struct dev_pagemap 
        struct percpu_ref *ref;
        struct percpu_ref internal_ref;
        struct completion done;
 -      struct device *dev;
        enum memory_type type;
        unsigned int flags;
-       u64 pci_p2pdma_bus_offset;
        const struct dev_pagemap_ops *ops;
  };
  
@@@ -123,8 -123,6 +122,8 @@@ static inline struct vmem_altmap *pgmap
  }
  
  #ifdef CONFIG_ZONE_DEVICE
 +void *memremap_pages(struct dev_pagemap *pgmap, int nid);
 +void memunmap_pages(struct dev_pagemap *pgmap);
  void *devm_memremap_pages(struct device *dev, struct dev_pagemap *pgmap);
  void devm_memunmap_pages(struct device *dev, struct dev_pagemap *pgmap);
  struct dev_pagemap *get_dev_pagemap(unsigned long pfn,
diff --combined include/linux/pci.h
index 82e4cd1b7ac3cb50346492a27163da53bb206e2c,deecf3cc17b13aca085b67f1e214a9045e9010fd..f9088c89a534737049463cc024e40db803422cb5
@@@ -6,12 -6,18 +6,18 @@@
   *    Copyright 1994, Drew Eckhardt
   *    Copyright 1997--1999 Martin Mares <mj@ucw.cz>
   *
+  *    PCI Express ASPM defines and function prototypes
+  *    Copyright (c) 2007 Intel Corp.
+  *            Zhang Yanmin (yanmin.zhang@intel.com)
+  *            Shaohua Li (shaohua.li@intel.com)
+  *
   *    For more information, please consult the following manuals (look at
   *    http://www.pcisig.com/ for how to get them):
   *
   *    PCI BIOS Specification
   *    PCI Local Bus Specification
   *    PCI to PCI Bridge Specification
+  *    PCI Express Specification
   *    PCI System Design Guide
   */
  #ifndef LINUX_PCI_H
@@@ -145,11 -151,6 +151,6 @@@ static inline const char *pci_power_nam
        return pci_power_names[1 + (__force int) state];
  }
  
- #define PCI_PM_D2_DELAY               200
- #define PCI_PM_D3_WAIT                10
- #define PCI_PM_D3COLD_WAIT    100
- #define PCI_PM_BUS_WAIT               50
  /**
   * typedef pci_channel_state_t
   *
@@@ -418,7 -419,6 +419,6 @@@ struct pci_dev 
        unsigned int    broken_intx_masking:1;  /* INTx masking can't be used */
        unsigned int    io_window_1k:1;         /* Intel bridge 1K I/O windows */
        unsigned int    irq_managed:1;
-       unsigned int    has_secondary_link:1;
        unsigned int    non_compliant_bars:1;   /* Broken BARs; ignore them */
        unsigned int    is_probed:1;            /* Device probing in progress */
        unsigned int    link_active_reporting:1;/* Device capable of reporting link active */
@@@ -649,9 -649,6 +649,6 @@@ static inline struct pci_dev *pci_upstr
        return dev->bus->self;
  }
  
- struct device *pci_get_host_bridge_device(struct pci_dev *dev);
- void pci_put_host_bridge_device(struct device *dev);
  #ifdef CONFIG_PCI_MSI
  static inline bool pci_dev_msi_enabled(struct pci_dev *pci_dev)
  {
@@@ -925,6 -922,11 +922,11 @@@ enum 
        PCI_SCAN_ALL_PCIE_DEVS  = 0x00000040,   /* Scan all, not just dev 0 */
  };
  
+ #define PCI_IRQ_LEGACY                (1 << 0) /* Allow legacy interrupts */
+ #define PCI_IRQ_MSI           (1 << 1) /* Allow MSI interrupts */
+ #define PCI_IRQ_MSIX          (1 << 2) /* Allow MSI-X interrupts */
+ #define PCI_IRQ_AFFINITY      (1 << 3) /* Auto-assign affinity */
  /* These external functions are only available when PCI support is enabled */
  #ifdef CONFIG_PCI
  
@@@ -969,7 -971,7 +971,7 @@@ resource_size_t pcibios_align_resource(
                                resource_size_t,
                                resource_size_t);
  
- /* Weak but can be overriden by arch */
+ /* Weak but can be overridden by arch */
  void pci_fixup_cardbus(struct pci_bus *);
  
  /* Generic PCI functions used internally */
@@@ -995,7 -997,6 +997,6 @@@ struct pci_bus *pci_scan_root_bus(struc
  int pci_scan_root_bus_bridge(struct pci_host_bridge *bridge);
  struct pci_bus *pci_add_new_bus(struct pci_bus *parent, struct pci_dev *dev,
                                int busnr);
- void pcie_update_link_speed(struct pci_bus *bus, u16 link_status);
  struct pci_slot *pci_create_slot(struct pci_bus *parent, int slot_nr,
                                 const char *name,
                                 struct hotplug_slot *hotplug);
@@@ -1241,19 -1242,12 +1242,12 @@@ int pci_wake_from_d3(struct pci_dev *de
  int pci_prepare_to_sleep(struct pci_dev *dev);
  int pci_back_from_sleep(struct pci_dev *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);
  bool pcie_relaxed_ordering_enabled(struct pci_dev *dev);
  void pci_wakeup_bus(struct pci_bus *bus);
  void pci_bus_set_current_state(struct pci_bus *bus, pci_power_t state);
  
- /* PCI Virtual Channel */
- int pci_save_vc_state(struct pci_dev *dev);
- void pci_restore_vc_state(struct pci_dev *dev);
- void pci_allocate_vc_save_buffers(struct pci_dev *dev);
  /* For use by arch with custom probe code */
  void set_pcie_port_type(struct pci_dev *pdev);
  void set_pcie_hotplug_bridge(struct pci_dev *pdev);
@@@ -1297,8 -1291,6 +1291,6 @@@ int pci_request_selected_regions_exclus
  void pci_release_selected_regions(struct pci_dev *, int);
  
  /* drivers/pci/bus.c */
- struct pci_bus *pci_bus_get(struct pci_bus *bus);
- void pci_bus_put(struct pci_bus *bus);
  void pci_add_resource(struct list_head *resources, struct resource *res);
  void pci_add_resource_offset(struct list_head *resources, struct resource *res,
                             resource_size_t offset);
@@@ -1408,11 -1400,6 +1400,6 @@@ resource_size_t pcibios_window_alignmen
  int pci_set_vga_state(struct pci_dev *pdev, bool decode,
                      unsigned int command_bits, u32 flags);
  
- #define PCI_IRQ_LEGACY                (1 << 0) /* Allow legacy interrupts */
- #define PCI_IRQ_MSI           (1 << 1) /* Allow MSI interrupts */
- #define PCI_IRQ_MSIX          (1 << 2) /* Allow MSI-X interrupts */
- #define PCI_IRQ_AFFINITY      (1 << 3) /* Auto-assign affinity */
  /*
   * Virtual interrupts allow for more interrupts to be allocated
   * than the device has interrupts for. These are not programmed
@@@ -1517,14 -1504,6 +1504,6 @@@ static inline int pci_irq_get_node(stru
  }
  #endif
  
- static inline int
- pci_alloc_irq_vectors(struct pci_dev *dev, unsigned int min_vecs,
-                     unsigned int max_vecs, unsigned int flags)
- {
-       return pci_alloc_irq_vectors_affinity(dev, min_vecs, max_vecs, flags,
-                                             NULL);
- }
  /**
   * pci_irqd_intx_xlate() - Translate PCI INTx value to an IRQ domain hwirq
   * @d: the INTx IRQ domain
@@@ -1565,12 -1544,22 +1544,24 @@@ extern bool pcie_ports_native
  #define pcie_ports_native     false
  #endif
  
+ #define PCIE_LINK_STATE_L0S   1
+ #define PCIE_LINK_STATE_L1    2
+ #define PCIE_LINK_STATE_CLKPM 4
  #ifdef CONFIG_PCIEASPM
+ int pci_disable_link_state(struct pci_dev *pdev, int state);
+ int pci_disable_link_state_locked(struct pci_dev *pdev, int state);
+ void pcie_no_aspm(void);
  bool pcie_aspm_support_enabled(void);
 +bool pcie_aspm_enabled(struct pci_dev *pdev);
  #else
+ static inline int pci_disable_link_state(struct pci_dev *pdev, int state)
+ { return 0; }
+ static inline int pci_disable_link_state_locked(struct pci_dev *pdev, int state)
+ { return 0; }
+ static inline void pcie_no_aspm(void) { }
  static inline bool pcie_aspm_support_enabled(void) { return false; }
 +static inline bool pcie_aspm_enabled(struct pci_dev *pdev) { return false; }
  #endif
  
  #ifdef CONFIG_PCIEAER
@@@ -1579,23 -1568,8 +1570,8 @@@ bool pci_aer_available(void)
  static inline bool pci_aer_available(void) { return false; }
  #endif
  
- #ifdef CONFIG_PCIE_ECRC
- void pcie_set_ecrc_checking(struct pci_dev *dev);
- void pcie_ecrc_get_policy(char *str);
- #else
- static inline void pcie_set_ecrc_checking(struct pci_dev *dev) { }
- static inline void pcie_ecrc_get_policy(char *str) { }
- #endif
  bool pci_ats_disabled(void);
  
- #ifdef CONFIG_PCIE_PTM
- int pci_enable_ptm(struct pci_dev *dev, u8 *granularity);
- #else
- static inline int pci_enable_ptm(struct pci_dev *dev, u8 *granularity)
- { return -EINVAL; }
- #endif
  void pci_cfg_access_lock(struct pci_dev *dev);
  bool pci_cfg_access_trylock(struct pci_dev *dev);
  void pci_cfg_access_unlock(struct pci_dev *dev);
@@@ -1749,11 -1723,6 +1725,6 @@@ static inline void pci_release_regions(
  
  static inline unsigned long pci_address_to_pio(phys_addr_t addr) { return -1; }
  
- static inline void pci_block_cfg_access(struct pci_dev *dev) { }
- static inline int pci_block_cfg_access_in_atomic(struct pci_dev *dev)
- { return 0; }
- static inline void pci_unblock_cfg_access(struct pci_dev *dev) { }
  static inline struct pci_bus *pci_find_next_bus(const struct pci_bus *from)
  { return NULL; }
  static inline struct pci_dev *pci_get_slot(struct pci_bus *bus,
@@@ -1782,17 -1751,36 +1753,36 @@@ static inline const struct pci_device_i
                                                         struct pci_dev *dev)
  { return NULL; }
  static inline bool pci_ats_disabled(void) { return true; }
+ static inline int pci_irq_vector(struct pci_dev *dev, unsigned int nr)
+ {
+       return -EINVAL;
+ }
+ static inline int
+ pci_alloc_irq_vectors_affinity(struct pci_dev *dev, unsigned int min_vecs,
+                              unsigned int max_vecs, unsigned int flags,
+                              struct irq_affinity *aff_desc)
+ {
+       return -ENOSPC;
+ }
  #endif /* CONFIG_PCI */
  
+ static inline int
+ pci_alloc_irq_vectors(struct pci_dev *dev, unsigned int min_vecs,
+                     unsigned int max_vecs, unsigned int flags)
+ {
+       return pci_alloc_irq_vectors_affinity(dev, min_vecs, max_vecs, flags,
+                                             NULL);
+ }
  #ifdef CONFIG_PCI_ATS
  /* Address Translation Service */
- void pci_ats_init(struct pci_dev *dev);
  int pci_enable_ats(struct pci_dev *dev, int ps);
  void pci_disable_ats(struct pci_dev *dev);
  int pci_ats_queue_depth(struct pci_dev *dev);
  int pci_ats_page_aligned(struct pci_dev *dev);
  #else
- static inline void pci_ats_init(struct pci_dev *d) { }
  static inline int pci_enable_ats(struct pci_dev *d, int ps) { return -ENODEV; }
  static inline void pci_disable_ats(struct pci_dev *d) { }
  static inline int pci_ats_queue_depth(struct pci_dev *d) { return -ENODEV; }
@@@ -1803,7 -1791,7 +1793,7 @@@ static inline int pci_ats_page_aligned(
  
  #include <asm/pci.h>
  
- /* These two functions provide almost identical functionality. Depennding
+ /* These two functions provide almost identical functionality. Depending
   * on the architecture, one will be implemented as a wrapper around the
   * other (in drivers/pci/mmap.c).
   *
@@@ -1872,25 -1860,9 +1862,9 @@@ static inline const char *pci_name(cons
        return dev_name(&pdev->dev);
  }
  
- /*
-  * Some archs don't want to expose struct resource to userland as-is
-  * in sysfs and /proc
-  */
- #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)
- {
-       *start = rsrc->start;
-       *end = rsrc->end;
- }
- #endif /* HAVE_ARCH_PCI_RESOURCE_TO_USER */
  
  /*
   * The world is not perfect and supplies us with broken PCI devices.
@@@ -2032,10 -2004,6 +2006,6 @@@ extern unsigned long pci_cardbus_mem_si
  extern u8 pci_dfl_cache_line_size;
  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);
  void pcibios_set_master(struct pci_dev *dev);
@@@ -2305,10 -2273,6 +2275,6 @@@ int pci_vpd_find_info_keyword(const u8 
  #ifdef CONFIG_OF
  struct device_node;
  struct irq_domain;
- void pci_set_of_node(struct pci_dev *dev);
- void pci_release_of_node(struct pci_dev *dev);
- void pci_set_bus_of_node(struct pci_bus *bus);
- void pci_release_bus_of_node(struct pci_bus *bus);
  struct irq_domain *pci_host_bridge_of_msi_domain(struct pci_bus *bus);
  int pci_parse_request_of_pci_ranges(struct device *dev,
                                    struct list_head *resources,
  struct device_node *pcibios_get_phb_of_node(struct pci_bus *bus);
  
  #else /* CONFIG_OF */
- static inline void pci_set_of_node(struct pci_dev *dev) { }
- static inline void pci_release_of_node(struct pci_dev *dev) { }
- static inline void pci_set_bus_of_node(struct pci_bus *bus) { }
- static inline void pci_release_bus_of_node(struct pci_bus *bus) { }
  static inline struct irq_domain *
  pci_host_bridge_of_msi_domain(struct pci_bus *bus) { return NULL; }
  static inline int pci_parse_request_of_pci_ranges(struct device *dev,
@@@ -2435,4 -2395,7 +2397,7 @@@ void pci_uevent_ers(struct pci_dev *pde
  #define pci_notice_ratelimited(pdev, fmt, arg...) \
        dev_notice_ratelimited(&(pdev)->dev, fmt, ##arg)
  
+ #define pci_info_ratelimited(pdev, fmt, arg...) \
+       dev_info_ratelimited(&(pdev)->dev, fmt, ##arg)
  #endif /* LINUX_PCI_H */
diff --combined include/linux/pci_ids.h
index de1b75e963ef317e3ad7c8ae65aba4e5684fcb05,f3130542c752a8ed8cdc03a89a0bc5bfaa8c15d9..21a572469a4e640bd7ca0525c88cc562d3825dc4
  #define PCI_DEVICE_ID_AMD_17H_DF_F3   0x1463
  #define PCI_DEVICE_ID_AMD_17H_M10H_DF_F3 0x15eb
  #define PCI_DEVICE_ID_AMD_17H_M30H_DF_F3 0x1493
 +#define PCI_DEVICE_ID_AMD_17H_M70H_DF_F3 0x1443
  #define PCI_DEVICE_ID_AMD_CNB17H_F3   0x1703
  #define PCI_DEVICE_ID_AMD_LANCE               0x2000
  #define PCI_DEVICE_ID_AMD_LANCE_HOME  0x2001
  #define PCI_VENDOR_ID_SGI             0x10a9
  #define PCI_DEVICE_ID_SGI_IOC3                0x0003
  #define PCI_DEVICE_ID_SGI_LITHIUM     0x1002
 -#define PCI_DEVICE_ID_SGI_IOC4                0x100a
  
  #define PCI_VENDOR_ID_WINBOND         0x10ad
  #define PCI_DEVICE_ID_WINBOND_82C105  0x0105
  #define PCI_VENDOR_ID_DIGIGRAM                0x1369
  #define PCI_SUBDEVICE_ID_DIGIGRAM_LX6464ES_SERIAL_SUBSYSTEM   0xc001
  #define PCI_SUBDEVICE_ID_DIGIGRAM_LX6464ES_CAE_SERIAL_SUBSYSTEM       0xc002
 +#define PCI_SUBDEVICE_ID_DIGIGRAM_LX6464ESE_SERIAL_SUBSYSTEM          0xc021
 +#define PCI_SUBDEVICE_ID_DIGIGRAM_LX6464ESE_CAE_SERIAL_SUBSYSTEM      0xc022
  
  #define PCI_VENDOR_ID_KAWASAKI                0x136b
  #define PCI_DEVICE_ID_MCHIP_KL5A72002 0xff01
  #define PCI_VENDOR_ID_MYRICOM         0x14c1
  
  #define PCI_VENDOR_ID_MEDIATEK                0x14c3
+ #define PCI_DEVICE_ID_MEDIATEK_7629   0x7629
  
  #define PCI_VENDOR_ID_TITAN           0x14D2
  #define PCI_DEVICE_ID_TITAN_010L      0x8001
  #define PCI_DEVICE_ID_RDC_R6061               0x6061
  #define PCI_DEVICE_ID_RDC_D1010               0x1010
  
 +#define PCI_VENDOR_ID_GLI             0x17a0
 +
  #define PCI_VENDOR_ID_LENOVO          0x17aa
  
  #define PCI_VENDOR_ID_QCOM            0x17cb
  
  #define PCI_VENDOR_ID_ASMEDIA         0x1b21
  
+ #define PCI_VENDOR_ID_AMAZON_ANNAPURNA_LABS   0x1c36
  #define PCI_VENDOR_ID_CIRCUITCO               0x1cc8
  #define PCI_SUBSYSTEM_ID_CIRCUITCO_MINNOWBOARD        0x0001