]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
Merge branch 'for-linus' of git://git.kernel.dk/linux-block
authorLinus Torvalds <torvalds@linux-foundation.org>
Fri, 28 Jul 2017 19:13:34 +0000 (12:13 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Fri, 28 Jul 2017 19:13:34 +0000 (12:13 -0700)
Pull block fixes from Jens Axboe:
 "A small collection of fixes that should go into this series. This
  contains:

   - NVMe pull request from Christoph, with various fixes for nvme
     proper and nvme-fc.

   - disable runtime PM for blk-mq for now.

     With scsi now defaulting to using blk-mq, this reared its head as
     an issue. Longer term we'll fix up runtime PM for blk-mq, for now
     just disable it to prevent a hang on laptop resume for some folks.

   - blk-mq CPU <-> hw queue map fix from Christoph.

   - xen/blkfront pull request from Konrad, with two small fixes for the
     blkfront driver.

   - a few fixups for nbd from Joseph.

   - a stable fix for pblk from Javier"

* 'for-linus' of git://git.kernel.dk/linux-block:
  lightnvm: pblk: advance bio according to lba index
  nvme: validate admin queue before unquiesce
  nbd: clear disconnected on reconnect
  nvme-pci: fix HMB size calculation
  nvme-fc: revise TRADDR parsing
  nvme-fc: address target disconnect race conditions in fcp io submit
  nvme: fabrics commands should use the fctype field for data direction
  nvme: also provide a UUID in the WWID sysfs attribute
  xen/blkfront: always allocate grants first from per-queue persistent grants
  xen-blkfront: fix mq start/stop race
  blk-mq: map queues to all present CPUs
  block: disable runtime-pm for blk-mq
  xen-blkfront: Fix handling of non-supported operations
  nbd: only set sndtimeo if we have a timeout set
  nbd: take tx_lock before disconnecting
  nbd: allow multiple disconnects to be sent

214 files changed:
Documentation/devicetree/bindings/mmc/exynos-dw-mshc.txt
Documentation/devicetree/bindings/mmc/img-dw-mshc.txt
Documentation/devicetree/bindings/mmc/k3-dw-mshc.txt
Documentation/devicetree/bindings/mmc/synopsys-dw-mshc.txt
Documentation/devicetree/bindings/mmc/zx-dw-mshc.txt
Documentation/devicetree/bindings/nvmem/rockchip-efuse.txt
Documentation/devicetree/bindings/serial/fsl-imx-uart.txt
MAINTAINERS
Makefile
arch/alpha/include/uapi/asm/ioctls.h
arch/arc/mm/dma.c
arch/arm/include/asm/kexec.h
arch/arm/include/asm/ucontext.h
arch/arm/kernel/machine_kexec.c
arch/arm/kernel/setup.c
arch/arm/kernel/signal.c
arch/arm/mach-omap2/hsmmc.c
arch/arm/mach-omap2/hsmmc.h
arch/arm/mm/dma-mapping-nommu.c
arch/arm/mm/dma-mapping.c
arch/arm64/mm/dma-mapping.c
arch/mips/include/uapi/asm/ioctls.h
arch/mips/mm/dma-default.c
arch/parisc/configs/712_defconfig
arch/parisc/configs/a500_defconfig
arch/parisc/configs/b180_defconfig
arch/parisc/configs/c3000_defconfig
arch/parisc/configs/c8000_defconfig
arch/parisc/configs/default_defconfig
arch/parisc/configs/generic-32bit_defconfig
arch/parisc/configs/generic-64bit_defconfig
arch/parisc/include/asm/pdcpat.h
arch/parisc/include/uapi/asm/ioctls.h
arch/parisc/kernel/cache.c
arch/parisc/kernel/firmware.c
arch/parisc/kernel/irq.c
arch/parisc/kernel/pdt.c
arch/parisc/kernel/process.c
arch/parisc/kernel/vmlinux.lds.S
arch/powerpc/include/uapi/asm/ioctls.h
arch/s390/kernel/perf_cpum_sf.c
arch/s390/mm/pgtable.c
arch/sh/include/uapi/asm/ioctls.h
arch/sparc/include/uapi/asm/ioctls.h
arch/x86/xen/smp_pv.c
arch/x86/xen/time.c
arch/xtensa/include/uapi/asm/ioctls.h
drivers/acpi/ec.c
drivers/acpi/internal.h
drivers/acpi/numa.c
drivers/acpi/sleep.c
drivers/android/binder.c
drivers/base/dma-coherent.c
drivers/base/dma-mapping.c
drivers/block/virtio_blk.c
drivers/fsi/fsi-core.c
drivers/gpu/drm/amd/amdgpu/amdgpu_bo_list.c
drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c
drivers/gpu/drm/amd/powerplay/hwmgr/vega10_hwmgr.c
drivers/gpu/drm/drm_dp_helper.c
drivers/gpu/drm/exynos/Kconfig
drivers/gpu/drm/exynos/exynos_drm_drv.c
drivers/gpu/drm/exynos/exynos_drm_dsi.c
drivers/gpu/drm/exynos/exynos_drm_mic.c
drivers/gpu/drm/exynos/exynos_hdmi.c
drivers/gpu/drm/exynos/exynos_mixer.c
drivers/gpu/drm/i915/gvt/display.c
drivers/gpu/drm/i915/i915_gem_clflush.c
drivers/gpu/drm/i915/i915_gem_clflush.h
drivers/gpu/drm/i915/i915_gem_execbuffer.c
drivers/gpu/drm/i915/i915_vma.h
drivers/gpu/drm/i915/intel_ddi.c
drivers/gpu/drm/i915/intel_display.c
drivers/gpu/drm/i915/intel_gvt.c
drivers/gpu/drm/i915/intel_pm.c
drivers/gpu/drm/i915/selftests/mock_gem_device.c
drivers/gpu/drm/nouveau/nouveau_connector.c
drivers/gpu/drm/nouveau/nouveau_display.c
drivers/gpu/drm/nouveau/nv50_display.c
drivers/gpu/drm/nouveau/nvkm/engine/disp/ior.h
drivers/gpu/drm/nouveau/nvkm/engine/disp/nv50.h
drivers/gpu/drm/nouveau/nvkm/engine/disp/outp.c
drivers/gpu/drm/nouveau/nvkm/subdev/bar/gf100.c
drivers/gpu/drm/nouveau/nvkm/subdev/i2c/Kbuild
drivers/gpu/drm/nouveau/nvkm/subdev/i2c/aux.c
drivers/gpu/drm/nouveau/nvkm/subdev/i2c/aux.h
drivers/gpu/drm/nouveau/nvkm/subdev/i2c/auxg94.c
drivers/gpu/drm/nouveau/nvkm/subdev/i2c/auxgf119.c [new file with mode: 0644]
drivers/gpu/drm/nouveau/nvkm/subdev/i2c/auxgm200.c
drivers/gpu/drm/nouveau/nvkm/subdev/i2c/padgf119.c
drivers/gpu/drm/rockchip/Kconfig
drivers/gpu/drm/vmwgfx/vmwgfx_buffer.c
drivers/gpu/drm/vmwgfx/vmwgfx_cmdbuf.c
drivers/gpu/drm/vmwgfx/vmwgfx_cmdbuf_res.c
drivers/gpu/drm/vmwgfx/vmwgfx_context.c
drivers/gpu/drm/vmwgfx/vmwgfx_cotable.c
drivers/gpu/drm/vmwgfx/vmwgfx_drv.c
drivers/gpu/drm/vmwgfx/vmwgfx_execbuf.c
drivers/gpu/drm/vmwgfx/vmwgfx_fence.c
drivers/gpu/drm/vmwgfx/vmwgfx_gmrid_manager.c
drivers/gpu/drm/vmwgfx/vmwgfx_kms.c
drivers/gpu/drm/vmwgfx/vmwgfx_mob.c
drivers/gpu/drm/vmwgfx/vmwgfx_msg.c
drivers/gpu/drm/vmwgfx/vmwgfx_resource.c
drivers/gpu/drm/vmwgfx/vmwgfx_shader.c
drivers/gpu/drm/vmwgfx/vmwgfx_stdu.c
drivers/gpu/host1x/dev.c
drivers/hid/hid-core.c
drivers/hid/hid-ids.h
drivers/hid/hid-ortek.c
drivers/hid/usbhid/hid-core.c
drivers/hv/channel.c
drivers/hwmon/applesmc.c
drivers/mmc/host/dw_mmc.c
drivers/mmc/host/omap_hsmmc.c
drivers/mmc/host/sunxi-mmc.c
drivers/mux/Kconfig
drivers/mux/mux-core.c
drivers/net/virtio_net.c
drivers/nvmem/rockchip-efuse.c
drivers/parisc/pdc_stable.c
drivers/s390/cio/chp.c
drivers/scsi/hpsa.c
drivers/scsi/sg.c
drivers/scsi/smartpqi/smartpqi.h
drivers/spmi/spmi-pmic-arb.c
drivers/spmi/spmi.c
drivers/staging/Kconfig
drivers/staging/Makefile
drivers/staging/comedi/drivers/ni_mio_common.c
drivers/staging/lustre/lnet/klnds/o2iblnd/o2iblnd_cb.c
drivers/staging/rtl8188eu/core/rtw_cmd.c
drivers/staging/rtl8188eu/os_dep/usb_intf.c
drivers/staging/sm750fb/ddk750_chip.c
drivers/staging/sm750fb/sm750.c
drivers/staging/speakup/main.c
drivers/staging/speakup/spk_priv.h
drivers/staging/speakup/spk_ttyio.c
drivers/staging/vboxvideo/Kconfig [new file with mode: 0644]
drivers/staging/vboxvideo/Makefile [new file with mode: 0644]
drivers/staging/vboxvideo/TODO [new file with mode: 0644]
drivers/staging/vboxvideo/hgsmi_base.c [new file with mode: 0644]
drivers/staging/vboxvideo/hgsmi_ch_setup.h [new file with mode: 0644]
drivers/staging/vboxvideo/hgsmi_channels.h [new file with mode: 0644]
drivers/staging/vboxvideo/hgsmi_defs.h [new file with mode: 0644]
drivers/staging/vboxvideo/modesetting.c [new file with mode: 0644]
drivers/staging/vboxvideo/vbox_drv.c [new file with mode: 0644]
drivers/staging/vboxvideo/vbox_drv.h [new file with mode: 0644]
drivers/staging/vboxvideo/vbox_err.h [new file with mode: 0644]
drivers/staging/vboxvideo/vbox_fb.c [new file with mode: 0644]
drivers/staging/vboxvideo/vbox_hgsmi.c [new file with mode: 0644]
drivers/staging/vboxvideo/vbox_irq.c [new file with mode: 0644]
drivers/staging/vboxvideo/vbox_main.c [new file with mode: 0644]
drivers/staging/vboxvideo/vbox_mode.c [new file with mode: 0644]
drivers/staging/vboxvideo/vbox_prime.c [new file with mode: 0644]
drivers/staging/vboxvideo/vbox_ttm.c [new file with mode: 0644]
drivers/staging/vboxvideo/vboxvideo.h [new file with mode: 0644]
drivers/staging/vboxvideo/vboxvideo_guest.h [new file with mode: 0644]
drivers/staging/vboxvideo/vboxvideo_vbe.h [new file with mode: 0644]
drivers/staging/vboxvideo/vbva_base.c [new file with mode: 0644]
drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c
drivers/thunderbolt/switch.c
drivers/thunderbolt/tb.h
drivers/thunderbolt/tb_msgs.h
drivers/tty/pty.c
drivers/tty/serial/fsl_lpuart.c
drivers/tty/serial/imx.c
drivers/tty/serial/sh-sci.c
drivers/tty/serial/st-asc.c
drivers/usb/class/cdc-acm.c
drivers/usb/dwc2/gadget.c
drivers/usb/dwc3/core.c
drivers/usb/dwc3/dwc3-omap.c
drivers/usb/dwc3/gadget.c
drivers/usb/gadget/function/f_mass_storage.c
drivers/usb/gadget/function/f_uac1.c
drivers/usb/gadget/function/f_uac2.c
drivers/usb/gadget/udc/Kconfig
drivers/usb/gadget/udc/renesas_usb3.c
drivers/usb/gadget/udc/snps_udc_plat.c
drivers/usb/host/pci-quirks.c
drivers/usb/host/pci-quirks.h
drivers/usb/host/xhci-hub.c
drivers/usb/host/xhci-pci.c
drivers/usb/host/xhci-ring.c
drivers/usb/host/xhci.c
drivers/usb/host/xhci.h
drivers/usb/renesas_usbhs/common.c
drivers/usb/renesas_usbhs/mod_gadget.c
drivers/usb/storage/isd200.c
drivers/usb/typec/ucsi/ucsi.h
drivers/virtio/virtio_balloon.c
drivers/w1/masters/omap_hdq.c
drivers/w1/w1.c
drivers/xen/balloon.c
drivers/xen/grant-table.c
drivers/xen/xen-balloon.c
fs/jfs/acl.c
fs/jfs/resize.c
fs/jfs/super.c
include/acpi/acpi_numa.h
include/linux/dma-mapping.h
include/linux/platform_data/hsmmc-omap.h
include/linux/usb/audio-v2.h
include/linux/uuid.h
include/uapi/asm-generic/ioctls.h
include/uapi/linux/usb/audio.h
include/xen/balloon.h
lib/test_uuid.c
scripts/parse-maintainers.pl [new file with mode: 0644]
sound/pci/fm801.c
sound/pci/hda/patch_conexant.c
sound/pci/hda/patch_hdmi.c
sound/pci/hda/patch_realtek.c

index aad98442788bc386366b019a6166e6145b2f0017..a58c173b7ab9882091fe26e378ce655610f17455 100644 (file)
@@ -78,7 +78,6 @@ Example:
        };
 
        dwmmc0@12200000 {
-               num-slots = <1>;
                cap-mmc-highspeed;
                cap-sd-highspeed;
                broken-cd;
index 85de99fcaa2fa14c146f768431978b089c674d54..c54e577eea0703c498d5fb397bd1d509f03faaa4 100644 (file)
@@ -24,6 +24,5 @@ Example:
 
                fifo-depth = <0x20>;
                bus-width = <4>;
-               num-slots = <1>;
                disable-wp;
        };
index 8af1afcb86dcf8c375aec37e99103ad73ddf2551..07242d1417735c56576bc59742284957259a4660 100644 (file)
@@ -36,7 +36,6 @@ Example:
 
        /* Board portion */
        dwmmc0@fcd03000 {
-               num-slots = <1>;
                vmmc-supply = <&ldo12>;
                fifo-depth = <0x100>;
                pinctrl-names = "default";
@@ -52,7 +51,6 @@ Example:
 
        dwmmc_1: dwmmc1@f723e000 {
                compatible = "hisilicon,hi6220-dw-mshc";
-               num-slots = <0x1>;
                bus-width = <0x4>;
                disable-wp;
                cap-sd-highspeed;
index 9cb55ca5746135a104d9e6d4722b87d888be63af..ef3e5f14067a17b91abf9715e98d56ad4bb220dd 100644 (file)
@@ -12,12 +12,12 @@ Required Properties:
 * #address-cells: should be 1.
 * #size-cells: should be 0.
 
-# Slots: The slot specific information are contained within child-nodes with
-  each child-node representing a supported slot. There should be atleast one
-  child node representing a card slot. The name of the child node representing
-  the slot is recommended to be slot@n where n is the unique number of the slot
-  connected to the controller. The following are optional properties which
-  can be included in the slot child node.
+# Slots (DEPRECATED): The slot specific information are contained within
+  child-nodes with each child-node representing a supported slot. There should
+  be atleast one child node representing a card slot. The name of the child node
+  representing the slot is recommended to be slot@n where n is the unique number
+  of the slot connected to the controller. The following are optional properties
+  which can be included in the slot child node.
 
        * reg: specifies the physical slot number. The valid values of this
          property is 0 to (num-slots -1), where num-slots is the value
@@ -63,7 +63,7 @@ Optional properties:
   clock(cclk_out). If it's not specified, max is 200MHZ and min is 400KHz by default.
          (Use the "max-frequency" instead of "clock-freq-min-max".)
 
-* num-slots: specifies the number of slots supported by the controller.
+* num-slots (DEPRECATED): specifies the number of slots supported by the controller.
   The number of physical slots actually used could be equal or less than the
   value specified by num-slots. If this property is not specified, the value
   of num-slot property is assumed to be 1.
@@ -124,7 +124,6 @@ board specific portions as listed below.
        dwmmc0@12200000 {
                clock-frequency = <400000000>;
                clock-freq-min-max = <400000 200000000>;
-               num-slots = <1>;
                broken-cd;
                fifo-depth = <0x80>;
                card-detect-delay = <200>;
@@ -139,7 +138,6 @@ board specific portions as listed below.
        dwmmc0@12200000 {
                clock-frequency = <400000000>;
                clock-freq-min-max = <400000 200000000>;
-               num-slots = <1>;
                broken-cd;
                fifo-depth = <0x80>;
                card-detect-delay = <200>;
index eaade0e5adeb09e8d1c2e25763cf90d7bb3c06c7..906819a90c2bb6232f82f1549ea563c58132aec4 100644 (file)
@@ -25,7 +25,6 @@ Example:
                clock-frequency = <50000000>;
                clocks = <&topcrm SD0_AHB>, <&topcrm SD0_WCLK>;
                clock-names = "biu", "ciu";
-               num-slots = <1>;
                max-frequency = <50000000>;
                cap-sdio-irq;
                cap-sd-highspeed;
index 194926f77194c4d3fea8e73942bd1f20ae361815..1ff02afdc55a8afab456daa3b17dce7c2a97263c 100644 (file)
@@ -4,7 +4,7 @@ Required properties:
 - compatible: Should be one of the following.
   - "rockchip,rk3066a-efuse" - for RK3066a SoCs.
   - "rockchip,rk3188-efuse" - for RK3188 SoCs.
-  - "rockchip,rk322x-efuse" - for RK322x SoCs.
+  - "rockchip,rk3228-efuse" - for RK3228 SoCs.
   - "rockchip,rk3288-efuse" - for RK3288 SoCs.
   - "rockchip,rk3399-efuse" - for RK3399 SoCs.
 - reg: Should contain the registers location and exact eFuse size
index e6b572409cf50a3aeb6f2899c961c8d0f248fefa..574c3a2c77d5cd28570e1272488703f0852ec2eb 100644 (file)
@@ -9,7 +9,6 @@ Optional properties:
 - fsl,irda-mode : Indicate the uart supports irda mode
 - fsl,dte-mode : Indicate the uart works in DTE mode. The uart works
                   in DCE mode by default.
-- fsl,dma-size : Indicate the size of the DMA buffer and its periods
 
 Please check Documentation/devicetree/bindings/serial/serial.txt
 for the complete list of generic properties.
@@ -29,5 +28,4 @@ uart1: serial@73fbc000 {
        interrupts = <31>;
        uart-has-rtscts;
        fsl,dte-mode;
-       fsl,dma-size = <1024 4>;
 };
index 2bc366472169788ae51f0314b4283a6f1fec454c..f66488dfdbc9cc59fc744ce9f8349b9b69bd945c 100644 (file)
@@ -205,7 +205,6 @@ F:  include/net/9p/
 F:     include/uapi/linux/virtio_9p.h
 F:     include/trace/events/9p.h
 
-
 A8293 MEDIA DRIVER
 M:     Antti Palosaari <crope@iki.fi>
 L:     linux-media@vger.kernel.org
@@ -808,6 +807,12 @@ W: http://blackfin.uclinux.org/
 S:     Supported
 F:     sound/soc/blackfin/*
 
+ANALOG DEVICES INC DMA DRIVERS
+M:     Lars-Peter Clausen <lars@metafoo.de>
+W:     http://ez.analog.com/community/linux-device-drivers
+S:     Supported
+F:     drivers/dma/dma-axi-dmac.c
+
 ANALOG DEVICES INC IIO DRIVERS
 M:     Lars-Peter Clausen <lars@metafoo.de>
 M:     Michael Hennerich <Michael.Hennerich@analog.com>
@@ -820,12 +825,6 @@ X: drivers/iio/*/adjd*
 F:     drivers/staging/iio/*/ad*
 F:     drivers/staging/iio/trigger/iio-trig-bfin-timer.c
 
-ANALOG DEVICES INC DMA DRIVERS
-M:     Lars-Peter Clausen <lars@metafoo.de>
-W:     http://ez.analog.com/community/linux-device-drivers
-S:     Supported
-F:     drivers/dma/dma-axi-dmac.c
-
 ANDROID CONFIG FRAGMENTS
 M:     Rob Herring <robh@kernel.org>
 S:     Supported
@@ -904,6 +903,18 @@ M: Duc Dang <dhdang@apm.com>
 S:     Supported
 F:     arch/arm64/boot/dts/apm/
 
+APPLIED MICRO (APM) X-GENE SOC EDAC
+M:     Loc Ho <lho@apm.com>
+S:     Supported
+F:     drivers/edac/xgene_edac.c
+F:     Documentation/devicetree/bindings/edac/apm-xgene-edac.txt
+
+APPLIED MICRO (APM) X-GENE SOC ETHERNET (V2) DRIVER
+M:     Iyappan Subramanian <isubramanian@apm.com>
+M:     Keyur Chudgar <kchudgar@apm.com>
+S:     Supported
+F:     drivers/net/ethernet/apm/xgene-v2/
+
 APPLIED MICRO (APM) X-GENE SOC ETHERNET DRIVER
 M:     Iyappan Subramanian <isubramanian@apm.com>
 M:     Keyur Chudgar <kchudgar@apm.com>
@@ -914,12 +925,6 @@ F: drivers/net/phy/mdio-xgene.c
 F:     Documentation/devicetree/bindings/net/apm-xgene-enet.txt
 F:     Documentation/devicetree/bindings/net/apm-xgene-mdio.txt
 
-APPLIED MICRO (APM) X-GENE SOC ETHERNET (V2) DRIVER
-M:     Iyappan Subramanian <isubramanian@apm.com>
-M:     Keyur Chudgar <kchudgar@apm.com>
-S:     Supported
-F:     drivers/net/ethernet/apm/xgene-v2/
-
 APPLIED MICRO (APM) X-GENE SOC PMU
 M:     Tai Nguyen <ttnguyen@apm.com>
 S:     Supported
@@ -1004,18 +1009,17 @@ S:      Maintained
 T:     git git://git.armlinux.org.uk/~rmk/linux-arm.git
 F:     arch/arm/
 
-ARM SUB-ARCHITECTURES
-L:     linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
-S:     Maintained
-F:     arch/arm/mach-*/
-F:     arch/arm/plat-*/
-T:     git git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc.git
-
 ARM PRIMECELL AACI PL041 DRIVER
 M:     Russell King <linux@armlinux.org.uk>
 S:     Maintained
 F:     sound/arm/aaci.*
 
+ARM PRIMECELL BUS SUPPORT
+M:     Russell King <linux@armlinux.org.uk>
+S:     Maintained
+F:     drivers/amba/
+F:     include/linux/amba/bus.h
+
 ARM PRIMECELL CLCD PL110 DRIVER
 M:     Russell King <linux@armlinux.org.uk>
 S:     Maintained
@@ -1039,11 +1043,22 @@ S:      Maintained
 F:     drivers/tty/serial/amba-pl01*.c
 F:     include/linux/amba/serial.h
 
-ARM PRIMECELL BUS SUPPORT
-M:     Russell King <linux@armlinux.org.uk>
+ARM SMMU DRIVERS
+M:     Will Deacon <will.deacon@arm.com>
+R:     Robin Murphy <robin.murphy@arm.com>
+L:     linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
 S:     Maintained
-F:     drivers/amba/
-F:     include/linux/amba/bus.h
+F:     drivers/iommu/arm-smmu.c
+F:     drivers/iommu/arm-smmu-v3.c
+F:     drivers/iommu/io-pgtable-arm.c
+F:     drivers/iommu/io-pgtable-arm-v7s.c
+
+ARM SUB-ARCHITECTURES
+L:     linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
+S:     Maintained
+F:     arch/arm/mach-*/
+F:     arch/arm/plat-*/
+T:     git git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc.git
 
 ARM/ACTIONS SEMI ARCHITECTURE
 M:     Andreas Färber <afaerber@suse.de>
@@ -1076,6 +1091,11 @@ M:       Lennert Buytenhek <kernel@wantstofly.org>
 L:     linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
 S:     Maintained
 
+ARM/Allwinner SoC Clock Support
+M:     Emilio López <emilio@elopez.com.ar>
+S:     Maintained
+F:     drivers/clk/sunxi/
+
 ARM/Allwinner sunXi SoC support
 M:     Maxime Ripard <maxime.ripard@free-electrons.com>
 M:     Chen-Yu Tsai <wens@csie.org>
@@ -1090,10 +1110,15 @@ F:      drivers/pinctrl/sunxi/
 F:     drivers/soc/sunxi/
 T:     git git://git.kernel.org/pub/scm/linux/kernel/git/sunxi/linux.git
 
-ARM/Allwinner SoC Clock Support
-M:     Emilio López <emilio@elopez.com.ar>
+ARM/Amlogic Meson SoC CLOCK FRAMEWORK
+M:     Neil Armstrong <narmstrong@baylibre.com>
+M:     Jerome Brunet <jbrunet@baylibre.com>
+L:     linux-amlogic@lists.infradead.org
 S:     Maintained
-F:     drivers/clk/sunxi/
+F:     drivers/clk/meson/
+F:     include/dt-bindings/clock/meson*
+F:     include/dt-bindings/clock/gxbb*
+F:     Documentation/devicetree/bindings/clock/amlogic*
 
 ARM/Amlogic Meson SoC support
 M:     Carlo Caione <carlo@caione.org>
@@ -1105,20 +1130,10 @@ S:      Maintained
 F:     arch/arm/mach-meson/
 F:     arch/arm/boot/dts/meson*
 F:     arch/arm64/boot/dts/amlogic/
-F:     drivers/pinctrl/meson/
+F:     drivers/pinctrl/meson/
 F:     drivers/mmc/host/meson*
 N:     meson
 
-ARM/Amlogic Meson SoC CLOCK FRAMEWORK
-M:     Neil Armstrong <narmstrong@baylibre.com>
-M:     Jerome Brunet <jbrunet@baylibre.com>
-L:     linux-amlogic@lists.infradead.org
-S:     Maintained
-F:     drivers/clk/meson/
-F:     include/dt-bindings/clock/meson*
-F:     include/dt-bindings/clock/gxbb*
-F:     Documentation/devicetree/bindings/clock/amlogic*
-
 ARM/Annapurna Labs ALPINE ARCHITECTURE
 M:     Tsahee Zidenberg <tsahee@annapurnalabs.com>
 M:     Antoine Tenart <antoine.tenart@free-electrons.com>
@@ -1141,13 +1156,6 @@ F:       drivers/clk/axis
 F:     drivers/pinctrl/pinctrl-artpec*
 F:     Documentation/devicetree/bindings/pinctrl/axis,artpec6-pinctrl.txt
 
-ARM/ASPEED MACHINE SUPPORT
-M:     Joel Stanley <joel@jms.id.au>
-S:     Maintained
-F:     arch/arm/mach-aspeed/
-F:     arch/arm/boot/dts/aspeed-*
-F:     drivers/*/*aspeed*
-
 ARM/ASPEED I2C DRIVER
 M:     Brendan Higgins <brendanhiggins@google.com>
 R:     Benjamin Herrenschmidt <benh@kernel.crashing.org>
@@ -1160,6 +1168,18 @@ F:       drivers/i2c/busses/i2c-aspeed.c
 F:     Documentation/devicetree/bindings/interrupt-controller/aspeed,ast2400-i2c-ic.txt
 F:     Documentation/devicetree/bindings/i2c/i2c-aspeed.txt
 
+ARM/ASPEED MACHINE SUPPORT
+M:     Joel Stanley <joel@jms.id.au>
+S:     Maintained
+F:     arch/arm/mach-aspeed/
+F:     arch/arm/boot/dts/aspeed-*
+F:     drivers/*/*aspeed*
+
+ARM/ATMEL AT91 Clock Support
+M:     Boris Brezillon <boris.brezillon@free-electrons.com>
+S:     Maintained
+F:     drivers/clk/at91
+
 ARM/ATMEL AT91RM9200, AT91SAM9 AND SAMA5 SOC SUPPORT
 M:     Nicolas Ferre <nicolas.ferre@microchip.com>
 M:     Alexandre Belloni <alexandre.belloni@free-electrons.com>
@@ -1176,11 +1196,6 @@ F:       arch/arm/boot/dts/sama*.dtsi
 F:     arch/arm/include/debug/at91.S
 F:     drivers/memory/atmel*
 
-ARM/ATMEL AT91 Clock Support
-M:     Boris Brezillon <boris.brezillon@free-electrons.com>
-S:     Maintained
-F:     drivers/clk/at91
-
 ARM/CALXEDA HIGHBANK ARCHITECTURE
 M:     Rob Herring <robh@kernel.org>
 L:     linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
@@ -1207,6 +1222,11 @@ L:       linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
 S:     Odd Fixes
 N:     clps711x
 
+ARM/CIRRUS LOGIC EDB9315A MACHINE SUPPORT
+M:     Lennert Buytenhek <kernel@wantstofly.org>
+L:     linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
+S:     Maintained
+
 ARM/CIRRUS LOGIC EP93XX ARM ARCHITECTURE
 M:     Hartley Sweeten <hsweeten@visionengravers.com>
 M:     Alexander Sverdlin <alexander.sverdlin@gmail.com>
@@ -1215,11 +1235,6 @@ S:       Maintained
 F:     arch/arm/mach-ep93xx/
 F:     arch/arm/mach-ep93xx/include/mach/
 
-ARM/CIRRUS LOGIC EDB9315A MACHINE SUPPORT
-M:     Lennert Buytenhek <kernel@wantstofly.org>
-L:     linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
-S:     Maintained
-
 ARM/CLKDEV SUPPORT
 M:     Russell King <linux@armlinux.org.uk>
 L:     linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
@@ -1233,6 +1248,13 @@ M:       Mike Rapoport <mike@compulab.co.il>
 L:     linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
 S:     Maintained
 
+ARM/CONEXANT DIGICOLOR MACHINE SUPPORT
+M:     Baruch Siach <baruch@tkos.co.il>
+L:     linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
+S:     Maintained
+F:     arch/arm/boot/dts/cx92755*
+N:     digicolor
+
 ARM/CONTEC MICRO9 MACHINE SUPPORT
 M:     Hubert Feurstein <hubert.feurstein@contec.at>
 S:     Maintained
@@ -1278,13 +1300,6 @@ F:       drivers/clocksource/timer-prima2.c
 F:     drivers/clocksource/timer-atlas7.c
 N:     [^a-z]sirf
 
-ARM/CONEXANT DIGICOLOR MACHINE SUPPORT
-M:     Baruch Siach <baruch@tkos.co.il>
-L:     linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
-S:     Maintained
-F:     arch/arm/boot/dts/cx92755*
-N:     digicolor
-
 ARM/EBSA110 MACHINE SUPPORT
 M:     Russell King <linux@armlinux.org.uk>
 L:     linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
@@ -1398,6 +1413,11 @@ L:       linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
 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)
@@ -1407,11 +1427,6 @@ ARM/INTEL IOP33X ARM ARCHITECTURE
 L:     linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
 S:     Orphan
 
-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 IQ81342EX MACHINE SUPPORT
 M:     Lennert Buytenhek <kernel@wantstofly.org>
 L:     linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
@@ -1446,39 +1461,6 @@ M:       Lennert Buytenhek <kernel@wantstofly.org>
 L:     linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
 S:     Maintained
 
-ARM/TEXAS INSTRUMENT KEYSTONE ARCHITECTURE
-M:     Santosh Shilimkar <ssantosh@kernel.org>
-L:     linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
-S:     Maintained
-F:     arch/arm/mach-keystone/
-F:     arch/arm/boot/dts/keystone-*
-T:     git git://git.kernel.org/pub/scm/linux/kernel/git/ssantosh/linux-keystone.git
-
-ARM/TEXAS INSTRUMENT KEYSTONE CLOCK FRAMEWORK
-M:     Santosh Shilimkar <ssantosh@kernel.org>
-L:     linux-kernel@vger.kernel.org
-S:     Maintained
-F:     drivers/clk/keystone/
-
-ARM/TEXAS INSTRUMENT KEYSTONE ClOCKSOURCE
-M:     Santosh Shilimkar <ssantosh@kernel.org>
-L:     linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
-L:     linux-kernel@vger.kernel.org
-S:     Maintained
-F:     drivers/clocksource/timer-keystone.c
-
-ARM/TEXAS INSTRUMENT KEYSTONE RESET DRIVER
-M:     Santosh Shilimkar <ssantosh@kernel.org>
-L:     linux-kernel@vger.kernel.org
-S:     Maintained
-F:     drivers/power/reset/keystone-reset.c
-
-ARM/TEXAS INSTRUMENT AEMIF/EMIF DRIVERS
-M:     Santosh Shilimkar <ssantosh@kernel.org>
-L:     linux-kernel@vger.kernel.org
-S:     Maintained
-F:     drivers/memory/*emif*
-
 ARM/LG1K ARCHITECTURE
 M:     Chanho Min <chanho.min@lge.com>
 L:     linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
@@ -1521,24 +1503,6 @@ ARM/MAGICIAN MACHINE SUPPORT
 M:     Philipp Zabel <philipp.zabel@gmail.com>
 S:     Maintained
 
-ARM/Marvell Kirkwood and Armada 370, 375, 38x, 39x, XP, 3700, 7K/8K SOC support
-M:     Jason Cooper <jason@lakedaemon.net>
-M:     Andrew Lunn <andrew@lunn.ch>
-M:     Gregory Clement <gregory.clement@free-electrons.com>
-M:     Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
-L:     linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
-S:     Maintained
-F:     arch/arm/boot/dts/armada*
-F:     arch/arm/boot/dts/kirkwood*
-F:     arch/arm/configs/mvebu_*_defconfig
-F:     arch/arm/mach-mvebu/
-F:     arch/arm64/boot/dts/marvell/armada*
-F:     drivers/cpufreq/mvebu-cpufreq.c
-F:     drivers/irqchip/irq-armada-370-xp.c
-F:     drivers/irqchip/irq-mvebu-*
-F:     drivers/pinctrl/mvebu/
-F:     drivers/rtc/rtc-armada38x.c
-
 ARM/Marvell Berlin SoC support
 M:     Jisheng Zhang <jszhang@marvell.com>
 M:     Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
@@ -1548,7 +1512,6 @@ F:        arch/arm/mach-berlin/
 F:     arch/arm/boot/dts/berlin*
 F:     arch/arm64/boot/dts/marvell/berlin*
 
-
 ARM/Marvell Dove/MV78xx0/Orion SOC support
 M:     Jason Cooper <jason@lakedaemon.net>
 M:     Andrew Lunn <andrew@lunn.ch>
@@ -1564,24 +1527,23 @@ F:      arch/arm/plat-orion/
 F:     arch/arm/boot/dts/dove*
 F:     arch/arm/boot/dts/orion5x*
 
-
-ARM/Orion SoC/Technologic Systems TS-78xx platform support
-M:     Alexander Clouter <alex@digriz.org.uk>
-L:     linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
-W:     http://www.digriz.org.uk/ts78xx/kernel
-S:     Maintained
-F:     arch/arm/mach-orion5x/ts78xx-*
-
-ARM/OXNAS platform support
-M:     Neil Armstrong <narmstrong@baylibre.com>
+ARM/Marvell Kirkwood and Armada 370, 375, 38x, 39x, XP, 3700, 7K/8K SOC support
+M:     Jason Cooper <jason@lakedaemon.net>
+M:     Andrew Lunn <andrew@lunn.ch>
+M:     Gregory Clement <gregory.clement@free-electrons.com>
+M:     Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
 L:     linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
-L:     linux-oxnas@lists.tuxfamily.org (moderated for non-subscribers)
 S:     Maintained
-F:     arch/arm/mach-oxnas/
-F:     arch/arm/boot/dts/ox8*.dtsi
-F:     arch/arm/boot/dts/wd-mbwe.dts
-F:     arch/arm/boot/dts/cloudengines-pogoplug-series-3.dts
-N:     oxnas
+F:     arch/arm/boot/dts/armada*
+F:     arch/arm/boot/dts/kirkwood*
+F:     arch/arm/configs/mvebu_*_defconfig
+F:     arch/arm/mach-mvebu/
+F:     arch/arm64/boot/dts/marvell/armada*
+F:     drivers/cpufreq/mvebu-cpufreq.c
+F:     drivers/irqchip/irq-armada-370-xp.c
+F:     drivers/irqchip/irq-mvebu-*
+F:     drivers/pinctrl/mvebu/
+F:     drivers/rtc/rtc-armada38x.c
 
 ARM/Mediatek RTC DRIVER
 M:     Eddie Huang <eddie.huang@mediatek.com>
@@ -1636,22 +1598,59 @@ F:      drivers/pinctrl/nomadik/
 F:     drivers/i2c/busses/i2c-nomadik.c
 T:     git git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-nomadik.git
 
+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/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
 M:     Nelson Castillo <arhuaco@freaks-unidos.net>
 L:     openmoko-kernel@lists.openmoko.org (subscribers-only)
 W:     http://wiki.openmoko.org/wiki/Neo_FreeRunner
 S:     Supported
 
-ARM/TOSA MACHINE SUPPORT
-M:     Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
-M:     Dirk Opfer <dirk@opfer-online.de>
+ARM/Orion SoC/Technologic Systems TS-78xx platform support
+M:     Alexander Clouter <alex@digriz.org.uk>
+L:     linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
+W:     http://www.digriz.org.uk/ts78xx/kernel
 S:     Maintained
+F:     arch/arm/mach-orion5x/ts78xx-*
 
-ARM/PALMTX,PALMT5,PALMLD,PALMTE2,PALMTC SUPPORT
-M:     Marek Vasut <marek.vasut@gmail.com>
-L:     linux-arm-kernel@lists.infradead.org
-W:     http://hackndev.com
-S:     Maintained
+ARM/OXNAS platform support
+M:     Neil Armstrong <narmstrong@baylibre.com>
+L:     linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
+L:     linux-oxnas@lists.tuxfamily.org (moderated for non-subscribers)
+S:     Maintained
+F:     arch/arm/mach-oxnas/
+F:     arch/arm/boot/dts/ox8*.dtsi
+F:     arch/arm/boot/dts/wd-mbwe.dts
+F:     arch/arm/boot/dts/cloudengines-pogoplug-series-3.dts
+N:     oxnas
+
+ARM/PALM TREO SUPPORT
+M:     Tomas Cech <sleep_walker@suse.com>
+L:     linux-arm-kernel@lists.infradead.org
+W:     http://hackndev.com
+S:     Maintained
+F:     arch/arm/mach-pxa/include/mach/palmtreo.h
+F:     arch/arm/mach-pxa/palmtreo.c
+
+ARM/PALMTX,PALMT5,PALMLD,PALMTE2,PALMTC SUPPORT
+M:     Marek Vasut <marek.vasut@gmail.com>
+L:     linux-arm-kernel@lists.infradead.org
+W:     http://hackndev.com
+S:     Maintained
 F:     arch/arm/mach-pxa/include/mach/palmtx.h
 F:     arch/arm/mach-pxa/palmtx.c
 F:     arch/arm/mach-pxa/include/mach/palmt5.h
@@ -1663,14 +1662,6 @@ F:       arch/arm/mach-pxa/palmte2.c
 F:     arch/arm/mach-pxa/include/mach/palmtc.h
 F:     arch/arm/mach-pxa/palmtc.c
 
-ARM/PALM TREO SUPPORT
-M:     Tomas Cech <sleep_walker@suse.com>
-L:     linux-arm-kernel@lists.infradead.org
-W:     http://hackndev.com
-S:     Maintained
-F:     arch/arm/mach-pxa/include/mach/palmtreo.h
-F:     arch/arm/mach-pxa/palmtreo.c
-
 ARM/PALMZ72 SUPPORT
 M:     Sergey Lapin <slapin@ossfans.org>
 L:     linux-arm-kernel@lists.infradead.org
@@ -1811,17 +1802,6 @@ L:       linux-media@vger.kernel.org
 S:     Maintained
 F:     drivers/media/platform/s5p-g2d/
 
-ARM/SAMSUNG S5P SERIES Multi Format Codec (MFC) SUPPORT
-M:     Kyungmin Park <kyungmin.park@samsung.com>
-M:     Kamil Debski <kamil@wypas.org>
-M:     Jeongtae Park <jtp.park@samsung.com>
-M:     Andrzej Hajda <a.hajda@samsung.com>
-L:     linux-arm-kernel@lists.infradead.org
-L:     linux-media@vger.kernel.org
-S:     Maintained
-F:     arch/arm/plat-samsung/s5p-dev-mfc.c
-F:     drivers/media/platform/s5p-mfc/
-
 ARM/SAMSUNG S5P SERIES HDMI CEC SUBSYSTEM SUPPORT
 M:     Marek Szyprowski <m.szyprowski@samsung.com>
 L:     linux-samsung-soc@vger.kernel.org (moderated for non-subscribers)
@@ -1838,6 +1818,17 @@ L:       linux-media@vger.kernel.org
 S:     Maintained
 F:     drivers/media/platform/s5p-jpeg/
 
+ARM/SAMSUNG S5P SERIES Multi Format Codec (MFC) SUPPORT
+M:     Kyungmin Park <kyungmin.park@samsung.com>
+M:     Kamil Debski <kamil@wypas.org>
+M:     Jeongtae Park <jtp.park@samsung.com>
+M:     Andrzej Hajda <a.hajda@samsung.com>
+L:     linux-arm-kernel@lists.infradead.org
+L:     linux-media@vger.kernel.org
+S:     Maintained
+F:     arch/arm/plat-samsung/s5p-dev-mfc.c
+F:     drivers/media/platform/s5p-mfc/
+
 ARM/SHMOBILE ARM ARCHITECTURE
 M:     Simon Horman <horms@verge.net.au>
 M:     Magnus Damm <magnus.damm@gmail.com>
@@ -1931,26 +1922,48 @@ M:      "Mark F. Brown" <mark.brown314@gmail.com>
 L:     linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
 S:     Maintained
 
+ARM/TEXAS INSTRUMENT AEMIF/EMIF DRIVERS
+M:     Santosh Shilimkar <ssantosh@kernel.org>
+L:     linux-kernel@vger.kernel.org
+S:     Maintained
+F:     drivers/memory/*emif*
+
+ARM/TEXAS INSTRUMENT KEYSTONE ARCHITECTURE
+M:     Santosh Shilimkar <ssantosh@kernel.org>
+L:     linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
+S:     Maintained
+F:     arch/arm/mach-keystone/
+F:     arch/arm/boot/dts/keystone-*
+T:     git git://git.kernel.org/pub/scm/linux/kernel/git/ssantosh/linux-keystone.git
+
+ARM/TEXAS INSTRUMENT KEYSTONE CLOCK FRAMEWORK
+M:     Santosh Shilimkar <ssantosh@kernel.org>
+L:     linux-kernel@vger.kernel.org
+S:     Maintained
+F:     drivers/clk/keystone/
+
+ARM/TEXAS INSTRUMENT KEYSTONE ClOCKSOURCE
+M:     Santosh Shilimkar <ssantosh@kernel.org>
+L:     linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
+L:     linux-kernel@vger.kernel.org
+S:     Maintained
+F:     drivers/clocksource/timer-keystone.c
+
+ARM/TEXAS INSTRUMENT KEYSTONE RESET DRIVER
+M:     Santosh Shilimkar <ssantosh@kernel.org>
+L:     linux-kernel@vger.kernel.org
+S:     Maintained
+F:     drivers/power/reset/keystone-reset.c
+
 ARM/THECUS N2100 MACHINE SUPPORT
 M:     Lennert Buytenhek <kernel@wantstofly.org>
 L:     linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
 S:     Maintained
 
-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
+ARM/TOSA MACHINE SUPPORT
+M:     Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
+M:     Dirk Opfer <dirk@opfer-online.de>
 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/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/U300 MACHINE SUPPORT
 M:     Linus Walleij <linus.walleij@linaro.org>
@@ -2095,16 +2108,6 @@ F:       drivers/i2c/busses/i2c-cadence.c
 F:     drivers/mmc/host/sdhci-of-arasan.c
 F:     drivers/edac/synopsys_edac.c
 
-ARM SMMU DRIVERS
-M:     Will Deacon <will.deacon@arm.com>
-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/io-pgtable-arm.c
-F:     drivers/iommu/io-pgtable-arm-v7s.c
-
 ARM64 PORT (AARCH64 ARCHITECTURE)
 M:     Catalin Marinas <catalin.marinas@arm.com>
 M:     Will Deacon <will.deacon@arm.com>
@@ -2256,25 +2259,12 @@ M:      Nicolas Ferre <nicolas.ferre@microchip.com>
 S:     Supported
 F:     drivers/power/reset/at91-sama5d2_shdwc.c
 
-ATMEL SAMA5D2 ADC DRIVER
-M:     Ludovic Desroches <ludovic.desroches@microchip.com>
-L:     linux-iio@vger.kernel.org
-S:     Supported
-F:     drivers/iio/adc/at91-sama5d2_adc.c
-
 ATMEL Audio ALSA driver
 M:     Nicolas Ferre <nicolas.ferre@microchip.com>
 L:     alsa-devel@alsa-project.org (moderated for non-subscribers)
 S:     Supported
 F:     sound/soc/atmel
 
-ATMEL XDMA DRIVER
-M:     Ludovic Desroches <ludovic.desroches@microchip.com>
-L:     linux-arm-kernel@lists.infradead.org
-L:     dmaengine@vger.kernel.org
-S:     Supported
-F:     drivers/dma/at_xdmac.c
-
 ATMEL I2C DRIVER
 M:     Ludovic Desroches <ludovic.desroches@microchip.com>
 L:     linux-i2c@vger.kernel.org
@@ -2300,6 +2290,14 @@ M:       Nicolas Ferre <nicolas.ferre@microchip.com>
 S:     Supported
 F:     drivers/net/ethernet/cadence/
 
+ATMEL MAXTOUCH DRIVER
+M:     Nick Dyer <nick@shmanahar.org>
+T:     git git://github.com/ndyer/linux.git
+S:     Maintained
+F:     Documentation/devicetree/bindings/input/atmel,maxtouch.txt
+F:     drivers/input/touchscreen/atmel_mxt_ts.c
+F:     include/linux/platform_data/atmel_mxt_ts.h
+
 ATMEL NAND DRIVER
 M:     Wenyou Yang <wenyou.yang@atmel.com>
 M:     Josh Wu <rainyfeeling@outlook.com>
@@ -2307,6 +2305,12 @@ L:       linux-mtd@lists.infradead.org
 S:     Supported
 F:     drivers/mtd/nand/atmel/*
 
+ATMEL SAMA5D2 ADC DRIVER
+M:     Ludovic Desroches <ludovic.desroches@microchip.com>
+L:     linux-iio@vger.kernel.org
+S:     Supported
+F:     drivers/iio/adc/at91-sama5d2_adc.c
+
 ATMEL SDMMC DRIVER
 M:     Ludovic Desroches <ludovic.desroches@microchip.com>
 L:     linux-mmc@vger.kernel.org
@@ -2346,13 +2350,12 @@ W:      http://atmelwlandriver.sourceforge.net/
 S:     Maintained
 F:     drivers/net/wireless/atmel/atmel*
 
-ATMEL MAXTOUCH DRIVER
-M:     Nick Dyer <nick@shmanahar.org>
-T:     git git://github.com/ndyer/linux.git
-S:     Maintained
-F:     Documentation/devicetree/bindings/input/atmel,maxtouch.txt
-F:     drivers/input/touchscreen/atmel_mxt_ts.c
-F:     include/linux/platform_data/atmel_mxt_ts.h
+ATMEL XDMA DRIVER
+M:     Ludovic Desroches <ludovic.desroches@microchip.com>
+L:     linux-arm-kernel@lists.infradead.org
+L:     dmaengine@vger.kernel.org
+S:     Supported
+F:     drivers/dma/at_xdmac.c
 
 ATOMIC INFRASTRUCTURE
 M:     Will Deacon <will.deacon@arm.com>
@@ -2406,13 +2409,6 @@ F:       include/uapi/linux/ax25.h
 F:     include/net/ax25.h
 F:     net/ax25/
 
-AXENTIA ASOC DRIVERS
-M:     Peter Rosin <peda@axentia.se>
-L:     alsa-devel@alsa-project.org (moderated for non-subscribers)
-S:     Maintained
-F:     Documentation/devicetree/bindings/sound/axentia,*
-F:     sound/soc/atmel/tse850-pcm5142.c
-
 AXENTIA ARM DEVICES
 M:     Peter Rosin <peda@axentia.se>
 L:     linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
@@ -2421,6 +2417,13 @@ F:       Documentation/devicetree/bindings/arm/axentia.txt
 F:     arch/arm/boot/dts/at91-linea.dtsi
 F:     arch/arm/boot/dts/at91-tse850-3.dts
 
+AXENTIA ASOC DRIVERS
+M:     Peter Rosin <peda@axentia.se>
+L:     alsa-devel@alsa-project.org (moderated for non-subscribers)
+S:     Maintained
+F:     Documentation/devicetree/bindings/sound/axentia,*
+F:     sound/soc/atmel/tse850-pcm5142.c
+
 AZ6007 DVB DRIVER
 M:     Mauro Carvalho Chehab <mchehab@s-opensource.com>
 M:     Mauro Carvalho Chehab <mchehab@kernel.org>
@@ -2543,6 +2546,22 @@ W:       http://blackfin.uclinux.org
 S:     Supported
 F:     drivers/net/ethernet/adi/
 
+BLACKFIN I2C TWI DRIVER
+M:     Sonic Zhang <sonic.zhang@analog.com>
+L:     adi-buildroot-devel@lists.sourceforge.net (moderated for non-subscribers)
+W:     http://blackfin.uclinux.org/
+S:     Supported
+F:     drivers/i2c/busses/i2c-bfin-twi.c
+
+BLACKFIN MEDIA DRIVER
+M:     Scott Jiang <scott.jiang.linux@gmail.com>
+L:     adi-buildroot-devel@lists.sourceforge.net (moderated for non-subscribers)
+W:     http://blackfin.uclinux.org/
+S:     Supported
+F:     drivers/media/platform/blackfin/
+F:     drivers/media/i2c/adv7183*
+F:     drivers/media/i2c/vs6624*
+
 BLACKFIN RTC DRIVER
 L:     adi-buildroot-devel@lists.sourceforge.net (moderated for non-subscribers)
 W:     http://blackfin.uclinux.org
@@ -2569,22 +2588,6 @@ W:       http://blackfin.uclinux.org
 S:     Supported
 F:     drivers/watchdog/bfin_wdt.c
 
-BLACKFIN I2C TWI DRIVER
-M:     Sonic Zhang <sonic.zhang@analog.com>
-L:     adi-buildroot-devel@lists.sourceforge.net (moderated for non-subscribers)
-W:     http://blackfin.uclinux.org/
-S:     Supported
-F:     drivers/i2c/busses/i2c-bfin-twi.c
-
-BLACKFIN MEDIA DRIVER
-M:     Scott Jiang <scott.jiang.linux@gmail.com>
-L:     adi-buildroot-devel@lists.sourceforge.net (moderated for non-subscribers)
-W:     http://blackfin.uclinux.org/
-S:     Supported
-F:     drivers/media/platform/blackfin/
-F:     drivers/media/i2c/adv7183*
-F:     drivers/media/i2c/vs6624*
-
 BLINKM RGB LED DRIVER
 M:     Jan-Simon Moeller <jansimon.moeller@gmx.de>
 S:     Maintained
@@ -2628,21 +2631,6 @@ S:       Maintained
 F:     net/bluetooth/
 F:     include/net/bluetooth/
 
-DMA MAPPING HELPERS
-M:     Christoph Hellwig <hch@lst.de>
-M:     Marek Szyprowski <m.szyprowski@samsung.com>
-R:     Robin Murphy <robin.murphy@arm.com>
-L:     linux-kernel@vger.kernel.org
-T:     git git://git.infradead.org/users/hch/dma-mapping.git
-W:     http://git.infradead.org/users/hch/dma-mapping.git
-S:     Supported
-F:     lib/dma-debug.c
-F:     lib/dma-noop.c
-F:     lib/dma-virt.c
-F:     drivers/base/dma-mapping.c
-F:     drivers/base/dma-coherent.c
-F:     include/linux/dma-mapping.h
-
 BONDING DRIVER
 M:     Jay Vosburgh <j.vosburgh@gmail.com>
 M:     Veaceslav Falico <vfalico@gmail.com>
@@ -2690,35 +2678,6 @@ S:       Supported
 F:     drivers/net/dsa/b53/*
 F:     include/linux/platform_data/b53.h
 
-BROADCOM GENET ETHERNET DRIVER
-M:     Florian Fainelli <f.fainelli@gmail.com>
-L:     netdev@vger.kernel.org
-S:     Supported
-F:     drivers/net/ethernet/broadcom/genet/
-
-BROADCOM BNX2 GIGABIT ETHERNET DRIVER
-M:     Rasesh Mody <rasesh.mody@cavium.com>
-M:     Harish Patil <harish.patil@cavium.com>
-M:     Dept-GELinuxNICDev@cavium.com
-L:     netdev@vger.kernel.org
-S:     Supported
-F:     drivers/net/ethernet/broadcom/bnx2.*
-F:     drivers/net/ethernet/broadcom/bnx2_*
-
-BROADCOM BNX2X 10 GIGABIT ETHERNET DRIVER
-M:     Yuval Mintz <Yuval.Mintz@cavium.com>
-M:     Ariel Elior <ariel.elior@cavium.com>
-M:     everest-linux-l2@cavium.com
-L:     netdev@vger.kernel.org
-S:     Supported
-F:     drivers/net/ethernet/broadcom/bnx2x/
-
-BROADCOM BNXT_EN 50 GIGABIT ETHERNET DRIVER
-M:     Michael Chan <michael.chan@broadcom.com>
-L:     netdev@vger.kernel.org
-S:     Supported
-F:     drivers/net/ethernet/broadcom/bnxt/
-
 BROADCOM BCM281XX/BCM11XXX/BCM216XX ARM ARCHITECTURE
 M:     Florian Fainelli <f.fainelli@gmail.com>
 M:     Ray Jui <rjui@broadcom.com>
@@ -2797,6 +2756,13 @@ F:       arch/arm/boot/dts/bcm7*.dts*
 F:     drivers/bus/brcmstb_gisb.c
 N:     brcmstb
 
+BROADCOM BMIPS CPUFREQ DRIVER
+M:     Markus Mayer <mmayer@broadcom.com>
+M:     bcm-kernel-feedback-list@broadcom.com
+L:     linux-pm@vger.kernel.org
+S:     Maintained
+F:     drivers/cpufreq/bmips-cpufreq.c
+
 BROADCOM BMIPS MIPS ARCHITECTURE
 M:     Kevin Cernekee <cernekee@gmail.com>
 M:     Florian Fainelli <f.fainelli@gmail.com>
@@ -2813,20 +2779,40 @@ F:      drivers/irqchip/irq-brcmstb*
 F:     include/linux/bcm963xx_nvram.h
 F:     include/linux/bcm963xx_tag.h
 
-BROADCOM BMIPS CPUFREQ DRIVER
-M:     Markus Mayer <mmayer@broadcom.com>
-M:     bcm-kernel-feedback-list@broadcom.com
-L:     linux-pm@vger.kernel.org
-S:     Maintained
-F:     drivers/cpufreq/bmips-cpufreq.c
+BROADCOM BNX2 GIGABIT ETHERNET DRIVER
+M:     Rasesh Mody <rasesh.mody@cavium.com>
+M:     Harish Patil <harish.patil@cavium.com>
+M:     Dept-GELinuxNICDev@cavium.com
+L:     netdev@vger.kernel.org
+S:     Supported
+F:     drivers/net/ethernet/broadcom/bnx2.*
+F:     drivers/net/ethernet/broadcom/bnx2_*
 
-BROADCOM TG3 GIGABIT ETHERNET DRIVER
-M:     Siva Reddy Kallam <siva.kallam@broadcom.com>
-M:     Prashant Sreedharan <prashant@broadcom.com>
-M:     Michael Chan <mchan@broadcom.com>
+BROADCOM BNX2FC 10 GIGABIT FCOE DRIVER
+M:     QLogic-Storage-Upstream@qlogic.com
+L:     linux-scsi@vger.kernel.org
+S:     Supported
+F:     drivers/scsi/bnx2fc/
+
+BROADCOM BNX2I 1/10 GIGABIT iSCSI DRIVER
+M:     QLogic-Storage-Upstream@qlogic.com
+L:     linux-scsi@vger.kernel.org
+S:     Supported
+F:     drivers/scsi/bnx2i/
+
+BROADCOM BNX2X 10 GIGABIT ETHERNET DRIVER
+M:     Yuval Mintz <Yuval.Mintz@cavium.com>
+M:     Ariel Elior <ariel.elior@cavium.com>
+M:     everest-linux-l2@cavium.com
 L:     netdev@vger.kernel.org
 S:     Supported
-F:     drivers/net/ethernet/broadcom/tg3.*
+F:     drivers/net/ethernet/broadcom/bnx2x/
+
+BROADCOM BNXT_EN 50 GIGABIT ETHERNET DRIVER
+M:     Michael Chan <michael.chan@broadcom.com>
+L:     netdev@vger.kernel.org
+S:     Supported
+F:     drivers/net/ethernet/broadcom/bnxt/
 
 BROADCOM BRCM80211 IEEE802.11n WIRELESS DRIVER
 M:     Arend van Spriel <arend.vanspriel@broadcom.com>
@@ -2840,17 +2826,18 @@ L:      brcm80211-dev-list@cypress.com
 S:     Supported
 F:     drivers/net/wireless/broadcom/brcm80211/
 
-BROADCOM BNX2FC 10 GIGABIT FCOE DRIVER
-M:     QLogic-Storage-Upstream@qlogic.com
-L:     linux-scsi@vger.kernel.org
+BROADCOM BRCMSTB GPIO DRIVER
+M:     Gregory Fong <gregory.0xf0@gmail.com>
+L:     bcm-kernel-feedback-list@broadcom.com
 S:     Supported
-F:     drivers/scsi/bnx2fc/
+F:     drivers/gpio/gpio-brcmstb.c
+F:     Documentation/devicetree/bindings/gpio/brcm,brcmstb-gpio.txt
 
-BROADCOM BNX2I 1/10 GIGABIT iSCSI DRIVER
-M:     QLogic-Storage-Upstream@qlogic.com
-L:     linux-scsi@vger.kernel.org
+BROADCOM GENET ETHERNET DRIVER
+M:     Florian Fainelli <f.fainelli@gmail.com>
+L:     netdev@vger.kernel.org
 S:     Supported
-F:     drivers/scsi/bnx2i/
+F:     drivers/net/ethernet/broadcom/genet/
 
 BROADCOM IPROC ARM ARCHITECTURE
 M:     Ray Jui <rjui@broadcom.com>
@@ -2877,13 +2864,6 @@ F:       arch/arm64/boot/dts/broadcom/ns2*
 F:     drivers/clk/bcm/clk-ns*
 F:     drivers/pinctrl/bcm/pinctrl-ns*
 
-BROADCOM BRCMSTB GPIO DRIVER
-M:     Gregory Fong <gregory.0xf0@gmail.com>
-L:     bcm-kernel-feedback-list@broadcom.com
-S:     Supported
-F:     drivers/gpio/gpio-brcmstb.c
-F:     Documentation/devicetree/bindings/gpio/brcm,brcmstb-gpio.txt
-
 BROADCOM KONA GPIO DRIVER
 M:     Ray Jui <rjui@broadcom.com>
 L:     bcm-kernel-feedback-list@broadcom.com
@@ -2891,19 +2871,29 @@ S:      Supported
 F:     drivers/gpio/gpio-bcm-kona.c
 F:     Documentation/devicetree/bindings/gpio/brcm,kona-gpio.txt
 
+BROADCOM NETXTREME-E ROCE DRIVER
+M:     Selvin Xavier <selvin.xavier@broadcom.com>
+M:     Devesh Sharma <devesh.sharma@broadcom.com>
+M:     Somnath Kotur <somnath.kotur@broadcom.com>
+M:     Sriharsha Basavapatna <sriharsha.basavapatna@broadcom.com>
+L:     linux-rdma@vger.kernel.org
+W:     http://www.broadcom.com
+S:     Supported
+F:     drivers/infiniband/hw/bnxt_re/
+F:     include/uapi/rdma/bnxt_re-abi.h
+
 BROADCOM NVRAM DRIVER
 M:     RafaÅ‚ MiÅ‚ecki <zajec5@gmail.com>
 L:     linux-mips@linux-mips.org
 S:     Maintained
 F:     drivers/firmware/broadcom/*
 
-BROADCOM STB NAND FLASH DRIVER
-M:     Brian Norris <computersforpeace@gmail.com>
-M:     Kamal Dasu <kdasu.kdev@gmail.com>
-L:     linux-mtd@lists.infradead.org
-L:     bcm-kernel-feedback-list@broadcom.com
+BROADCOM SPECIFIC AMBA DRIVER (BCMA)
+M:     RafaÅ‚ MiÅ‚ecki <zajec5@gmail.com>
+L:     linux-wireless@vger.kernel.org
 S:     Maintained
-F:     drivers/mtd/nand/brcmnand/
+F:     drivers/bcma/
+F:     include/linux/bcma/
 
 BROADCOM STB AVS CPUFREQ DRIVER
 M:     Markus Mayer <mmayer@broadcom.com>
@@ -2913,12 +2903,13 @@ S:      Maintained
 F:     Documentation/devicetree/bindings/cpufreq/brcm,stb-avs-cpu-freq.txt
 F:     drivers/cpufreq/brcmstb*
 
-BROADCOM SPECIFIC AMBA DRIVER (BCMA)
-M:     RafaÅ‚ MiÅ‚ecki <zajec5@gmail.com>
-L:     linux-wireless@vger.kernel.org
+BROADCOM STB NAND FLASH DRIVER
+M:     Brian Norris <computersforpeace@gmail.com>
+M:     Kamal Dasu <kdasu.kdev@gmail.com>
+L:     linux-mtd@lists.infradead.org
+L:     bcm-kernel-feedback-list@broadcom.com
 S:     Maintained
-F:     drivers/bcma/
-F:     include/linux/bcma/
+F:     drivers/mtd/nand/brcmnand/
 
 BROADCOM SYSTEMPORT ETHERNET DRIVER
 M:     Florian Fainelli <f.fainelli@gmail.com>
@@ -2926,16 +2917,13 @@ L:      netdev@vger.kernel.org
 S:     Supported
 F:     drivers/net/ethernet/broadcom/bcmsysport.*
 
-BROADCOM NETXTREME-E ROCE DRIVER
-M:     Selvin Xavier <selvin.xavier@broadcom.com>
-M:     Devesh Sharma <devesh.sharma@broadcom.com>
-M:     Somnath Kotur <somnath.kotur@broadcom.com>
-M:     Sriharsha Basavapatna <sriharsha.basavapatna@broadcom.com>
-L:     linux-rdma@vger.kernel.org
-W:     http://www.broadcom.com
+BROADCOM TG3 GIGABIT ETHERNET DRIVER
+M:     Siva Reddy Kallam <siva.kallam@broadcom.com>
+M:     Prashant Sreedharan <prashant@broadcom.com>
+M:     Michael Chan <mchan@broadcom.com>
+L:     netdev@vger.kernel.org
 S:     Supported
-F:     drivers/infiniband/hw/bnxt_re/
-F:     include/uapi/rdma/bnxt_re-abi.h
+F:     drivers/net/ethernet/broadcom/tg3.*
 
 BROCADE BFA FC SCSI DRIVER
 M:     Anil Gurumurthy <anil.gurumurthy@qlogic.com>
@@ -3081,6 +3069,21 @@ F:       arch/x86/kernel/tce_64.c
 F:     arch/x86/include/asm/calgary.h
 F:     arch/x86/include/asm/tce.h
 
+CAN NETWORK DRIVERS
+M:     Wolfgang Grandegger <wg@grandegger.com>
+M:     Marc Kleine-Budde <mkl@pengutronix.de>
+L:     linux-can@vger.kernel.org
+W:     https://github.com/linux-can
+T:     git git://git.kernel.org/pub/scm/linux/kernel/git/mkl/linux-can.git
+T:     git git://git.kernel.org/pub/scm/linux/kernel/git/mkl/linux-can-next.git
+S:     Maintained
+F:     Documentation/devicetree/bindings/net/can/
+F:     drivers/net/can/
+F:     include/linux/can/dev.h
+F:     include/linux/can/platform/
+F:     include/uapi/linux/can/error.h
+F:     include/uapi/linux/can/netlink.h
+
 CAN NETWORK LAYER
 M:     Oliver Hartkopp <socketcan@hartkopp.net>
 M:     Marc Kleine-Budde <mkl@pengutronix.de>
@@ -3097,21 +3100,6 @@ F:       include/uapi/linux/can/bcm.h
 F:     include/uapi/linux/can/raw.h
 F:     include/uapi/linux/can/gw.h
 
-CAN NETWORK DRIVERS
-M:     Wolfgang Grandegger <wg@grandegger.com>
-M:     Marc Kleine-Budde <mkl@pengutronix.de>
-L:     linux-can@vger.kernel.org
-W:     https://github.com/linux-can
-T:     git git://git.kernel.org/pub/scm/linux/kernel/git/mkl/linux-can.git
-T:     git git://git.kernel.org/pub/scm/linux/kernel/git/mkl/linux-can-next.git
-S:     Maintained
-F:     Documentation/devicetree/bindings/net/can/
-F:     drivers/net/can/
-F:     include/linux/can/dev.h
-F:     include/linux/can/platform/
-F:     include/uapi/linux/can/error.h
-F:     include/uapi/linux/can/netlink.h
-
 CAPABILITIES
 M:     Serge Hallyn <serge@hallyn.com>
 L:     linux-security-module@vger.kernel.org
@@ -3133,13 +3121,6 @@ W:       http://wireless.kernel.org/en/users/Drivers/carl9170
 S:     Maintained
 F:     drivers/net/wireless/ath/carl9170/
 
-CAVIUM THUNDERX2 ARM64 SOC
-M:     Jayachandran C <jnair@caviumnetworks.com>
-L:     linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
-S:     Maintained
-F:     arch/arm64/boot/dts/cavium/thunder2-99xx*
-F:     Documentation/devicetree/bindings/arm/cavium-thunder2.txt
-
 CAVIUM I2C DRIVER
 M:     Jan Glauber <jglauber@cavium.com>
 M:     David Daney <david.daney@cavium.com>
@@ -3148,6 +3129,16 @@ S:       Supported
 F:     drivers/i2c/busses/i2c-octeon*
 F:     drivers/i2c/busses/i2c-thunderx*
 
+CAVIUM LIQUIDIO NETWORK DRIVER
+M:     Derek Chickles <derek.chickles@caviumnetworks.com>
+M:     Satanand Burla <satananda.burla@caviumnetworks.com>
+M:     Felix Manlunas <felix.manlunas@caviumnetworks.com>
+M:     Raghu Vatsavayi <raghu.vatsavayi@caviumnetworks.com>
+L:     netdev@vger.kernel.org
+W:     http://www.cavium.com
+S:     Supported
+F:     drivers/net/ethernet/cavium/liquidio/
+
 CAVIUM MMC DRIVER
 M:     Jan Glauber <jglauber@cavium.com>
 M:     David Daney <david.daney@cavium.com>
@@ -3156,16 +3147,6 @@ W:       http://www.cavium.com
 S:     Supported
 F:     drivers/mmc/host/cavium*
 
-CAVIUM LIQUIDIO NETWORK DRIVER
-M:     Derek Chickles <derek.chickles@caviumnetworks.com>
-M:     Satanand Burla <satananda.burla@caviumnetworks.com>
-M:     Felix Manlunas <felix.manlunas@caviumnetworks.com>
-M:     Raghu Vatsavayi <raghu.vatsavayi@caviumnetworks.com>
-L:     netdev@vger.kernel.org
-W:     http://www.cavium.com
-S:     Supported
-F:     drivers/net/ethernet/cavium/liquidio/
-
 CAVIUM OCTEON-TX CRYPTO DRIVER
 M:     George Cherian <george.cherian@cavium.com>
 L:     linux-crypto@vger.kernel.org
@@ -3173,6 +3154,13 @@ W:       http://www.cavium.com
 S:     Supported
 F:     drivers/crypto/cavium/cpt/
 
+CAVIUM THUNDERX2 ARM64 SOC
+M:     Jayachandran C <jnair@caviumnetworks.com>
+L:     linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
+S:     Maintained
+F:     arch/arm64/boot/dts/cavium/thunder2-99xx*
+F:     Documentation/devicetree/bindings/arm/cavium-thunder2.txt
+
 CC2520 IEEE-802.15.4 RADIO DRIVER
 M:     Varka Bhadram <varkabhadram@gmail.com>
 L:     linux-wpan@vger.kernel.org
@@ -3332,12 +3320,6 @@ S:       Maintained
 T:     git git://git.kernel.org/pub/scm/linux/kernel/git/bleung/chrome-platform.git
 F:     drivers/platform/chrome/
 
-CIRRUS LOGIC EP93XX ETHERNET DRIVER
-M:     Hartley Sweeten <hsweeten@visionengravers.com>
-L:     netdev@vger.kernel.org
-S:     Maintained
-F:     drivers/net/ethernet/cirrus/ep93xx_eth.c
-
 CIRRUS LOGIC AUDIO CODEC DRIVERS
 M:     Brian Austin <brian.austin@cirrus.com>
 M:     Paul Handrigan <Paul.Handrigan@cirrus.com>
@@ -3345,6 +3327,12 @@ L:       alsa-devel@alsa-project.org (moderated for non-subscribers)
 S:     Maintained
 F:     sound/soc/codecs/cs*
 
+CIRRUS LOGIC EP93XX ETHERNET DRIVER
+M:     Hartley Sweeten <hsweeten@visionengravers.com>
+L:     netdev@vger.kernel.org
+S:     Maintained
+F:     drivers/net/ethernet/cirrus/ep93xx_eth.c
+
 CISCO FCOE HBA DRIVER
 M:     Satish Kharat <satishkh@cisco.com>
 M:     Sesidhar Baddela <sebaddel@cisco.com>
@@ -3469,17 +3457,17 @@ L:      linux-pci@vger.kernel.org
 S:     Maintained
 F:     drivers/pci/hotplug/cpci_hotplug*
 
-COMPACTPCI HOTPLUG ZIATECH ZT5550 DRIVER
+COMPACTPCI HOTPLUG GENERIC DRIVER
 M:     Scott Murray <scott@spiteful.org>
 L:     linux-pci@vger.kernel.org
 S:     Maintained
-F:     drivers/pci/hotplug/cpcihp_zt5550.*
+F:     drivers/pci/hotplug/cpcihp_generic.c
 
-COMPACTPCI HOTPLUG GENERIC DRIVER
+COMPACTPCI HOTPLUG ZIATECH ZT5550 DRIVER
 M:     Scott Murray <scott@spiteful.org>
 L:     linux-pci@vger.kernel.org
 S:     Maintained
-F:     drivers/pci/hotplug/cpcihp_generic.c
+F:     drivers/pci/hotplug/cpcihp_zt5550.*
 
 COMPAL LAPTOP SUPPORT
 M:     Cezary Jackiewicz <cezary.jackiewicz@gmail.com>
@@ -3752,6 +3740,13 @@ S:       Supported
 F:     drivers/infiniband/hw/cxgb3/
 F:     include/uapi/rdma/cxgb3-abi.h
 
+CXGB4 CRYPTO DRIVER (chcr)
+M:     Harsh Jain <harsh@chelsio.com>
+L:     linux-crypto@vger.kernel.org
+W:     http://www.chelsio.com
+S:     Supported
+F:     drivers/crypto/chelsio
+
 CXGB4 ETHERNET DRIVER (CXGB4)
 M:     Ganesh Goudar <ganeshgr@chelsio.com>
 L:     netdev@vger.kernel.org
@@ -3774,13 +3769,6 @@ S:       Supported
 F:     drivers/infiniband/hw/cxgb4/
 F:     include/uapi/rdma/cxgb4-abi.h
 
-CXGB4 CRYPTO DRIVER (chcr)
-M:     Harsh Jain <harsh@chelsio.com>
-L:     linux-crypto@vger.kernel.org
-W:     http://www.chelsio.com
-S:     Supported
-F:     drivers/crypto/chelsio
-
 CXGB4VF ETHERNET DRIVER (CXGB4VF)
 M:     Casey Leedom <leedom@chelsio.com>
 L:     netdev@vger.kernel.org
@@ -3933,15 +3921,15 @@ L:      platform-driver-x86@vger.kernel.org
 S:     Maintained
 F:     drivers/platform/x86/dell-laptop.c
 
-DELL LAPTOP RBTN DRIVER
+DELL LAPTOP FREEFALL DRIVER
 M:     Pali Rohár <pali.rohar@gmail.com>
 S:     Maintained
-F:     drivers/platform/x86/dell-rbtn.*
+F:     drivers/platform/x86/dell-smo8800.c
 
-DELL LAPTOP FREEFALL DRIVER
+DELL LAPTOP RBTN DRIVER
 M:     Pali Rohár <pali.rohar@gmail.com>
 S:     Maintained
-F:     drivers/platform/x86/dell-smo8800.c
+F:     drivers/platform/x86/dell-rbtn.*
 
 DELL LAPTOP SMM DRIVER
 M:     Pali Rohár <pali.rohar@gmail.com>
@@ -3961,12 +3949,6 @@ M:       Pali Rohár <pali.rohar@gmail.com>
 S:     Maintained
 F:     drivers/platform/x86/dell-wmi.c
 
-DENALI NAND DRIVER
-M:     Masahiro Yamada <yamada.masahiro@socionext.com>
-L:     linux-mtd@lists.infradead.org
-S:     Supported
-F:     drivers/mtd/nand/denali*
-
 DELTA ST MEDIA DRIVER
 M:     Hugues Fruchet <hugues.fruchet@st.com>
 L:     linux-media@vger.kernel.org
@@ -3975,6 +3957,12 @@ W:       https://linuxtv.org
 S:     Supported
 F:     drivers/media/platform/sti/delta
 
+DENALI NAND DRIVER
+M:     Masahiro Yamada <yamada.masahiro@socionext.com>
+L:     linux-mtd@lists.infradead.org
+S:     Supported
+F:     drivers/mtd/nand/denali*
+
 DESIGNWARE USB2 DRD IP DRIVER
 M:     John Youn <johnyoun@synopsys.com>
 L:     linux-usb@vger.kernel.org
@@ -4183,6 +4171,21 @@ F:       Documentation/devicetree/bindings/dma/
 F:     Documentation/dmaengine/
 T:     git git://git.infradead.org/users/vkoul/slave-dma.git
 
+DMA MAPPING HELPERS
+M:     Christoph Hellwig <hch@lst.de>
+M:     Marek Szyprowski <m.szyprowski@samsung.com>
+R:     Robin Murphy <robin.murphy@arm.com>
+L:     linux-kernel@vger.kernel.org
+T:     git git://git.infradead.org/users/hch/dma-mapping.git
+W:     http://git.infradead.org/users/hch/dma-mapping.git
+S:     Supported
+F:     lib/dma-debug.c
+F:     lib/dma-noop.c
+F:     lib/dma-virt.c
+F:     drivers/base/dma-mapping.c
+F:     drivers/base/dma-coherent.c
+F:     include/linux/dma-mapping.h
+
 DME1737 HARDWARE MONITOR DRIVER
 M:     Juerg Haefliger <juergh@gmail.com>
 L:     linux-hwmon@vger.kernel.org
@@ -4213,6 +4216,13 @@ X:       Documentation/spi
 X:     Documentation/media
 T:     git git://git.lwn.net/linux.git docs-next
 
+DONGWOON DW9714 LENS VOICE COIL DRIVER
+M:     Sakari Ailus <sakari.ailus@linux.intel.com>
+L:     linux-media@vger.kernel.org
+T:     git git://linuxtv.org/media_tree.git
+S:     Maintained
+F:     drivers/media/i2c/dw9714.c
+
 DOUBLETALK DRIVER
 M:     "James R. Van Zandt" <jrv@vanzandt.mv.com>
 L:     blinux-list@redhat.com
@@ -4272,37 +4282,6 @@ F:       drivers/power/avs/
 F:     include/linux/power/smartreflex.h
 L:     linux-pm@vger.kernel.org
 
-DRM DRIVERS
-M:     David Airlie <airlied@linux.ie>
-L:     dri-devel@lists.freedesktop.org
-T:     git git://people.freedesktop.org/~airlied/linux
-B:     https://bugs.freedesktop.org/
-C:     irc://chat.freenode.net/dri-devel
-S:     Maintained
-F:     drivers/gpu/drm/
-F:     drivers/gpu/vga/
-F:     Documentation/devicetree/bindings/display/
-F:     Documentation/devicetree/bindings/gpu/
-F:     Documentation/devicetree/bindings/video/
-F:     Documentation/gpu/
-F:     include/drm/
-F:     include/uapi/drm/
-F:     include/linux/vga*
-
-DRM DRIVERS AND MISC GPU PATCHES
-M:     Daniel Vetter <daniel.vetter@intel.com>
-M:     Jani Nikula <jani.nikula@linux.intel.com>
-M:     Sean Paul <seanpaul@chromium.org>
-W:     https://01.org/linuxgraphics/gfx-docs/maintainer-tools/drm-misc.html
-S:     Maintained
-T:     git git://anongit.freedesktop.org/drm/drm-misc
-F:     Documentation/gpu/
-F:     drivers/gpu/vga/
-F:     drivers/gpu/drm/*
-F:     include/drm/drm*
-F:     include/uapi/drm/drm*
-F:     include/linux/vga*
-
 DRM DRIVER FOR ARM PL111 CLCD
 M:     Eric Anholt <eric@anholt.net>
 T:     git git://anongit.freedesktop.org/drm/drm-misc
@@ -4314,14 +4293,6 @@ M:       Dave Airlie <airlied@redhat.com>
 S:     Odd Fixes
 F:     drivers/gpu/drm/ast/
 
-DRM DRIVERS FOR BRIDGE CHIPS
-M:     Archit Taneja <architt@codeaurora.org>
-M:     Andrzej Hajda <a.hajda@samsung.com>
-R:     Laurent Pinchart <Laurent.pinchart@ideasonboard.com>
-S:     Maintained
-T:     git git://anongit.freedesktop.org/drm/drm-misc
-F:     drivers/gpu/drm/bridge/
-
 DRM DRIVER FOR BOCHS VIRTUAL GPU
 M:     Gerd Hoffmann <kraxel@redhat.com>
 L:     virtualization@lists.linux-foundation.org
@@ -4329,6 +4300,47 @@ T:       git git://anongit.freedesktop.org/drm/drm-misc
 S:     Maintained
 F:     drivers/gpu/drm/bochs/
 
+DRM DRIVER FOR INTEL I810 VIDEO CARDS
+S:     Orphan / Obsolete
+F:     drivers/gpu/drm/i810/
+F:     include/uapi/drm/i810_drm.h
+
+DRM DRIVER FOR MATROX G200/G400 GRAPHICS CARDS
+S:     Orphan / Obsolete
+F:     drivers/gpu/drm/mga/
+F:     include/uapi/drm/mga_drm.h
+
+DRM DRIVER FOR MGA G200 SERVER GRAPHICS CHIPS
+M:     Dave Airlie <airlied@redhat.com>
+S:     Odd Fixes
+F:     drivers/gpu/drm/mgag200/
+
+DRM DRIVER FOR MI0283QT
+M:     Noralf Trønnes <noralf@tronnes.org>
+S:     Maintained
+F:     drivers/gpu/drm/tinydrm/mi0283qt.c
+F:     Documentation/devicetree/bindings/display/multi-inno,mi0283qt.txt
+
+DRM DRIVER FOR MSM ADRENO GPU
+M:     Rob Clark <robdclark@gmail.com>
+L:     linux-arm-msm@vger.kernel.org
+L:     dri-devel@lists.freedesktop.org
+L:     freedreno@lists.freedesktop.org
+T:     git git://people.freedesktop.org/~robclark/linux
+S:     Maintained
+F:     drivers/gpu/drm/msm/
+F:     include/uapi/drm/msm_drm.h
+F:     Documentation/devicetree/bindings/display/msm/
+
+DRM DRIVER FOR NVIDIA GEFORCE/QUADRO GPUS
+M:     Ben Skeggs <bskeggs@redhat.com>
+L:     dri-devel@lists.freedesktop.org
+L:     nouveau@lists.freedesktop.org
+T:     git git://github.com/skeggsb/linux
+S:     Supported
+F:     drivers/gpu/drm/nouveau/
+F:     include/uapi/drm/nouveau_drm.h
+
 DRM DRIVER FOR QEMU'S CIRRUS DEVICE
 M:     Dave Airlie <airlied@redhat.com>
 M:     Gerd Hoffmann <kraxel@redhat.com>
@@ -4338,59 +4350,80 @@ S:      Obsolete
 W:     https://www.kraxel.org/blog/2014/10/qemu-using-cirrus-considered-harmful/
 F:     drivers/gpu/drm/cirrus/
 
-RADEON and AMDGPU DRM DRIVERS
-M:     Alex Deucher <alexander.deucher@amd.com>
-M:     Christian König <christian.koenig@amd.com>
-L:     amd-gfx@lists.freedesktop.org
-T:     git git://people.freedesktop.org/~agd5f/linux
+DRM DRIVER FOR QXL VIRTUAL GPU
+M:     Dave Airlie <airlied@redhat.com>
+M:     Gerd Hoffmann <kraxel@redhat.com>
+L:     virtualization@lists.linux-foundation.org
+T:     git git://anongit.freedesktop.org/drm/drm-misc
+S:     Maintained
+F:     drivers/gpu/drm/qxl/
+F:     include/uapi/drm/qxl_drm.h
+
+DRM DRIVER FOR RAGE 128 VIDEO CARDS
+S:     Orphan / Obsolete
+F:     drivers/gpu/drm/r128/
+F:     include/uapi/drm/r128_drm.h
+
+DRM DRIVER FOR SAVAGE VIDEO CARDS
+S:     Orphan / Obsolete
+F:     drivers/gpu/drm/savage/
+F:     include/uapi/drm/savage_drm.h
+
+DRM DRIVER FOR SIS VIDEO CARDS
+S:     Orphan / Obsolete
+F:     drivers/gpu/drm/sis/
+F:     include/uapi/drm/sis_drm.h
+
+DRM DRIVER FOR TDFX VIDEO CARDS
+S:     Orphan / Obsolete
+F:     drivers/gpu/drm/tdfx/
+
+DRM DRIVER FOR USB DISPLAYLINK VIDEO ADAPTERS
+M:     Dave Airlie <airlied@redhat.com>
+S:     Odd Fixes
+F:     drivers/gpu/drm/udl/
+
+DRM DRIVER FOR VMWARE VIRTUAL GPU
+M:     "VMware Graphics" <linux-graphics-maintainer@vmware.com>
+M:     Sinclair Yeh <syeh@vmware.com>
+M:     Thomas Hellstrom <thellstrom@vmware.com>
+L:     dri-devel@lists.freedesktop.org
+T:     git git://people.freedesktop.org/~syeh/repos_linux
+T:     git git://people.freedesktop.org/~thomash/linux
 S:     Supported
-F:     drivers/gpu/drm/radeon/
-F:     include/uapi/drm/radeon_drm.h
-F:     drivers/gpu/drm/amd/
-F:     include/uapi/drm/amdgpu_drm.h
+F:     drivers/gpu/drm/vmwgfx/
+F:     include/uapi/drm/vmwgfx_drm.h
 
-DRM PANEL DRIVERS
-M:     Thierry Reding <thierry.reding@gmail.com>
+DRM DRIVERS
+M:     David Airlie <airlied@linux.ie>
 L:     dri-devel@lists.freedesktop.org
-T:     git git://anongit.freedesktop.org/tegra/linux.git
+T:     git git://people.freedesktop.org/~airlied/linux
+B:     https://bugs.freedesktop.org/
+C:     irc://chat.freenode.net/dri-devel
 S:     Maintained
-F:     drivers/gpu/drm/drm_panel.c
-F:     drivers/gpu/drm/panel/
-F:     include/drm/drm_panel.h
-F:     Documentation/devicetree/bindings/display/panel/
+F:     drivers/gpu/drm/
+F:     drivers/gpu/vga/
+F:     Documentation/devicetree/bindings/display/
+F:     Documentation/devicetree/bindings/gpu/
+F:     Documentation/devicetree/bindings/video/
+F:     Documentation/gpu/
+F:     include/drm/
+F:     include/uapi/drm/
+F:     include/linux/vga*
 
-INTEL DRM DRIVERS (excluding Poulsbo, Moorestown and derivative chipsets)
+DRM DRIVERS AND MISC GPU PATCHES
 M:     Daniel Vetter <daniel.vetter@intel.com>
 M:     Jani Nikula <jani.nikula@linux.intel.com>
-L:     intel-gfx@lists.freedesktop.org
-W:     https://01.org/linuxgraphics/
-B:     https://01.org/linuxgraphics/documentation/how-report-bugs
-C:     irc://chat.freenode.net/intel-gfx
-Q:     http://patchwork.freedesktop.org/project/intel-gfx/
-T:     git git://anongit.freedesktop.org/drm-intel
-S:     Supported
-F:     drivers/gpu/drm/i915/
-F:     include/drm/i915*
-F:     include/uapi/drm/i915_drm.h
-F:     Documentation/gpu/i915.rst
-
-INTEL GVT-g DRIVERS (Intel GPU Virtualization)
-M:      Zhenyu Wang <zhenyuw@linux.intel.com>
-M:      Zhi Wang <zhi.a.wang@intel.com>
-L:      intel-gvt-dev@lists.freedesktop.org
-L:      intel-gfx@lists.freedesktop.org
-W:      https://01.org/igvt-g
-T:      git https://github.com/01org/gvt-linux.git
-S:      Supported
-F:      drivers/gpu/drm/i915/gvt/
-
-DRM DRIVERS FOR ATMEL HLCDC
-M:     Boris Brezillon <boris.brezillon@free-electrons.com>
-L:     dri-devel@lists.freedesktop.org
-S:     Supported
-F:     drivers/gpu/drm/atmel-hlcdc/
-F:     Documentation/devicetree/bindings/drm/atmel/
+M:     Sean Paul <seanpaul@chromium.org>
+W:     https://01.org/linuxgraphics/gfx-docs/maintainer-tools/drm-misc.html
+S:     Maintained
 T:     git git://anongit.freedesktop.org/drm/drm-misc
+F:     Documentation/gpu/
+F:     drivers/gpu/vga/
+F:     drivers/gpu/drm/*
+F:     include/drm/drm*
+F:     include/uapi/drm/drm*
+F:     include/linux/vga*
 
 DRM DRIVERS FOR ALLWINNER A10
 M:     Maxime Ripard  <maxime.ripard@free-electrons.com>
@@ -4412,6 +4445,22 @@ F:       Documentation/devicetree/bindings/display/amlogic,meson-dw-hdmi.txt
 F:     Documentation/gpu/meson.rst
 T:     git git://anongit.freedesktop.org/drm/drm-misc
 
+DRM DRIVERS FOR ATMEL HLCDC
+M:     Boris Brezillon <boris.brezillon@free-electrons.com>
+L:     dri-devel@lists.freedesktop.org
+S:     Supported
+F:     drivers/gpu/drm/atmel-hlcdc/
+F:     Documentation/devicetree/bindings/drm/atmel/
+T:     git git://anongit.freedesktop.org/drm/drm-misc
+
+DRM DRIVERS FOR BRIDGE CHIPS
+M:     Archit Taneja <architt@codeaurora.org>
+M:     Andrzej Hajda <a.hajda@samsung.com>
+R:     Laurent Pinchart <Laurent.pinchart@ideasonboard.com>
+S:     Maintained
+T:     git git://anongit.freedesktop.org/drm/drm-misc
+F:     drivers/gpu/drm/bridge/
+
 DRM DRIVERS FOR EXYNOS
 M:     Inki Dae <inki.dae@samsung.com>
 M:     Joonyoung Shim <jy0922.shim@samsung.com>
@@ -4460,11 +4509,6 @@ S:       Maintained
 F:     drivers/gpu/drm/hisilicon/
 F:     Documentation/devicetree/bindings/display/hisilicon/
 
-DRM DRIVER FOR INTEL I810 VIDEO CARDS
-S:     Orphan / Obsolete
-F:     drivers/gpu/drm/i810/
-F:     include/uapi/drm/i810_drm.h
-
 DRM DRIVERS FOR MEDIATEK
 M:     CK Hu <ck.hu@mediatek.com>
 M:     Philipp Zabel <p.zabel@pengutronix.de>
@@ -4473,32 +4517,6 @@ S:       Supported
 F:     drivers/gpu/drm/mediatek/
 F:     Documentation/devicetree/bindings/display/mediatek/
 
-DRM DRIVER FOR MI0283QT
-M:     Noralf Trønnes <noralf@tronnes.org>
-S:     Maintained
-F:     drivers/gpu/drm/tinydrm/mi0283qt.c
-F:     Documentation/devicetree/bindings/display/multi-inno,mi0283qt.txt
-
-DRM DRIVER FOR MSM ADRENO GPU
-M:     Rob Clark <robdclark@gmail.com>
-L:     linux-arm-msm@vger.kernel.org
-L:     dri-devel@lists.freedesktop.org
-L:     freedreno@lists.freedesktop.org
-T:     git git://people.freedesktop.org/~robclark/linux
-S:     Maintained
-F:     drivers/gpu/drm/msm/
-F:     include/uapi/drm/msm_drm.h
-F:     Documentation/devicetree/bindings/display/msm/
-
-DRM DRIVER FOR NVIDIA GEFORCE/QUADRO GPUS
-M:     Ben Skeggs <bskeggs@redhat.com>
-L:     dri-devel@lists.freedesktop.org
-L:     nouveau@lists.freedesktop.org
-T:     git git://github.com/skeggsb/linux
-S:     Supported
-F:     drivers/gpu/drm/nouveau/
-F:     include/uapi/drm/nouveau_drm.h
-
 DRM DRIVERS FOR NVIDIA TEGRA
 M:     Thierry Reding <thierry.reding@gmail.com>
 L:     dri-devel@lists.freedesktop.org
@@ -4511,21 +4529,6 @@ F:       include/linux/host1x.h
 F:     include/uapi/drm/tegra_drm.h
 F:     Documentation/devicetree/bindings/display/tegra/nvidia,tegra20-host1x.txt
 
-DRM DRIVER FOR MATROX G200/G400 GRAPHICS CARDS
-S:     Orphan / Obsolete
-F:     drivers/gpu/drm/mga/
-F:     include/uapi/drm/mga_drm.h
-
-DRM DRIVER FOR MGA G200 SERVER GRAPHICS CHIPS
-M:     Dave Airlie <airlied@redhat.com>
-S:     Odd Fixes
-F:     drivers/gpu/drm/mgag200/
-
-DRM DRIVER FOR RAGE 128 VIDEO CARDS
-S:     Orphan / Obsolete
-F:     drivers/gpu/drm/r128/
-F:     include/uapi/drm/r128_drm.h
-
 DRM DRIVERS FOR RENESAS
 M:     Laurent Pinchart <laurent.pinchart@ideasonboard.com>
 L:     dri-devel@lists.freedesktop.org
@@ -4538,15 +4541,6 @@ F:       include/linux/platform_data/shmob_drm.h
 F:     Documentation/devicetree/bindings/display/bridge/renesas,dw-hdmi.txt
 F:     Documentation/devicetree/bindings/display/renesas,du.txt
 
-DRM DRIVER FOR QXL VIRTUAL GPU
-M:     Dave Airlie <airlied@redhat.com>
-M:     Gerd Hoffmann <kraxel@redhat.com>
-L:     virtualization@lists.linux-foundation.org
-T:     git git://anongit.freedesktop.org/drm/drm-misc
-S:     Maintained
-F:     drivers/gpu/drm/qxl/
-F:     include/uapi/drm/qxl_drm.h
-
 DRM DRIVERS FOR ROCKCHIP
 M:     Mark Yao <mark.yao@rock-chips.com>
 L:     dri-devel@lists.freedesktop.org
@@ -4555,16 +4549,6 @@ F:       drivers/gpu/drm/rockchip/
 F:     Documentation/devicetree/bindings/display/rockchip/
 T:     git git://anongit.freedesktop.org/drm/drm-misc
 
-DRM DRIVER FOR SAVAGE VIDEO CARDS
-S:     Orphan / Obsolete
-F:     drivers/gpu/drm/savage/
-F:     include/uapi/drm/savage_drm.h
-
-DRM DRIVER FOR SIS VIDEO CARDS
-S:     Orphan / Obsolete
-F:     drivers/gpu/drm/sis/
-F:     include/uapi/drm/sis_drm.h
-
 DRM DRIVERS FOR STI
 M:     Benjamin Gaignard <benjamin.gaignard@linaro.org>
 M:     Vincent Abriou <vincent.abriou@st.com>
@@ -4585,36 +4569,20 @@ S:      Maintained
 F:     drivers/gpu/drm/stm
 F:     Documentation/devicetree/bindings/display/st,stm32-ltdc.txt
 
-DRM DRIVER FOR TDFX VIDEO CARDS
-S:     Orphan / Obsolete
-F:     drivers/gpu/drm/tdfx/
-
-DRM DRIVER FOR USB DISPLAYLINK VIDEO ADAPTERS
-M:     Dave Airlie <airlied@redhat.com>
-S:     Odd Fixes
-F:     drivers/gpu/drm/udl/
-
-DRM DRIVERS FOR VIVANTE GPU IP
-M:     Lucas Stach <l.stach@pengutronix.de>
-R:     Russell King <linux+etnaviv@armlinux.org.uk>
-R:     Christian Gmeiner <christian.gmeiner@gmail.com>
-L:     etnaviv@lists.freedesktop.org
+DRM DRIVERS FOR TI LCDC
+M:     Jyri Sarha <jsarha@ti.com>
+R:     Tomi Valkeinen <tomi.valkeinen@ti.com>
 L:     dri-devel@lists.freedesktop.org
 S:     Maintained
-F:     drivers/gpu/drm/etnaviv/
-F:     include/uapi/drm/etnaviv_drm.h
-F:     Documentation/devicetree/bindings/display/etnaviv/
+F:     drivers/gpu/drm/tilcdc/
+F:     Documentation/devicetree/bindings/display/tilcdc/
 
-DRM DRIVER FOR VMWARE VIRTUAL GPU
-M:     "VMware Graphics" <linux-graphics-maintainer@vmware.com>
-M:     Sinclair Yeh <syeh@vmware.com>
-M:     Thomas Hellstrom <thellstrom@vmware.com>
+DRM DRIVERS FOR TI OMAP
+M:     Tomi Valkeinen <tomi.valkeinen@ti.com>
 L:     dri-devel@lists.freedesktop.org
-T:     git git://people.freedesktop.org/~syeh/repos_linux
-T:     git git://people.freedesktop.org/~thomash/linux
-S:     Supported
-F:     drivers/gpu/drm/vmwgfx/
-F:     include/uapi/drm/vmwgfx_drm.h
+S:     Maintained
+F:     drivers/gpu/drm/omapdrm/
+F:     Documentation/devicetree/bindings/display/ti/
 
 DRM DRIVERS FOR VC4
 M:     Eric Anholt <eric@anholt.net>
@@ -4625,20 +4593,16 @@ F:      include/uapi/drm/vc4_drm.h
 F:     Documentation/devicetree/bindings/display/brcm,bcm-vc4.txt
 T:     git git://anongit.freedesktop.org/drm/drm-misc
 
-DRM DRIVERS FOR TI OMAP
-M:     Tomi Valkeinen <tomi.valkeinen@ti.com>
-L:     dri-devel@lists.freedesktop.org
-S:     Maintained
-F:     drivers/gpu/drm/omapdrm/
-F:     Documentation/devicetree/bindings/display/ti/
-
-DRM DRIVERS FOR TI LCDC
-M:     Jyri Sarha <jsarha@ti.com>
-R:     Tomi Valkeinen <tomi.valkeinen@ti.com>
+DRM DRIVERS FOR VIVANTE GPU IP
+M:     Lucas Stach <l.stach@pengutronix.de>
+R:     Russell King <linux+etnaviv@armlinux.org.uk>
+R:     Christian Gmeiner <christian.gmeiner@gmail.com>
+L:     etnaviv@lists.freedesktop.org
 L:     dri-devel@lists.freedesktop.org
 S:     Maintained
-F:     drivers/gpu/drm/tilcdc/
-F:     Documentation/devicetree/bindings/display/tilcdc/
+F:     drivers/gpu/drm/etnaviv/
+F:     include/uapi/drm/etnaviv_drm.h
+F:     Documentation/devicetree/bindings/display/etnaviv/
 
 DRM DRIVERS FOR ZTE ZX
 M:     Shawn Guo <shawnguo@kernel.org>
@@ -4648,6 +4612,16 @@ F:       drivers/gpu/drm/zte/
 F:     Documentation/devicetree/bindings/display/zte,vou.txt
 T:     git git://anongit.freedesktop.org/drm/drm-misc
 
+DRM PANEL DRIVERS
+M:     Thierry Reding <thierry.reding@gmail.com>
+L:     dri-devel@lists.freedesktop.org
+T:     git git://anongit.freedesktop.org/tegra/linux.git
+S:     Maintained
+F:     drivers/gpu/drm/drm_panel.c
+F:     drivers/gpu/drm/panel/
+F:     include/drm/drm_panel.h
+F:     Documentation/devicetree/bindings/display/panel/
+
 DSBR100 USB FM RADIO DRIVER
 M:     Alexey Klimov <klimov.linux@gmail.com>
 L:     linux-media@vger.kernel.org
@@ -4779,13 +4753,6 @@ S:       Maintained
 F:     drivers/media/usb/dvb-usb-v2/dvb_usb*
 F:     drivers/media/usb/dvb-usb-v2/usb_urb.c
 
-DONGWOON DW9714 LENS VOICE COIL DRIVER
-M:     Sakari Ailus <sakari.ailus@linux.intel.com>
-L:     linux-media@vger.kernel.org
-T:     git git://linuxtv.org/media_tree.git
-S:     Maintained
-F:     drivers/media/i2c/dw9714.c
-
 DYNAMIC DEBUG
 M:     Jason Baron <jbaron@akamai.com>
 S:     Maintained
@@ -4841,19 +4808,6 @@ S:       Supported
 F:     Documentation/filesystems/ecryptfs.txt
 F:     fs/ecryptfs/
 
-EDAC-CORE
-M:     Borislav Petkov <bp@alien8.de>
-M:     Mauro Carvalho Chehab <mchehab@s-opensource.com>
-M:     Mauro Carvalho Chehab <mchehab@kernel.org>
-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
-S:     Supported
-F:     Documentation/admin-guide/ras.rst
-F:     Documentation/driver-api/edac.rst
-F:     drivers/edac/
-F:     include/linux/edac.h
-
 EDAC-AMD64
 M:     Borislav Petkov <bp@alien8.de>
 L:     linux-edac@vger.kernel.org
@@ -4875,6 +4829,19 @@ S:       Supported
 F:     drivers/edac/octeon_edac*
 F:     drivers/edac/thunderx_edac*
 
+EDAC-CORE
+M:     Borislav Petkov <bp@alien8.de>
+M:     Mauro Carvalho Chehab <mchehab@s-opensource.com>
+M:     Mauro Carvalho Chehab <mchehab@kernel.org>
+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
+S:     Supported
+F:     Documentation/admin-guide/ras.rst
+F:     Documentation/driver-api/edac.rst
+F:     drivers/edac/
+F:     include/linux/edac.h
+
 EDAC-E752X
 M:     Mark Gross <mark.gross@intel.com>
 L:     linux-edac@vger.kernel.org
@@ -4899,12 +4866,6 @@ L:       linux-edac@vger.kernel.org
 S:     Maintained
 F:     drivers/edac/ghes_edac.c
 
-EDAC-I82443BXGX
-M:     Tim Small <tim@buttersideup.com>
-L:     linux-edac@vger.kernel.org
-S:     Maintained
-F:     drivers/edac/i82443bxgx_edac.c
-
 EDAC-I3000
 L:     linux-edac@vger.kernel.org
 S:     Orphan
@@ -4936,6 +4897,12 @@ L:       linux-edac@vger.kernel.org
 S:     Maintained
 F:     drivers/edac/i7core_edac.c
 
+EDAC-I82443BXGX
+M:     Tim Small <tim@buttersideup.com>
+L:     linux-edac@vger.kernel.org
+S:     Maintained
+F:     drivers/edac/i82443bxgx_edac.c
+
 EDAC-I82975X
 M:     Ranganathan Desikan <ravi@jetztechnologies.com>
 M:     "Arvind R." <arvino55@gmail.com>
@@ -4955,18 +4922,18 @@ L:      linux-edac@vger.kernel.org
 S:     Maintained
 F:     drivers/edac/mpc85xx_edac.[ch]
 
-EDAC-PND2
-M:     Tony Luck <tony.luck@intel.com>
-L:     linux-edac@vger.kernel.org
-S:     Maintained
-F:     drivers/edac/pnd2_edac.[ch]
-
 EDAC-PASEMI
 M:     Egor Martovetsky <egor@pasemi.com>
 L:     linux-edac@vger.kernel.org
 S:     Maintained
 F:     drivers/edac/pasemi_edac.c
 
+EDAC-PND2
+M:     Tony Luck <tony.luck@intel.com>
+L:     linux-edac@vger.kernel.org
+S:     Maintained
+F:     drivers/edac/pnd2_edac.[ch]
+
 EDAC-R82600
 M:     Tim Small <tim@buttersideup.com>
 L:     linux-edac@vger.kernel.org
@@ -4986,13 +4953,6 @@ L:       linux-edac@vger.kernel.org
 S:     Maintained
 F:     drivers/edac/skx_edac.c
 
-EDAC-XGENE
-APPLIED MICRO (APM) X-GENE SOC EDAC
-M:     Loc Ho <lho@apm.com>
-S:     Supported
-F:     drivers/edac/xgene_edac.c
-F:     Documentation/devicetree/bindings/edac/apm-xgene-edac.txt
-
 EDIROL UA-101/UA-1000 DRIVER
 M:     Clemens Ladisch <clemens@ladisch.de>
 L:     alsa-devel@alsa-project.org (moderated for non-subscribers)
@@ -5000,21 +4960,12 @@ T:      git git://git.alsa-project.org/alsa-kernel.git
 S:     Maintained
 F:     sound/usb/misc/ua101.c
 
-EXTENSIBLE FIRMWARE INTERFACE (EFI)
-M:     Matt Fleming <matt@codeblueprint.co.uk>
-M:     Ard Biesheuvel <ard.biesheuvel@linaro.org>
+EFI TEST DRIVER
 L:     linux-efi@vger.kernel.org
-T:     git git://git.kernel.org/pub/scm/linux/kernel/git/efi/efi.git
+M:     Ivan Hu <ivan.hu@canonical.com>
+M:     Matt Fleming <matt@codeblueprint.co.uk>
 S:     Maintained
-F:     Documentation/efi-stub.txt
-F:     arch/*/kernel/efi.c
-F:     arch/x86/boot/compressed/eboot.[ch]
-F:     arch/*/include/asm/efi.h
-F:     arch/x86/platform/efi/
-F:     drivers/firmware/efi/
-F:     include/linux/efi*.h
-F:     arch/arm/boot/compressed/efi-header.S
-F:     arch/arm64/kernel/efi-entry.S
+F:     drivers/firmware/efi/test/
 
 EFI VARIABLE FILESYSTEM
 M:     Matthew Garrett <matthew.garrett@nebula.com>
@@ -5031,13 +4982,6 @@ M:       Peter Jones <pjones@redhat.com>
 S:     Maintained
 F:     drivers/video/fbdev/efifb.c
 
-EFI TEST DRIVER
-L:     linux-efi@vger.kernel.org
-M:     Ivan Hu <ivan.hu@canonical.com>
-M:     Matt Fleming <matt@codeblueprint.co.uk>
-S:     Maintained
-F:     drivers/firmware/efi/test/
-
 EFS FILESYSTEM
 W:     http://aeschi.ch.eu.org/efs/
 S:     Orphan
@@ -5179,6 +5123,22 @@ L:       linux-security-module@vger.kernel.org
 S:     Supported
 F:     security/integrity/evm/
 
+EXTENSIBLE FIRMWARE INTERFACE (EFI)
+M:     Matt Fleming <matt@codeblueprint.co.uk>
+M:     Ard Biesheuvel <ard.biesheuvel@linaro.org>
+L:     linux-efi@vger.kernel.org
+T:     git git://git.kernel.org/pub/scm/linux/kernel/git/efi/efi.git
+S:     Maintained
+F:     Documentation/efi-stub.txt
+F:     arch/*/kernel/efi.c
+F:     arch/x86/boot/compressed/eboot.[ch]
+F:     arch/*/include/asm/efi.h
+F:     arch/x86/platform/efi/
+F:     drivers/firmware/efi/
+F:     include/linux/efi*.h
+F:     arch/arm/boot/compressed/efi-header.S
+F:     arch/arm64/kernel/efi-entry.S
+
 EXTERNAL CONNECTOR SUBSYSTEM (EXTCON)
 M:     MyungJoo Ham <myungjoo.ham@samsung.com>
 M:     Chanwoo Choi <cw00.choi@samsung.com>
@@ -5429,6 +5389,14 @@ L:       linuxppc-dev@lists.ozlabs.org
 S:     Maintained
 F:     drivers/dma/fsldma.*
 
+FREESCALE eTSEC ETHERNET DRIVER (GIANFAR)
+M:     Claudiu Manoil <claudiu.manoil@freescale.com>
+L:     netdev@vger.kernel.org
+S:     Maintained
+F:     drivers/net/ethernet/freescale/gianfar*
+X:     drivers/net/ethernet/freescale/gianfar_ptp.c
+F:     Documentation/devicetree/bindings/net/fsl-tsec-phy.txt
+
 FREESCALE GPMI NAND DRIVER
 M:     Han Xu <han.xu@nxp.com>
 L:     linux-mtd@lists.infradead.org
@@ -5442,6 +5410,15 @@ L:       linux-i2c@vger.kernel.org
 S:     Maintained
 F:     drivers/i2c/busses/i2c-cpm.c
 
+FREESCALE IMX / MXC FEC DRIVER
+M:     Fugang Duan <fugang.duan@nxp.com>
+L:     netdev@vger.kernel.org
+S:     Maintained
+F:     drivers/net/ethernet/freescale/fec_main.c
+F:     drivers/net/ethernet/freescale/fec_ptp.c
+F:     drivers/net/ethernet/freescale/fec.h
+F:     Documentation/devicetree/bindings/net/fsl-fec.txt
+
 FREESCALE IMX / MXC FRAMEBUFFER DRIVER
 M:     Sascha Hauer <kernel@pengutronix.de>
 L:     linux-fbdev@vger.kernel.org
@@ -5450,29 +5427,11 @@ S:      Maintained
 F:     include/linux/platform_data/video-imxfb.h
 F:     drivers/video/fbdev/imxfb.c
 
-FREESCALE QUAD SPI DRIVER
-M:     Han Xu <han.xu@nxp.com>
-L:     linux-mtd@lists.infradead.org
-S:     Maintained
-F:     drivers/mtd/spi-nor/fsl-quadspi.c
-
-FREESCALE SOC FS_ENET DRIVER
-M:     Pantelis Antoniou <pantelis.antoniou@gmail.com>
-M:     Vitaly Bordug <vbordug@ru.mvista.com>
-L:     linuxppc-dev@lists.ozlabs.org
-L:     netdev@vger.kernel.org
-S:     Maintained
-F:     drivers/net/ethernet/freescale/fs_enet/
-F:     include/linux/fs_enet_pd.h
-
-FREESCALE IMX / MXC FEC DRIVER
-M:     Fugang Duan <fugang.duan@nxp.com>
+FREESCALE QORIQ DPAA ETHERNET DRIVER
+M:     Madalin Bucur <madalin.bucur@nxp.com>
 L:     netdev@vger.kernel.org
 S:     Maintained
-F:     drivers/net/ethernet/freescale/fec_main.c
-F:     drivers/net/ethernet/freescale/fec_ptp.c
-F:     drivers/net/ethernet/freescale/fec.h
-F:     Documentation/devicetree/bindings/net/fsl-fec.txt
+F:     drivers/net/ethernet/freescale/dpaa
 
 FREESCALE QORIQ DPAA FMAN DRIVER
 M:     Madalin Bucur <madalin.bucur@nxp.com>
@@ -5481,20 +5440,11 @@ S:      Maintained
 F:     drivers/net/ethernet/freescale/fman
 F:     Documentation/devicetree/bindings/powerpc/fsl/fman.txt
 
-FREESCALE QORIQ DPAA ETHERNET DRIVER
-M:     Madalin Bucur <madalin.bucur@nxp.com>
-L:     netdev@vger.kernel.org
-S:     Maintained
-F:     drivers/net/ethernet/freescale/dpaa
-
-FREESCALE SOC DRIVERS
-M:     Li Yang <leoyang.li@nxp.com>
-L:     linuxppc-dev@lists.ozlabs.org
-L:     linux-arm-kernel@lists.infradead.org
+FREESCALE QUAD SPI DRIVER
+M:     Han Xu <han.xu@nxp.com>
+L:     linux-mtd@lists.infradead.org
 S:     Maintained
-F:     Documentation/devicetree/bindings/soc/fsl/
-F:     drivers/soc/fsl/
-F:     include/linux/fsl/
+F:     drivers/mtd/spi-nor/fsl-quadspi.c
 
 FREESCALE QUICC ENGINE LIBRARY
 M:     Qiang Zhao <qiang.zhao@nxp.com>
@@ -5504,13 +5454,6 @@ F:       drivers/soc/fsl/qe/
 F:     include/soc/fsl/*qe*.h
 F:     include/soc/fsl/*ucc*.h
 
-FREESCALE USB PERIPHERAL DRIVERS
-M:     Li Yang <leoyang.li@nxp.com>
-L:     linux-usb@vger.kernel.org
-L:     linuxppc-dev@lists.ozlabs.org
-S:     Maintained
-F:     drivers/usb/gadget/udc/fsl*
-
 FREESCALE QUICC ENGINE UCC ETHERNET DRIVER
 M:     Li Yang <leoyang.li@nxp.com>
 L:     netdev@vger.kernel.org
@@ -5518,14 +5461,6 @@ L:       linuxppc-dev@lists.ozlabs.org
 S:     Maintained
 F:     drivers/net/ethernet/freescale/ucc_geth*
 
-FREESCALE eTSEC ETHERNET DRIVER (GIANFAR)
-M:     Claudiu Manoil <claudiu.manoil@freescale.com>
-L:     netdev@vger.kernel.org
-S:     Maintained
-F:     drivers/net/ethernet/freescale/gianfar*
-X:     drivers/net/ethernet/freescale/gianfar_ptp.c
-F:     Documentation/devicetree/bindings/net/fsl-tsec-phy.txt
-
 FREESCALE QUICC ENGINE UCC HDLC DRIVER
 M:     Zhao Qiang <qiang.zhao@nxp.com>
 L:     netdev@vger.kernel.org
@@ -5539,6 +5474,24 @@ L:       linuxppc-dev@lists.ozlabs.org
 S:     Maintained
 F:     drivers/tty/serial/ucc_uart.c
 
+FREESCALE SOC DRIVERS
+M:     Li Yang <leoyang.li@nxp.com>
+L:     linuxppc-dev@lists.ozlabs.org
+L:     linux-arm-kernel@lists.infradead.org
+S:     Maintained
+F:     Documentation/devicetree/bindings/soc/fsl/
+F:     drivers/soc/fsl/
+F:     include/linux/fsl/
+
+FREESCALE SOC FS_ENET DRIVER
+M:     Pantelis Antoniou <pantelis.antoniou@gmail.com>
+M:     Vitaly Bordug <vbordug@ru.mvista.com>
+L:     linuxppc-dev@lists.ozlabs.org
+L:     netdev@vger.kernel.org
+S:     Maintained
+F:     drivers/net/ethernet/freescale/fs_enet/
+F:     include/linux/fs_enet_pd.h
+
 FREESCALE SOC SOUND DRIVERS
 M:     Timur Tabi <timur@tabi.org>
 M:     Nicolin Chen <nicoleotsuka@gmail.com>
@@ -5551,6 +5504,13 @@ F:       sound/soc/fsl/fsl*
 F:     sound/soc/fsl/imx*
 F:     sound/soc/fsl/mpc8610_hpcd.c
 
+FREESCALE USB PERIPHERAL DRIVERS
+M:     Li Yang <leoyang.li@nxp.com>
+L:     linux-usb@vger.kernel.org
+L:     linuxppc-dev@lists.ozlabs.org
+S:     Maintained
+F:     drivers/usb/gadget/udc/fsl*
+
 FREEVXFS FILESYSTEM
 M:     Christoph Hellwig <hch@infradead.org>
 W:     ftp://ftp.openlinux.org/pub/people/hch/vxfs
@@ -5786,6 +5746,15 @@ L:       linux-input@vger.kernel.org
 S:     Maintained
 F:     drivers/input/touchscreen/goodix.c
 
+GPIO ACPI SUPPORT
+M:     Mika Westerberg <mika.westerberg@linux.intel.com>
+M:     Andy Shevchenko <andriy.shevchenko@linux.intel.com>
+L:     linux-gpio@vger.kernel.org
+L:     linux-acpi@vger.kernel.org
+S:     Maintained
+F:     Documentation/acpi/gpio-properties.txt
+F:     drivers/gpio/gpiolib-acpi.c
+
 GPIO MOCKUP DRIVER
 M:     Bamvor Jian Zhang <bamvor.zhangjian@linaro.org>
 L:     linux-gpio@vger.kernel.org
@@ -5809,15 +5778,6 @@ F:       include/asm-generic/gpio.h
 F:     include/uapi/linux/gpio.h
 F:     tools/gpio/
 
-GPIO ACPI SUPPORT
-M:     Mika Westerberg <mika.westerberg@linux.intel.com>
-M:     Andy Shevchenko <andriy.shevchenko@linux.intel.com>
-L:     linux-gpio@vger.kernel.org
-L:     linux-acpi@vger.kernel.org
-S:     Maintained
-F:     Documentation/acpi/gpio-properties.txt
-F:     drivers/gpio/gpiolib-acpi.c
-
 GRE DEMULTIPLEXER DRIVER
 M:     Dmitry Kozlov <xeb@mail.ru>
 L:     netdev@vger.kernel.org
@@ -5832,14 +5792,6 @@ L:       netdev@vger.kernel.org
 S:     Maintained
 F:     drivers/net/ethernet/aeroflex/
 
-GREYBUS SUBSYSTEM
-M:     Johan Hovold <johan@kernel.org>
-M:     Alex Elder <elder@kernel.org>
-M:     Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-S:     Maintained
-F:     drivers/staging/greybus/
-L:     greybus-dev@lists.linaro.org (moderated for non-subscribers)
-
 GREYBUS AUDIO PROTOCOLS DRIVERS
 M:     Vaibhav Agarwal <vaibhav.sr@gmail.com>
 M:     Mark Greer <mgreer@animalcreek.com>
@@ -5857,24 +5809,7 @@ F:       drivers/staging/greybus/audio_manager_sysfs.c
 F:     drivers/staging/greybus/audio_module.c
 F:     drivers/staging/greybus/audio_topology.c
 
-GREYBUS PROTOCOLS DRIVERS
-M:     Rui Miguel Silva <rmfrfs@gmail.com>
-S:     Maintained
-F:     drivers/staging/greybus/sdio.c
-F:     drivers/staging/greybus/light.c
-F:     drivers/staging/greybus/gpio.c
-F:     drivers/staging/greybus/power_supply.c
-F:     drivers/staging/greybus/spi.c
-F:     drivers/staging/greybus/spilib.c
-
-GREYBUS PROTOCOLS DRIVERS
-M:     Bryan O'Donoghue <pure.logic@nexus-software.ie>
-S:     Maintained
-F:     drivers/staging/greybus/loopback.c
-F:     drivers/staging/greybus/timesync.c
-F:     drivers/staging/greybus/timesync_platform.c
-
-GREYBUS PROTOCOLS DRIVERS
+GREYBUS FW/HID/SPI PROTOCOLS DRIVERS
 M:     Viresh Kumar <vireshk@kernel.org>
 S:     Maintained
 F:     drivers/staging/greybus/authentication.c
@@ -5891,11 +5826,12 @@ F:      drivers/staging/greybus/spi.c
 F:     drivers/staging/greybus/spilib.c
 F:     drivers/staging/greybus/spilib.h
 
-GREYBUS PROTOCOLS DRIVERS
-M:     David Lin <dtwlin@gmail.com>
+GREYBUS LOOBACK/TIME PROTOCOLS DRIVERS
+M:     Bryan O'Donoghue <pure.logic@nexus-software.ie>
 S:     Maintained
-F:     drivers/staging/greybus/uart.c
-F:     drivers/staging/greybus/log.c
+F:     drivers/staging/greybus/loopback.c
+F:     drivers/staging/greybus/timesync.c
+F:     drivers/staging/greybus/timesync_platform.c
 
 GREYBUS PLATFORM DRIVERS
 M:     Vaibhav Hiremath <hvaibhav.linux@gmail.com>
@@ -5904,6 +5840,30 @@ F:       drivers/staging/greybus/arche-platform.c
 F:     drivers/staging/greybus/arche-apb-ctrl.c
 F:     drivers/staging/greybus/arche_platform.h
 
+GREYBUS SDIO/GPIO/SPI PROTOCOLS DRIVERS
+M:     Rui Miguel Silva <rmfrfs@gmail.com>
+S:     Maintained
+F:     drivers/staging/greybus/sdio.c
+F:     drivers/staging/greybus/light.c
+F:     drivers/staging/greybus/gpio.c
+F:     drivers/staging/greybus/power_supply.c
+F:     drivers/staging/greybus/spi.c
+F:     drivers/staging/greybus/spilib.c
+
+GREYBUS SUBSYSTEM
+M:     Johan Hovold <johan@kernel.org>
+M:     Alex Elder <elder@kernel.org>
+M:     Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+S:     Maintained
+F:     drivers/staging/greybus/
+L:     greybus-dev@lists.linaro.org (moderated for non-subscribers)
+
+GREYBUS UART PROTOCOLS DRIVERS
+M:     David Lin <dtwlin@gmail.com>
+S:     Maintained
+F:     drivers/staging/greybus/uart.c
+F:     drivers/staging/greybus/log.c
+
 GS1662 VIDEO SERIALIZER
 M:     Charles-Antoine Couret <charles-antoine.couret@nexvision.fr>
 L:     linux-media@vger.kernel.org
@@ -6310,6 +6270,13 @@ L:       linuxppc-dev@lists.ozlabs.org
 S:     Odd Fixes
 F:     drivers/tty/hvc/
 
+I2C ACPI SUPPORT
+M:     Mika Westerberg <mika.westerberg@linux.intel.com>
+L:     linux-i2c@vger.kernel.org
+L:     linux-acpi@vger.kernel.org
+S:     Maintained
+F:     drivers/i2c/i2c-core-acpi.c
+
 I2C MUXES
 M:     Peter Rosin <peda@axentia.se>
 L:     linux-i2c@vger.kernel.org
@@ -6332,6 +6299,36 @@ F:       Documentation/i2c/busses/i2c-parport-light
 F:     drivers/i2c/busses/i2c-parport.c
 F:     drivers/i2c/busses/i2c-parport-light.c
 
+I2C SUBSYSTEM
+M:     Wolfram Sang <wsa@the-dreams.de>
+L:     linux-i2c@vger.kernel.org
+W:     https://i2c.wiki.kernel.org/
+Q:     https://patchwork.ozlabs.org/project/linux-i2c/list/
+T:     git git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux.git
+S:     Maintained
+F:     Documentation/devicetree/bindings/i2c/
+F:     Documentation/i2c/
+F:     drivers/i2c/
+F:     drivers/i2c/*/
+F:     include/linux/i2c.h
+F:     include/linux/i2c-*.h
+F:     include/uapi/linux/i2c.h
+F:     include/uapi/linux/i2c-*.h
+
+I2C-TAOS-EVM DRIVER
+M:     Jean Delvare <jdelvare@suse.com>
+L:     linux-i2c@vger.kernel.org
+S:     Maintained
+F:     Documentation/i2c/busses/i2c-taos-evm
+F:     drivers/i2c/busses/i2c-taos-evm.c
+
+I2C-TINY-USB DRIVER
+M:     Till Harbaum <till@harbaum.org>
+L:     linux-i2c@vger.kernel.org
+W:     http://www.harbaum.org/till/i2c_tiny_usb
+S:     Maintained
+F:     drivers/i2c/busses/i2c-tiny-usb.c
+
 I2C/SMBUS CONTROLLER DRIVERS FOR PC
 M:     Jean Delvare <jdelvare@suse.com>
 L:     linux-i2c@vger.kernel.org
@@ -6365,56 +6362,19 @@ F:      drivers/i2c/busses/i2c-sis630.c
 F:     drivers/i2c/busses/i2c-sis96x.c
 F:     drivers/i2c/busses/i2c-via.c
 F:     drivers/i2c/busses/i2c-viapro.c
-
-I2C/SMBUS ISMT DRIVER
-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
-
-I2C/SMBUS STUB DRIVER
-M:     Jean Delvare <jdelvare@suse.com>
-L:     linux-i2c@vger.kernel.org
-S:     Maintained
-F:     drivers/i2c/i2c-stub.c
-
-I2C SUBSYSTEM
-M:     Wolfram Sang <wsa@the-dreams.de>
-L:     linux-i2c@vger.kernel.org
-W:     https://i2c.wiki.kernel.org/
-Q:     https://patchwork.ozlabs.org/project/linux-i2c/list/
-T:     git git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux.git
-S:     Maintained
-F:     Documentation/devicetree/bindings/i2c/
-F:     Documentation/i2c/
-F:     drivers/i2c/
-F:     drivers/i2c/*/
-F:     include/linux/i2c.h
-F:     include/linux/i2c-*.h
-F:     include/uapi/linux/i2c.h
-F:     include/uapi/linux/i2c-*.h
-
-I2C ACPI SUPPORT
-M:     Mika Westerberg <mika.westerberg@linux.intel.com>
-L:     linux-i2c@vger.kernel.org
-L:     linux-acpi@vger.kernel.org
-S:     Maintained
-F:     drivers/i2c/i2c-core-acpi.c
-
-I2C-TAOS-EVM DRIVER
-M:     Jean Delvare <jdelvare@suse.com>
+
+I2C/SMBUS ISMT DRIVER
+M:     Seth Heasley <seth.heasley@intel.com>
+M:     Neil Horman <nhorman@tuxdriver.com>
 L:     linux-i2c@vger.kernel.org
-S:     Maintained
-F:     Documentation/i2c/busses/i2c-taos-evm
-F:     drivers/i2c/busses/i2c-taos-evm.c
+F:     drivers/i2c/busses/i2c-ismt.c
+F:     Documentation/i2c/busses/i2c-ismt
 
-I2C-TINY-USB DRIVER
-M:     Till Harbaum <till@harbaum.org>
+I2C/SMBUS STUB DRIVER
+M:     Jean Delvare <jdelvare@suse.com>
 L:     linux-i2c@vger.kernel.org
-W:     http://www.harbaum.org/till/i2c_tiny_usb
 S:     Maintained
-F:     drivers/i2c/busses/i2c-tiny-usb.c
+F:     drivers/i2c/i2c-stub.c
 
 i386 BOOT CODE
 M:     "H. Peter Anvin" <hpa@zytor.com>
@@ -6434,17 +6394,15 @@ T:      git git://git.kernel.org/pub/scm/linux/kernel/git/aegl/linux.git
 S:     Maintained
 F:     arch/ia64/
 
-IBM Power VMX Cryptographic instructions
-M:     Leonidas S. Barbosa <leosilva@linux.vnet.ibm.com>
-M:     Paulo Flabiano Smorigo <pfsmorigo@linux.vnet.ibm.com>
-L:     linux-crypto@vger.kernel.org
+IBM Power 842 compression accelerator
+M:     Haren Myneni <haren@us.ibm.com>
 S:     Supported
-F:     drivers/crypto/vmx/Makefile
-F:     drivers/crypto/vmx/Kconfig
-F:     drivers/crypto/vmx/vmx.c
-F:     drivers/crypto/vmx/aes*
-F:     drivers/crypto/vmx/ghash*
-F:     drivers/crypto/vmx/ppc-xlate.pl
+F:     drivers/crypto/nx/Makefile
+F:     drivers/crypto/nx/Kconfig
+F:     drivers/crypto/nx/nx-842*
+F:     include/linux/sw842.h
+F:     crypto/842.c
+F:     lib/842/
 
 IBM Power in-Nest Crypto Acceleration
 M:     Leonidas S. Barbosa <leosilva@linux.vnet.ibm.com>
@@ -6459,33 +6417,29 @@ F:      drivers/crypto/nx/nx.*
 F:     drivers/crypto/nx/nx_csbcpb.h
 F:     drivers/crypto/nx/nx_debugfs.h
 
-IBM Power 842 compression accelerator
-M:     Haren Myneni <haren@us.ibm.com>
-S:     Supported
-F:     drivers/crypto/nx/Makefile
-F:     drivers/crypto/nx/Kconfig
-F:     drivers/crypto/nx/nx-842*
-F:     include/linux/sw842.h
-F:     crypto/842.c
-F:     lib/842/
-
 IBM Power Linux RAID adapter
 M:     Brian King <brking@us.ibm.com>
 S:     Supported
 F:     drivers/scsi/ipr.*
 
-IBM Power Virtual Ethernet Device Driver
+IBM Power SRIOV Virtual NIC Device Driver
 M:     Thomas Falcon <tlfalcon@linux.vnet.ibm.com>
+M:     John Allen <jallen@linux.vnet.ibm.com>
 L:     netdev@vger.kernel.org
 S:     Supported
-F:     drivers/net/ethernet/ibm/ibmveth.*
+F:     drivers/net/ethernet/ibm/ibmvnic.*
 
-IBM Power SRIOV Virtual NIC Device Driver
+IBM Power Virtual Ethernet Device Driver
 M:     Thomas Falcon <tlfalcon@linux.vnet.ibm.com>
-M:     John Allen <jallen@linux.vnet.ibm.com>
 L:     netdev@vger.kernel.org
 S:     Supported
-F:     drivers/net/ethernet/ibm/ibmvnic.*
+F:     drivers/net/ethernet/ibm/ibmveth.*
+
+IBM Power Virtual FC Device Drivers
+M:     Tyrel Datwyler <tyreld@linux.vnet.ibm.com>
+L:     linux-scsi@vger.kernel.org
+S:     Supported
+F:     drivers/scsi/ibmvscsi/ibmvfc*
 
 IBM Power Virtual SCSI Device Drivers
 M:     Tyrel Datwyler <tyreld@linux.vnet.ibm.com>
@@ -6502,11 +6456,17 @@ L:      target-devel@vger.kernel.org
 S:     Supported
 F:     drivers/scsi/ibmvscsi_tgt/
 
-IBM Power Virtual FC Device Drivers
-M:     Tyrel Datwyler <tyreld@linux.vnet.ibm.com>
-L:     linux-scsi@vger.kernel.org
+IBM Power VMX Cryptographic instructions
+M:     Leonidas S. Barbosa <leosilva@linux.vnet.ibm.com>
+M:     Paulo Flabiano Smorigo <pfsmorigo@linux.vnet.ibm.com>
+L:     linux-crypto@vger.kernel.org
 S:     Supported
-F:     drivers/scsi/ibmvscsi/ibmvfc*
+F:     drivers/crypto/vmx/Makefile
+F:     drivers/crypto/vmx/Kconfig
+F:     drivers/crypto/vmx/vmx.c
+F:     drivers/crypto/vmx/aes*
+F:     drivers/crypto/vmx/ghash*
+F:     drivers/crypto/vmx/ppc-xlate.pl
 
 IBM ServeRAID RAID DRIVER
 S:     Orphan
@@ -6752,6 +6712,12 @@ T:       git git://git.kernel.org/pub/scm/linux/kernel/git/zohar/linux-integrity.git
 S:     Supported
 F:     security/integrity/ima/
 
+INTEL 810/815 FRAMEBUFFER DRIVER
+M:     Antonino Daplas <adaplas@gmail.com>
+L:     linux-fbdev@vger.kernel.org
+S:     Maintained
+F:     drivers/video/fbdev/i810/
+
 INTEL ASoC BDW/HSW DRIVERS
 M:     Jie Yang <yang.jie@linux.intel.com>
 L:     alsa-devel@alsa-project.org (moderated for non-subscribers)
@@ -6769,96 +6735,20 @@ T:      git git://git.code.sf.net/p/intel-sas/isci
 S:     Supported
 F:     drivers/scsi/isci/
 
-INTEL HID EVENT DRIVER
-M:     Alex Hung <alex.hung@canonical.com>
-L:     platform-driver-x86@vger.kernel.org
-S:     Maintained
-F:     drivers/platform/x86/intel-hid.c
-
-INTEL VIRTUAL BUTTON DRIVER
-M:     AceLan Kao <acelan.kao@canonical.com>
-L:     platform-driver-x86@vger.kernel.org
-S:     Maintained
-F:     drivers/platform/x86/intel-vbtn.c
-
-INTEL IDLE DRIVER
-M:     Jacob Pan <jacob.jun.pan@linux.intel.com>
-M:     Len Brown <lenb@kernel.org>
-L:     linux-pm@vger.kernel.org
-T:     git git://git.kernel.org/pub/scm/linux/kernel/git/lenb/linux.git
-B:     https://bugzilla.kernel.org
-S:     Supported
-F:     drivers/idle/intel_idle.c
-
-INTEL INTEGRATED SENSOR HUB DRIVER
-M:     Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
-M:     Jiri Kosina <jikos@kernel.org>
-L:     linux-input@vger.kernel.org
-S:     Maintained
-F:     drivers/hid/intel-ish-hid/
-
-INTEL PSTATE DRIVER
-M:     Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
-M:     Len Brown <lenb@kernel.org>
-L:     linux-pm@vger.kernel.org
-S:     Supported
-F:     drivers/cpufreq/intel_pstate.c
-
-INTEL FRAMEBUFFER DRIVER (excluding 810 and 815)
-M:     Maik Broemme <mbroemme@libmpq.org>
-L:     linux-fbdev@vger.kernel.org
-S:     Maintained
-F:     Documentation/fb/intelfb.txt
-F:     drivers/video/fbdev/intelfb/
-
-INTEL 810/815 FRAMEBUFFER DRIVER
-M:     Antonino Daplas <adaplas@gmail.com>
-L:     linux-fbdev@vger.kernel.org
-S:     Maintained
-F:     drivers/video/fbdev/i810/
-
-INTEL MENLOW THERMAL DRIVER
-M:     Sujith Thomas <sujith.thomas@intel.com>
-L:     platform-driver-x86@vger.kernel.org
-W:     https://01.org/linux-acpi
-S:     Supported
-F:     drivers/platform/x86/intel_menlow.c
-
-INTEL I/OAT DMA DRIVER
-M:     Dave Jiang <dave.jiang@intel.com>
-R:     Dan Williams <dan.j.williams@intel.com>
-L:     dmaengine@vger.kernel.org
-Q:     https://patchwork.kernel.org/project/linux-dmaengine/list/
-S:     Supported
-F:     drivers/dma/ioat*
-
-INTEL IOMMU (VT-d)
-M:     David Woodhouse <dwmw2@infradead.org>
-L:     iommu@lists.linux-foundation.org
-T:     git git://git.infradead.org/iommu-2.6.git
+INTEL DRM DRIVERS (excluding Poulsbo, Moorestown and derivative chipsets)
+M:     Daniel Vetter <daniel.vetter@intel.com>
+M:     Jani Nikula <jani.nikula@linux.intel.com>
+L:     intel-gfx@lists.freedesktop.org
+W:     https://01.org/linuxgraphics/
+B:     https://01.org/linuxgraphics/documentation/how-report-bugs
+C:     irc://chat.freenode.net/intel-gfx
+Q:     http://patchwork.freedesktop.org/project/intel-gfx/
+T:     git git://anongit.freedesktop.org/drm-intel
 S:     Supported
-F:     drivers/iommu/intel-iommu.c
-F:     include/linux/intel-iommu.h
-
-INTEL IOP-ADMA DMA DRIVER
-R:     Dan Williams <dan.j.williams@intel.com>
-S:     Odd fixes
-F:     drivers/dma/iop-adma.c
-
-INTEL IXP4XX QMGR, NPE, ETHERNET and HSS SUPPORT
-M:     Krzysztof Halasa <khalasa@piap.pl>
-S:     Maintained
-F:     arch/arm/mach-ixp4xx/include/mach/qmgr.h
-F:     arch/arm/mach-ixp4xx/include/mach/npe.h
-F:     arch/arm/mach-ixp4xx/ixp4xx_qmgr.c
-F:     arch/arm/mach-ixp4xx/ixp4xx_npe.c
-F:     drivers/net/ethernet/xscale/ixp4xx_eth.c
-F:     drivers/net/wan/ixp4xx_hss.c
-
-INTEL IXP4XX RANDOM NUMBER GENERATOR SUPPORT
-M:     Deepak Saxena <dsaxena@plexity.net>
-S:     Maintained
-F:     drivers/char/hw_random/ixp4xx-rng.c
+F:     drivers/gpu/drm/i915/
+F:     include/drm/i915*
+F:     include/uapi/drm/i915_drm.h
+F:     Documentation/gpu/i915.rst
 
 INTEL ETHERNET DRIVERS
 M:     Jeff Kirsher <jeffrey.t.kirsher@intel.com>
@@ -6883,75 +6773,80 @@ F:      drivers/net/ethernet/intel/
 F:     drivers/net/ethernet/intel/*/
 F:     include/linux/avf/virtchnl.h
 
-INTEL RDMA RNIC DRIVER
-M:     Faisal Latif <faisal.latif@intel.com>
-M:     Shiraz Saleem <shiraz.saleem@intel.com>
-L:     linux-rdma@vger.kernel.org
-S:     Supported
-F:     drivers/infiniband/hw/i40iw/
-
-INTEL MERRIFIELD GPIO DRIVER
-M:     Andy Shevchenko <andriy.shevchenko@linux.intel.com>
-L:     linux-gpio@vger.kernel.org
+INTEL FRAMEBUFFER DRIVER (excluding 810 and 815)
+M:     Maik Broemme <mbroemme@libmpq.org>
+L:     linux-fbdev@vger.kernel.org
 S:     Maintained
-F:     drivers/gpio/gpio-merrifield.c
+F:     Documentation/fb/intelfb.txt
+F:     drivers/video/fbdev/intelfb/
 
-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
+INTEL GVT-g DRIVERS (Intel GPU Virtualization)
+M:     Zhenyu Wang <zhenyuw@linux.intel.com>
+M:     Zhi Wang <zhi.a.wang@intel.com>
+L:     intel-gvt-dev@lists.freedesktop.org
+L:     intel-gfx@lists.freedesktop.org
+W:     https://01.org/igvt-g
+T:     git https://github.com/01org/gvt-linux.git
+S:     Supported
+F:     drivers/gpu/drm/i915/gvt/
 
-INTEL PRO/WIRELESS 2100, 2200BG, 2915ABG NETWORK CONNECTION SUPPORT
-M:     Stanislav Yakovlev <stas.yakovlev@gmail.com>
-L:     linux-wireless@vger.kernel.org
+INTEL HID EVENT DRIVER
+M:     Alex Hung <alex.hung@canonical.com>
+L:     platform-driver-x86@vger.kernel.org
 S:     Maintained
-F:     Documentation/networking/README.ipw2100
-F:     Documentation/networking/README.ipw2200
-F:     drivers/net/wireless/intel/ipw2x00/
+F:     drivers/platform/x86/intel-hid.c
 
-INTEL(R) TRACE HUB
-M:     Alexander Shishkin <alexander.shishkin@linux.intel.com>
+INTEL I/OAT DMA DRIVER
+M:     Dave Jiang <dave.jiang@intel.com>
+R:     Dan Williams <dan.j.williams@intel.com>
+L:     dmaengine@vger.kernel.org
+Q:     https://patchwork.kernel.org/project/linux-dmaengine/list/
 S:     Supported
-F:     Documentation/trace/intel_th.txt
-F:     drivers/hwtracing/intel_th/
+F:     drivers/dma/ioat*
 
-INTEL(R) TRUSTED EXECUTION TECHNOLOGY (TXT)
-M:     Ning Sun <ning.sun@intel.com>
-L:     tboot-devel@lists.sourceforge.net
-W:     http://tboot.sourceforge.net
-T:     hg http://tboot.hg.sourceforge.net:8000/hgroot/tboot/tboot
+INTEL IDLE DRIVER
+M:     Jacob Pan <jacob.jun.pan@linux.intel.com>
+M:     Len Brown <lenb@kernel.org>
+L:     linux-pm@vger.kernel.org
+T:     git git://git.kernel.org/pub/scm/linux/kernel/git/lenb/linux.git
+B:     https://bugzilla.kernel.org
 S:     Supported
-F:     Documentation/intel_txt.txt
-F:     include/linux/tboot.h
-F:     arch/x86/kernel/tboot.c
+F:     drivers/idle/intel_idle.c
 
-INTEL WIRELESS WIMAX CONNECTION 2400
-M:     Inaky Perez-Gonzalez <inaky.perez-gonzalez@intel.com>
-M:     linux-wimax@intel.com
-L:     wimax@linuxwimax.org (subscribers-only)
-S:     Supported
-W:     http://linuxwimax.org
-F:     Documentation/wimax/README.i2400m
-F:     drivers/net/wimax/i2400m/
-F:     include/uapi/linux/wimax/i2400m.h
+INTEL INTEGRATED SENSOR HUB DRIVER
+M:     Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
+M:     Jiri Kosina <jikos@kernel.org>
+L:     linux-input@vger.kernel.org
+S:     Maintained
+F:     drivers/hid/intel-ish-hid/
 
-INTEL WIRELESS 3945ABG/BG, 4965AGN (iwlegacy)
-M:     Stanislaw Gruszka <sgruszka@redhat.com>
-L:     linux-wireless@vger.kernel.org
+INTEL IOMMU (VT-d)
+M:     David Woodhouse <dwmw2@infradead.org>
+L:     iommu@lists.linux-foundation.org
+T:     git git://git.infradead.org/iommu-2.6.git
 S:     Supported
-F:     drivers/net/wireless/intel/iwlegacy/
+F:     drivers/iommu/intel-iommu.c
+F:     include/linux/intel-iommu.h
 
-INTEL WIRELESS WIFI LINK (iwlwifi)
-M:     Johannes Berg <johannes.berg@intel.com>
-M:     Emmanuel Grumbach <emmanuel.grumbach@intel.com>
-M:     Luca Coelho <luciano.coelho@intel.com>
-M:     Intel Linux Wireless <linuxwifi@intel.com>
-L:     linux-wireless@vger.kernel.org
-W:     http://intellinuxwireless.org
-T:     git git://git.kernel.org/pub/scm/linux/kernel/git/iwlwifi/iwlwifi.git
-S:     Supported
-F:     drivers/net/wireless/intel/iwlwifi/
+INTEL IOP-ADMA DMA DRIVER
+R:     Dan Williams <dan.j.williams@intel.com>
+S:     Odd fixes
+F:     drivers/dma/iop-adma.c
+
+INTEL IXP4XX QMGR, NPE, ETHERNET and HSS SUPPORT
+M:     Krzysztof Halasa <khalasa@piap.pl>
+S:     Maintained
+F:     arch/arm/mach-ixp4xx/include/mach/qmgr.h
+F:     arch/arm/mach-ixp4xx/include/mach/npe.h
+F:     arch/arm/mach-ixp4xx/ixp4xx_qmgr.c
+F:     arch/arm/mach-ixp4xx/ixp4xx_npe.c
+F:     drivers/net/ethernet/xscale/ixp4xx_eth.c
+F:     drivers/net/wan/ixp4xx_hss.c
+
+INTEL IXP4XX RANDOM NUMBER GENERATOR SUPPORT
+M:     Deepak Saxena <dsaxena@plexity.net>
+S:     Maintained
+F:     drivers/char/hw_random/ixp4xx-rng.c
 
 INTEL MANAGEMENT ENGINE (mei)
 M:     Tomas Winkler <tomas.winkler@intel.com>
@@ -6964,6 +6859,19 @@ F:       drivers/watchdog/mei_wdt.c
 F:     Documentation/misc-devices/mei/*
 F:     samples/mei/*
 
+INTEL MENLOW THERMAL DRIVER
+M:     Sujith Thomas <sujith.thomas@intel.com>
+L:     platform-driver-x86@vger.kernel.org
+W:     https://01.org/linux-acpi
+S:     Supported
+F:     drivers/platform/x86/intel_menlow.c
+
+INTEL MERRIFIELD GPIO DRIVER
+M:     Andy Shevchenko <andriy.shevchenko@linux.intel.com>
+L:     linux-gpio@vger.kernel.org
+S:     Maintained
+F:     drivers/gpio/gpio-merrifield.c
+
 INTEL MIC DRIVERS (mic)
 M:     Sudeep Dutt <sudeep.dutt@intel.com>
 M:     Ashutosh Dixit <ashutosh.dixit@intel.com>
@@ -6973,13 +6881,21 @@ W:      http://software.intel.com/en-us/mic-developer
 F:     include/linux/mic_bus.h
 F:     include/linux/scif.h
 F:     include/uapi/linux/mic_common.h
-F:     include/uapi/linux/mic_ioctl.h
+F:     include/uapi/linux/mic_ioctl.h
 F:     include/uapi/linux/scif_ioctl.h
 F:     drivers/misc/mic/
 F:     drivers/dma/mic_x100_dma.c
 F:     drivers/dma/mic_x100_dma.h
 F:     Documentation/mic/
 
+INTEL PMC CORE DRIVER
+M:     Rajneesh Bhardwaj <rajneesh.bhardwaj@intel.com>
+M:     Vishwanath Somayaji <vishwanath.somayaji@intel.com>
+L:     platform-driver-x86@vger.kernel.org
+S:     Maintained
+F:     arch/x86/include/asm/pmc_core.h
+F:     drivers/platform/x86/intel_pmc_core*
+
 INTEL PMC/P-Unit IPC DRIVER
 M:     Zha Qipeng<qipeng.zha@intel.com>
 L:     platform-driver-x86@vger.kernel.org
@@ -6989,6 +6905,28 @@ F:       drivers/platform/x86/intel_punit_ipc.c
 F:     arch/x86/include/asm/intel_pmc_ipc.h
 F:     arch/x86/include/asm/intel_punit_ipc.h
 
+INTEL PRO/WIRELESS 2100, 2200BG, 2915ABG NETWORK CONNECTION SUPPORT
+M:     Stanislav Yakovlev <stas.yakovlev@gmail.com>
+L:     linux-wireless@vger.kernel.org
+S:     Maintained
+F:     Documentation/networking/README.ipw2100
+F:     Documentation/networking/README.ipw2200
+F:     drivers/net/wireless/intel/ipw2x00/
+
+INTEL PSTATE DRIVER
+M:     Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
+M:     Len Brown <lenb@kernel.org>
+L:     linux-pm@vger.kernel.org
+S:     Supported
+F:     drivers/cpufreq/intel_pstate.c
+
+INTEL RDMA RNIC DRIVER
+M:     Faisal Latif <faisal.latif@intel.com>
+M:     Shiraz Saleem <shiraz.saleem@intel.com>
+L:     linux-rdma@vger.kernel.org
+S:     Supported
+F:     drivers/infiniband/hw/i40iw/
+
 INTEL TELEMETRY DRIVER
 M:     Souvik Kumar Chakravarty <souvik.k.chakravarty@intel.com>
 L:     platform-driver-x86@vger.kernel.org
@@ -6996,13 +6934,60 @@ S:      Maintained
 F:     arch/x86/include/asm/intel_telemetry.h
 F:     drivers/platform/x86/intel_telemetry*
 
-INTEL PMC CORE DRIVER
-M:     Rajneesh Bhardwaj <rajneesh.bhardwaj@intel.com>
-M:     Vishwanath Somayaji <vishwanath.somayaji@intel.com>
+INTEL VIRTUAL BUTTON DRIVER
+M:     AceLan Kao <acelan.kao@canonical.com>
 L:     platform-driver-x86@vger.kernel.org
 S:     Maintained
-F:     arch/x86/include/asm/pmc_core.h
-F:     drivers/platform/x86/intel_pmc_core*
+F:     drivers/platform/x86/intel-vbtn.c
+
+INTEL WIRELESS 3945ABG/BG, 4965AGN (iwlegacy)
+M:     Stanislaw Gruszka <sgruszka@redhat.com>
+L:     linux-wireless@vger.kernel.org
+S:     Supported
+F:     drivers/net/wireless/intel/iwlegacy/
+
+INTEL WIRELESS WIFI LINK (iwlwifi)
+M:     Johannes Berg <johannes.berg@intel.com>
+M:     Emmanuel Grumbach <emmanuel.grumbach@intel.com>
+M:     Luca Coelho <luciano.coelho@intel.com>
+M:     Intel Linux Wireless <linuxwifi@intel.com>
+L:     linux-wireless@vger.kernel.org
+W:     http://intellinuxwireless.org
+T:     git git://git.kernel.org/pub/scm/linux/kernel/git/iwlwifi/iwlwifi.git
+S:     Supported
+F:     drivers/net/wireless/intel/iwlwifi/
+
+INTEL WIRELESS WIMAX CONNECTION 2400
+M:     Inaky Perez-Gonzalez <inaky.perez-gonzalez@intel.com>
+M:     linux-wimax@intel.com
+L:     wimax@linuxwimax.org (subscribers-only)
+S:     Supported
+W:     http://linuxwimax.org
+F:     Documentation/wimax/README.i2400m
+F:     drivers/net/wimax/i2400m/
+F:     include/uapi/linux/wimax/i2400m.h
+
+INTEL(R) TRACE HUB
+M:     Alexander Shishkin <alexander.shishkin@linux.intel.com>
+S:     Supported
+F:     Documentation/trace/intel_th.txt
+F:     drivers/hwtracing/intel_th/
+
+INTEL(R) TRUSTED EXECUTION TECHNOLOGY (TXT)
+M:     Ning Sun <ning.sun@intel.com>
+L:     tboot-devel@lists.sourceforge.net
+W:     http://tboot.sourceforge.net
+T:     hg http://tboot.hg.sourceforge.net:8000/hgroot/tboot/tboot
+S:     Supported
+F:     Documentation/intel_txt.txt
+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
 
 INVENSENSE MPU-3050 GYROSCOPE DRIVER
 M:     Linus Walleij <linus.walleij@linaro.org>
@@ -7094,13 +7079,6 @@ F:       drivers/net/irda/
 F:     include/net/irda/
 F:     net/irda/
 
-IRQ SUBSYSTEM
-M:     Thomas Gleixner <tglx@linutronix.de>
-L:     linux-kernel@vger.kernel.org
-S:     Maintained
-T:     git git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git irq/core
-F:     kernel/irq/
-
 IRQ DOMAINS (IRQ NUMBER MAPPING LIBRARY)
 M:     Marc Zyngier <marc.zyngier@arm.com>
 S:     Maintained
@@ -7110,6 +7088,13 @@ F:       include/linux/irqdomain.h
 F:     kernel/irq/irqdomain.c
 F:     kernel/irq/msi.c
 
+IRQ SUBSYSTEM
+M:     Thomas Gleixner <tglx@linutronix.de>
+L:     linux-kernel@vger.kernel.org
+S:     Maintained
+T:     git git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git irq/core
+F:     kernel/irq/
+
 IRQCHIP DRIVERS
 M:     Thomas Gleixner <tglx@linutronix.de>
 M:     Jason Cooper <jason@lakedaemon.net>
@@ -7413,27 +7398,6 @@ S:       Maintained
 F:     arch/x86/include/asm/svm.h
 F:     arch/x86/kvm/svm.c
 
-KERNEL VIRTUAL MACHINE (KVM) FOR POWERPC
-M:     Alexander Graf <agraf@suse.com>
-L:     kvm-ppc@vger.kernel.org
-W:     http://www.linux-kvm.org/
-T:     git git://github.com/agraf/linux-2.6.git
-S:     Supported
-F:     arch/powerpc/include/asm/kvm*
-F:     arch/powerpc/kvm/
-
-KERNEL VIRTUAL MACHINE for s390 (KVM/s390)
-M:     Christian Borntraeger <borntraeger@de.ibm.com>
-M:     Cornelia Huck <cohuck@redhat.com>
-L:     linux-s390@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
-F:     Documentation/s390/kvm.txt
-F:     arch/s390/include/asm/kvm*
-F:     arch/s390/kvm/
-F:     arch/s390/mm/gmap.c
-
 KERNEL VIRTUAL MACHINE (KVM) FOR ARM
 M:     Christoffer Dall <christoffer.dall@linaro.org>
 M:     Marc Zyngier <marc.zyngier@arm.com>
@@ -7448,6 +7412,15 @@ F:       arch/arm/kvm/
 F:     virt/kvm/arm/
 F:     include/kvm/arm_*
 
+KERNEL VIRTUAL MACHINE (KVM) FOR POWERPC
+M:     Alexander Graf <agraf@suse.com>
+L:     kvm-ppc@vger.kernel.org
+W:     http://www.linux-kvm.org/
+T:     git git://github.com/agraf/linux-2.6.git
+S:     Supported
+F:     arch/powerpc/include/asm/kvm*
+F:     arch/powerpc/kvm/
+
 KERNEL VIRTUAL MACHINE FOR ARM64 (KVM/arm64)
 M:     Christoffer Dall <christoffer.dall@linaro.org>
 M:     Marc Zyngier <marc.zyngier@arm.com>
@@ -7466,6 +7439,18 @@ F:       arch/mips/include/uapi/asm/kvm*
 F:     arch/mips/include/asm/kvm*
 F:     arch/mips/kvm/
 
+KERNEL VIRTUAL MACHINE for s390 (KVM/s390)
+M:     Christian Borntraeger <borntraeger@de.ibm.com>
+M:     Cornelia Huck <cohuck@redhat.com>
+L:     linux-s390@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
+F:     Documentation/s390/kvm.txt
+F:     arch/s390/include/asm/kvm*
+F:     arch/s390/kvm/
+F:     arch/s390/mm/gmap.c
+
 KERNFS
 M:     Greg Kroah-Hartman <gregkh@linuxfoundation.org>
 M:     Tejun Heo <tj@kernel.org>
@@ -7483,17 +7468,15 @@ F:      include/linux/kexec.h
 F:     include/uapi/linux/kexec.h
 F:     kernel/kexec*
 
-KEYS/KEYRINGS:
-M:     David Howells <dhowells@redhat.com>
+KEYS-ENCRYPTED
+M:     Mimi Zohar <zohar@linux.vnet.ibm.com>
+M:     David Safford <safford@us.ibm.com>
+L:     linux-security-module@vger.kernel.org
 L:     keyrings@vger.kernel.org
-S:     Maintained
-F:     Documentation/security/keys/core.rst
-F:     include/linux/key.h
-F:     include/linux/key-type.h
-F:     include/linux/keyctl.h
-F:     include/uapi/linux/keyctl.h
-F:     include/keys/
-F:     security/keys/
+S:     Supported
+F:     Documentation/security/keys/trusted-encrypted.rst
+F:     include/keys/encrypted-type.h
+F:     security/keys/encrypted-keys/
 
 KEYS-TRUSTED
 M:     David Safford <safford@us.ibm.com>
@@ -7506,15 +7489,17 @@ F:      include/keys/trusted-type.h
 F:     security/keys/trusted.c
 F:     security/keys/trusted.h
 
-KEYS-ENCRYPTED
-M:     Mimi Zohar <zohar@linux.vnet.ibm.com>
-M:     David Safford <safford@us.ibm.com>
-L:     linux-security-module@vger.kernel.org
+KEYS/KEYRINGS:
+M:     David Howells <dhowells@redhat.com>
 L:     keyrings@vger.kernel.org
-S:     Supported
-F:     Documentation/security/keys/trusted-encrypted.rst
-F:     include/keys/encrypted-type.h
-F:     security/keys/encrypted-keys/
+S:     Maintained
+F:     Documentation/security/keys/core.rst
+F:     include/linux/key.h
+F:     include/linux/key-type.h
+F:     include/linux/keyctl.h
+F:     include/uapi/linux/keyctl.h
+F:     include/keys/
+F:     security/keys/
 
 KGDB / KDB /debug_core
 M:     Jason Wessel <jason.wessel@windriver.com>
@@ -7658,16 +7643,6 @@ F:       drivers/lguest/
 F:     include/linux/lguest*.h
 F:     tools/lguest/
 
-LIBATA SUBSYSTEM (Serial and Parallel ATA drivers)
-M:     Tejun Heo <tj@kernel.org>
-L:     linux-ide@vger.kernel.org
-T:     git git://git.kernel.org/pub/scm/linux/kernel/git/tj/libata.git
-S:     Maintained
-F:     drivers/ata/
-F:     include/linux/ata.h
-F:     include/linux/libata.h
-F:     Documentation/devicetree/bindings/ata/
-
 LIBATA PATA ARASAN COMPACT FLASH CONTROLLER
 M:     Viresh Kumar <vireshk@kernel.org>
 L:     linux-ide@vger.kernel.org
@@ -7711,23 +7686,21 @@ T:      git git://git.kernel.org/pub/scm/linux/kernel/git/tj/libata.git
 S:     Maintained
 F:     drivers/ata/sata_promise.*
 
+LIBATA SUBSYSTEM (Serial and Parallel ATA drivers)
+M:     Tejun Heo <tj@kernel.org>
+L:     linux-ide@vger.kernel.org
+T:     git git://git.kernel.org/pub/scm/linux/kernel/git/tj/libata.git
+S:     Maintained
+F:     drivers/ata/
+F:     include/linux/ata.h
+F:     include/linux/libata.h
+F:     Documentation/devicetree/bindings/ata/
+
 LIBLOCKDEP
 M:     Sasha Levin <alexander.levin@verizon.com>
 S:     Maintained
 F:     tools/lib/lockdep/
 
-LIBNVDIMM: NON-VOLATILE MEMORY DEVICE SUBSYSTEM
-M:     Dan Williams <dan.j.williams@intel.com>
-L:     linux-nvdimm@lists.01.org
-Q:     https://patchwork.kernel.org/project/linux-nvdimm/list/
-T:     git git://git.kernel.org/pub/scm/linux/kernel/git/nvdimm/nvdimm.git
-S:     Supported
-F:     drivers/nvdimm/*
-F:     drivers/acpi/nfit/*
-F:     include/linux/nd.h
-F:     include/linux/libnvdimm.h
-F:     include/uapi/linux/ndctl.h
-
 LIBNVDIMM BLK: MMIO-APERTURE DRIVER
 M:     Ross Zwisler <ross.zwisler@linux.intel.com>
 L:     linux-nvdimm@lists.01.org
@@ -7750,6 +7723,18 @@ Q:       https://patchwork.kernel.org/project/linux-nvdimm/list/
 S:     Supported
 F:     drivers/nvdimm/pmem*
 
+LIBNVDIMM: NON-VOLATILE MEMORY DEVICE SUBSYSTEM
+M:     Dan Williams <dan.j.williams@intel.com>
+L:     linux-nvdimm@lists.01.org
+Q:     https://patchwork.kernel.org/project/linux-nvdimm/list/
+T:     git git://git.kernel.org/pub/scm/linux/kernel/git/nvdimm/nvdimm.git
+S:     Supported
+F:     drivers/nvdimm/*
+F:     drivers/acpi/nfit/*
+F:     include/linux/nd.h
+F:     include/linux/libnvdimm.h
+F:     include/uapi/linux/ndctl.h
+
 LIGHTNVM PLATFORM SUPPORT
 M:     Matias Bjorling <mb@lightnvm.io>
 W:     http://github/OpenChannelSSD
@@ -7759,6 +7744,14 @@ F:       drivers/lightnvm/
 F:     include/linux/lightnvm.h
 F:     include/uapi/linux/lightnvm.h
 
+LINUX FOR POWER MACINTOSH
+M:     Benjamin Herrenschmidt <benh@kernel.crashing.org>
+W:     http://www.penguinppc.org/
+L:     linuxppc-dev@lists.ozlabs.org
+S:     Maintained
+F:     arch/powerpc/platforms/powermac/
+F:     drivers/macintosh/
+
 LINUX FOR POWERPC (32-BIT AND 64-BIT)
 M:     Benjamin Herrenschmidt <benh@kernel.crashing.org>
 M:     Paul Mackerras <paulus@samba.org>
@@ -7792,14 +7785,6 @@ N:       powernv
 N:     [^a-z0-9]ps3
 N:     pseries
 
-LINUX FOR POWER MACINTOSH
-M:     Benjamin Herrenschmidt <benh@kernel.crashing.org>
-W:     http://www.penguinppc.org/
-L:     linuxppc-dev@lists.ozlabs.org
-S:     Maintained
-F:     arch/powerpc/platforms/powermac/
-F:     drivers/macintosh/
-
 LINUX FOR POWERPC EMBEDDED MPC5XXX
 M:     Anatolij Gustschin <agust@denx.de>
 L:     linuxppc-dev@lists.ozlabs.org
@@ -7817,19 +7802,6 @@ S:       Maintained
 F:     arch/powerpc/platforms/40x/
 F:     arch/powerpc/platforms/44x/
 
-LINUX FOR POWERPC EMBEDDED XILINX VIRTEX
-L:     linuxppc-dev@lists.ozlabs.org
-S:     Orphan
-F:     arch/powerpc/*/*virtex*
-F:     arch/powerpc/*/*/*virtex*
-
-LINUX FOR POWERPC EMBEDDED PPC8XX
-M:     Vitaly Bordug <vitb@kernel.crashing.org>
-W:     http://www.penguinppc.org/
-L:     linuxppc-dev@lists.ozlabs.org
-S:     Maintained
-F:     arch/powerpc/platforms/8xx/
-
 LINUX FOR POWERPC EMBEDDED PPC83XX AND PPC85XX
 M:     Scott Wood <oss@buserror.net>
 M:     Kumar Gala <galak@kernel.crashing.org>
@@ -7841,6 +7813,19 @@ F:       arch/powerpc/platforms/83xx/
 F:     arch/powerpc/platforms/85xx/
 F:     Documentation/devicetree/bindings/powerpc/fsl/
 
+LINUX FOR POWERPC EMBEDDED PPC8XX
+M:     Vitaly Bordug <vitb@kernel.crashing.org>
+W:     http://www.penguinppc.org/
+L:     linuxppc-dev@lists.ozlabs.org
+S:     Maintained
+F:     arch/powerpc/platforms/8xx/
+
+LINUX FOR POWERPC EMBEDDED XILINX VIRTEX
+L:     linuxppc-dev@lists.ozlabs.org
+S:     Orphan
+F:     arch/powerpc/*/*virtex*
+F:     arch/powerpc/*/*/*virtex*
+
 LINUX FOR POWERPC PA SEMI PWRFICIENT
 L:     linuxppc-dev@lists.ozlabs.org
 S:     Orphan
@@ -7848,16 +7833,16 @@ F:      arch/powerpc/platforms/pasemi/
 F:     drivers/*/*pasemi*
 F:     drivers/*/*/*pasemi*
 
-LINUX SECURITY MODULE (LSM) FRAMEWORK
-M:     Chris Wright <chrisw@sous-sol.org>
-L:     linux-security-module@vger.kernel.org
-S:     Supported
-
 LINUX KERNEL DUMP TEST MODULE (LKDTM)
 M:     Kees Cook <keescook@chromium.org>
 S:     Maintained
 F:     drivers/misc/lkdtm*
 
+LINUX SECURITY MODULE (LSM) FRAMEWORK
+M:     Chris Wright <chrisw@sous-sol.org>
+L:     linux-security-module@vger.kernel.org
+S:     Supported
+
 LIS3LV02D ACCELEROMETER DRIVER
 M:     Eric Piel <eric.piel@tremplin-utc.net>
 S:     Maintained
@@ -8231,14 +8216,6 @@ S:       Maintained
 F:     Documentation/devicetree/bindings/sound/max9860.txt
 F:     sound/soc/codecs/max9860.*
 
-MAXIM MUIC CHARGER DRIVERS FOR EXYNOS BASED BOARDS
-M:     Krzysztof Kozlowski <krzk@kernel.org>
-M:     Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
-L:     linux-pm@vger.kernel.org
-S:     Supported
-F:     drivers/power/supply/max14577_charger.c
-F:     drivers/power/supply/max77693_charger.c
-
 MAXIM MAX77802 PMIC REGULATOR DEVICE DRIVER
 M:     Javier Martinez Canillas <javier@dowhile0.org>
 L:     linux-kernel@vger.kernel.org
@@ -8247,6 +8224,14 @@ F:       drivers/regulator/max77802-regulator.c
 F:     Documentation/devicetree/bindings/*/*max77802.txt
 F:     include/dt-bindings/*/*max77802.h
 
+MAXIM MUIC CHARGER DRIVERS FOR EXYNOS BASED BOARDS
+M:     Krzysztof Kozlowski <krzk@kernel.org>
+M:     Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
+L:     linux-pm@vger.kernel.org
+S:     Supported
+F:     drivers/power/supply/max14577_charger.c
+F:     drivers/power/supply/max77693_charger.c
+
 MAXIM PMIC AND MUIC DRIVERS FOR EXYNOS BASED BOARDS
 M:     Chanwoo Choi <cw00.choi@samsung.com>
 M:     Krzysztof Kozlowski <krzk@kernel.org>
@@ -8289,14 +8274,25 @@ L:      linux-iio@vger.kernel.org
 S:     Maintained
 F:     drivers/iio/dac/cio-dac.c
 
-MEDIA DRIVERS FOR RENESAS - DRIF
-M:     Ramesh Shanmugasundaram <ramesh.shanmugasundaram@bp.renesas.com>
+MEDIA DRIVERS FOR ASCOT2E
+M:     Sergey Kozlov <serjk@netup.ru>
+M:     Abylay Ospan <aospan@netup.ru>
 L:     linux-media@vger.kernel.org
-L:     linux-renesas-soc@vger.kernel.org
+W:     https://linuxtv.org
+W:     http://netup.tv/
 T:     git git://linuxtv.org/media_tree.git
 S:     Supported
-F:     Documentation/devicetree/bindings/media/renesas,drif.txt
-F:     drivers/media/platform/rcar_drif.c
+F:     drivers/media/dvb-frontends/ascot2e*
+
+MEDIA DRIVERS FOR CXD2841ER
+M:     Sergey Kozlov <serjk@netup.ru>
+M:     Abylay Ospan <aospan@netup.ru>
+L:     linux-media@vger.kernel.org
+W:     https://linuxtv.org
+W:     http://netup.tv/
+T:     git git://linuxtv.org/media_tree.git
+S:     Supported
+F:     drivers/media/dvb-frontends/cxd2841er*
 
 MEDIA DRIVERS FOR FREESCALE IMX
 M:     Steve Longerbeam <slongerbeam@gmail.com>
@@ -8310,43 +8306,6 @@ F:       drivers/staging/media/imx/
 F:     include/linux/imx-media.h
 F:     include/media/imx.h
 
-MEDIA DRIVERS FOR RENESAS - FCP
-M:     Laurent Pinchart <laurent.pinchart@ideasonboard.com>
-L:     linux-media@vger.kernel.org
-L:     linux-renesas-soc@vger.kernel.org
-T:     git git://linuxtv.org/media_tree.git
-S:     Supported
-F:     Documentation/devicetree/bindings/media/renesas,fcp.txt
-F:     drivers/media/platform/rcar-fcp.c
-F:     include/media/rcar-fcp.h
-
-MEDIA DRIVERS FOR RENESAS - FDP1
-M:     Kieran Bingham <kieran@bingham.xyz>
-L:     linux-media@vger.kernel.org
-L:     linux-renesas-soc@vger.kernel.org
-T:     git git://linuxtv.org/media_tree.git
-S:     Supported
-F:     Documentation/devicetree/bindings/media/renesas,fdp1.txt
-F:     drivers/media/platform/rcar_fdp1.c
-
-MEDIA DRIVERS FOR RENESAS - VIN
-M:     Niklas Söderlund <niklas.soderlund@ragnatech.se>
-L:     linux-media@vger.kernel.org
-L:     linux-renesas-soc@vger.kernel.org
-T:     git git://linuxtv.org/media_tree.git
-S:     Supported
-F:     Documentation/devicetree/bindings/media/rcar_vin.txt
-F:     drivers/media/platform/rcar-vin/
-
-MEDIA DRIVERS FOR RENESAS - VSP1
-M:     Laurent Pinchart <laurent.pinchart@ideasonboard.com>
-L:     linux-media@vger.kernel.org
-L:     linux-renesas-soc@vger.kernel.org
-T:     git git://linuxtv.org/media_tree.git
-S:     Supported
-F:     Documentation/devicetree/bindings/media/renesas,vsp1.txt
-F:     drivers/media/platform/vsp1/
-
 MEDIA DRIVERS FOR HELENE
 M:     Abylay Ospan <aospan@netup.ru>
 L:     linux-media@vger.kernel.org
@@ -8356,7 +8315,7 @@ T:        git git://linuxtv.org/media_tree.git
 S:     Supported
 F:     drivers/media/dvb-frontends/helene*
 
-MEDIA DRIVERS FOR ASCOT2E
+MEDIA DRIVERS FOR HORUS3A
 M:     Sergey Kozlov <serjk@netup.ru>
 M:     Abylay Ospan <aospan@netup.ru>
 L:     linux-media@vger.kernel.org
@@ -8364,9 +8323,9 @@ W:        https://linuxtv.org
 W:     http://netup.tv/
 T:     git git://linuxtv.org/media_tree.git
 S:     Supported
-F:     drivers/media/dvb-frontends/ascot2e*
+F:     drivers/media/dvb-frontends/horus3a*
 
-MEDIA DRIVERS FOR CXD2841ER
+MEDIA DRIVERS FOR LNBH25
 M:     Sergey Kozlov <serjk@netup.ru>
 M:     Abylay Ospan <aospan@netup.ru>
 L:     linux-media@vger.kernel.org
@@ -8374,9 +8333,9 @@ W:        https://linuxtv.org
 W:     http://netup.tv/
 T:     git git://linuxtv.org/media_tree.git
 S:     Supported
-F:     drivers/media/dvb-frontends/cxd2841er*
+F:     drivers/media/dvb-frontends/lnbh25*
 
-MEDIA DRIVERS FOR HORUS3A
+MEDIA DRIVERS FOR NETUP PCI UNIVERSAL DVB devices
 M:     Sergey Kozlov <serjk@netup.ru>
 M:     Abylay Ospan <aospan@netup.ru>
 L:     linux-media@vger.kernel.org
@@ -8384,27 +8343,53 @@ W:      https://linuxtv.org
 W:     http://netup.tv/
 T:     git git://linuxtv.org/media_tree.git
 S:     Supported
-F:     drivers/media/dvb-frontends/horus3a*
+F:     drivers/media/pci/netup_unidvb/*
 
-MEDIA DRIVERS FOR LNBH25
-M:     Sergey Kozlov <serjk@netup.ru>
-M:     Abylay Ospan <aospan@netup.ru>
+MEDIA DRIVERS FOR RENESAS - DRIF
+M:     Ramesh Shanmugasundaram <ramesh.shanmugasundaram@bp.renesas.com>
 L:     linux-media@vger.kernel.org
-W:     https://linuxtv.org
-W:     http://netup.tv/
+L:     linux-renesas-soc@vger.kernel.org
 T:     git git://linuxtv.org/media_tree.git
 S:     Supported
-F:     drivers/media/dvb-frontends/lnbh25*
+F:     Documentation/devicetree/bindings/media/renesas,drif.txt
+F:     drivers/media/platform/rcar_drif.c
 
-MEDIA DRIVERS FOR NETUP PCI UNIVERSAL DVB devices
-M:     Sergey Kozlov <serjk@netup.ru>
-M:     Abylay Ospan <aospan@netup.ru>
+MEDIA DRIVERS FOR RENESAS - FCP
+M:     Laurent Pinchart <laurent.pinchart@ideasonboard.com>
 L:     linux-media@vger.kernel.org
-W:     https://linuxtv.org
-W:     http://netup.tv/
+L:     linux-renesas-soc@vger.kernel.org
 T:     git git://linuxtv.org/media_tree.git
 S:     Supported
-F:     drivers/media/pci/netup_unidvb/*
+F:     Documentation/devicetree/bindings/media/renesas,fcp.txt
+F:     drivers/media/platform/rcar-fcp.c
+F:     include/media/rcar-fcp.h
+
+MEDIA DRIVERS FOR RENESAS - FDP1
+M:     Kieran Bingham <kieran@bingham.xyz>
+L:     linux-media@vger.kernel.org
+L:     linux-renesas-soc@vger.kernel.org
+T:     git git://linuxtv.org/media_tree.git
+S:     Supported
+F:     Documentation/devicetree/bindings/media/renesas,fdp1.txt
+F:     drivers/media/platform/rcar_fdp1.c
+
+MEDIA DRIVERS FOR RENESAS - VIN
+M:     Niklas Söderlund <niklas.soderlund@ragnatech.se>
+L:     linux-media@vger.kernel.org
+L:     linux-renesas-soc@vger.kernel.org
+T:     git git://linuxtv.org/media_tree.git
+S:     Supported
+F:     Documentation/devicetree/bindings/media/rcar_vin.txt
+F:     drivers/media/platform/rcar-vin/
+
+MEDIA DRIVERS FOR RENESAS - VSP1
+M:     Laurent Pinchart <laurent.pinchart@ideasonboard.com>
+L:     linux-media@vger.kernel.org
+L:     linux-renesas-soc@vger.kernel.org
+T:     git git://linuxtv.org/media_tree.git
+S:     Supported
+F:     Documentation/devicetree/bindings/media/renesas,vsp1.txt
+F:     drivers/media/platform/vsp1/
 
 MEDIA INPUT INFRASTRUCTURE (V4L/DVB)
 M:     Mauro Carvalho Chehab <mchehab@s-opensource.com>
@@ -8443,15 +8428,6 @@ S:       Supported
 F:     drivers/media/platform/mtk-jpeg/
 F:     Documentation/devicetree/bindings/media/mediatek-jpeg-decoder.txt
 
-MEDIATEK MEDIA DRIVER
-M:     Tiffany Lin <tiffany.lin@mediatek.com>
-M:     Andrew-CT Chen <andrew-ct.chen@mediatek.com>
-S:     Supported
-F:     drivers/media/platform/mtk-vcodec/
-F:     drivers/media/platform/mtk-vpu/
-F:     Documentation/devicetree/bindings/media/mediatek-vcodec.txt
-F:     Documentation/devicetree/bindings/media/mediatek-vpu.txt
-
 MEDIATEK MDP DRIVER
 M:     Minghsiu Tsai <minghsiu.tsai@mediatek.com>
 M:     Houlong Wei <houlong.wei@mediatek.com>
@@ -8461,6 +8437,15 @@ F:       drivers/media/platform/mtk-mdp/
 F:     drivers/media/platform/mtk-vpu/
 F:     Documentation/devicetree/bindings/media/mediatek-mdp.txt
 
+MEDIATEK MEDIA DRIVER
+M:     Tiffany Lin <tiffany.lin@mediatek.com>
+M:     Andrew-CT Chen <andrew-ct.chen@mediatek.com>
+S:     Supported
+F:     drivers/media/platform/mtk-vcodec/
+F:     drivers/media/platform/mtk-vpu/
+F:     Documentation/devicetree/bindings/media/mediatek-vcodec.txt
+F:     Documentation/devicetree/bindings/media/mediatek-vpu.txt
+
 MEDIATEK MT7601U WIRELESS LAN DRIVER
 M:     Jakub Kicinski <kubakici@wp.pl>
 L:     linux-wireless@vger.kernel.org
@@ -8468,9 +8453,9 @@ S:        Maintained
 F:     drivers/net/wireless/mediatek/mt7601u/
 
 MEDIATEK RANDOM NUMBER GENERATOR SUPPORT
-M:      Sean Wang <sean.wang@mediatek.com>
-S:      Maintained
-F:      drivers/char/hw_random/mtk-rng.c
+M:     Sean Wang <sean.wang@mediatek.com>
+S:     Maintained
+F:     drivers/char/hw_random/mtk-rng.c
 
 MEGACHIPS STDPXXXX-GE-B850V3-FW LVDS/DP++ BRIDGES
 M:     Peter Senna Tschudin <peter.senna@collabora.com>
@@ -8559,28 +8544,6 @@ W:       http://www.mellanox.com
 Q:     http://patchwork.ozlabs.org/project/netdev/list/
 F:     drivers/net/ethernet/mellanox/mlxfw/
 
-MELLANOX MLXCPLD I2C AND MUX DRIVER
-M:     Vadim Pasternak <vadimp@mellanox.com>
-M:     Michael Shych <michaelsh@mellanox.com>
-L:     linux-i2c@vger.kernel.org
-S:     Supported
-F:     drivers/i2c/busses/i2c-mlxcpld.c
-F:     drivers/i2c/muxes/i2c-mux-mlxcpld.c
-F:     Documentation/i2c/busses/i2c-mlxcpld
-
-MELLANOX MLXCPLD LED DRIVER
-M:     Vadim Pasternak <vadimp@mellanox.com>
-L:     linux-leds@vger.kernel.org
-S:     Supported
-F:     drivers/leds/leds-mlxcpld.c
-F:     Documentation/leds/leds-mlxcpld.txt
-
-MELLANOX PLATFORM DRIVER
-M:      Vadim Pasternak <vadimp@mellanox.com>
-L:      platform-driver-x86@vger.kernel.org
-S:      Supported
-F:      drivers/platform/x86/mlx-platform.c
-
 MELLANOX MLX CPLD HOTPLUG DRIVER
 M:     Vadim Pasternak <vadimp@mellanox.com>
 L:     platform-driver-x86@vger.kernel.org
@@ -8627,9 +8590,31 @@ L:       linux-rdma@vger.kernel.org
 W:     http://www.mellanox.com
 Q:     http://patchwork.kernel.org/project/linux-rdma/list/
 S:     Supported
-F:     drivers/infiniband/hw/mlx5/
-F:     include/linux/mlx5/
-F:     include/uapi/rdma/mlx5-abi.h
+F:     drivers/infiniband/hw/mlx5/
+F:     include/linux/mlx5/
+F:     include/uapi/rdma/mlx5-abi.h
+
+MELLANOX MLXCPLD I2C AND MUX DRIVER
+M:     Vadim Pasternak <vadimp@mellanox.com>
+M:     Michael Shych <michaelsh@mellanox.com>
+L:     linux-i2c@vger.kernel.org
+S:     Supported
+F:     drivers/i2c/busses/i2c-mlxcpld.c
+F:     drivers/i2c/muxes/i2c-mux-mlxcpld.c
+F:     Documentation/i2c/busses/i2c-mlxcpld
+
+MELLANOX MLXCPLD LED DRIVER
+M:     Vadim Pasternak <vadimp@mellanox.com>
+L:     linux-leds@vger.kernel.org
+S:     Supported
+F:     drivers/leds/leds-mlxcpld.c
+F:     Documentation/leds/leds-mlxcpld.txt
+
+MELLANOX PLATFORM DRIVER
+M:     Vadim Pasternak <vadimp@mellanox.com>
+L:     platform-driver-x86@vger.kernel.org
+S:     Supported
+F:     drivers/platform/x86/mlx-platform.c
 
 MEMBARRIER SUPPORT
 M:     Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
@@ -8785,6 +8770,16 @@ F:       Documentation/devicetree/bindings/mips/
 F:     Documentation/mips/
 F:     arch/mips/
 
+MIPS BOSTON DEVELOPMENT BOARD
+M:     Paul Burton <paul.burton@imgtec.com>
+L:     linux-mips@linux-mips.org
+S:     Maintained
+F:     Documentation/devicetree/bindings/clock/img,boston-clock.txt
+F:     arch/mips/boot/dts/img/boston.dts
+F:     arch/mips/configs/generic/board-boston.config
+F:     drivers/clk/imgtec/clk-boston.c
+F:     include/dt-bindings/clock/boston-clock.h
+
 MIPS GENERIC PLATFORM
 M:     Paul Burton <paul.burton@imgtec.com>
 L:     linux-mips@linux-mips.org
@@ -8800,16 +8795,6 @@ F:       arch/mips/include/asm/mach-loongson32/
 F:     drivers/*/*loongson1*
 F:     drivers/*/*/*loongson1*
 
-MIPS BOSTON DEVELOPMENT BOARD
-M:     Paul Burton <paul.burton@imgtec.com>
-L:     linux-mips@linux-mips.org
-S:     Maintained
-F:     Documentation/devicetree/bindings/clock/img,boston-clock.txt
-F:     arch/mips/boot/dts/img/boston.dts
-F:     arch/mips/configs/generic/board-boston.config
-F:     drivers/clk/imgtec/clk-boston.c
-F:     include/dt-bindings/clock/boston-clock.h
-
 MIROSOUND PCM20 FM RADIO RECEIVER DRIVER
 M:     Hans Verkuil <hverkuil@xs4all.nl>
 L:     linux-media@vger.kernel.org
@@ -8960,6 +8945,11 @@ F:       drivers/mfd/
 F:     include/linux/mfd/
 F:     include/dt-bindings/mfd/
 
+MULTIMEDIA CARD (MMC) ETC. OVER SPI
+S:     Orphan
+F:     drivers/mmc/host/mmc_spi.c
+F:     include/linux/spi/mmc_spi.h
+
 MULTIMEDIA CARD (MMC), SECURE DIGITAL (SD) AND SDIO SUBSYSTEM
 M:     Ulf Hansson <ulf.hansson@linaro.org>
 L:     linux-mmc@vger.kernel.org
@@ -8970,11 +8960,6 @@ F:       drivers/mmc/
 F:     include/linux/mmc/
 F:     include/uapi/linux/mmc/
 
-MULTIMEDIA CARD (MMC) ETC. OVER SPI
-S:     Orphan
-F:     drivers/mmc/host/mmc_spi.c
-F:     include/linux/spi/mmc_spi.h
-
 MULTIPLEXER SUBSYSTEM
 M:     Peter Rosin <peda@axentia.se>
 S:     Maintained
@@ -9167,6 +9152,35 @@ S:       Maintained
 W:     https://fedorahosted.org/dropwatch/
 F:     net/core/drop_monitor.c
 
+NETWORKING DRIVERS
+L:     netdev@vger.kernel.org
+W:     http://www.linuxfoundation.org/en/Net
+Q:     http://patchwork.ozlabs.org/project/netdev/list/
+T:     git git://git.kernel.org/pub/scm/linux/kernel/git/davem/net.git
+T:     git git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next.git
+S:     Odd Fixes
+F:     Documentation/devicetree/bindings/net/
+F:     drivers/net/
+F:     include/linux/if_*
+F:     include/linux/netdevice.h
+F:     include/linux/etherdevice.h
+F:     include/linux/fcdevice.h
+F:     include/linux/fddidevice.h
+F:     include/linux/hippidevice.h
+F:     include/linux/inetdevice.h
+F:     include/uapi/linux/if_*
+F:     include/uapi/linux/netdevice.h
+
+NETWORKING DRIVERS (WIRELESS)
+M:     Kalle Valo <kvalo@codeaurora.org>
+L:     linux-wireless@vger.kernel.org
+Q:     http://patchwork.kernel.org/project/linux-wireless/list/
+T:     git git://git.kernel.org/pub/scm/linux/kernel/git/kvalo/wireless-drivers.git
+T:     git git://git.kernel.org/pub/scm/linux/kernel/git/kvalo/wireless-drivers-next.git
+S:     Maintained
+F:     Documentation/devicetree/bindings/net/wireless/
+F:     drivers/net/wireless/
+
 NETWORKING [DSA]
 M:     Andrew Lunn <andrew@lunn.ch>
 M:     Vivien Didelot <vivien.didelot@savoirfairelinux.com>
@@ -9198,28 +9212,6 @@ F:       tools/net/
 F:     tools/testing/selftests/net/
 F:     lib/random32.c
 
-NETWORKING [IPv4/IPv6]
-M:     "David S. Miller" <davem@davemloft.net>
-M:     Alexey Kuznetsov <kuznet@ms2.inr.ac.ru>
-M:     Hideaki YOSHIFUJI <yoshfuji@linux-ipv6.org>
-L:     netdev@vger.kernel.org
-T:     git git://git.kernel.org/pub/scm/linux/kernel/git/davem/net.git
-S:     Maintained
-F:     net/ipv4/
-F:     net/ipv6/
-F:     include/net/ip*
-F:     arch/x86/net/*
-
-NETWORKING [TLS]
-M:     Ilya Lesokhin <ilyal@mellanox.com>
-M:     Aviad Yehezkel <aviadye@mellanox.com>
-M:     Dave Watson <davejwatson@fb.com>
-L:     netdev@vger.kernel.org
-S:     Maintained
-F:     net/tls/*
-F:     include/uapi/linux/tls.h
-F:     include/net/tls.h
-
 NETWORKING [IPSEC]
 M:     Steffen Klassert <steffen.klassert@secunet.com>
 M:     Herbert Xu <herbert@gondor.apana.org.au>
@@ -9244,43 +9236,36 @@ F:      net/ipv6/ip6_vti.c
 F:     include/uapi/linux/xfrm.h
 F:     include/net/xfrm.h
 
+NETWORKING [IPv4/IPv6]
+M:     "David S. Miller" <davem@davemloft.net>
+M:     Alexey Kuznetsov <kuznet@ms2.inr.ac.ru>
+M:     Hideaki YOSHIFUJI <yoshfuji@linux-ipv6.org>
+L:     netdev@vger.kernel.org
+T:     git git://git.kernel.org/pub/scm/linux/kernel/git/davem/net.git
+S:     Maintained
+F:     net/ipv4/
+F:     net/ipv6/
+F:     include/net/ip*
+F:     arch/x86/net/*
+
 NETWORKING [LABELED] (NetLabel, CIPSO, Labeled IPsec, SECMARK)
 M:     Paul Moore <paul@paul-moore.com>
 L:     netdev@vger.kernel.org
 S:     Maintained
 
-NETWORKING [WIRELESS]
-L:     linux-wireless@vger.kernel.org
-Q:     http://patchwork.kernel.org/project/linux-wireless/list/
-
-NETWORKING DRIVERS
+NETWORKING [TLS]
+M:     Ilya Lesokhin <ilyal@mellanox.com>
+M:     Aviad Yehezkel <aviadye@mellanox.com>
+M:     Dave Watson <davejwatson@fb.com>
 L:     netdev@vger.kernel.org
-W:     http://www.linuxfoundation.org/en/Net
-Q:     http://patchwork.ozlabs.org/project/netdev/list/
-T:     git git://git.kernel.org/pub/scm/linux/kernel/git/davem/net.git
-T:     git git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next.git
-S:     Odd Fixes
-F:     Documentation/devicetree/bindings/net/
-F:     drivers/net/
-F:     include/linux/if_*
-F:     include/linux/netdevice.h
-F:     include/linux/etherdevice.h
-F:     include/linux/fcdevice.h
-F:     include/linux/fddidevice.h
-F:     include/linux/hippidevice.h
-F:     include/linux/inetdevice.h
-F:     include/uapi/linux/if_*
-F:     include/uapi/linux/netdevice.h
+S:     Maintained
+F:     net/tls/*
+F:     include/uapi/linux/tls.h
+F:     include/net/tls.h
 
-NETWORKING DRIVERS (WIRELESS)
-M:     Kalle Valo <kvalo@codeaurora.org>
+NETWORKING [WIRELESS]
 L:     linux-wireless@vger.kernel.org
 Q:     http://patchwork.kernel.org/project/linux-wireless/list/
-T:     git git://git.kernel.org/pub/scm/linux/kernel/git/kvalo/wireless-drivers.git
-T:     git git://git.kernel.org/pub/scm/linux/kernel/git/kvalo/wireless-drivers-next.git
-S:     Maintained
-F:     Documentation/devicetree/bindings/net/wireless/
-F:     drivers/net/wireless/
 
 NETXEN (1/10) GbE SUPPORT
 M:     Manish Chopra <manish.chopra@cavium.com>
@@ -9374,14 +9359,6 @@ S:       Maintained
 F:     drivers/media/i2c/et8ek8
 F:     drivers/media/i2c/ad5820.c
 
-NOKIA N900 CAMERA SUPPORT (ET8EK8 SENSOR, AD5820 FOCUS)
-M:     Pavel Machek <pavel@ucw.cz>
-M:     Sakari Ailus <sakari.ailus@iki.fi>
-L:     linux-media@vger.kernel.org
-S:     Maintained
-F:     drivers/media/i2c/et8ek8
-F:     drivers/media/i2c/ad5820.c
-
 NOKIA N900 POWER SUPPLY DRIVERS
 R:     Pali Rohár <pali.rohar@gmail.com>
 F:     include/linux/power/bq2415x_charger.h
@@ -9393,6 +9370,12 @@ F:       drivers/power/supply/bq27xxx_battery_i2c.c
 F:     drivers/power/supply/isp1704_charger.c
 F:     drivers/power/supply/rx51_battery.c
 
+NTB AMD DRIVER
+M:     Shyam Sundar S K <Shyam-sundar.S-k@amd.com>
+L:     linux-ntb@googlegroups.com
+S:     Supported
+F:     drivers/ntb/hw/amd/
+
 NTB DRIVER CORE
 M:     Jon Mason <jdmason@kudzu.us>
 M:     Dave Jiang <dave.jiang@intel.com>
@@ -9422,12 +9405,6 @@ W:       https://github.com/jonmason/ntb/wiki
 T:     git git://github.com/jonmason/ntb.git
 F:     drivers/ntb/hw/intel/
 
-NTB AMD DRIVER
-M:     Shyam Sundar S K <Shyam-sundar.S-k@amd.com>
-L:     linux-ntb@googlegroups.com
-S:     Supported
-F:     drivers/ntb/hw/amd/
-
 NTFS FILESYSTEM
 M:     Anton Altaparmakov <anton@tuxera.com>
 L:     linux-ntfs-dev@lists.sourceforge.net
@@ -9457,15 +9434,6 @@ F:       drivers/nvme/host/
 F:     include/linux/nvme.h
 F:     include/uapi/linux/nvme_ioctl.h
 
-NVM EXPRESS TARGET DRIVER
-M:     Christoph Hellwig <hch@lst.de>
-M:     Sagi Grimberg <sagi@grimberg.me>
-L:     linux-nvme@lists.infradead.org
-T:     git://git.infradead.org/nvme.git
-W:     http://git.infradead.org/nvme.git
-S:     Supported
-F:     drivers/nvme/target/
-
 NVM EXPRESS FC TRANSPORT DRIVERS
 M:     James Smart <james.smart@broadcom.com>
 L:     linux-nvme@lists.infradead.org
@@ -9476,6 +9444,15 @@ F:       drivers/nvme/host/fc.c
 F:     drivers/nvme/target/fc.c
 F:     drivers/nvme/target/fcloop.c
 
+NVM EXPRESS TARGET DRIVER
+M:     Christoph Hellwig <hch@lst.de>
+M:     Sagi Grimberg <sagi@grimberg.me>
+L:     linux-nvme@lists.infradead.org
+T:     git://git.infradead.org/nvme.git
+W:     http://git.infradead.org/nvme.git
+S:     Supported
+F:     drivers/nvme/target/
+
 NVMEM FRAMEWORK
 M:     Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
 S:     Maintained
@@ -9484,13 +9461,6 @@ F:       Documentation/devicetree/bindings/nvmem/
 F:     include/linux/nvmem-consumer.h
 F:     include/linux/nvmem-provider.h
 
-NXP-NCI NFC DRIVER
-M:     Clément Perrochaud <clement.perrochaud@effinnov.com>
-R:     Charles Gorand <charles.gorand@effinnov.com>
-L:     linux-nfc@lists.01.org (moderated for non-subscribers)
-S:     Supported
-F:     drivers/nfc/nxp-nci
-
 NXP TDA998X DRM DRIVER
 M:     Russell King <linux@armlinux.org.uk>
 S:     Supported
@@ -9505,95 +9475,58 @@ L:      alsa-devel@alsa-project.org (moderated for non-subscribers)
 S:     Maintained
 F:     sound/soc/codecs/tfa9879*
 
+NXP-NCI NFC DRIVER
+M:     Clément Perrochaud <clement.perrochaud@effinnov.com>
+R:     Charles Gorand <charles.gorand@effinnov.com>
+L:     linux-nfc@lists.01.org (moderated for non-subscribers)
+S:     Supported
+F:     drivers/nfc/nxp-nci
+
 OBJTOOL
 M:     Josh Poimboeuf <jpoimboe@redhat.com>
 S:     Supported
 F:     tools/objtool/
 
-OMAP1 SUPPORT
-M:     Aaro Koskinen <aaro.koskinen@iki.fi>
-M:     Tony Lindgren <tony@atomide.com>
+OMAP AUDIO SUPPORT
+M:     Peter Ujfalusi <peter.ujfalusi@ti.com>
+M:     Jarkko Nikula <jarkko.nikula@bitmer.com>
+L:     alsa-devel@alsa-project.org (moderated for non-subscribers)
 L:     linux-omap@vger.kernel.org
-Q:     http://patchwork.kernel.org/project/linux-omap/list/
-T:     git git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap.git
 S:     Maintained
-F:     arch/arm/mach-omap1/
-F:     arch/arm/plat-omap/
-F:     arch/arm/configs/omap1_defconfig
-F:     drivers/i2c/busses/i2c-omap.c
-F:     include/linux/i2c-omap.h
+F:     sound/soc/omap/
 
-OMAP2+ SUPPORT
-M:     Tony Lindgren <tony@atomide.com>
+OMAP CLOCK FRAMEWORK SUPPORT
+M:     Paul Walmsley <paul@pwsan.com>
 L:     linux-omap@vger.kernel.org
-W:     http://www.muru.com/linux/omap/
-W:     http://linux.omap.com/
-Q:     http://patchwork.kernel.org/project/linux-omap/list/
-T:     git git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap.git
 S:     Maintained
-F:     arch/arm/mach-omap2/
-F:     arch/arm/plat-omap/
-F:     arch/arm/configs/omap2plus_defconfig
-F:     drivers/i2c/busses/i2c-omap.c
-F:     drivers/irqchip/irq-omap-intc.c
-F:     drivers/mfd/*omap*.c
-F:     drivers/mfd/menelaus.c
-F:     drivers/mfd/palmas.c
-F:     drivers/mfd/tps65217.c
-F:     drivers/mfd/tps65218.c
-F:     drivers/mfd/tps65910.c
-F:     drivers/mfd/twl-core.[ch]
-F:     drivers/mfd/twl4030*.c
-F:     drivers/mfd/twl6030*.c
-F:     drivers/mfd/twl6040*.c
-F:     drivers/regulator/palmas-regulator*.c
-F:     drivers/regulator/pbias-regulator.c
-F:     drivers/regulator/tps65217-regulator.c
-F:     drivers/regulator/tps65218-regulator.c
-F:     drivers/regulator/tps65910-regulator.c
-F:     drivers/regulator/twl-regulator.c
-F:     drivers/regulator/twl6030-regulator.c
-F:     include/linux/i2c-omap.h
+F:     arch/arm/*omap*/*clock*
 
 OMAP DEVICE TREE SUPPORT
 M:     Benoît Cousson <bcousson@baylibre.com>
 M:     Tony Lindgren <tony@atomide.com>
 L:     linux-omap@vger.kernel.org
 L:     devicetree@vger.kernel.org
-S:     Maintained
-F:     arch/arm/boot/dts/*omap*
-F:     arch/arm/boot/dts/*am3*
-F:     arch/arm/boot/dts/*am4*
-F:     arch/arm/boot/dts/*am5*
-F:     arch/arm/boot/dts/*dra7*
-
-OMAP CLOCK FRAMEWORK SUPPORT
-M:     Paul Walmsley <paul@pwsan.com>
-L:     linux-omap@vger.kernel.org
-S:     Maintained
-F:     arch/arm/*omap*/*clock*
-
-OMAP POWER MANAGEMENT SUPPORT
-M:     Kevin Hilman <khilman@kernel.org>
-L:     linux-omap@vger.kernel.org
-S:     Maintained
-F:     arch/arm/*omap*/*pm*
-F:     drivers/cpufreq/omap-cpufreq.c
+S:     Maintained
+F:     arch/arm/boot/dts/*omap*
+F:     arch/arm/boot/dts/*am3*
+F:     arch/arm/boot/dts/*am4*
+F:     arch/arm/boot/dts/*am5*
+F:     arch/arm/boot/dts/*dra7*
 
-OMAP POWERDOMAIN SOC ADAPTATION LAYER SUPPORT
-M:     Rajendra Nayak <rnayak@codeaurora.org>
-M:     Paul Walmsley <paul@pwsan.com>
+OMAP DISPLAY SUBSYSTEM and FRAMEBUFFER SUPPORT (DSS2)
+M:     Tomi Valkeinen <tomi.valkeinen@ti.com>
 L:     linux-omap@vger.kernel.org
+L:     linux-fbdev@vger.kernel.org
 S:     Maintained
-F:     arch/arm/mach-omap2/prm*
+F:     drivers/video/fbdev/omap2/
+F:     Documentation/arm/OMAP/DSS
 
-OMAP AUDIO SUPPORT
-M:     Peter Ujfalusi <peter.ujfalusi@ti.com>
-M:     Jarkko Nikula <jarkko.nikula@bitmer.com>
-L:     alsa-devel@alsa-project.org (moderated for non-subscribers)
+OMAP FRAMEBUFFER SUPPORT
+M:     Tomi Valkeinen <tomi.valkeinen@ti.com>
+L:     linux-fbdev@vger.kernel.org
 L:     linux-omap@vger.kernel.org
 S:     Maintained
-F:     sound/soc/omap/
+F:     drivers/video/fbdev/omap/
 
 OMAP GENERAL PURPOSE MEMORY CONTROLLER SUPPORT
 M:     Roger Quadros <rogerq@ti.com>
@@ -9603,20 +9536,14 @@ S:      Maintained
 F:     drivers/memory/omap-gpmc.c
 F:     arch/arm/mach-omap2/*gpmc*
 
-OMAP FRAMEBUFFER SUPPORT
-M:     Tomi Valkeinen <tomi.valkeinen@ti.com>
-L:     linux-fbdev@vger.kernel.org
-L:     linux-omap@vger.kernel.org
-S:     Maintained
-F:     drivers/video/fbdev/omap/
-
-OMAP DISPLAY SUBSYSTEM and FRAMEBUFFER SUPPORT (DSS2)
-M:     Tomi Valkeinen <tomi.valkeinen@ti.com>
+OMAP GPIO DRIVER
+M:     Grygorii Strashko <grygorii.strashko@ti.com>
+M:     Santosh Shilimkar <ssantosh@kernel.org>
+M:     Kevin Hilman <khilman@kernel.org>
 L:     linux-omap@vger.kernel.org
-L:     linux-fbdev@vger.kernel.org
 S:     Maintained
-F:     drivers/video/fbdev/omap2/
-F:     Documentation/arm/OMAP/DSS
+F:     Documentation/devicetree/bindings/gpio/gpio-omap.txt
+F:     drivers/gpio/gpio-omap.c
 
 OMAP HARDWARE SPINLOCK SUPPORT
 M:     Ohad Ben-Cohen <ohad@wizery.com>
@@ -9624,30 +9551,12 @@ L:      linux-omap@vger.kernel.org
 S:     Maintained
 F:     drivers/hwspinlock/omap_hwspinlock.c
 
-OMAP MMC SUPPORT
-M:     Jarkko Lavinen <jarkko.lavinen@nokia.com>
-L:     linux-omap@vger.kernel.org
-S:     Maintained
-F:     drivers/mmc/host/omap.c
-
 OMAP HS MMC SUPPORT
 L:     linux-mmc@vger.kernel.org
 L:     linux-omap@vger.kernel.org
 S:     Orphan
 F:     drivers/mmc/host/omap_hsmmc.c
 
-OMAP RANDOM NUMBER GENERATOR SUPPORT
-M:     Deepak Saxena <dsaxena@plexity.net>
-S:     Maintained
-F:     drivers/char/hw_random/omap-rng.c
-
-OMAP HWMOD SUPPORT
-M:     Benoît Cousson <bcousson@baylibre.com>
-M:     Paul Walmsley <paul@pwsan.com>
-L:     linux-omap@vger.kernel.org
-S:     Maintained
-F:     arch/arm/mach-omap2/omap_hwmod.*
-
 OMAP HWMOD DATA
 M:     Paul Walmsley <paul@pwsan.com>
 L:     linux-omap@vger.kernel.org
@@ -9660,6 +9569,13 @@ L:       linux-omap@vger.kernel.org
 S:     Maintained
 F:     arch/arm/mach-omap2/omap_hwmod_44xx_data.c
 
+OMAP HWMOD SUPPORT
+M:     Benoît Cousson <bcousson@baylibre.com>
+M:     Paul Walmsley <paul@pwsan.com>
+L:     linux-omap@vger.kernel.org
+S:     Maintained
+F:     arch/arm/mach-omap2/omap_hwmod.*
+
 OMAP IMAGING SUBSYSTEM (OMAP3 ISP and OMAP4 ISS)
 M:     Laurent Pinchart <laurent.pinchart@ideasonboard.com>
 L:     linux-media@vger.kernel.org
@@ -9668,6 +9584,31 @@ F:       Documentation/devicetree/bindings/media/ti,omap3isp.txt
 F:     drivers/media/platform/omap3isp/
 F:     drivers/staging/media/omap4iss/
 
+OMAP MMC SUPPORT
+M:     Jarkko Lavinen <jarkko.lavinen@nokia.com>
+L:     linux-omap@vger.kernel.org
+S:     Maintained
+F:     drivers/mmc/host/omap.c
+
+OMAP POWER MANAGEMENT SUPPORT
+M:     Kevin Hilman <khilman@kernel.org>
+L:     linux-omap@vger.kernel.org
+S:     Maintained
+F:     arch/arm/*omap*/*pm*
+F:     drivers/cpufreq/omap-cpufreq.c
+
+OMAP POWERDOMAIN SOC ADAPTATION LAYER SUPPORT
+M:     Rajendra Nayak <rnayak@codeaurora.org>
+M:     Paul Walmsley <paul@pwsan.com>
+L:     linux-omap@vger.kernel.org
+S:     Maintained
+F:     arch/arm/mach-omap2/prm*
+
+OMAP RANDOM NUMBER GENERATOR SUPPORT
+M:     Deepak Saxena <dsaxena@plexity.net>
+S:     Maintained
+F:     drivers/char/hw_random/omap-rng.c
+
 OMAP USB SUPPORT
 L:     linux-usb@vger.kernel.org
 L:     linux-omap@vger.kernel.org
@@ -9675,21 +9616,57 @@ S:      Orphan
 F:     drivers/usb/*/*omap*
 F:     arch/arm/*omap*/usb*
 
-OMAP GPIO DRIVER
-M:     Grygorii Strashko <grygorii.strashko@ti.com>
-M:     Santosh Shilimkar <ssantosh@kernel.org>
-M:     Kevin Hilman <khilman@kernel.org>
-L:     linux-omap@vger.kernel.org
-S:     Maintained
-F:     Documentation/devicetree/bindings/gpio/gpio-omap.txt
-F:     drivers/gpio/gpio-omap.c
-
 OMAP/NEWFLOW NANOBONE MACHINE SUPPORT
 M:     Mark Jackson <mpfj@newflow.co.uk>
 L:     linux-omap@vger.kernel.org
 S:     Maintained
 F:     arch/arm/boot/dts/am335x-nano.dts
 
+OMAP1 SUPPORT
+M:     Aaro Koskinen <aaro.koskinen@iki.fi>
+M:     Tony Lindgren <tony@atomide.com>
+L:     linux-omap@vger.kernel.org
+Q:     http://patchwork.kernel.org/project/linux-omap/list/
+T:     git git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap.git
+S:     Maintained
+F:     arch/arm/mach-omap1/
+F:     arch/arm/plat-omap/
+F:     arch/arm/configs/omap1_defconfig
+F:     drivers/i2c/busses/i2c-omap.c
+F:     include/linux/i2c-omap.h
+
+OMAP2+ SUPPORT
+M:     Tony Lindgren <tony@atomide.com>
+L:     linux-omap@vger.kernel.org
+W:     http://www.muru.com/linux/omap/
+W:     http://linux.omap.com/
+Q:     http://patchwork.kernel.org/project/linux-omap/list/
+T:     git git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap.git
+S:     Maintained
+F:     arch/arm/mach-omap2/
+F:     arch/arm/plat-omap/
+F:     arch/arm/configs/omap2plus_defconfig
+F:     drivers/i2c/busses/i2c-omap.c
+F:     drivers/irqchip/irq-omap-intc.c
+F:     drivers/mfd/*omap*.c
+F:     drivers/mfd/menelaus.c
+F:     drivers/mfd/palmas.c
+F:     drivers/mfd/tps65217.c
+F:     drivers/mfd/tps65218.c
+F:     drivers/mfd/tps65910.c
+F:     drivers/mfd/twl-core.[ch]
+F:     drivers/mfd/twl4030*.c
+F:     drivers/mfd/twl6030*.c
+F:     drivers/mfd/twl6040*.c
+F:     drivers/regulator/palmas-regulator*.c
+F:     drivers/regulator/pbias-regulator.c
+F:     drivers/regulator/tps65217-regulator.c
+F:     drivers/regulator/tps65218-regulator.c
+F:     drivers/regulator/tps65910-regulator.c
+F:     drivers/regulator/twl-regulator.c
+F:     drivers/regulator/twl6030-regulator.c
+F:     include/linux/i2c-omap.h
+
 OMFS FILESYSTEM
 M:     Bob Copeland <me@bobcopeland.com>
 L:     linux-karma-devel@lists.sourceforge.net
@@ -9709,6 +9686,13 @@ M:       Harald Welte <laforge@gnumonks.org>
 S:     Maintained
 F:     drivers/char/pcmcia/cm4040_cs.*
 
+OMNIVISION OV13858 SENSOR DRIVER
+M:     Sakari Ailus <sakari.ailus@linux.intel.com>
+L:     linux-media@vger.kernel.org
+T:     git git://linuxtv.org/media_tree.git
+S:     Maintained
+F:     drivers/media/i2c/ov13858.c
+
 OMNIVISION OV5640 SENSOR DRIVER
 M:     Steve Longerbeam <slongerbeam@gmail.com>
 L:     linux-media@vger.kernel.org
@@ -9731,13 +9715,6 @@ S:       Maintained
 F:     drivers/media/i2c/ov7670.c
 F:     Documentation/devicetree/bindings/media/i2c/ov7670.txt
 
-OMNIVISION OV13858 SENSOR DRIVER
-M:     Sakari Ailus <sakari.ailus@linux.intel.com>
-L:     linux-media@vger.kernel.org
-T:     git git://linuxtv.org/media_tree.git
-S:     Maintained
-F:     drivers/media/i2c/ov13858.c
-
 ONENAND FLASH DRIVER
 M:     Kyungmin Park <kyungmin.park@samsung.com>
 L:     linux-mtd@lists.infradead.org
@@ -9767,6 +9744,15 @@ L:       linux-rdma@vger.kernel.org
 S:     Supported
 F:     drivers/infiniband/ulp/opa_vnic
 
+OPEN FIRMWARE AND DEVICE TREE OVERLAYS
+M:     Pantelis Antoniou <pantelis.antoniou@konsulko.com>
+L:     devicetree@vger.kernel.org
+S:     Maintained
+F:     Documentation/devicetree/dynamic-resolution-notes.txt
+F:     Documentation/devicetree/overlay-notes.txt
+F:     drivers/of/overlay.c
+F:     drivers/of/resolver.c
+
 OPEN FIRMWARE AND FLATTENED DEVICE TREE
 M:     Rob Herring <robh+dt@kernel.org>
 M:     Frank Rowand <frowand.list@gmail.com>
@@ -9790,15 +9776,6 @@ F:       Documentation/devicetree/
 F:     arch/*/boot/dts/
 F:     include/dt-bindings/
 
-OPEN FIRMWARE AND DEVICE TREE OVERLAYS
-M:     Pantelis Antoniou <pantelis.antoniou@konsulko.com>
-L:     devicetree@vger.kernel.org
-S:     Maintained
-F:     Documentation/devicetree/dynamic-resolution-notes.txt
-F:     Documentation/devicetree/overlay-notes.txt
-F:     drivers/of/overlay.c
-F:     drivers/of/resolver.c
-
 OPENCORES I2C BUS DRIVER
 M:     Peter Korsgaard <jacmet@sunsite.dk>
 L:     linux-i2c@vger.kernel.org
@@ -9943,11 +9920,11 @@ F:      Documentation/mn10300/
 F:     arch/mn10300/
 
 PARALLEL LCD/KEYPAD PANEL DRIVER
-M:      Willy Tarreau <willy@haproxy.com>
-M:      Ksenija Stanojevic <ksenija.stanojevic@gmail.com>
-S:      Odd Fixes
-F:      Documentation/misc-devices/lcd-panel-cgram.txt
-F:      drivers/misc/panel.c
+M:     Willy Tarreau <willy@haproxy.com>
+M:     Ksenija Stanojevic <ksenija.stanojevic@gmail.com>
+S:     Odd Fixes
+F:     Documentation/misc-devices/lcd-panel-cgram.txt
+F:     drivers/misc/panel.c
 
 PARALLEL PORT SUBSYSTEM
 M:     Sudip Mukherjee <sudipm.mukherjee@gmail.com>
@@ -10043,42 +10020,13 @@ M:    Khalid Aziz <khalid@gonehiking.org>
 S:     Maintained
 F:     drivers/firmware/pcdp.*
 
-PCI ERROR RECOVERY
-M:     Linas Vepstas <linasvepstas@gmail.com>
-L:     linux-pci@vger.kernel.org
-S:     Supported
-F:     Documentation/PCI/pci-error-recovery.txt
-
-PCI ENHANCED ERROR HANDLING (EEH) FOR POWERPC
-M:     Russell Currey <ruscur@russell.cc>
-L:     linuxppc-dev@lists.ozlabs.org
-S:     Supported
-F:     Documentation/powerpc/eeh-pci-error-recovery.txt
-F:     arch/powerpc/kernel/eeh*.c
-F:     arch/powerpc/platforms/*/eeh*.c
-F:     arch/powerpc/include/*/eeh*.h
-
-PCI SUBSYSTEM
-M:     Bjorn Helgaas <bhelgaas@google.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/helgaas/pci.git
-S:     Supported
-F:     Documentation/devicetree/bindings/pci/
-F:     Documentation/PCI/
-F:     drivers/pci/
-F:     include/linux/pci*
-F:     arch/x86/pci/
-F:     arch/x86/kernel/quirks.c
-
-PCI ENDPOINT SUBSYSTEM
-M:     Kishon Vijay Abraham I <kishon@ti.com>
+PCI DRIVER FOR AARDVARK (Marvell Armada 3700)
+M:     Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
 L:     linux-pci@vger.kernel.org
-T:     git git://git.kernel.org/pub/scm/linux/kernel/git/kishon/pci-endpoint.git
-S:     Supported
-F:     drivers/pci/endpoint/
-F:     drivers/misc/pci_endpoint_test.c
-F:     tools/pci/
+L:     linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
+S:     Maintained
+F:     Documentation/devicetree/bindings/pci/aardvark-pci.txt
+F:     drivers/pci/host/pci-aardvark.c
 
 PCI DRIVER FOR ALTERA PCIE IP
 M:     Ley Foon Tan <lftan@altera.com>
@@ -10088,6 +10036,14 @@ S:     Supported
 F:     Documentation/devicetree/bindings/pci/altera-pcie.txt
 F:     drivers/pci/host/pcie-altera.c
 
+PCI DRIVER FOR APPLIEDMICRO XGENE
+M:     Tanmay Inamdar <tinamdar@apm.com>
+L:     linux-pci@vger.kernel.org
+L:     linux-arm-kernel@lists.infradead.org
+S:     Maintained
+F:     Documentation/devicetree/bindings/pci/xgene-pci.txt
+F:     drivers/pci/host/pci-xgene.c
+
 PCI DRIVER FOR ARM VERSATILE PLATFORM
 M:     Rob Herring <robh@kernel.org>
 L:     linux-pci@vger.kernel.org
@@ -10104,14 +10060,6 @@ S:     Maintained
 F:     Documentation/devicetree/bindings/pci/pci-armada8k.txt
 F:     drivers/pci/dwc/pcie-armada8k.c
 
-PCI DRIVER FOR APPLIEDMICRO XGENE
-M:     Tanmay Inamdar <tinamdar@apm.com>
-L:     linux-pci@vger.kernel.org
-L:     linux-arm-kernel@lists.infradead.org
-S:     Maintained
-F:     Documentation/devicetree/bindings/pci/xgene-pci.txt
-F:     drivers/pci/host/pci-xgene.c
-
 PCI DRIVER FOR FREESCALE LAYERSCAPE
 M:     Minghuan Lian <minghuan.Lian@freescale.com>
 M:     Mingkai Hu <mingkai.hu@freescale.com>
@@ -10122,37 +10070,29 @@ L:    linux-arm-kernel@lists.infradead.org
 S:     Maintained
 F:     drivers/pci/dwc/*layerscape*
 
-PCI DRIVER FOR IMX6
-M:     Richard Zhu <hongxing.zhu@nxp.com>
-M:     Lucas Stach <l.stach@pengutronix.de>
-L:     linux-pci@vger.kernel.org
-L:     linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
-S:     Maintained
-F:     Documentation/devicetree/bindings/pci/fsl,imx6q-pcie.txt
-F:     drivers/pci/dwc/*imx6*
-
-PCI DRIVER FOR TI KEYSTONE
-M:     Murali Karicheri <m-karicheri2@ti.com>
+PCI DRIVER FOR GENERIC OF HOSTS
+M:     Will Deacon <will.deacon@arm.com>
 L:     linux-pci@vger.kernel.org
 L:     linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
 S:     Maintained
-F:     drivers/pci/dwc/*keystone*
+F:     Documentation/devicetree/bindings/pci/host-generic-pci.txt
+F:     drivers/pci/host/pci-host-common.c
+F:     drivers/pci/host/pci-host-generic.c
 
-PCI DRIVER FOR MVEBU (Marvell Armada 370 and Armada XP SOC support)
-M:     Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
-M:     Jason Cooper <jason@lakedaemon.net>
+PCI DRIVER FOR IMX6
+M:     Richard Zhu <hongxing.zhu@nxp.com>
+M:     Lucas Stach <l.stach@pengutronix.de>
 L:     linux-pci@vger.kernel.org
 L:     linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
 S:     Maintained
-F:     drivers/pci/host/*mvebu*
+F:     Documentation/devicetree/bindings/pci/fsl,imx6q-pcie.txt
+F:     drivers/pci/dwc/*imx6*
 
-PCI DRIVER FOR AARDVARK (Marvell Armada 3700)
-M:     Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
+PCI DRIVER FOR INTEL VOLUME MANAGEMENT DEVICE (VMD)
+M:     Keith Busch <keith.busch@intel.com>
 L:     linux-pci@vger.kernel.org
-L:     linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
-S:     Maintained
-F:     Documentation/devicetree/bindings/pci/aardvark-pci.txt
-F:     drivers/pci/host/pci-aardvark.c
+S:     Supported
+F:     drivers/pci/host/vmd.c
 
 PCI DRIVER FOR MICROSEMI SWITCHTEC
 M:     Kurt Schwemmer <kurt.schwemmer@microsemi.com>
@@ -10165,6 +10105,14 @@ F:     Documentation/ABI/testing/sysfs-class-switchtec
 F:     drivers/pci/switch/switchtec*
 F:     include/uapi/linux/switchtec_ioctl.h
 
+PCI DRIVER FOR MVEBU (Marvell Armada 370 and Armada XP SOC support)
+M:     Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
+M:     Jason Cooper <jason@lakedaemon.net>
+L:     linux-pci@vger.kernel.org
+L:     linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
+S:     Maintained
+F:     drivers/pci/host/*mvebu*
+
 PCI DRIVER FOR NVIDIA TEGRA
 M:     Thierry Reding <thierry.reding@gmail.com>
 L:     linux-tegra@vger.kernel.org
@@ -10173,14 +10121,6 @@ S:     Supported
 F:     Documentation/devicetree/bindings/pci/nvidia,tegra20-pcie.txt
 F:     drivers/pci/host/pci-tegra.c
 
-PCI DRIVER FOR TI DRA7XX
-M:     Kishon Vijay Abraham I <kishon@ti.com>
-L:     linux-omap@vger.kernel.org
-L:     linux-pci@vger.kernel.org
-S:     Supported
-F:     Documentation/devicetree/bindings/pci/ti-pci.txt
-F:     drivers/pci/dwc/pci-dra7xx.c
-
 PCI DRIVER FOR RENESAS R-CAR
 M:     Simon Horman <horms@verge.net.au>
 L:     linux-pci@vger.kernel.org
@@ -10204,26 +10144,44 @@ S:    Maintained
 F:     Documentation/devicetree/bindings/pci/designware-pcie.txt
 F:     drivers/pci/dwc/*designware*
 
-PCI DRIVER FOR GENERIC OF HOSTS
-M:     Will Deacon <will.deacon@arm.com>
+PCI DRIVER FOR TI DRA7XX
+M:     Kishon Vijay Abraham I <kishon@ti.com>
+L:     linux-omap@vger.kernel.org
+L:     linux-pci@vger.kernel.org
+S:     Supported
+F:     Documentation/devicetree/bindings/pci/ti-pci.txt
+F:     drivers/pci/dwc/pci-dra7xx.c
+
+PCI DRIVER FOR TI KEYSTONE
+M:     Murali Karicheri <m-karicheri2@ti.com>
 L:     linux-pci@vger.kernel.org
 L:     linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
 S:     Maintained
-F:     Documentation/devicetree/bindings/pci/host-generic-pci.txt
-F:     drivers/pci/host/pci-host-common.c
-F:     drivers/pci/host/pci-host-generic.c
+F:     drivers/pci/dwc/*keystone*
 
-PCI DRIVER FOR INTEL VOLUME MANAGEMENT DEVICE (VMD)
-M:     Keith Busch <keith.busch@intel.com>
+PCI ENDPOINT SUBSYSTEM
+M:     Kishon Vijay Abraham I <kishon@ti.com>
 L:     linux-pci@vger.kernel.org
+T:     git git://git.kernel.org/pub/scm/linux/kernel/git/kishon/pci-endpoint.git
 S:     Supported
-F:     drivers/pci/host/vmd.c
+F:     drivers/pci/endpoint/
+F:     drivers/misc/pci_endpoint_test.c
+F:     tools/pci/
 
-PCIE DRIVER FOR ST SPEAR13XX
-M:     Pratyush Anand <pratyush.anand@gmail.com>
+PCI ENHANCED ERROR HANDLING (EEH) FOR POWERPC
+M:     Russell Currey <ruscur@russell.cc>
+L:     linuxppc-dev@lists.ozlabs.org
+S:     Supported
+F:     Documentation/powerpc/eeh-pci-error-recovery.txt
+F:     arch/powerpc/kernel/eeh*.c
+F:     arch/powerpc/platforms/*/eeh*.c
+F:     arch/powerpc/include/*/eeh*.h
+
+PCI ERROR RECOVERY
+M:     Linas Vepstas <linasvepstas@gmail.com>
 L:     linux-pci@vger.kernel.org
-S:     Maintained
-F:     drivers/pci/dwc/*spear*
+S:     Supported
+F:     Documentation/PCI/pci-error-recovery.txt
 
 PCI MSI DRIVER FOR ALTERA MSI IP
 M:     Ley Foon Tan <lftan@altera.com>
@@ -10241,6 +10199,19 @@ S:     Maintained
 F:     Documentation/devicetree/bindings/pci/xgene-pci-msi.txt
 F:     drivers/pci/host/pci-xgene-msi.c
 
+PCI SUBSYSTEM
+M:     Bjorn Helgaas <bhelgaas@google.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/helgaas/pci.git
+S:     Supported
+F:     Documentation/devicetree/bindings/pci/
+F:     Documentation/PCI/
+F:     drivers/pci/
+F:     include/linux/pci*
+F:     arch/x86/pci/
+F:     arch/x86/kernel/quirks.c
+
 PCIE DRIVER FOR AXIS ARTPEC
 M:     Niklas Cassel <niklas.cassel@axis.com>
 M:     Jesper Nilsson <jesper.nilsson@axis.com>
@@ -10250,6 +10221,14 @@ S:     Maintained
 F:     Documentation/devicetree/bindings/pci/axis,artpec*
 F:     drivers/pci/dwc/*artpec*
 
+PCIE DRIVER FOR CAVIUM THUNDERX
+M:     David Daney <david.daney@cavium.com>
+L:     linux-pci@vger.kernel.org
+L:     linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
+S:     Supported
+F:     Documentation/devicetree/bindings/pci/pci-thunder-*
+F:     drivers/pci/host/pci-thunder-*
+
 PCIE DRIVER FOR HISILICON
 M:     Zhou Wang <wangzhou1@hisilicon.com>
 M:     Gabriele Paoloni <gabriele.paoloni@huawei.com>
@@ -10266,6 +10245,21 @@ S:     Maintained
 F:     Documentation/devicetree/bindings/pci/pcie-kirin.txt
 F:     drivers/pci/dwc/pcie-kirin.c
 
+PCIE DRIVER FOR MEDIATEK
+M:     Ryder Lee <ryder.lee@mediatek.com>
+L:     linux-pci@vger.kernel.org
+L:     linux-mediatek@lists.infradead.org
+S:     Supported
+F:     Documentation/devicetree/bindings/pci/mediatek*
+F:     drivers/pci/host/*mediatek*
+
+PCIE DRIVER FOR QUALCOMM MSM
+M:     Stanimir Varbanov <svarbanov@mm-sol.com>
+L:     linux-pci@vger.kernel.org
+L:     linux-arm-msm@vger.kernel.org
+S:     Maintained
+F:     drivers/pci/dwc/*qcom*
+
 PCIE DRIVER FOR ROCKCHIP
 M:     Shawn Lin <shawn.lin@rock-chips.com>
 L:     linux-pci@vger.kernel.org
@@ -10274,28 +10268,11 @@ S:    Maintained
 F:     Documentation/devicetree/bindings/pci/rockchip-pcie.txt
 F:     drivers/pci/host/pcie-rockchip.c
 
-PCIE DRIVER FOR QUALCOMM MSM
-M:     Stanimir Varbanov <svarbanov@mm-sol.com>
-L:     linux-pci@vger.kernel.org
-L:     linux-arm-msm@vger.kernel.org
-S:     Maintained
-F:     drivers/pci/dwc/*qcom*
-
-PCIE DRIVER FOR CAVIUM THUNDERX
-M:     David Daney <david.daney@cavium.com>
+PCIE DRIVER FOR ST SPEAR13XX
+M:     Pratyush Anand <pratyush.anand@gmail.com>
 L:     linux-pci@vger.kernel.org
-L:     linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
-S:     Supported
-F:     Documentation/devicetree/bindings/pci/pci-thunder-*
-F:     drivers/pci/host/pci-thunder-*
-
-PCIE DRIVER FOR MEDIATEK
-M:      Ryder Lee <ryder.lee@mediatek.com>
-L:      linux-pci@vger.kernel.org
-L:      linux-mediatek@lists.infradead.org
-S:      Supported
-F:      Documentation/devicetree/bindings/pci/mediatek*
-F:      drivers/pci/host/*mediatek*
+S:     Maintained
+F:     drivers/pci/dwc/*spear*
 
 PCMCIA SUBSYSTEM
 P:     Linux PCMCIA Team
@@ -10464,14 +10441,14 @@ S:    Maintained
 F:     drivers/pinctrl/spear/
 
 PISTACHIO SOC SUPPORT
-M:      James Hartley <james.hartley@imgtec.com>
-M:      Ionela Voinescu <ionela.voinescu@imgtec.com>
-L:      linux-mips@linux-mips.org
-S:      Maintained
-F:      arch/mips/pistachio/
-F:      arch/mips/include/asm/mach-pistachio/
-F:      arch/mips/boot/dts/img/pistachio*
-F:      arch/mips/configs/pistachio*_defconfig
+M:     James Hartley <james.hartley@imgtec.com>
+M:     Ionela Voinescu <ionela.voinescu@imgtec.com>
+L:     linux-mips@linux-mips.org
+S:     Maintained
+F:     arch/mips/pistachio/
+F:     arch/mips/include/asm/mach-pistachio/
+F:     arch/mips/boot/dts/img/pistachio*
+F:     arch/mips/configs/pistachio*_defconfig
 
 PKTCDVD DRIVER
 S:     Orphan
@@ -10540,15 +10517,6 @@ F:     include/linux/pm_*
 F:     include/linux/powercap.h
 F:     drivers/powercap/
 
-POWER SUPPLY CLASS/SUBSYSTEM and DRIVERS
-M:     Sebastian Reichel <sre@kernel.org>
-L:     linux-pm@vger.kernel.org
-T:     git git://git.kernel.org/pub/scm/linux/kernel/git/sre/linux-power-supply.git
-S:     Maintained
-F:     Documentation/devicetree/bindings/power/supply/
-F:     include/linux/power_supply.h
-F:     drivers/power/supply/
-
 POWER STATE COORDINATION INTERFACE (PSCI)
 M:     Mark Rutland <mark.rutland@arm.com>
 M:     Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
@@ -10558,18 +10526,21 @@ F:    drivers/firmware/psci*.c
 F:     include/linux/psci.h
 F:     include/uapi/linux/psci.h
 
+POWER SUPPLY CLASS/SUBSYSTEM and DRIVERS
+M:     Sebastian Reichel <sre@kernel.org>
+L:     linux-pm@vger.kernel.org
+T:     git git://git.kernel.org/pub/scm/linux/kernel/git/sre/linux-power-supply.git
+S:     Maintained
+F:     Documentation/devicetree/bindings/power/supply/
+F:     include/linux/power_supply.h
+F:     drivers/power/supply/
+
 POWERNV OPERATOR PANEL LCD DISPLAY DRIVER
 M:     Suraj Jitindar Singh <sjitindarsingh@gmail.com>
 L:     linuxppc-dev@lists.ozlabs.org
 S:     Maintained
 F:     drivers/char/powernv-op-panel.c
 
-PPP PROTOCOL DRIVERS AND COMPRESSORS
-M:     Paul Mackerras <paulus@samba.org>
-L:     linux-ppp@vger.kernel.org
-S:     Maintained
-F:     drivers/net/ppp/ppp_*
-
 PPP OVER ATM (RFC 2364)
 M:     Mitchell Blank Jr <mitch@sfgoth.com>
 S:     Maintained
@@ -10589,6 +10560,12 @@ F:     net/l2tp/l2tp_ppp.c
 F:     include/linux/if_pppol2tp.h
 F:     include/uapi/linux/if_pppol2tp.h
 
+PPP PROTOCOL DRIVERS AND COMPRESSORS
+M:     Paul Mackerras <paulus@samba.org>
+L:     linux-ppp@vger.kernel.org
+S:     Maintained
+F:     drivers/net/ppp/ppp_*
+
 PPS SUPPORT
 M:     Rodolfo Giometti <giometti@enneenne.com>
 W:     http://wiki.enneenne.com/index.php/LinuxPPS_support
@@ -10763,6 +10740,20 @@ F:     include/linux/pwm_backlight.h
 F:     drivers/gpio/gpio-mvebu.c
 F:     Documentation/devicetree/bindings/gpio/gpio-mvebu.txt
 
+PXA GPIO DRIVER
+M:     Robert Jarzmik <robert.jarzmik@free.fr>
+L:     linux-gpio@vger.kernel.org
+S:     Maintained
+F:     drivers/gpio/gpio-pxa.c
+
+PXA MMCI DRIVER
+S:     Orphan
+
+PXA RTC DRIVER
+M:     Robert Jarzmik <robert.jarzmik@free.fr>
+L:     linux-rtc@vger.kernel.org
+S:     Maintained
+
 PXA2xx/PXA3xx SUPPORT
 M:     Daniel Mack <daniel@zonque.org>
 M:     Haojian Zhuang <haojian.zhuang@gmail.com>
@@ -10782,26 +10773,12 @@ F:    include/sound/pxa2xx-lib.h
 F:     sound/arm/pxa*
 F:     sound/soc/pxa/
 
-PXA GPIO DRIVER
-M:     Robert Jarzmik <robert.jarzmik@free.fr>
-L:     linux-gpio@vger.kernel.org
-S:     Maintained
-F:     drivers/gpio/gpio-pxa.c
-
 PXA3xx NAND FLASH DRIVER
 M:     Ezequiel Garcia <ezequiel.garcia@free-electrons.com>
 L:     linux-mtd@lists.infradead.org
 S:     Maintained
 F:     drivers/mtd/nand/pxa3xx_nand.c
 
-PXA MMCI DRIVER
-S:     Orphan
-
-PXA RTC DRIVER
-M:     Robert Jarzmik <robert.jarzmik@free.fr>
-L:     linux-rtc@vger.kernel.org
-S:     Maintained
-
 QAT DRIVER
 M:     Giovanni Cabiddu <giovanni.cabiddu@intel.com>
 M:     Salvatore Benedetto <salvatore.benedetto@intel.com>
@@ -10829,6 +10806,36 @@ L:     linux-rdma@vger.kernel.org
 S:     Supported
 F:     drivers/infiniband/hw/qib/
 
+QLOGIC QL41xxx FCOE DRIVER
+M:     QLogic-Storage-Upstream@cavium.com
+L:     linux-scsi@vger.kernel.org
+S:     Supported
+F:     drivers/scsi/qedf/
+
+QLOGIC QL41xxx ISCSI DRIVER
+M:     QLogic-Storage-Upstream@cavium.com
+L:     linux-scsi@vger.kernel.org
+S:     Supported
+F:     drivers/scsi/qedi/
+
+QLOGIC QL4xxx ETHERNET DRIVER
+M:     Yuval Mintz <Yuval.Mintz@cavium.com>
+M:     Ariel Elior <Ariel.Elior@cavium.com>
+M:     everest-linux-l2@cavium.com
+L:     netdev@vger.kernel.org
+S:     Supported
+F:     drivers/net/ethernet/qlogic/qed/
+F:     include/linux/qed/
+F:     drivers/net/ethernet/qlogic/qede/
+
+QLOGIC QL4xxx RDMA DRIVER
+M:     Ram Amrani <Ram.Amrani@cavium.com>
+M:     Ariel Elior <Ariel.Elior@cavium.com>
+L:     linux-rdma@vger.kernel.org
+S:     Supported
+F:     drivers/infiniband/hw/qedr/
+F:     include/uapi/rdma/qedr-abi.h
+
 QLOGIC QLA1280 SCSI DRIVER
 M:     Michael Reed <mdr@sgi.com>
 L:     linux-scsi@vger.kernel.org
@@ -10842,13 +10849,6 @@ S:     Supported
 F:     Documentation/scsi/LICENSE.qla2xxx
 F:     drivers/scsi/qla2xxx/
 
-QLOGIC QLA4XXX iSCSI DRIVER
-M:     QLogic-Storage-Upstream@qlogic.com
-L:     linux-scsi@vger.kernel.org
-S:     Supported
-F:     Documentation/scsi/LICENSE.qla4xxx
-F:     drivers/scsi/qla4xxx/
-
 QLOGIC QLA3XXX NETWORK DRIVER
 M:     Dept-GELinuxNICDev@cavium.com
 L:     netdev@vger.kernel.org
@@ -10856,51 +10856,28 @@ S:    Supported
 F:     Documentation/networking/LICENSE.qla3xxx
 F:     drivers/net/ethernet/qlogic/qla3xxx.*
 
-QLOGIC QLCNIC (1/10)Gb ETHERNET DRIVER
-M:     Harish Patil <harish.patil@cavium.com>
-M:     Manish Chopra <manish.chopra@cavium.com>
-M:     Dept-GELinuxNICDev@cavium.com
-L:     netdev@vger.kernel.org
+QLOGIC QLA4XXX iSCSI DRIVER
+M:     QLogic-Storage-Upstream@qlogic.com
+L:     linux-scsi@vger.kernel.org
 S:     Supported
-F:     drivers/net/ethernet/qlogic/qlcnic/
+F:     Documentation/scsi/LICENSE.qla4xxx
+F:     drivers/scsi/qla4xxx/
 
-QLOGIC QLGE 10Gb ETHERNET DRIVER
+QLOGIC QLCNIC (1/10)Gb ETHERNET DRIVER
 M:     Harish Patil <harish.patil@cavium.com>
 M:     Manish Chopra <manish.chopra@cavium.com>
 M:     Dept-GELinuxNICDev@cavium.com
 L:     netdev@vger.kernel.org
 S:     Supported
-F:     drivers/net/ethernet/qlogic/qlge/
-
-QLOGIC QL4xxx ETHERNET DRIVER
-M:     Yuval Mintz <Yuval.Mintz@cavium.com>
-M:     Ariel Elior <Ariel.Elior@cavium.com>
-M:     everest-linux-l2@cavium.com
-L:     netdev@vger.kernel.org
-S:     Supported
-F:     drivers/net/ethernet/qlogic/qed/
-F:     include/linux/qed/
-F:     drivers/net/ethernet/qlogic/qede/
-
-QLOGIC QL41xxx ISCSI DRIVER
-M:     QLogic-Storage-Upstream@cavium.com
-L:     linux-scsi@vger.kernel.org
-S:     Supported
-F:     drivers/scsi/qedi/
-
-QLOGIC QL41xxx FCOE DRIVER
-M:     QLogic-Storage-Upstream@cavium.com
-L:     linux-scsi@vger.kernel.org
-S:     Supported
-F:     drivers/scsi/qedf/
-
-QLOGIC QL4xxx RDMA DRIVER
-M:     Ram Amrani <Ram.Amrani@cavium.com>
-M:     Ariel Elior <Ariel.Elior@cavium.com>
-L:     linux-rdma@vger.kernel.org
+F:     drivers/net/ethernet/qlogic/qlcnic/
+
+QLOGIC QLGE 10Gb ETHERNET DRIVER
+M:     Harish Patil <harish.patil@cavium.com>
+M:     Manish Chopra <manish.chopra@cavium.com>
+M:     Dept-GELinuxNICDev@cavium.com
+L:     netdev@vger.kernel.org
 S:     Supported
-F:     drivers/infiniband/hw/qedr/
-F:     include/uapi/rdma/qedr-abi.h
+F:     drivers/net/ethernet/qlogic/qlge/
 
 QNX4 FILESYSTEM
 M:     Anders Larsen <al@alarsen.net>
@@ -10928,13 +10905,6 @@ T:     git git://linuxtv.org/anttip/media_tree.git
 S:     Maintained
 F:     drivers/media/tuners/qt1010*
 
-QUALCOMM ATHEROS ATH9K WIRELESS DRIVER
-M:     QCA ath9k Development <ath9k-devel@qca.qualcomm.com>
-L:     linux-wireless@vger.kernel.org
-W:     http://wireless.kernel.org/en/users/Drivers/ath9k
-S:     Supported
-F:     drivers/net/wireless/ath/ath9k/
-
 QUALCOMM ATHEROS ATH10K WIRELESS DRIVER
 M:     Kalle Valo <kvalo@qca.qualcomm.com>
 L:     ath10k@lists.infradead.org
@@ -10943,6 +10913,13 @@ T:     git git://git.kernel.org/pub/scm/linux/kernel/git/kvalo/ath.git
 S:     Supported
 F:     drivers/net/wireless/ath/ath10k/
 
+QUALCOMM ATHEROS ATH9K WIRELESS DRIVER
+M:     QCA ath9k Development <ath9k-devel@qca.qualcomm.com>
+L:     linux-wireless@vger.kernel.org
+W:     http://wireless.kernel.org/en/users/Drivers/ath9k
+S:     Supported
+F:     drivers/net/wireless/ath/ath9k/
+
 QUALCOMM EMAC GIGABIT ETHERNET DRIVER
 M:     Timur Tabi <timur@codeaurora.org>
 L:     netdev@vger.kernel.org
@@ -10973,12 +10950,23 @@ S:    Supported
 F:     drivers/net/wireless/ath/wcn36xx/
 
 QUANTENNA QTNFMAC WIRELESS DRIVER
-M:   Igor Mitsyanko <imitsyanko@quantenna.com>
-M:   Avinash Patil <avinashp@quantenna.com>
-M:   Sergey Matyukevich <smatyukevich@quantenna.com>
-L:   linux-wireless@vger.kernel.org
-S:   Maintained
-F:   drivers/net/wireless/quantenna
+M:     Igor Mitsyanko <imitsyanko@quantenna.com>
+M:     Avinash Patil <avinashp@quantenna.com>
+M:     Sergey Matyukevich <smatyukevich@quantenna.com>
+L:     linux-wireless@vger.kernel.org
+S:     Maintained
+F:     drivers/net/wireless/quantenna
+
+RADEON and AMDGPU DRM DRIVERS
+M:     Alex Deucher <alexander.deucher@amd.com>
+M:     Christian König <christian.koenig@amd.com>
+L:     amd-gfx@lists.freedesktop.org
+T:     git git://people.freedesktop.org/~agd5f/linux
+S:     Supported
+F:     drivers/gpu/drm/radeon/
+F:     include/uapi/drm/radeon_drm.h
+F:     drivers/gpu/drm/amd/
+F:     include/uapi/drm/amdgpu_drm.h
 
 RADEON FRAMEBUFFER DISPLAY DRIVER
 M:     Benjamin Herrenschmidt <benh@kernel.crashing.org>
@@ -11247,16 +11235,16 @@ S:    Maintained
 F:     lib/rhashtable.c
 F:     include/linux/rhashtable.h
 
-RICOH SMARTMEDIA/XD DRIVER
+RICOH R5C592 MEMORYSTICK DRIVER
 M:     Maxim Levitsky <maximlevitsky@gmail.com>
 S:     Maintained
-F:     drivers/mtd/nand/r852.c
-F:     drivers/mtd/nand/r852.h
+F:     drivers/memstick/host/r592.*
 
-RICOH R5C592 MEMORYSTICK DRIVER
+RICOH SMARTMEDIA/XD DRIVER
 M:     Maxim Levitsky <maximlevitsky@gmail.com>
 S:     Maintained
-F:     drivers/memstick/host/r592.*
+F:     drivers/mtd/nand/r852.c
+F:     drivers/mtd/nand/r852.h
 
 ROCCAT DRIVERS
 M:     Stefan Achatz <erazor_de@users.sourceforge.net>
@@ -11393,6 +11381,23 @@ S:     Supported
 F:     drivers/s390/block/dasd*
 F:     block/partitions/ibm.c
 
+S390 IOMMU (PCI)
+M:     Gerald Schaefer <gerald.schaefer@de.ibm.com>
+L:     linux-s390@vger.kernel.org
+W:     http://www.ibm.com/developerworks/linux/linux390/
+S:     Supported
+F:     drivers/iommu/s390-iommu.c
+
+S390 IUCV NETWORK LAYER
+M:     Julian Wiedmann <jwi@linux.vnet.ibm.com>
+M:     Ursula Braun <ubraun@linux.vnet.ibm.com>
+L:     linux-s390@vger.kernel.org
+W:     http://www.ibm.com/developerworks/linux/linux390/
+S:     Supported
+F:     drivers/s390/net/*iucv*
+F:     include/net/iucv/
+F:     net/iucv/
+
 S390 NETWORK DRIVERS
 M:     Julian Wiedmann <jwi@linux.vnet.ibm.com>
 M:     Ursula Braun <ubraun@linux.vnet.ibm.com>
@@ -11410,6 +11415,16 @@ S:     Supported
 F:     arch/s390/pci/
 F:     drivers/pci/hotplug/s390_pci_hpc.c
 
+S390 VFIO-CCW DRIVER
+M:     Cornelia Huck <cohuck@redhat.com>
+M:     Dong Jia Shi <bjsdjshi@linux.vnet.ibm.com>
+L:     linux-s390@vger.kernel.org
+L:     kvm@vger.kernel.org
+S:     Supported
+F:     drivers/s390/cio/vfio_ccw*
+F:     Documentation/s390/vfio-ccw.txt
+F:     include/uapi/linux/vfio_ccw.h
+
 S390 ZCRYPT DRIVER
 M:     Harald Freudenberger <freude@de.ibm.com>
 L:     linux-s390@vger.kernel.org
@@ -11424,33 +11439,6 @@ W:     http://www.ibm.com/developerworks/linux/linux390/
 S:     Supported
 F:     drivers/s390/scsi/zfcp_*
 
-S390 IUCV NETWORK LAYER
-M:     Julian Wiedmann <jwi@linux.vnet.ibm.com>
-M:     Ursula Braun <ubraun@linux.vnet.ibm.com>
-L:     linux-s390@vger.kernel.org
-W:     http://www.ibm.com/developerworks/linux/linux390/
-S:     Supported
-F:     drivers/s390/net/*iucv*
-F:     include/net/iucv/
-F:     net/iucv/
-
-S390 IOMMU (PCI)
-M:     Gerald Schaefer <gerald.schaefer@de.ibm.com>
-L:     linux-s390@vger.kernel.org
-W:     http://www.ibm.com/developerworks/linux/linux390/
-S:     Supported
-F:     drivers/iommu/s390-iommu.c
-
-S390 VFIO-CCW DRIVER
-M:     Cornelia Huck <cohuck@redhat.com>
-M:     Dong Jia Shi <bjsdjshi@linux.vnet.ibm.com>
-L:     linux-s390@vger.kernel.org
-L:     kvm@vger.kernel.org
-S:     Supported
-F:     drivers/s390/cio/vfio_ccw*
-F:     Documentation/s390/vfio-ccw.txt
-F:     include/uapi/linux/vfio_ccw.h
-
 S3C24XX SD/MMC Driver
 M:     Ben Dooks <ben-linux@fluff.org>
 L:     linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
@@ -11484,12 +11472,6 @@ F:     drivers/media/common/saa7146/
 F:     drivers/media/pci/saa7146/
 F:     include/media/saa7146*
 
-SAMSUNG LAPTOP DRIVER
-M:     Corentin Chary <corentin.chary@gmail.com>
-L:     platform-driver-x86@vger.kernel.org
-S:     Maintained
-F:     drivers/platform/x86/samsung-laptop.c
-
 SAMSUNG AUDIO (ASoC) DRIVERS
 M:     Krzysztof Kozlowski <krzk@kernel.org>
 M:     Sangbeom Kim <sbkim73@samsung.com>
@@ -11512,6 +11494,12 @@ L:     linux-fbdev@vger.kernel.org
 S:     Maintained
 F:     drivers/video/fbdev/s3c-fb.c
 
+SAMSUNG LAPTOP DRIVER
+M:     Corentin Chary <corentin.chary@gmail.com>
+L:     platform-driver-x86@vger.kernel.org
+S:     Maintained
+F:     drivers/platform/x86/samsung-laptop.c
+
 SAMSUNG MULTIFUNCTION PMIC DEVICE DRIVERS
 M:     Sangbeom Kim <sbkim73@samsung.com>
 M:     Krzysztof Kozlowski <krzk@kernel.org>
@@ -11530,22 +11518,6 @@ F:     Documentation/devicetree/bindings/regulator/samsung,s2m*.txt
 F:     Documentation/devicetree/bindings/regulator/samsung,s5m*.txt
 F:     Documentation/devicetree/bindings/clock/samsung,s2mps11.txt
 
-SAMSUNG S5P Security SubSystem (SSS) DRIVER
-M:     Krzysztof Kozlowski <krzk@kernel.org>
-M:     Vladimir Zapolskiy <vz@mleia.com>
-L:     linux-crypto@vger.kernel.org
-L:     linux-samsung-soc@vger.kernel.org
-S:     Maintained
-F:     drivers/crypto/s5p-sss.c
-
-SAMSUNG S5P/EXYNOS4 SOC SERIES CAMERA SUBSYSTEM DRIVERS
-M:     Kyungmin Park <kyungmin.park@samsung.com>
-M:     Sylwester Nawrocki <s.nawrocki@samsung.com>
-L:     linux-media@vger.kernel.org
-Q:     https://patchwork.linuxtv.org/project/linux-media/list/
-S:     Supported
-F:     drivers/media/platform/exynos4-is/
-
 SAMSUNG S3C24XX/S3C64XX SOC SERIES CAMIF DRIVER
 M:     Sylwester Nawrocki <sylvester.nawrocki@gmail.com>
 L:     linux-media@vger.kernel.org
@@ -11554,6 +11526,13 @@ S:     Maintained
 F:     drivers/media/platform/s3c-camif/
 F:     include/media/drv-intf/s3c_camif.h
 
+SAMSUNG S3FWRN5 NFC DRIVER
+M:     Robert Baldyga <r.baldyga@samsung.com>
+M:     Krzysztof Opasiak <k.opasiak@samsung.com>
+L:     linux-nfc@lists.01.org (moderated for non-subscribers)
+S:     Supported
+F:     drivers/nfc/s3fwrn5
+
 SAMSUNG S5C73M3 CAMERA DRIVER
 M:     Kyungmin Park <kyungmin.park@samsung.com>
 M:     Andrzej Hajda <a.hajda@samsung.com>
@@ -11568,12 +11547,21 @@ L:    linux-media@vger.kernel.org
 S:     Supported
 F:     drivers/media/i2c/s5k5baf.c
 
-SAMSUNG S3FWRN5 NFC DRIVER
-M:     Robert Baldyga <r.baldyga@samsung.com>
-M:     Krzysztof Opasiak <k.opasiak@samsung.com>
-L:     linux-nfc@lists.01.org (moderated for non-subscribers)
+SAMSUNG S5P Security SubSystem (SSS) DRIVER
+M:     Krzysztof Kozlowski <krzk@kernel.org>
+M:     Vladimir Zapolskiy <vz@mleia.com>
+L:     linux-crypto@vger.kernel.org
+L:     linux-samsung-soc@vger.kernel.org
+S:     Maintained
+F:     drivers/crypto/s5p-sss.c
+
+SAMSUNG S5P/EXYNOS4 SOC SERIES CAMERA SUBSYSTEM DRIVERS
+M:     Kyungmin Park <kyungmin.park@samsung.com>
+M:     Sylwester Nawrocki <s.nawrocki@samsung.com>
+L:     linux-media@vger.kernel.org
+Q:     https://patchwork.linuxtv.org/project/linux-media/list/
 S:     Supported
-F:     drivers/nfc/s3fwrn5
+F:     drivers/media/platform/exynos4-is/
 
 SAMSUNG SOC CLOCK DRIVERS
 M:     Sylwester Nawrocki <s.nawrocki@samsung.com>
@@ -11753,6 +11741,13 @@ F:     Documentation/userspace-api/seccomp_filter.rst
 K:     \bsecure_computing
 K:     \bTIF_SECCOMP\b
 
+SECURE DIGITAL HOST CONTROLLER INTERFACE (SDHCI) Broadcom BRCMSTB DRIVER
+M:     Al Cooper <alcooperx@gmail.com>
+L:     linux-mmc@vger.kernel.org
+L:     bcm-kernel-feedback-list@broadcom.com
+S:     Maintained
+F:     drivers/mmc/host/sdhci-brcmstb*
+
 SECURE DIGITAL HOST CONTROLLER INTERFACE (SDHCI) DRIVER
 M:     Adrian Hunter <adrian.hunter@intel.com>
 L:     linux-mmc@vger.kernel.org
@@ -11761,13 +11756,6 @@ S:     Maintained
 F:     drivers/mmc/host/sdhci*
 F:     include/linux/mmc/sdhci*
 
-SECURE DIGITAL HOST CONTROLLER INTERFACE (SDHCI) Broadcom BRCMSTB DRIVER
-M:     Al Cooper <alcooperx@gmail.com>
-L:     linux-mmc@vger.kernel.org
-L:     bcm-kernel-feedback-list@broadcom.com
-S:     Maintained
-F:     drivers/mmc/host/sdhci-brcmstb*
-
 SECURE DIGITAL HOST CONTROLLER INTERFACE (SDHCI) SAMSUNG DRIVER
 M:     Ben Dooks <ben-linux@fluff.org>
 M:     Jaehoon Chung <jh80.chung@samsung.com>
@@ -11792,6 +11780,10 @@ F:     block/opal_proto.h
 F:     include/linux/sed*
 F:     include/uapi/linux/sed*
 
+SECURITY CONTACT
+M:     Security Officers <security@kernel.org>
+S:     Supported
+
 SECURITY SUBSYSTEM
 M:     James Morris <james.l.morris@oracle.com>
 M:     "Serge E. Hallyn" <serge@hallyn.com>
@@ -11801,10 +11793,6 @@ W:     http://kernsec.org/
 S:     Supported
 F:     security/
 
-SECURITY CONTACT
-M:     Security Officers <security@kernel.org>
-S:     Supported
-
 SELINUX SECURITY MODULE
 M:     Paul Moore <paul@paul-moore.com>
 M:     Stephen Smalley <sds@tycho.nsa.gov>
@@ -11824,13 +11812,6 @@ S:     Maintained
 F:     drivers/misc/phantom.c
 F:     include/uapi/linux/phantom.h
 
-SERIAL DRIVERS
-M:     Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-L:     linux-serial@vger.kernel.org
-S:     Maintained
-F:     Documentation/devicetree/bindings/serial/
-F:     drivers/tty/serial/
-
 SERIAL DEVICE BUS
 M:     Rob Herring <robh@kernel.org>
 L:     linux-serial@vger.kernel.org
@@ -11839,6 +11820,13 @@ F:     Documentation/devicetree/bindings/serial/slave-device.txt
 F:     drivers/tty/serdev/
 F:     include/linux/serdev.h
 
+SERIAL DRIVERS
+M:     Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+L:     linux-serial@vger.kernel.org
+S:     Maintained
+F:     Documentation/devicetree/bindings/serial/
+F:     drivers/tty/serial/
+
 SERIAL IR RECEIVER
 M:     Sean Young <sean@mess.org>
 L:     linux-media@vger.kernel.org
@@ -11872,6 +11860,13 @@ M:     Robin Holt <robinmholt@gmail.com>
 S:     Maintained
 F:     drivers/misc/sgi-xp/
 
+SHARED MEMORY COMMUNICATIONS (SMC) SOCKETS
+M:     Ursula Braun <ubraun@linux.vnet.ibm.com>
+L:     linux-s390@vger.kernel.org
+W:     http://www.ibm.com/developerworks/linux/linux390/
+S:     Supported
+F:     net/smc/
+
 SH_VEU V4L2 MEM2MEM DRIVER
 L:     linux-media@vger.kernel.org
 S:     Orphan
@@ -11883,13 +11878,6 @@ S:     Orphan
 F:     drivers/media/platform/sh_vou.c
 F:     include/media/drv-intf/sh_vou.h
 
-SHARED MEMORY COMMUNICATIONS (SMC) SOCKETS
-M:     Ursula Braun <ubraun@linux.vnet.ibm.com>
-L:     linux-s390@vger.kernel.org
-W:     http://www.ibm.com/developerworks/linux/linux390/
-S:     Supported
-F:     net/smc/
-
 SI2157 MEDIA DRIVER
 M:     Antti Palosaari <crope@iki.fi>
 L:     linux-media@vger.kernel.org
@@ -12120,6 +12108,12 @@ S:     Supported
 F:     Documentation/hwmon/sch5627
 F:     drivers/hwmon/sch5627.c
 
+SMSC UFX6000 and UFX7000 USB to VGA DRIVER
+M:     Steve Glendinning <steve.glendinning@shawell.net>
+L:     linux-fbdev@vger.kernel.org
+S:     Maintained
+F:     drivers/video/fbdev/smscufx.c
+
 SMSC47B397 HARDWARE MONITOR DRIVER
 M:     Jean Delvare <jdelvare@suse.com>
 L:     linux-hwmon@vger.kernel.org
@@ -12140,12 +12134,6 @@ L:     netdev@vger.kernel.org
 S:     Maintained
 F:     drivers/net/ethernet/smsc/smsc9420.*
 
-SMSC UFX6000 and UFX7000 USB to VGA DRIVER
-M:     Steve Glendinning <steve.glendinning@shawell.net>
-L:     linux-fbdev@vger.kernel.org
-S:     Maintained
-F:     drivers/video/fbdev/smscufx.c
-
 SOC-CAMERA V4L2 SUBSYSTEM
 M:     Guennadi Liakhovetski <g.liakhovetski@gmx.de>
 L:     linux-media@vger.kernel.org
@@ -12201,16 +12189,6 @@ S:     Maintained
 F:     drivers/ssb/
 F:     include/linux/ssb/
 
-SONY VAIO CONTROL DEVICE DRIVER
-M:     Mattia Dongili <malattia@linux.it>
-L:     platform-driver-x86@vger.kernel.org
-W:     http://www.linux.it/~malattia/wiki/index.php/Sony_drivers
-S:     Maintained
-F:     Documentation/laptops/sony-laptop.txt
-F:     drivers/char/sonypi.c
-F:     drivers/platform/x86/sony-laptop.c
-F:     include/linux/sony-laptop.h
-
 SONY MEMORYSTICK CARD SUPPORT
 M:     Alex Dubov <oakad@yahoo.com>
 W:     http://tifmxx.berlios.de/
@@ -12222,6 +12200,16 @@ M:     Maxim Levitsky <maximlevitsky@gmail.com>
 S:     Maintained
 F:     drivers/memstick/core/ms_block.*
 
+SONY VAIO CONTROL DEVICE DRIVER
+M:     Mattia Dongili <malattia@linux.it>
+L:     platform-driver-x86@vger.kernel.org
+W:     http://www.linux.it/~malattia/wiki/index.php/Sony_drivers
+S:     Maintained
+F:     Documentation/laptops/sony-laptop.txt
+F:     drivers/char/sonypi.c
+F:     drivers/platform/x86/sony-laptop.c
+F:     include/linux/sony-laptop.h
+
 SOUND
 M:     Jaroslav Kysela <perex@perex.cz>
 M:     Takashi Iwai <tiwai@suse.com>
@@ -12247,6 +12235,13 @@ F:     include/uapi/sound/compress_*
 F:     sound/core/compress_offload.c
 F:     sound/soc/soc-compress.c
 
+SOUND - DMAENGINE HELPERS
+M:     Lars-Peter Clausen <lars@metafoo.de>
+S:     Supported
+F:     include/sound/dmaengine_pcm.h
+F:     sound/core/pcm_dmaengine.c
+F:     sound/soc/soc-generic-dmaengine-pcm.c
+
 SOUND - SOC LAYER / DYNAMIC AUDIO POWER MANAGEMENT (ASoC)
 M:     Liam Girdwood <lgirdwood@gmail.com>
 M:     Mark Brown <broonie@kernel.org>
@@ -12259,13 +12254,6 @@ F:     Documentation/sound/alsa/soc/
 F:     sound/soc/
 F:     include/sound/soc*
 
-SOUND - DMAENGINE HELPERS
-M:     Lars-Peter Clausen <lars@metafoo.de>
-S:     Supported
-F:     include/sound/dmaengine_pcm.h
-F:     sound/core/pcm_dmaengine.c
-F:     sound/soc/soc-generic-dmaengine-pcm.c
-
 SP2 MEDIA DRIVER
 M:     Olli Salonen <olli.salonen@iki.fi>
 L:     linux-media@vger.kernel.org
@@ -12306,7 +12294,14 @@ W:     https://sparse.wiki.kernel.org/
 T:     git git://git.kernel.org/pub/scm/devel/sparse/sparse.git
 T:     git git://git.kernel.org/pub/scm/devel/sparse/chrisl/sparse.git
 S:     Maintained
-F:     include/linux/compiler.h
+F:     include/linux/compiler.h
+
+SPEAR CLOCK FRAMEWORK SUPPORT
+M:     Viresh Kumar <vireshk@kernel.org>
+L:     linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
+W:     http://www.st.com/spear
+S:     Maintained
+F:     drivers/clk/spear/
 
 SPEAR PLATFORM SUPPORT
 M:     Viresh Kumar <vireshk@kernel.org>
@@ -12317,13 +12312,6 @@ S:     Maintained
 F:     arch/arm/boot/dts/spear*
 F:     arch/arm/mach-spear/
 
-SPEAR CLOCK FRAMEWORK SUPPORT
-M:     Viresh Kumar <vireshk@kernel.org>
-L:     linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
-W:     http://www.st.com/spear
-S:     Maintained
-F:     drivers/clk/spear/
-
 SPI NOR SUBSYSTEM
 M:     Cyrille Pitchen <cyrille.pitchen@wedev4u.fr>
 M:     Marek Vasut <marek.vasut@gmail.com>
@@ -12356,6 +12344,15 @@ S:     Supported
 F:     Documentation/networking/spider_net.txt
 F:     drivers/net/ethernet/toshiba/spider_net*
 
+SPMI SUBSYSTEM
+R:     Stephen Boyd <sboyd@codeaurora.org>
+L:     linux-arm-msm@vger.kernel.org
+F:     Documentation/devicetree/bindings/spmi/
+F:     drivers/spmi/
+F:     include/dt-bindings/spmi/spmi.h
+F:     include/linux/spmi.h
+F:     include/trace/events/spmi.h
+
 SPU FILE SYSTEM
 M:     Jeremy Kerr <jk@ozlabs.org>
 L:     linuxppc-dev@lists.ozlabs.org
@@ -12384,13 +12381,6 @@ L:     stable@vger.kernel.org
 S:     Supported
 F:     Documentation/process/stable-kernel-rules.rst
 
-STAGING SUBSYSTEM
-M:     Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-T:     git git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging.git
-L:     devel@driverdev.osuosl.org
-S:     Supported
-F:     drivers/staging/
-
 STAGING - COMEDI
 M:     Ian Abbott <abbotti@mev.co.uk>
 M:     H Hartley Sweeten <hsweeten@visionengravers.com>
@@ -12480,6 +12470,13 @@ M:     Arnaud Patard <arnaud.patard@rtp-net.org>
 S:     Odd Fixes
 F:     drivers/staging/xgifb/
 
+STAGING SUBSYSTEM
+M:     Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+T:     git git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging.git
+L:     devel@driverdev.osuosl.org
+S:     Supported
+F:     drivers/staging/
+
 STARFIRE/DURALAN NETWORK DRIVER
 M:     Ion Badulescu <ionut@badula.org>
 S:     Odd Fixes
@@ -12988,39 +12985,6 @@ M:     Yehezkel Bernat <yehezkel.bernat@intel.com>
 S:     Maintained
 F:     drivers/thunderbolt/
 
-TI BQ27XXX POWER SUPPLY DRIVER
-R:     Andrew F. Davis <afd@ti.com>
-F:     include/linux/power/bq27xxx_battery.h
-F:     drivers/power/supply/bq27xxx_battery.c
-F:     drivers/power/supply/bq27xxx_battery_i2c.c
-
-TI DAVINCI MACHINE SUPPORT
-M:     Sekhar Nori <nsekhar@ti.com>
-M:     Kevin Hilman <khilman@kernel.org>
-L:     linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
-T:     git git://git.kernel.org/pub/scm/linux/kernel/git/nsekhar/linux-davinci.git
-S:     Supported
-F:     arch/arm/mach-davinci/
-F:     drivers/i2c/busses/i2c-davinci.c
-F:     arch/arm/boot/dts/da850*
-
-TI DAVINCI SERIES MEDIA DRIVER
-M:     "Lad, Prabhakar" <prabhakar.csengg@gmail.com>
-L:     linux-media@vger.kernel.org
-W:     https://linuxtv.org
-Q:     http://patchwork.linuxtv.org/project/linux-media/list/
-T:     git git://linuxtv.org/mhadli/v4l-dvb-davinci_devices.git
-S:     Maintained
-F:     drivers/media/platform/davinci/
-F:     include/media/davinci/
-
-TI DAVINCI SERIES GPIO DRIVER
-M:     Keerthy <j-keerthy@ti.com>
-L:     linux-gpio@vger.kernel.org
-S:     Maintained
-F:     Documentation/devicetree/bindings/gpio/gpio-davinci.txt
-F:     drivers/gpio/gpio-davinci.c
-
 TI AM437X VPFE DRIVER
 M:     "Lad, Prabhakar" <prabhakar.csengg@gmail.com>
 L:     linux-media@vger.kernel.org
@@ -13038,13 +13002,11 @@ L:    linux-omap@vger.kernel.org
 S:     Maintained
 F:     drivers/thermal/ti-soc-thermal/
 
-TI VPE/CAL DRIVERS
-M:     Benoit Parrot <bparrot@ti.com>
-L:     linux-media@vger.kernel.org
-W:     http://linuxtv.org/
-Q:     http://patchwork.linuxtv.org/project/linux-media/list/
-S:     Maintained
-F:     drivers/media/platform/ti-vpe/
+TI BQ27XXX POWER SUPPLY DRIVER
+R:     Andrew F. Davis <afd@ti.com>
+F:     include/linux/power/bq27xxx_battery.h
+F:     drivers/power/supply/bq27xxx_battery.c
+F:     drivers/power/supply/bq27xxx_battery_i2c.c
 
 TI CDCE706 CLOCK DRIVER
 M:     Max Filippov <jcmvbkbc@gmail.com>
@@ -13058,6 +13020,33 @@ S:     Maintained
 F:     drivers/clk/ti/
 F:     include/linux/clk/ti.h
 
+TI DAVINCI MACHINE SUPPORT
+M:     Sekhar Nori <nsekhar@ti.com>
+M:     Kevin Hilman <khilman@kernel.org>
+L:     linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
+T:     git git://git.kernel.org/pub/scm/linux/kernel/git/nsekhar/linux-davinci.git
+S:     Supported
+F:     arch/arm/mach-davinci/
+F:     drivers/i2c/busses/i2c-davinci.c
+F:     arch/arm/boot/dts/da850*
+
+TI DAVINCI SERIES GPIO DRIVER
+M:     Keerthy <j-keerthy@ti.com>
+L:     linux-gpio@vger.kernel.org
+S:     Maintained
+F:     Documentation/devicetree/bindings/gpio/gpio-davinci.txt
+F:     drivers/gpio/gpio-davinci.c
+
+TI DAVINCI SERIES MEDIA DRIVER
+M:     "Lad, Prabhakar" <prabhakar.csengg@gmail.com>
+L:     linux-media@vger.kernel.org
+W:     https://linuxtv.org
+Q:     http://patchwork.linuxtv.org/project/linux-media/list/
+T:     git git://linuxtv.org/mhadli/v4l-dvb-davinci_devices.git
+S:     Maintained
+F:     drivers/media/platform/davinci/
+F:     include/media/davinci/
+
 TI ETHERNET SWITCH DRIVER (CPSW)
 R:     Grygorii Strashko <grygorii.strashko@ti.com>
 L:     linux-omap@vger.kernel.org
@@ -13139,6 +13128,14 @@ L:     alsa-devel@alsa-project.org (moderated for non-subscribers)
 S:     Maintained
 F:     sound/soc/codecs/twl4030*
 
+TI VPE/CAL DRIVERS
+M:     Benoit Parrot <bparrot@ti.com>
+L:     linux-media@vger.kernel.org
+W:     http://linuxtv.org/
+Q:     http://patchwork.linuxtv.org/project/linux-media/list/
+S:     Maintained
+F:     drivers/media/platform/ti-vpe/
+
 TI WILINK WIRELESS DRIVERS
 L:     linux-wireless@vger.kernel.org
 W:     http://wireless.kernel.org/en/users/Drivers/wl12xx
@@ -13267,12 +13264,6 @@ L:     platform-driver-x86@vger.kernel.org
 S:     Maintained
 F:     drivers/platform/x86/toshiba_haps.c
 
-TOSHIBA WMI HOTKEYS DRIVER
-M:     Azael Avalos <coproscefalo@gmail.com>
-L:     platform-driver-x86@vger.kernel.org
-S:     Maintained
-F:     drivers/platform/x86/toshiba-wmi.c
-
 TOSHIBA SMM DRIVER
 M:     Jonathan Buzzard <jonathan@buzzard.org.uk>
 W:     http://www.buzzard.org.uk/toshiba/
@@ -13288,6 +13279,12 @@ S:     Maintained
 F:     drivers/media/i2c/tc358743*
 F:     include/media/i2c/tc358743.h
 
+TOSHIBA WMI HOTKEYS DRIVER
+M:     Azael Avalos <coproscefalo@gmail.com>
+L:     platform-driver-x86@vger.kernel.org
+S:     Maintained
+F:     drivers/platform/x86/toshiba-wmi.c
+
 TPM DEVICE DRIVER
 M:     Peter Huewe <peterhuewe@gmx.de>
 M:     Marcel Selhorst <tpmdd@selhorst.net>
@@ -13529,6 +13526,14 @@ F:     drivers/mtd/ubi/
 F:     include/linux/mtd/ubi.h
 F:     include/uapi/mtd/ubi-user.h
 
+USB "USBNET" DRIVER FRAMEWORK
+M:     Oliver Neukum <oneukum@suse.com>
+L:     netdev@vger.kernel.org
+W:     http://www.linux-usb.org/usbnet
+S:     Maintained
+F:     drivers/net/usb/usbnet.c
+F:     include/linux/usb/usbnet.h
+
 USB ACM DRIVER
 M:     Oliver Neukum <oneukum@suse.com>
 L:     linux-usb@vger.kernel.org
@@ -13752,14 +13757,6 @@ L:     linux-usb@vger.kernel.org
 S:     Maintained
 F:     drivers/usb/host/uhci*
 
-USB "USBNET" DRIVER FRAMEWORK
-M:     Oliver Neukum <oneukum@suse.com>
-L:     netdev@vger.kernel.org
-W:     http://www.linux-usb.org/usbnet
-S:     Maintained
-F:     drivers/net/usb/usbnet.c
-F:     include/linux/usb/usbnet.h
-
 USB VIDEO CLASS
 M:     Laurent Pinchart <laurent.pinchart@ideasonboard.com>
 L:     linux-uvc-devel@lists.sourceforge.net (subscribers-only)
@@ -13932,6 +13929,12 @@ L:     netdev@vger.kernel.org
 S:     Maintained
 F:     drivers/net/ethernet/via/via-velocity.*
 
+VIDEO MULTIPLEXER DRIVER
+M:     Philipp Zabel <p.zabel@pengutronix.de>
+L:     linux-media@vger.kernel.org
+S:     Maintained
+F:     drivers/media/platform/video-mux.c
+
 VIDEOBUF2 FRAMEWORK
 M:     Pawel Osciak <pawel@osciak.com>
 M:     Marek Szyprowski <m.szyprowski@samsung.com>
@@ -13941,12 +13944,6 @@ S:     Maintained
 F:     drivers/media/v4l2-core/videobuf2-*
 F:     include/media/videobuf2-*
 
-VIDEO MULTIPLEXER DRIVER
-M:     Philipp Zabel <p.zabel@pengutronix.de>
-L:     linux-media@vger.kernel.org
-S:     Maintained
-F:     drivers/media/platform/video-mux.c
-
 VIMC VIRTUAL MEDIA CONTROLLER DRIVER
 M:     Helen Koike <helen.koike@collabora.com>
 L:     linux-media@vger.kernel.org
@@ -14000,6 +13997,14 @@ F:     include/linux/virtio*.h
 F:     include/uapi/linux/virtio_*.h
 F:     drivers/crypto/virtio/
 
+VIRTIO CRYPTO DRIVER
+M:     Gonglei <arei.gonglei@huawei.com>
+L:     virtualization@lists.linux-foundation.org
+L:     linux-crypto@vger.kernel.org
+S:     Maintained
+F:     drivers/crypto/virtio/
+F:     include/uapi/linux/virtio_crypto.h
+
 VIRTIO DRIVERS FOR S390
 M:     Cornelia Huck <cohuck@redhat.com>
 M:     Halil Pasic <pasic@linux.vnet.ibm.com>
@@ -14036,14 +14041,6 @@ S:     Maintained
 F:     drivers/virtio/virtio_input.c
 F:     include/uapi/linux/virtio_input.h
 
-VIRTIO CRYPTO DRIVER
-M:  Gonglei <arei.gonglei@huawei.com>
-L:  virtualization@lists.linux-foundation.org
-L:  linux-crypto@vger.kernel.org
-S:  Maintained
-F:  drivers/crypto/virtio/
-F:  include/uapi/linux/virtio_crypto.h
-
 VIRTUAL SERIO DEVICE DRIVER
 M:     Stephen Chandler Paul <thatslyude@gmail.com>
 S:     Maintained
@@ -14077,12 +14074,6 @@ F:     drivers/staging/vme/
 F:     drivers/vme/
 F:     include/linux/vme*
 
-VMWARE HYPERVISOR INTERFACE
-M:     Alok Kataria <akataria@vmware.com>
-L:     virtualization@lists.linux-foundation.org
-S:     Supported
-F:     arch/x86/kernel/cpu/vmware.c
-
 VMWARE BALLOON DRIVER
 M:     Xavier Deguillard <xdeguillard@vmware.com>
 M:     Philip Moltmann <moltmann@vmware.com>
@@ -14091,6 +14082,27 @@ L:     linux-kernel@vger.kernel.org
 S:     Maintained
 F:     drivers/misc/vmw_balloon.c
 
+VMWARE HYPERVISOR INTERFACE
+M:     Alok Kataria <akataria@vmware.com>
+L:     virtualization@lists.linux-foundation.org
+S:     Supported
+F:     arch/x86/kernel/cpu/vmware.c
+
+VMWARE PVRDMA DRIVER
+M:     Adit Ranadive <aditr@vmware.com>
+M:     VMware PV-Drivers <pv-drivers@vmware.com>
+L:     linux-rdma@vger.kernel.org
+S:     Maintained
+F:     drivers/infiniband/hw/vmw_pvrdma/
+
+VMware PVSCSI driver
+M:     Jim Gill <jgill@vmware.com>
+M:     VMware PV-Drivers <pv-drivers@vmware.com>
+L:     linux-scsi@vger.kernel.org
+S:     Maintained
+F:     drivers/scsi/vmw_pvscsi.c
+F:     drivers/scsi/vmw_pvscsi.h
+
 VMWARE VMMOUSE SUBDRIVER
 M:     "VMware Graphics" <linux-graphics-maintainer@vmware.com>
 M:     "VMware, Inc." <pv-drivers@vmware.com>
@@ -14106,21 +14118,6 @@ L:     netdev@vger.kernel.org
 S:     Maintained
 F:     drivers/net/vmxnet3/
 
-VMware PVSCSI driver
-M:     Jim Gill <jgill@vmware.com>
-M:     VMware PV-Drivers <pv-drivers@vmware.com>
-L:     linux-scsi@vger.kernel.org
-S:     Maintained
-F:     drivers/scsi/vmw_pvscsi.c
-F:     drivers/scsi/vmw_pvscsi.h
-
-VMWARE PVRDMA DRIVER
-M:     Adit Ranadive <aditr@vmware.com>
-M:     VMware PV-Drivers <pv-drivers@vmware.com>
-L:     linux-rdma@vger.kernel.org
-S:     Maintained
-F:     drivers/infiniband/hw/vmw_pvrdma/
-
 VOLTAGE AND CURRENT REGULATOR FRAMEWORK
 M:     Liam Girdwood <lgirdwood@gmail.com>
 M:     Mark Brown <broonie@kernel.org>
@@ -14341,15 +14338,6 @@ S:     Maintained
 F:     Documentation/x86/
 F:     arch/x86/
 
-X86 PLATFORM DRIVERS
-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/users/dvhart/linux-platform-drivers-x86.git
-S:     Maintained
-F:     drivers/platform/x86/
-F:     drivers/platform/olpc/
-
 X86 MCE INFRASTRUCTURE
 M:     Tony Luck <tony.luck@intel.com>
 M:     Borislav Petkov <bp@alien8.de>
@@ -14362,6 +14350,15 @@ M:     Borislav Petkov <bp@alien8.de>
 S:     Maintained
 F:     arch/x86/kernel/cpu/microcode/*
 
+X86 PLATFORM DRIVERS
+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/users/dvhart/linux-platform-drivers-x86.git
+S:     Maintained
+F:     drivers/platform/x86/
+F:     drivers/platform/olpc/
+
 X86 VDSO
 M:     Andy Lutomirski <luto@amacapital.net>
 L:     linux-kernel@vger.kernel.org
@@ -14378,20 +14375,13 @@ T:    git git://linuxtv.org/media_tree.git
 S:     Maintained
 F:     drivers/media/tuners/tuner-xc2028.*
 
-XEN HYPERVISOR INTERFACE
-M:     Boris Ostrovsky <boris.ostrovsky@oracle.com>
-M:     Juergen Gross <jgross@suse.com>
+XEN BLOCK SUBSYSTEM
+M:     Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
+M:     Roger Pau Monné <roger.pau@citrix.com>
 L:     xen-devel@lists.xenproject.org (moderated for non-subscribers)
-T:     git git://git.kernel.org/pub/scm/linux/kernel/git/xen/tip.git
 S:     Supported
-F:     arch/x86/xen/
-F:     drivers/*/xen-*front.c
-F:     drivers/xen/
-F:     arch/x86/include/asm/xen/
-F:     include/xen/
-F:     include/uapi/xen/
-F:     Documentation/ABI/stable/sysfs-hypervisor-xen
-F:     Documentation/ABI/testing/sysfs-hypervisor-xen
+F:     drivers/block/xen-blkback/*
+F:     drivers/block/xen*
 
 XEN HYPERVISOR ARM
 M:     Stefano Stabellini <sstabellini@kernel.org>
@@ -14407,6 +14397,21 @@ S:     Maintained
 F:     arch/arm64/xen/
 F:     arch/arm64/include/asm/xen/
 
+XEN HYPERVISOR INTERFACE
+M:     Boris Ostrovsky <boris.ostrovsky@oracle.com>
+M:     Juergen Gross <jgross@suse.com>
+L:     xen-devel@lists.xenproject.org (moderated for non-subscribers)
+T:     git git://git.kernel.org/pub/scm/linux/kernel/git/xen/tip.git
+S:     Supported
+F:     arch/x86/xen/
+F:     drivers/*/xen-*front.c
+F:     drivers/xen/
+F:     arch/x86/include/asm/xen/
+F:     include/xen/
+F:     include/uapi/xen/
+F:     Documentation/ABI/stable/sysfs-hypervisor-xen
+F:     Documentation/ABI/testing/sysfs-hypervisor-xen
+
 XEN NETWORK BACKEND DRIVER
 M:     Wei Liu <wei.liu2@citrix.com>
 M:     Paul Durrant <paul.durrant@citrix.com>
@@ -14422,14 +14427,6 @@ S:     Supported
 F:     arch/x86/pci/*xen*
 F:     drivers/pci/*xen*
 
-XEN BLOCK SUBSYSTEM
-M:     Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
-M:     Roger Pau Monné <roger.pau@citrix.com>
-L:     xen-devel@lists.xenproject.org (moderated for non-subscribers)
-S:     Supported
-F:     drivers/block/xen-blkback/*
-F:     drivers/block/xen*
-
 XEN PVSCSI DRIVERS
 M:     Juergen Gross <jgross@suse.com>
 L:     xen-devel@lists.xenproject.org (moderated for non-subscribers)
index b4fb9a1d1594ea2ba78889b12fcd434ced7f11be..0662b5201d3eda544b0d2493fe65444905d51ce4 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1,7 +1,7 @@
 VERSION = 4
 PATCHLEVEL = 13
 SUBLEVEL = 0
-EXTRAVERSION = -rc1
+EXTRAVERSION = -rc2
 NAME = Fearless Coyote
 
 # *DOCUMENTATION*
index ff67b8373bf78bb24a72df561390236842707a6a..1cd7dc7d487012fc1fa19cc636d1da562c905203 100644 (file)
 #define TIOCGPKT       _IOR('T', 0x38, int) /* Get packet mode state */
 #define TIOCGPTLCK     _IOR('T', 0x39, int) /* Get Pty lock state */
 #define TIOCGEXCL      _IOR('T', 0x40, int) /* Get exclusive mode state */
-#define TIOCGPTPEER    _IOR('T', 0x41, int) /* Safely open the slave */
+#define TIOCGPTPEER    _IO('T', 0x41) /* Safely open the slave */
 
 #define TIOCSERCONFIG  0x5453
 #define TIOCSERGWILD   0x5454
index 2a07e6ecafbd768bcdca7c09fa4cc29bc1a6ff65..71d3efff99d35c56c6f30bea8a6ab1cf1702d753 100644 (file)
@@ -117,7 +117,7 @@ static int arc_dma_mmap(struct device *dev, struct vm_area_struct *vma,
 
        vma->vm_page_prot = pgprot_noncached(vma->vm_page_prot);
 
-       if (dma_mmap_from_coherent(dev, vma, cpu_addr, size, &ret))
+       if (dma_mmap_from_dev_coherent(dev, vma, cpu_addr, size, &ret))
                return ret;
 
        if (off < count && user_count <= (count - off)) {
index 1869af6bac5ceee7178b7e0126ecc88816d4d0c5..25021b798a1e4d857567df78349e5d7c781aa5a3 100644 (file)
 
 #ifndef __ASSEMBLY__
 
+#define ARCH_HAS_KIMAGE_ARCH
+struct kimage_arch {
+       u32 kernel_r2;
+};
+
 /**
  * crash_setup_regs() - save registers for the panic kernel
  * @newregs: registers are saved here
index 14749aec94bf3847148d3e6532f6507d06a2e15a..921d8274855c74cc5f1ba170db869dbe056d03b4 100644 (file)
@@ -35,6 +35,12 @@ struct ucontext {
  * bytes, to prevent unpredictable padding in the signal frame.
  */
 
+/*
+ * Dummy padding block: if this magic is encountered, the block should
+ * be skipped using the corresponding size field.
+ */
+#define DUMMY_MAGIC            0xb0d9ed01
+
 #ifdef CONFIG_CRUNCH
 #define CRUNCH_MAGIC           0x5065cf03
 #define CRUNCH_STORAGE_SIZE    (CRUNCH_SIZE + 8)
index 15495887ca14eedc883daa60b9a9a034913f0c3e..fe1419eeb9321ea553fcd68462596dadaf385185 100644 (file)
@@ -30,7 +30,6 @@ extern unsigned long kexec_boot_atags;
 
 static atomic_t waiting_for_crash_ipi;
 
-static unsigned long dt_mem;
 /*
  * Provide a dummy crash_notes definition while crash dump arrives to arm.
  * This prevents breakage of crash_notes attribute in kernel/ksysfs.c.
@@ -42,6 +41,9 @@ int machine_kexec_prepare(struct kimage *image)
        __be32 header;
        int i, err;
 
+       image->arch.kernel_r2 = image->start - KEXEC_ARM_ZIMAGE_OFFSET
+                                    + KEXEC_ARM_ATAGS_OFFSET;
+
        /*
         * Validate that if the current HW supports SMP, then the SW supports
         * and implements CPU hotplug for the current HW. If not, we won't be
@@ -66,8 +68,8 @@ int machine_kexec_prepare(struct kimage *image)
                if (err)
                        return err;
 
-               if (be32_to_cpu(header) == OF_DT_HEADER)
-                       dt_mem = current_segment->mem;
+               if (header == cpu_to_be32(OF_DT_HEADER))
+                       image->arch.kernel_r2 = current_segment->mem;
        }
        return 0;
 }
@@ -165,8 +167,7 @@ void machine_kexec(struct kimage *image)
        kexec_start_address = image->start;
        kexec_indirection_page = page_list;
        kexec_mach_type = machine_arch_type;
-       kexec_boot_atags = dt_mem ?: image->start - KEXEC_ARM_ZIMAGE_OFFSET
-                                    + KEXEC_ARM_ATAGS_OFFSET;
+       kexec_boot_atags = image->arch.kernel_r2;
 
        /* copy our kernel relocation code to the control code page */
        reboot_entry = fncpy(reboot_code_buffer,
index 4e80bf7420d4e65fb30e0c68e7bef53932f765b3..8e9a3e40d949567598cfdcc8146823f5ada96cb2 100644 (file)
@@ -987,6 +987,9 @@ static void __init reserve_crashkernel(void)
 
        if (crash_base <= 0) {
                unsigned long long crash_max = idmap_to_phys((u32)~0);
+               unsigned long long lowmem_max = __pa(high_memory - 1) + 1;
+               if (crash_max > lowmem_max)
+                       crash_max = lowmem_max;
                crash_base = memblock_find_in_range(CRASH_ALIGN, crash_max,
                                                    crash_size, CRASH_ALIGN);
                if (!crash_base) {
index 7b8f2141427bda172899bfe8ae5113367163af47..5814298ef0b701e61e4de018aa216009c9445d30 100644 (file)
@@ -40,8 +40,10 @@ static int preserve_crunch_context(struct crunch_sigframe __user *frame)
        return __copy_to_user(frame, kframe, sizeof(*frame));
 }
 
-static int restore_crunch_context(struct crunch_sigframe __user *frame)
+static int restore_crunch_context(char __user **auxp)
 {
+       struct crunch_sigframe __user *frame =
+               (struct crunch_sigframe __user *)*auxp;
        char kbuf[sizeof(*frame) + 8];
        struct crunch_sigframe *kframe;
 
@@ -52,6 +54,7 @@ static int restore_crunch_context(struct crunch_sigframe __user *frame)
        if (kframe->magic != CRUNCH_MAGIC ||
            kframe->size != CRUNCH_STORAGE_SIZE)
                return -1;
+       *auxp += CRUNCH_STORAGE_SIZE;
        crunch_task_restore(current_thread_info(), &kframe->storage);
        return 0;
 }
@@ -59,21 +62,39 @@ static int restore_crunch_context(struct crunch_sigframe __user *frame)
 
 #ifdef CONFIG_IWMMXT
 
-static int preserve_iwmmxt_context(struct iwmmxt_sigframe *frame)
+static int preserve_iwmmxt_context(struct iwmmxt_sigframe __user *frame)
 {
        char kbuf[sizeof(*frame) + 8];
        struct iwmmxt_sigframe *kframe;
+       int err = 0;
 
        /* the iWMMXt context must be 64 bit aligned */
        kframe = (struct iwmmxt_sigframe *)((unsigned long)(kbuf + 8) & ~7);
-       kframe->magic = IWMMXT_MAGIC;
-       kframe->size = IWMMXT_STORAGE_SIZE;
-       iwmmxt_task_copy(current_thread_info(), &kframe->storage);
-       return __copy_to_user(frame, kframe, sizeof(*frame));
+
+       if (test_thread_flag(TIF_USING_IWMMXT)) {
+               kframe->magic = IWMMXT_MAGIC;
+               kframe->size = IWMMXT_STORAGE_SIZE;
+               iwmmxt_task_copy(current_thread_info(), &kframe->storage);
+
+               err = __copy_to_user(frame, kframe, sizeof(*frame));
+       } else {
+               /*
+                * For bug-compatibility with older kernels, some space
+                * has to be reserved for iWMMXt even if it's not used.
+                * Set the magic and size appropriately so that properly
+                * written userspace can skip it reliably:
+                */
+               __put_user_error(DUMMY_MAGIC, &frame->magic, err);
+               __put_user_error(IWMMXT_STORAGE_SIZE, &frame->size, err);
+       }
+
+       return err;
 }
 
-static int restore_iwmmxt_context(struct iwmmxt_sigframe *frame)
+static int restore_iwmmxt_context(char __user **auxp)
 {
+       struct iwmmxt_sigframe __user *frame =
+               (struct iwmmxt_sigframe __user *)*auxp;
        char kbuf[sizeof(*frame) + 8];
        struct iwmmxt_sigframe *kframe;
 
@@ -81,10 +102,28 @@ static int restore_iwmmxt_context(struct iwmmxt_sigframe *frame)
        kframe = (struct iwmmxt_sigframe *)((unsigned long)(kbuf + 8) & ~7);
        if (__copy_from_user(kframe, frame, sizeof(*frame)))
                return -1;
-       if (kframe->magic != IWMMXT_MAGIC ||
-           kframe->size != IWMMXT_STORAGE_SIZE)
+
+       /*
+        * For non-iWMMXt threads: a single iwmmxt_sigframe-sized dummy
+        * block is discarded for compatibility with setup_sigframe() if
+        * present, but we don't mandate its presence.  If some other
+        * magic is here, it's not for us:
+        */
+       if (!test_thread_flag(TIF_USING_IWMMXT) &&
+           kframe->magic != DUMMY_MAGIC)
+               return 0;
+
+       if (kframe->size != IWMMXT_STORAGE_SIZE)
                return -1;
-       iwmmxt_task_restore(current_thread_info(), &kframe->storage);
+
+       if (test_thread_flag(TIF_USING_IWMMXT)) {
+               if (kframe->magic != IWMMXT_MAGIC)
+                       return -1;
+
+               iwmmxt_task_restore(current_thread_info(), &kframe->storage);
+       }
+
+       *auxp += IWMMXT_STORAGE_SIZE;
        return 0;
 }
 
@@ -107,8 +146,10 @@ static int preserve_vfp_context(struct vfp_sigframe __user *frame)
        return vfp_preserve_user_clear_hwstate(&frame->ufp, &frame->ufp_exc);
 }
 
-static int restore_vfp_context(struct vfp_sigframe __user *frame)
+static int restore_vfp_context(char __user **auxp)
 {
+       struct vfp_sigframe __user *frame =
+               (struct vfp_sigframe __user *)*auxp;
        unsigned long magic;
        unsigned long size;
        int err = 0;
@@ -121,6 +162,7 @@ static int restore_vfp_context(struct vfp_sigframe __user *frame)
        if (magic != VFP_MAGIC || size != VFP_STORAGE_SIZE)
                return -EINVAL;
 
+       *auxp += size;
        return vfp_restore_user_hwstate(&frame->ufp, &frame->ufp_exc);
 }
 
@@ -141,7 +183,7 @@ struct rt_sigframe {
 
 static int restore_sigframe(struct pt_regs *regs, struct sigframe __user *sf)
 {
-       struct aux_sigframe __user *aux;
+       char __user *aux;
        sigset_t set;
        int err;
 
@@ -169,18 +211,18 @@ static int restore_sigframe(struct pt_regs *regs, struct sigframe __user *sf)
 
        err |= !valid_user_regs(regs);
 
-       aux = (struct aux_sigframe __user *) sf->uc.uc_regspace;
+       aux = (char __user *) sf->uc.uc_regspace;
 #ifdef CONFIG_CRUNCH
        if (err == 0)
-               err |= restore_crunch_context(&aux->crunch);
+               err |= restore_crunch_context(&aux);
 #endif
 #ifdef CONFIG_IWMMXT
-       if (err == 0 && test_thread_flag(TIF_USING_IWMMXT))
-               err |= restore_iwmmxt_context(&aux->iwmmxt);
+       if (err == 0)
+               err |= restore_iwmmxt_context(&aux);
 #endif
 #ifdef CONFIG_VFP
        if (err == 0)
-               err |= restore_vfp_context(&aux->vfp);
+               err |= restore_vfp_context(&aux);
 #endif
 
        return err;
@@ -286,7 +328,7 @@ setup_sigframe(struct sigframe __user *sf, struct pt_regs *regs, sigset_t *set)
                err |= preserve_crunch_context(&aux->crunch);
 #endif
 #ifdef CONFIG_IWMMXT
-       if (err == 0 && test_thread_flag(TIF_USING_IWMMXT))
+       if (err == 0)
                err |= preserve_iwmmxt_context(&aux->iwmmxt);
 #endif
 #ifdef CONFIG_VFP
index be517b048762b4fe1bb5467ebaea61a19cc1386e..5b614388d72f4b7ca8be1c851f1369f719ce2c29 100644 (file)
@@ -32,120 +32,6 @@ static u16 control_devconf1_offset;
 
 #define HSMMC_NAME_LEN 9
 
-static void omap_hsmmc1_before_set_reg(struct device *dev,
-                                      int power_on, int vdd)
-{
-       u32 reg, prog_io;
-       struct omap_hsmmc_platform_data *mmc = dev->platform_data;
-
-       if (mmc->remux)
-               mmc->remux(dev, power_on);
-
-       /*
-        * Assume we power both OMAP VMMC1 (for CMD, CLK, DAT0..3) and the
-        * card with Vcc regulator (from twl4030 or whatever).  OMAP has both
-        * 1.8V and 3.0V modes, controlled by the PBIAS register.
-        *
-        * In 8-bit modes, OMAP VMMC1A (for DAT4..7) needs a supply, which
-        * is most naturally TWL VSIM; those pins also use PBIAS.
-        *
-        * FIXME handle VMMC1A as needed ...
-        */
-       if (power_on) {
-               if (cpu_is_omap2430()) {
-                       reg = omap_ctrl_readl(OMAP243X_CONTROL_DEVCONF1);
-                       if ((1 << vdd) >= MMC_VDD_30_31)
-                               reg |= OMAP243X_MMC1_ACTIVE_OVERWRITE;
-                       else
-                               reg &= ~OMAP243X_MMC1_ACTIVE_OVERWRITE;
-                       omap_ctrl_writel(reg, OMAP243X_CONTROL_DEVCONF1);
-               }
-
-               if (mmc->internal_clock) {
-                       reg = omap_ctrl_readl(OMAP2_CONTROL_DEVCONF0);
-                       reg |= OMAP2_MMCSDIO1ADPCLKISEL;
-                       omap_ctrl_writel(reg, OMAP2_CONTROL_DEVCONF0);
-               }
-
-               reg = omap_ctrl_readl(control_pbias_offset);
-               if (cpu_is_omap3630()) {
-                       /* Set MMC I/O to 52MHz */
-                       prog_io = omap_ctrl_readl(OMAP343X_CONTROL_PROG_IO1);
-                       prog_io |= OMAP3630_PRG_SDMMC1_SPEEDCTRL;
-                       omap_ctrl_writel(prog_io, OMAP343X_CONTROL_PROG_IO1);
-               } else {
-                       reg |= OMAP2_PBIASSPEEDCTRL0;
-               }
-               reg &= ~OMAP2_PBIASLITEPWRDNZ0;
-               omap_ctrl_writel(reg, control_pbias_offset);
-       } else {
-               reg = omap_ctrl_readl(control_pbias_offset);
-               reg &= ~OMAP2_PBIASLITEPWRDNZ0;
-               omap_ctrl_writel(reg, control_pbias_offset);
-       }
-}
-
-static void omap_hsmmc1_after_set_reg(struct device *dev, int power_on, int vdd)
-{
-       u32 reg;
-
-       /* 100ms delay required for PBIAS configuration */
-       msleep(100);
-
-       if (power_on) {
-               reg = omap_ctrl_readl(control_pbias_offset);
-               reg |= (OMAP2_PBIASLITEPWRDNZ0 | OMAP2_PBIASSPEEDCTRL0);
-               if ((1 << vdd) <= MMC_VDD_165_195)
-                       reg &= ~OMAP2_PBIASLITEVMODE0;
-               else
-                       reg |= OMAP2_PBIASLITEVMODE0;
-               omap_ctrl_writel(reg, control_pbias_offset);
-       } else {
-               reg = omap_ctrl_readl(control_pbias_offset);
-               reg |= (OMAP2_PBIASSPEEDCTRL0 | OMAP2_PBIASLITEPWRDNZ0 |
-                       OMAP2_PBIASLITEVMODE0);
-               omap_ctrl_writel(reg, control_pbias_offset);
-       }
-}
-
-static void hsmmc2_select_input_clk_src(struct omap_hsmmc_platform_data *mmc)
-{
-       u32 reg;
-
-       reg = omap_ctrl_readl(control_devconf1_offset);
-       if (mmc->internal_clock)
-               reg |= OMAP2_MMCSDIO2ADPCLKISEL;
-       else
-               reg &= ~OMAP2_MMCSDIO2ADPCLKISEL;
-       omap_ctrl_writel(reg, control_devconf1_offset);
-}
-
-static void hsmmc2_before_set_reg(struct device *dev, int power_on, int vdd)
-{
-       struct omap_hsmmc_platform_data *mmc = dev->platform_data;
-
-       if (mmc->remux)
-               mmc->remux(dev, power_on);
-
-       if (power_on)
-               hsmmc2_select_input_clk_src(mmc);
-}
-
-static int am35x_hsmmc2_set_power(struct device *dev, int power_on, int vdd)
-{
-       struct omap_hsmmc_platform_data *mmc = dev->platform_data;
-
-       if (power_on)
-               hsmmc2_select_input_clk_src(mmc);
-
-       return 0;
-}
-
-static int nop_mmc_set_power(struct device *dev, int power_on, int vdd)
-{
-       return 0;
-}
-
 static int __init omap_hsmmc_pdata_init(struct omap2_hsmmc_info *c,
                                        struct omap_hsmmc_platform_data *mmc)
 {
@@ -157,101 +43,11 @@ static int __init omap_hsmmc_pdata_init(struct omap2_hsmmc_info *c,
                return -ENOMEM;
        }
 
-       if (c->name)
-               strncpy(hc_name, c->name, HSMMC_NAME_LEN);
-       else
-               snprintf(hc_name, (HSMMC_NAME_LEN + 1), "mmc%islot%i",
-                                                               c->mmc, 1);
+       snprintf(hc_name, (HSMMC_NAME_LEN + 1), "mmc%islot%i", c->mmc, 1);
        mmc->name = hc_name;
        mmc->caps = c->caps;
-       mmc->internal_clock = !c->ext_clock;
        mmc->reg_offset = 0;
 
-       if (c->cover_only) {
-               /* detect if mobile phone cover removed */
-               mmc->gpio_cd = -EINVAL;
-               mmc->gpio_cod = c->gpio_cd;
-       } else {
-               /* card detect pin on the mmc socket itself */
-               mmc->gpio_cd = c->gpio_cd;
-               mmc->gpio_cod = -EINVAL;
-       }
-       mmc->gpio_wp = c->gpio_wp;
-
-       mmc->remux = c->remux;
-       mmc->init_card = c->init_card;
-
-       if (c->nonremovable)
-               mmc->nonremovable = 1;
-
-       /*
-        * NOTE:  MMC slots should have a Vcc regulator set up.
-        * This may be from a TWL4030-family chip, another
-        * controllable regulator, or a fixed supply.
-        *
-        * temporary HACK: ocr_mask instead of fixed supply
-        */
-       if (soc_is_am35xx())
-               mmc->ocr_mask = MMC_VDD_165_195 |
-                                        MMC_VDD_26_27 |
-                                        MMC_VDD_27_28 |
-                                        MMC_VDD_29_30 |
-                                        MMC_VDD_30_31 |
-                                        MMC_VDD_31_32;
-       else
-               mmc->ocr_mask = c->ocr_mask;
-
-       if (!soc_is_am35xx())
-               mmc->features |= HSMMC_HAS_PBIAS;
-
-       switch (c->mmc) {
-       case 1:
-               if (mmc->features & HSMMC_HAS_PBIAS) {
-                       /* on-chip level shifting via PBIAS0/PBIAS1 */
-                       mmc->before_set_reg =
-                                       omap_hsmmc1_before_set_reg;
-                       mmc->after_set_reg =
-                                       omap_hsmmc1_after_set_reg;
-               }
-
-               if (soc_is_am35xx())
-                       mmc->set_power = nop_mmc_set_power;
-
-               /* OMAP3630 HSMMC1 supports only 4-bit */
-               if (cpu_is_omap3630() &&
-                               (c->caps & MMC_CAP_8_BIT_DATA)) {
-                       c->caps &= ~MMC_CAP_8_BIT_DATA;
-                       c->caps |= MMC_CAP_4_BIT_DATA;
-                       mmc->caps = c->caps;
-               }
-               break;
-       case 2:
-               if (soc_is_am35xx())
-                       mmc->set_power = am35x_hsmmc2_set_power;
-
-               if (c->ext_clock)
-                       c->transceiver = 1;
-               if (c->transceiver && (c->caps & MMC_CAP_8_BIT_DATA)) {
-                       c->caps &= ~MMC_CAP_8_BIT_DATA;
-                       c->caps |= MMC_CAP_4_BIT_DATA;
-               }
-               if (mmc->features & HSMMC_HAS_PBIAS) {
-                       /* off-chip level shifting, or none */
-                       mmc->before_set_reg = hsmmc2_before_set_reg;
-                       mmc->after_set_reg = NULL;
-               }
-               break;
-       case 3:
-       case 4:
-       case 5:
-               mmc->before_set_reg = NULL;
-               mmc->after_set_reg = NULL;
-               break;
-       default:
-               pr_err("MMC%d configuration not supported!\n", c->mmc);
-               kfree(hc_name);
-               return -ENODEV;
-       }
        return 0;
 }
 
@@ -260,7 +56,6 @@ static int omap_hsmmc_done;
 void omap_hsmmc_late_init(struct omap2_hsmmc_info *c)
 {
        struct platform_device *pdev;
-       struct omap_hsmmc_platform_data *mmc_pdata;
        int res;
 
        if (omap_hsmmc_done != 1)
@@ -269,32 +64,12 @@ void omap_hsmmc_late_init(struct omap2_hsmmc_info *c)
        omap_hsmmc_done++;
 
        for (; c->mmc; c++) {
-               if (!c->deferred)
-                       continue;
-
                pdev = c->pdev;
                if (!pdev)
                        continue;
-
-               mmc_pdata = pdev->dev.platform_data;
-               if (!mmc_pdata)
-                       continue;
-
-               if (c->cover_only) {
-                       /* detect if mobile phone cover removed */
-                       mmc_pdata->gpio_cd = -EINVAL;
-                       mmc_pdata->gpio_cod = c->gpio_cd;
-               } else {
-                       /* card detect pin on the mmc socket itself */
-                       mmc_pdata->gpio_cd = c->gpio_cd;
-                       mmc_pdata->gpio_cod = -EINVAL;
-               }
-               mmc_pdata->gpio_wp = c->gpio_wp;
-
                res = omap_device_register(pdev);
                if (res)
-                       pr_err("Could not late init MMC %s\n",
-                              c->name);
+                       pr_err("Could not late init MMC\n");
        }
 }
 
@@ -336,13 +111,6 @@ static void __init omap_hsmmc_init_one(struct omap2_hsmmc_info *hsmmcinfo,
        if (oh->dev_attr != NULL) {
                mmc_dev_attr = oh->dev_attr;
                mmc_data->controller_flags = mmc_dev_attr->flags;
-               /*
-                * erratum 2.1.1.128 doesn't apply if board has
-                * a transceiver is attached
-                */
-               if (hsmmcinfo->transceiver)
-                       mmc_data->controller_flags &=
-                               ~OMAP_HSMMC_BROKEN_MULTIBLOCK_READ;
        }
 
        pdev = platform_device_alloc(name, ctrl_nr - 1);
@@ -367,9 +135,6 @@ static void __init omap_hsmmc_init_one(struct omap2_hsmmc_info *hsmmcinfo,
 
        hsmmcinfo->pdev = pdev;
 
-       if (hsmmcinfo->deferred)
-               goto free_mmc;
-
        res = omap_device_register(pdev);
        if (res) {
                pr_err("Could not register od for %s\n", name);
index 69b619ddc7650c7eac714898b0219a925005a7b5..af9af5094ec33811e0fa5fba562e87a51e7568ff 100644 (file)
@@ -12,18 +12,9 @@ struct omap2_hsmmc_info {
        u8      mmc;            /* controller 1/2/3 */
        u32     caps;           /* 4/8 wires and any additional host
                                 * capabilities OR'd (ref. linux/mmc/host.h) */
-       bool    transceiver;    /* MMC-2 option */
-       bool    ext_clock;      /* use external pin for input clock */
-       bool    cover_only;     /* No card detect - just cover switch */
-       bool    nonremovable;   /* Nonremovable e.g. eMMC */
-       bool    deferred;       /* mmc needs a deferred probe */
        int     gpio_cd;        /* or -EINVAL */
        int     gpio_wp;        /* or -EINVAL */
-       char    *name;          /* or NULL for default */
        struct platform_device *pdev;   /* mmc controller instance */
-       int     ocr_mask;       /* temporary HACK */
-       /* Remux (pad configuration) when powering on/off */
-       void (*remux)(struct device *dev, int power_on);
        /* init some special card */
        void (*init_card)(struct mmc_card *card);
 };
index 90ee354d803e6ce6a9f06e6bf3513f439716ac35..6db5fc26d154c6febf6d61c0bdf66aae9c563f9e 100644 (file)
@@ -40,9 +40,21 @@ static void *arm_nommu_dma_alloc(struct device *dev, size_t size,
 
 {
        const struct dma_map_ops *ops = &dma_noop_ops;
+       void *ret;
 
        /*
-        * We are here because:
+        * Try generic allocator first if we are advertised that
+        * consistency is not required.
+        */
+
+       if (attrs & DMA_ATTR_NON_CONSISTENT)
+               return ops->alloc(dev, size, dma_handle, gfp, attrs);
+
+       ret = dma_alloc_from_global_coherent(size, dma_handle);
+
+       /*
+        * dma_alloc_from_global_coherent() may fail because:
+        *
         * - no consistent DMA region has been defined, so we can't
         *   continue.
         * - there is no space left in consistent DMA region, so we
@@ -50,11 +62,8 @@ static void *arm_nommu_dma_alloc(struct device *dev, size_t size,
         *   advertised that consistency is not required.
         */
 
-       if (attrs & DMA_ATTR_NON_CONSISTENT)
-               return ops->alloc(dev, size, dma_handle, gfp, attrs);
-
-       WARN_ON_ONCE(1);
-       return NULL;
+       WARN_ON_ONCE(ret == NULL);
+       return ret;
 }
 
 static void arm_nommu_dma_free(struct device *dev, size_t size,
@@ -63,14 +72,31 @@ static void arm_nommu_dma_free(struct device *dev, size_t size,
 {
        const struct dma_map_ops *ops = &dma_noop_ops;
 
-       if (attrs & DMA_ATTR_NON_CONSISTENT)
+       if (attrs & DMA_ATTR_NON_CONSISTENT) {
                ops->free(dev, size, cpu_addr, dma_addr, attrs);
-       else
-               WARN_ON_ONCE(1);
+       } else {
+               int ret = dma_release_from_global_coherent(get_order(size),
+                                                          cpu_addr);
+
+               WARN_ON_ONCE(ret == 0);
+       }
 
        return;
 }
 
+static int arm_nommu_dma_mmap(struct device *dev, struct vm_area_struct *vma,
+                             void *cpu_addr, dma_addr_t dma_addr, size_t size,
+                             unsigned long attrs)
+{
+       int ret;
+
+       if (dma_mmap_from_global_coherent(vma, cpu_addr, size, &ret))
+               return ret;
+
+       return dma_common_mmap(dev, vma, cpu_addr, dma_addr, size);
+}
+
+
 static void __dma_page_cpu_to_dev(phys_addr_t paddr, size_t size,
                                  enum dma_data_direction dir)
 {
@@ -173,6 +199,7 @@ static void arm_nommu_dma_sync_sg_for_cpu(struct device *dev, struct scatterlist
 const struct dma_map_ops arm_nommu_dma_ops = {
        .alloc                  = arm_nommu_dma_alloc,
        .free                   = arm_nommu_dma_free,
+       .mmap                   = arm_nommu_dma_mmap,
        .map_page               = arm_nommu_dma_map_page,
        .unmap_page             = arm_nommu_dma_unmap_page,
        .map_sg                 = arm_nommu_dma_map_sg,
index e7380bafbfa6d37ef928fecf38ec26c56df31f90..fcf1473d6fed5398be1f9474c2543958120e22a5 100644 (file)
@@ -851,7 +851,7 @@ static int __arm_dma_mmap(struct device *dev, struct vm_area_struct *vma,
        unsigned long pfn = dma_to_pfn(dev, dma_addr);
        unsigned long off = vma->vm_pgoff;
 
-       if (dma_mmap_from_coherent(dev, vma, cpu_addr, size, &ret))
+       if (dma_mmap_from_dev_coherent(dev, vma, cpu_addr, size, &ret))
                return ret;
 
        if (off < nr_pages && nr_vma_pages <= (nr_pages - off)) {
index e90cd1db42a809ebbb978cc9ae4674c0944d265f..f27d4dd043848dc8775a52588cffa7e27bd006a6 100644 (file)
@@ -329,7 +329,7 @@ static int __swiotlb_mmap(struct device *dev,
        vma->vm_page_prot = __get_dma_pgprot(attrs, vma->vm_page_prot,
                                             is_device_dma_coherent(dev));
 
-       if (dma_mmap_from_coherent(dev, vma, cpu_addr, size, &ret))
+       if (dma_mmap_from_dev_coherent(dev, vma, cpu_addr, size, &ret))
                return ret;
 
        return __swiotlb_mmap_pfn(vma, pfn, size);
@@ -706,7 +706,7 @@ static int __iommu_mmap_attrs(struct device *dev, struct vm_area_struct *vma,
        vma->vm_page_prot = __get_dma_pgprot(attrs, vma->vm_page_prot,
                                             is_device_dma_coherent(dev));
 
-       if (dma_mmap_from_coherent(dev, vma, cpu_addr, size, &ret))
+       if (dma_mmap_from_dev_coherent(dev, vma, cpu_addr, size, &ret))
                return ret;
 
        if (attrs & DMA_ATTR_FORCE_CONTIGUOUS) {
index 68e19b689a00c4d783cdde376ca40c95a48c3f3c..1609cb0907acecaa03d149e4b043ebe3dff952c9 100644 (file)
@@ -91,7 +91,7 @@
 #define TIOCGPKT       _IOR('T', 0x38, int) /* Get packet mode state */
 #define TIOCGPTLCK     _IOR('T', 0x39, int) /* Get Pty lock state */
 #define TIOCGEXCL      _IOR('T', 0x40, int) /* Get exclusive mode state */
-#define TIOCGPTPEER    _IOR('T', 0x41, int) /* Safely open the slave */
+#define TIOCGPTPEER    _IO('T', 0x41) /* Safely open the slave */
 
 /* I hope the range from 0x5480 on is free ... */
 #define TIOCSCTTY      0x5480          /* become controlling tty */
index e08598c70b3e72d3c579462d9b82cbe340256ac9..8e78251eccc25e0a981ede0b89d1df907f9e896a 100644 (file)
@@ -232,7 +232,7 @@ static int mips_dma_mmap(struct device *dev, struct vm_area_struct *vma,
        else
                vma->vm_page_prot = pgprot_noncached(vma->vm_page_prot);
 
-       if (dma_mmap_from_coherent(dev, vma, cpu_addr, size, &ret))
+       if (dma_mmap_from_dev_coherent(dev, vma, cpu_addr, size, &ret))
                return ret;
 
        if (off < count && user_count <= (count - off)) {
index 143d0265279204ef9e51288640ba091eb2453c27..ccc109761f445655218bd3cdc16a16f772b65d77 100644 (file)
@@ -1,11 +1,9 @@
-CONFIG_EXPERIMENTAL=y
 # CONFIG_LOCALVERSION_AUTO is not set
 CONFIG_SYSVIPC=y
 CONFIG_POSIX_MQUEUE=y
 CONFIG_IKCONFIG=y
 CONFIG_IKCONFIG_PROC=y
 CONFIG_LOG_BUF_SHIFT=16
-CONFIG_SYSFS_DEPRECATED_V2=y
 CONFIG_BLK_DEV_INITRD=y
 CONFIG_KALLSYMS_ALL=y
 CONFIG_SLAB=y
@@ -14,7 +12,6 @@ CONFIG_OPROFILE=m
 CONFIG_MODULES=y
 CONFIG_MODULE_UNLOAD=y
 CONFIG_MODULE_FORCE_UNLOAD=y
-# CONFIG_BLK_DEV_BSG is not set
 CONFIG_PA7100LC=y
 CONFIG_PREEMPT_VOLUNTARY=y
 CONFIG_GSC_LASI=y
@@ -32,11 +29,9 @@ CONFIG_IP_PNP_DHCP=y
 CONFIG_IP_PNP_BOOTP=y
 CONFIG_INET_AH=m
 CONFIG_INET_ESP=m
-# CONFIG_INET_LRO is not set
 CONFIG_INET_DIAG=m
 # CONFIG_IPV6 is not set
 CONFIG_NETFILTER=y
-CONFIG_IP_NF_QUEUE=m
 CONFIG_LLC2=m
 CONFIG_NET_PKTGEN=m
 CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
@@ -65,21 +60,20 @@ CONFIG_MD_LINEAR=m
 CONFIG_MD_RAID0=m
 CONFIG_MD_RAID1=m
 CONFIG_NETDEVICES=y
-CONFIG_DUMMY=m
 CONFIG_BONDING=m
+CONFIG_DUMMY=m
 CONFIG_TUN=m
-CONFIG_NET_ETHERNET=y
-CONFIG_MII=m
 CONFIG_LASI_82596=y
 CONFIG_PPP=m
-CONFIG_PPP_ASYNC=m
-CONFIG_PPP_SYNC_TTY=m
-CONFIG_PPP_DEFLATE=m
 CONFIG_PPP_BSDCOMP=m
+CONFIG_PPP_DEFLATE=m
 CONFIG_PPP_MPPE=m
 CONFIG_PPPOE=m
+CONFIG_PPP_ASYNC=m
+CONFIG_PPP_SYNC_TTY=m
 # CONFIG_KEYBOARD_HIL_OLD is not set
 CONFIG_MOUSE_SERIAL=m
+CONFIG_LEGACY_PTY_COUNT=64
 CONFIG_SERIAL_8250=y
 CONFIG_SERIAL_8250_CONSOLE=y
 CONFIG_SERIAL_8250_NR_UARTS=17
@@ -88,22 +82,17 @@ CONFIG_SERIAL_8250_MANY_PORTS=y
 CONFIG_SERIAL_8250_SHARE_IRQ=y
 # CONFIG_SERIAL_MUX is not set
 CONFIG_PDC_CONSOLE=y
-CONFIG_LEGACY_PTY_COUNT=64
 CONFIG_PRINTER=m
 CONFIG_PPDEV=m
 # CONFIG_HW_RANDOM is not set
 CONFIG_RAW_DRIVER=y
 # CONFIG_HWMON is not set
-CONFIG_VIDEO_OUTPUT_CONTROL=m
 CONFIG_FB=y
 CONFIG_FB_MODE_HELPERS=y
 CONFIG_FB_TILEBLITTING=y
 CONFIG_DUMMY_CONSOLE_COLUMNS=128
 CONFIG_DUMMY_CONSOLE_ROWS=48
 CONFIG_FRAMEBUFFER_CONSOLE=y
-CONFIG_FONTS=y
-CONFIG_FONT_8x8=y
-CONFIG_FONT_8x16=y
 CONFIG_LOGO=y
 # CONFIG_LOGO_LINUX_MONO is not set
 # CONFIG_LOGO_LINUX_VGA16 is not set
@@ -111,13 +100,9 @@ CONFIG_LOGO=y
 CONFIG_SOUND=y
 CONFIG_SND=y
 CONFIG_SND_SEQUENCER=y
-CONFIG_SND_MIXER_OSS=y
-CONFIG_SND_PCM_OSS=y
-CONFIG_SND_SEQUENCER_OSS=y
 CONFIG_SND_HARMONY=y
 CONFIG_EXT2_FS=y
 CONFIG_EXT3_FS=y
-# CONFIG_EXT3_FS_XATTR is not set
 CONFIG_JFS_FS=m
 CONFIG_XFS_FS=m
 CONFIG_AUTOFS4_FS=y
@@ -130,14 +115,10 @@ CONFIG_PROC_KCORE=y
 CONFIG_TMPFS=y
 CONFIG_UFS_FS=m
 CONFIG_NFS_FS=y
-CONFIG_NFS_V3=y
 CONFIG_NFS_V4=y
 CONFIG_ROOT_NFS=y
 CONFIG_NFSD=m
 CONFIG_NFSD_V4=y
-CONFIG_RPCSEC_GSS_SPKM3=m
-CONFIG_SMB_FS=m
-CONFIG_SMB_NLS_DEFAULT=y
 CONFIG_CIFS=m
 CONFIG_NLS_CODEPAGE_437=m
 CONFIG_NLS_CODEPAGE_737=m
@@ -177,21 +158,16 @@ CONFIG_NLS_ISO8859_15=m
 CONFIG_NLS_KOI8_R=m
 CONFIG_NLS_KOI8_U=m
 CONFIG_NLS_UTF8=m
-CONFIG_MAGIC_SYSRQ=y
 CONFIG_DEBUG_FS=y
+CONFIG_MAGIC_SYSRQ=y
 CONFIG_DEBUG_KERNEL=y
 CONFIG_DEBUG_MUTEXES=y
-# CONFIG_RCU_CPU_STALL_DETECTOR is not set
-CONFIG_CRYPTO_NULL=m
 CONFIG_CRYPTO_TEST=m
 CONFIG_CRYPTO_HMAC=y
-CONFIG_CRYPTO_MD4=m
 CONFIG_CRYPTO_MICHAEL_MIC=m
-CONFIG_CRYPTO_SHA256=m
 CONFIG_CRYPTO_SHA512=m
 CONFIG_CRYPTO_TGR192=m
 CONFIG_CRYPTO_WP512=m
-CONFIG_CRYPTO_AES=m
 CONFIG_CRYPTO_ANUBIS=m
 CONFIG_CRYPTO_BLOWFISH=m
 CONFIG_CRYPTO_CAST6=m
@@ -200,6 +176,7 @@ CONFIG_CRYPTO_SERPENT=m
 CONFIG_CRYPTO_TEA=m
 CONFIG_CRYPTO_TWOFISH=m
 CONFIG_CRYPTO_DEFLATE=m
-# CONFIG_CRYPTO_ANSI_CPRNG is not set
 # CONFIG_CRYPTO_HW is not set
-CONFIG_LIBCRC32C=m
+CONFIG_FONTS=y
+CONFIG_FONT_8x8=y
+CONFIG_FONT_8x16=y
index 1a4f776b49b8915dca8cf9d1dbd09e6116b96204..5acb93dcaabfd84680f7c5cdde0a598fc4bf1b3e 100644 (file)
@@ -1,13 +1,10 @@
-CONFIG_EXPERIMENTAL=y
 # CONFIG_LOCALVERSION_AUTO is not set
 CONFIG_SYSVIPC=y
 CONFIG_POSIX_MQUEUE=y
 CONFIG_IKCONFIG=y
 CONFIG_IKCONFIG_PROC=y
 CONFIG_LOG_BUF_SHIFT=16
-CONFIG_SYSFS_DEPRECATED_V2=y
 CONFIG_BLK_DEV_INITRD=y
-# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
 CONFIG_EXPERT=y
 CONFIG_KALLSYMS_ALL=y
 CONFIG_SLAB=y
@@ -16,7 +13,6 @@ CONFIG_OPROFILE=m
 CONFIG_MODULES=y
 CONFIG_MODULE_UNLOAD=y
 CONFIG_MODULE_FORCE_UNLOAD=y
-# CONFIG_BLK_DEV_BSG is not set
 CONFIG_PA8X00=y
 CONFIG_64BIT=y
 CONFIG_SMP=y
@@ -43,21 +39,17 @@ CONFIG_IP_PNP_DHCP=y
 CONFIG_IP_PNP_BOOTP=y
 CONFIG_INET_AH=m
 CONFIG_INET_ESP=m
-# CONFIG_INET_LRO is not set
 CONFIG_INET6_AH=m
 CONFIG_INET6_ESP=m
 CONFIG_INET6_IPCOMP=m
 CONFIG_IPV6_TUNNEL=m
 CONFIG_NETFILTER=y
 # CONFIG_NETFILTER_XT_MATCH_DCCP is not set
-CONFIG_IP_NF_QUEUE=m
 CONFIG_IP_NF_IPTABLES=m
 CONFIG_IP_NF_MATCH_ECN=m
 CONFIG_IP_NF_MATCH_TTL=m
 CONFIG_IP_NF_FILTER=m
 CONFIG_IP_NF_TARGET_REJECT=m
-CONFIG_IP_NF_TARGET_LOG=m
-CONFIG_IP_NF_TARGET_ULOG=m
 CONFIG_IP_NF_MANGLE=m
 CONFIG_IP_NF_TARGET_ECN=m
 CONFIG_IP_NF_RAW=m
@@ -70,7 +62,6 @@ CONFIG_IP6_NF_MATCH_OPTS=m
 CONFIG_IP6_NF_MATCH_HL=m
 CONFIG_IP6_NF_MATCH_IPV6HEADER=m
 CONFIG_IP6_NF_MATCH_RT=m
-CONFIG_IP6_NF_TARGET_LOG=m
 CONFIG_IP6_NF_FILTER=m
 CONFIG_IP6_NF_TARGET_REJECT=m
 CONFIG_IP6_NF_MANGLE=m
@@ -94,7 +85,6 @@ CONFIG_BLK_DEV_SD=y
 CONFIG_CHR_DEV_ST=y
 CONFIG_BLK_DEV_SR=y
 CONFIG_CHR_DEV_SG=y
-CONFIG_SCSI_MULTI_LUN=y
 CONFIG_SCSI_ISCSI_ATTRS=m
 CONFIG_SCSI_SYM53C8XX_2=y
 CONFIG_SCSI_QLOGIC_1280=m
@@ -106,43 +96,38 @@ CONFIG_MD_RAID0=y
 CONFIG_MD_RAID1=y
 CONFIG_FUSION=y
 CONFIG_FUSION_SPI=m
-CONFIG_FUSION_FC=m
 CONFIG_FUSION_CTL=m
 CONFIG_NETDEVICES=y
-CONFIG_DUMMY=m
 CONFIG_BONDING=m
+CONFIG_DUMMY=m
 CONFIG_TUN=m
-CONFIG_NET_ETHERNET=y
-CONFIG_NET_VENDOR_3COM=y
+CONFIG_PCMCIA_3C574=m
+CONFIG_PCMCIA_3C589=m
 CONFIG_VORTEX=m
 CONFIG_TYPHOON=m
+CONFIG_ACENIC=m
+CONFIG_ACENIC_OMIT_TIGON_I=y
+CONFIG_PCNET32=m
+CONFIG_TIGON3=m
 CONFIG_NET_TULIP=y
 CONFIG_DE2104X=m
 CONFIG_TULIP=y
 CONFIG_TULIP_MMIO=y
 CONFIG_PCMCIA_XIRCOM=m
 CONFIG_HP100=m
-CONFIG_NET_PCI=y
-CONFIG_PCNET32=m
 CONFIG_E100=m
-CONFIG_ACENIC=m
-CONFIG_ACENIC_OMIT_TIGON_I=y
 CONFIG_E1000=m
-CONFIG_TIGON3=m
-CONFIG_NET_PCMCIA=y
-CONFIG_PCMCIA_3C589=m
-CONFIG_PCMCIA_3C574=m
 CONFIG_PCMCIA_SMC91C92=m
 CONFIG_PCMCIA_XIRC2PS=m
 CONFIG_PPP=m
+CONFIG_PPP_BSDCOMP=m
+CONFIG_PPP_DEFLATE=m
 CONFIG_PPP_ASYNC=m
 CONFIG_PPP_SYNC_TTY=m
-CONFIG_PPP_DEFLATE=m
-CONFIG_PPP_BSDCOMP=m
-# CONFIG_INPUT_MOUSEDEV is not set
 # CONFIG_INPUT_KEYBOARD is not set
 # CONFIG_INPUT_MOUSE is not set
 # CONFIG_SERIO is not set
+# CONFIG_LEGACY_PTYS is not set
 CONFIG_SERIAL_8250=y
 CONFIG_SERIAL_8250_CONSOLE=y
 CONFIG_SERIAL_8250_CS=m
@@ -151,7 +136,6 @@ CONFIG_SERIAL_8250_EXTENDED=y
 CONFIG_SERIAL_8250_MANY_PORTS=y
 CONFIG_SERIAL_8250_SHARE_IRQ=y
 CONFIG_PDC_CONSOLE=y
-# CONFIG_LEGACY_PTYS is not set
 # CONFIG_HW_RANDOM is not set
 CONFIG_RAW_DRIVER=y
 # CONFIG_HWMON is not set
@@ -160,7 +144,6 @@ CONFIG_AGP_PARISC=y
 # CONFIG_STI_CONSOLE is not set
 CONFIG_EXT2_FS=y
 CONFIG_EXT3_FS=y
-# CONFIG_EXT3_FS_XATTR is not set
 CONFIG_JFS_FS=m
 CONFIG_XFS_FS=m
 CONFIG_AUTOFS4_FS=y
@@ -173,13 +156,9 @@ CONFIG_PROC_KCORE=y
 CONFIG_TMPFS=y
 CONFIG_UFS_FS=m
 CONFIG_NFS_FS=m
-CONFIG_NFS_V3=y
-CONFIG_NFS_V4=y
+CONFIG_NFS_V4=m
 CONFIG_NFSD=m
 CONFIG_NFSD_V4=y
-CONFIG_RPCSEC_GSS_SPKM3=m
-CONFIG_SMB_FS=m
-CONFIG_SMB_NLS_DEFAULT=y
 CONFIG_CIFS=m
 CONFIG_NLS_CODEPAGE_437=m
 CONFIG_NLS_CODEPAGE_850=m
@@ -187,17 +166,12 @@ CONFIG_NLS_ASCII=m
 CONFIG_NLS_ISO8859_1=m
 CONFIG_NLS_ISO8859_15=m
 CONFIG_NLS_UTF8=m
-CONFIG_MAGIC_SYSRQ=y
 CONFIG_DEBUG_FS=y
 CONFIG_HEADERS_CHECK=y
-CONFIG_DEBUG_KERNEL=y
+CONFIG_MAGIC_SYSRQ=y
 # CONFIG_DEBUG_BUGVERBOSE is not set
-# CONFIG_RCU_CPU_STALL_DETECTOR is not set
-CONFIG_CRYPTO_NULL=m
 CONFIG_CRYPTO_TEST=m
 CONFIG_CRYPTO_HMAC=y
 CONFIG_CRYPTO_MD5=y
 CONFIG_CRYPTO_BLOWFISH=m
-# CONFIG_CRYPTO_ANSI_CPRNG is not set
 # CONFIG_CRYPTO_HW is not set
-CONFIG_LIBCRC32C=m
index f1a0c25bef8dc3a6667c608a092f96a39d5994aa..83ffd161aec55fc1f7063c7ed8bcb9f92bcca909 100644 (file)
@@ -3,7 +3,6 @@ CONFIG_SYSVIPC=y
 CONFIG_IKCONFIG=y
 CONFIG_IKCONFIG_PROC=y
 CONFIG_LOG_BUF_SHIFT=16
-CONFIG_SYSFS_DEPRECATED_V2=y
 CONFIG_BLK_DEV_INITRD=y
 CONFIG_SLAB=y
 CONFIG_MODULES=y
@@ -25,8 +24,6 @@ CONFIG_INET=y
 CONFIG_IP_MULTICAST=y
 CONFIG_IP_PNP=y
 CONFIG_IP_PNP_BOOTP=y
-# CONFIG_INET_LRO is not set
-CONFIG_IPV6=y
 CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
 CONFIG_DEVTMPFS=y
 CONFIG_DEVTMPFS_MOUNT=y
@@ -53,10 +50,9 @@ CONFIG_MD_LINEAR=y
 CONFIG_MD_RAID0=y
 CONFIG_MD_RAID1=y
 CONFIG_NETDEVICES=y
-CONFIG_NET_ETHERNET=y
-CONFIG_LASI_82596=y
 CONFIG_NET_TULIP=y
 CONFIG_TULIP=y
+CONFIG_LASI_82596=y
 CONFIG_PPP=y
 CONFIG_INPUT_EVDEV=y
 # CONFIG_KEYBOARD_HIL_OLD is not set
@@ -71,40 +67,31 @@ CONFIG_SERIAL_8250_SHARE_IRQ=y
 CONFIG_PRINTER=y
 # CONFIG_HW_RANDOM is not set
 # CONFIG_HWMON is not set
-CONFIG_VIDEO_OUTPUT_CONTROL=m
 CONFIG_FB=y
 CONFIG_FRAMEBUFFER_CONSOLE=y
 CONFIG_LOGO=y
 CONFIG_SOUND=y
 CONFIG_SND=y
 CONFIG_SND_SEQUENCER=y
-CONFIG_SND_MIXER_OSS=y
-CONFIG_SND_PCM_OSS=y
-CONFIG_SND_SEQUENCER_OSS=y
 CONFIG_SND_HARMONY=y
 CONFIG_EXT2_FS=y
 CONFIG_EXT3_FS=y
-# CONFIG_EXT3_FS_XATTR is not set
 CONFIG_AUTOFS4_FS=y
 CONFIG_ISO9660_FS=y
 CONFIG_JOLIET=y
 CONFIG_PROC_KCORE=y
 CONFIG_TMPFS=y
 CONFIG_NFS_FS=y
-CONFIG_NFS_V3=y
 CONFIG_ROOT_NFS=y
 CONFIG_NFSD=y
 CONFIG_NFSD_V3=y
-CONFIG_SMB_FS=y
 CONFIG_NLS_CODEPAGE_437=m
 CONFIG_NLS_CODEPAGE_850=m
 CONFIG_NLS_ASCII=m
 CONFIG_NLS_ISO8859_1=m
 CONFIG_NLS_ISO8859_15=m
 CONFIG_NLS_UTF8=m
-CONFIG_MAGIC_SYSRQ=y
 CONFIG_HEADERS_CHECK=y
+CONFIG_MAGIC_SYSRQ=y
 CONFIG_DEBUG_KERNEL=y
-# CONFIG_RCU_CPU_STALL_DETECTOR is not set
 CONFIG_SECURITY=y
-# CONFIG_CRYPTO_ANSI_CPRNG is not set
index 8e8f0e34f8174c5905ca8b3b3b65c829c3557265..0764d3971cf66e456a03e26f7542a11ddd98f86f 100644 (file)
@@ -1,12 +1,9 @@
-CONFIG_EXPERIMENTAL=y
 # CONFIG_LOCALVERSION_AUTO is not set
 CONFIG_SYSVIPC=y
 CONFIG_IKCONFIG=y
 CONFIG_IKCONFIG_PROC=y
 CONFIG_LOG_BUF_SHIFT=16
-CONFIG_SYSFS_DEPRECATED_V2=y
 CONFIG_BLK_DEV_INITRD=y
-# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
 CONFIG_EXPERT=y
 CONFIG_KALLSYMS_ALL=y
 CONFIG_SLAB=y
@@ -15,7 +12,6 @@ CONFIG_OPROFILE=m
 CONFIG_MODULES=y
 CONFIG_MODULE_UNLOAD=y
 CONFIG_MODULE_FORCE_UNLOAD=y
-# CONFIG_BLK_DEV_BSG is not set
 CONFIG_PA8X00=y
 CONFIG_PREEMPT_VOLUNTARY=y
 # CONFIG_GSC is not set
@@ -31,13 +27,11 @@ CONFIG_INET=y
 CONFIG_IP_MULTICAST=y
 CONFIG_IP_PNP=y
 CONFIG_IP_PNP_BOOTP=y
-# CONFIG_INET_LRO is not set
 # CONFIG_INET_DIAG is not set
 CONFIG_INET6_IPCOMP=m
 CONFIG_IPV6_TUNNEL=m
 CONFIG_NETFILTER=y
 CONFIG_NETFILTER_DEBUG=y
-CONFIG_IP_NF_QUEUE=m
 CONFIG_NET_PKTGEN=m
 CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
 CONFIG_DEVTMPFS=y
@@ -50,13 +44,11 @@ CONFIG_BLK_DEV_CRYPTOLOOP=m
 CONFIG_IDE=y
 CONFIG_BLK_DEV_IDECD=y
 CONFIG_BLK_DEV_NS87415=y
-CONFIG_PATA_SIL680=m
 CONFIG_SCSI=y
 CONFIG_BLK_DEV_SD=y
 CONFIG_CHR_DEV_ST=y
 CONFIG_BLK_DEV_SR=y
 CONFIG_CHR_DEV_SG=y
-CONFIG_SCSI_MULTI_LUN=y
 CONFIG_SCSI_ISCSI_ATTRS=m
 CONFIG_SCSI_SYM53C8XX_2=y
 CONFIG_SCSI_SYM53C8XX_DMA_ADDRESSING_MODE=0
@@ -76,28 +68,23 @@ CONFIG_FUSION=y
 CONFIG_FUSION_SPI=m
 CONFIG_FUSION_CTL=m
 CONFIG_NETDEVICES=y
-CONFIG_DUMMY=m
 CONFIG_BONDING=m
+CONFIG_DUMMY=m
 CONFIG_TUN=m
-CONFIG_NET_ETHERNET=y
+CONFIG_ACENIC=m
+CONFIG_TIGON3=m
 CONFIG_NET_TULIP=y
 CONFIG_DE2104X=m
 CONFIG_TULIP=y
 CONFIG_TULIP_MMIO=y
-CONFIG_NET_PCI=y
 CONFIG_E100=m
-CONFIG_ACENIC=m
 CONFIG_E1000=m
-CONFIG_TIGON3=m
 CONFIG_PPP=m
-CONFIG_PPP_ASYNC=m
-CONFIG_PPP_SYNC_TTY=m
-CONFIG_PPP_DEFLATE=m
 CONFIG_PPP_BSDCOMP=m
+CONFIG_PPP_DEFLATE=m
 CONFIG_PPPOE=m
-# CONFIG_INPUT_MOUSEDEV_PSAUX is not set
-CONFIG_INPUT_MOUSEDEV_SCREEN_X=1600
-CONFIG_INPUT_MOUSEDEV_SCREEN_Y=1200
+CONFIG_PPP_ASYNC=m
+CONFIG_PPP_SYNC_TTY=m
 # CONFIG_KEYBOARD_ATKBD is not set
 # CONFIG_MOUSE_PS2 is not set
 CONFIG_SERIO=m
@@ -111,7 +98,6 @@ CONFIG_SERIAL_8250_SHARE_IRQ=y
 # CONFIG_HW_RANDOM is not set
 CONFIG_RAW_DRIVER=y
 # CONFIG_HWMON is not set
-CONFIG_VIDEO_OUTPUT_CONTROL=m
 CONFIG_FB=y
 CONFIG_FRAMEBUFFER_CONSOLE=y
 CONFIG_LOGO=y
@@ -121,9 +107,6 @@ CONFIG_LOGO=y
 CONFIG_SOUND=y
 CONFIG_SND=y
 CONFIG_SND_SEQUENCER=y
-CONFIG_SND_MIXER_OSS=y
-CONFIG_SND_PCM_OSS=y
-CONFIG_SND_SEQUENCER_OSS=y
 CONFIG_SND_AD1889=y
 CONFIG_USB_HIDDEV=y
 CONFIG_USB=y
@@ -139,7 +122,6 @@ CONFIG_USB_MICROTEK=m
 CONFIG_USB_LEGOTOWER=m
 CONFIG_EXT2_FS=y
 CONFIG_EXT3_FS=y
-# CONFIG_EXT3_FS_XATTR is not set
 CONFIG_XFS_FS=m
 CONFIG_AUTOFS4_FS=y
 CONFIG_ISO9660_FS=y
@@ -149,7 +131,6 @@ CONFIG_VFAT_FS=m
 CONFIG_PROC_KCORE=y
 CONFIG_TMPFS=y
 CONFIG_NFS_FS=y
-CONFIG_NFS_V3=y
 CONFIG_ROOT_NFS=y
 CONFIG_NFSD=y
 CONFIG_NFSD_V3=y
@@ -159,18 +140,13 @@ CONFIG_NLS_ASCII=m
 CONFIG_NLS_ISO8859_1=m
 CONFIG_NLS_ISO8859_15=m
 CONFIG_NLS_UTF8=m
-CONFIG_MAGIC_SYSRQ=y
 CONFIG_DEBUG_FS=y
 CONFIG_HEADERS_CHECK=y
-CONFIG_DEBUG_KERNEL=y
+CONFIG_MAGIC_SYSRQ=y
 CONFIG_DEBUG_MUTEXES=y
 # CONFIG_DEBUG_BUGVERBOSE is not set
-# CONFIG_RCU_CPU_STALL_DETECTOR is not set
-CONFIG_CRYPTO_NULL=m
 CONFIG_CRYPTO_TEST=m
 CONFIG_CRYPTO_MD5=m
 CONFIG_CRYPTO_BLOWFISH=m
 CONFIG_CRYPTO_DES=m
-# CONFIG_CRYPTO_ANSI_CPRNG is not set
 # CONFIG_CRYPTO_HW is not set
-CONFIG_LIBCRC32C=m
index f6a4c016304b657149d8c87f23e0c564e875a36b..088ab948a5caf8b8f7455233c1cba5295e00cc0f 100644 (file)
@@ -1,16 +1,13 @@
 # CONFIG_LOCALVERSION_AUTO is not set
 CONFIG_SYSVIPC=y
 CONFIG_POSIX_MQUEUE=y
-CONFIG_FHANDLE=y
+# CONFIG_CROSS_MEMORY_ATTACH is not set
 CONFIG_BSD_PROCESS_ACCT=y
 CONFIG_BSD_PROCESS_ACCT_V3=y
 CONFIG_IKCONFIG=y
 CONFIG_IKCONFIG_PROC=y
 CONFIG_RELAY=y
 CONFIG_BLK_DEV_INITRD=y
-CONFIG_RD_BZIP2=y
-CONFIG_RD_LZMA=y
-CONFIG_RD_LZO=y
 CONFIG_EXPERT=y
 CONFIG_SYSCTL_SYSCALL=y
 CONFIG_SLAB=y
@@ -23,7 +20,6 @@ CONFIG_PA8X00=y
 CONFIG_64BIT=y
 CONFIG_SMP=y
 CONFIG_PREEMPT=y
-# CONFIG_CROSS_MEMORY_ATTACH is not set
 CONFIG_IOMMU_CCIO=y
 CONFIG_PCI=y
 CONFIG_PCI_LBA=y
@@ -146,7 +142,6 @@ CONFIG_FB_FOREIGN_ENDIAN=y
 CONFIG_FB_MODE_HELPERS=y
 CONFIG_FB_TILEBLITTING=y
 # CONFIG_FB_STI is not set
-CONFIG_BACKLIGHT_LCD_SUPPORT=y
 # CONFIG_LCD_CLASS_DEVICE is not set
 # CONFIG_BACKLIGHT_GENERIC is not set
 CONFIG_FRAMEBUFFER_CONSOLE=y
@@ -157,12 +152,9 @@ CONFIG_LOGO=y
 # CONFIG_LOGO_LINUX_CLUT224 is not set
 CONFIG_SOUND=m
 CONFIG_SND=m
+CONFIG_SND_VERBOSE_PRINTK=y
 CONFIG_SND_SEQUENCER=m
 CONFIG_SND_SEQ_DUMMY=m
-CONFIG_SND_MIXER_OSS=m
-CONFIG_SND_PCM_OSS=m
-CONFIG_SND_SEQUENCER_OSS=y
-CONFIG_SND_VERBOSE_PRINTK=y
 CONFIG_SND_AD1889=m
 # CONFIG_SND_USB is not set
 # CONFIG_SND_GSC is not set
@@ -174,8 +166,6 @@ CONFIG_EXT2_FS_XATTR=y
 CONFIG_EXT2_FS_POSIX_ACL=y
 CONFIG_EXT2_FS_SECURITY=y
 CONFIG_EXT3_FS=y
-# CONFIG_EXT3_DEFAULTS_TO_ORDERED is not set
-CONFIG_EXT4_FS=m
 CONFIG_REISERFS_FS=m
 CONFIG_REISERFS_PROC_INFO=y
 CONFIG_XFS_FS=m
@@ -238,11 +228,8 @@ CONFIG_DEBUG_SLAB=y
 CONFIG_DEBUG_SLAB_LEAK=y
 CONFIG_DEBUG_MEMORY_INIT=y
 CONFIG_DEBUG_STACKOVERFLOW=y
-CONFIG_LOCKUP_DETECTOR=y
-CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC=y
 CONFIG_PANIC_ON_OOPS=y
 CONFIG_DEBUG_RT_MUTEXES=y
-CONFIG_PROVE_RCU_DELAY=y
 CONFIG_DEBUG_BLOCK_EXT_DEVT=y
 CONFIG_LATENCYTOP=y
 CONFIG_KEYS=y
index 310b6657e4ac9b38380eaecab1eccf12aeaad0d6..52c9050a7c5c6d5305923a5e3f357ab9f6515a78 100644 (file)
@@ -1,11 +1,9 @@
-CONFIG_EXPERIMENTAL=y
 # CONFIG_LOCALVERSION_AUTO is not set
 CONFIG_SYSVIPC=y
 CONFIG_POSIX_MQUEUE=y
 CONFIG_IKCONFIG=y
 CONFIG_IKCONFIG_PROC=y
 CONFIG_LOG_BUF_SHIFT=16
-CONFIG_SYSFS_DEPRECATED_V2=y
 CONFIG_BLK_DEV_INITRD=y
 CONFIG_KALLSYMS_ALL=y
 CONFIG_SLAB=y
@@ -41,9 +39,7 @@ CONFIG_IP_PNP_DHCP=y
 CONFIG_IP_PNP_BOOTP=y
 CONFIG_INET_AH=m
 CONFIG_INET_ESP=m
-# CONFIG_INET_LRO is not set
 CONFIG_INET_DIAG=m
-CONFIG_IPV6=y
 CONFIG_INET6_AH=y
 CONFIG_INET6_ESP=y
 CONFIG_INET6_IPCOMP=y
@@ -82,26 +78,23 @@ CONFIG_MD_RAID1=y
 CONFIG_MD_RAID10=y
 CONFIG_BLK_DEV_DM=y
 CONFIG_NETDEVICES=y
-CONFIG_DUMMY=m
 CONFIG_BONDING=m
+CONFIG_DUMMY=m
 CONFIG_TUN=m
-CONFIG_NET_ETHERNET=y
-CONFIG_MII=m
-CONFIG_LASI_82596=y
-CONFIG_NET_TULIP=y
-CONFIG_TULIP=y
-CONFIG_NET_PCI=y
 CONFIG_ACENIC=y
 CONFIG_TIGON3=y
-CONFIG_NET_PCMCIA=y
+CONFIG_NET_TULIP=y
+CONFIG_TULIP=y
+CONFIG_LASI_82596=y
 CONFIG_PPP=m
-CONFIG_PPP_ASYNC=m
-CONFIG_PPP_SYNC_TTY=m
-CONFIG_PPP_DEFLATE=m
 CONFIG_PPP_BSDCOMP=m
+CONFIG_PPP_DEFLATE=m
 CONFIG_PPPOE=m
+CONFIG_PPP_ASYNC=m
+CONFIG_PPP_SYNC_TTY=m
 # CONFIG_KEYBOARD_HIL_OLD is not set
 CONFIG_MOUSE_SERIAL=y
+CONFIG_LEGACY_PTY_COUNT=64
 CONFIG_SERIAL_8250=y
 CONFIG_SERIAL_8250_CONSOLE=y
 CONFIG_SERIAL_8250_CS=y
@@ -109,31 +102,24 @@ CONFIG_SERIAL_8250_NR_UARTS=17
 CONFIG_SERIAL_8250_EXTENDED=y
 CONFIG_SERIAL_8250_MANY_PORTS=y
 CONFIG_SERIAL_8250_SHARE_IRQ=y
-CONFIG_LEGACY_PTY_COUNT=64
 CONFIG_PRINTER=m
 CONFIG_PPDEV=m
 # CONFIG_HW_RANDOM is not set
 # CONFIG_HWMON is not set
-CONFIG_VIDEO_OUTPUT_CONTROL=m
 CONFIG_FB=y
 CONFIG_FB_MODE_HELPERS=y
 CONFIG_FB_TILEBLITTING=y
 CONFIG_DUMMY_CONSOLE_COLUMNS=128
 CONFIG_DUMMY_CONSOLE_ROWS=48
 CONFIG_FRAMEBUFFER_CONSOLE=y
-CONFIG_FONTS=y
-CONFIG_FONT_8x16=y
 CONFIG_LOGO=y
 # CONFIG_LOGO_LINUX_MONO is not set
 # CONFIG_LOGO_LINUX_VGA16 is not set
 # CONFIG_LOGO_LINUX_CLUT224 is not set
 CONFIG_SOUND=y
 CONFIG_SND=y
-CONFIG_SND_SEQUENCER=y
-CONFIG_SND_MIXER_OSS=y
-CONFIG_SND_PCM_OSS=y
-CONFIG_SND_SEQUENCER_OSS=y
 CONFIG_SND_DYNAMIC_MINORS=y
+CONFIG_SND_SEQUENCER=y
 CONFIG_SND_AD1889=y
 CONFIG_SND_HARMONY=y
 CONFIG_HID_GYRATION=y
@@ -141,7 +127,6 @@ CONFIG_HID_NTRIG=y
 CONFIG_HID_PANTHERLORD=y
 CONFIG_HID_PETALYNX=y
 CONFIG_HID_SAMSUNG=y
-CONFIG_HID_SONY=y
 CONFIG_HID_SUNPLUS=y
 CONFIG_HID_TOPSEED=y
 CONFIG_USB=y
@@ -150,21 +135,15 @@ CONFIG_USB_OHCI_HCD=y
 CONFIG_USB_UHCI_HCD=y
 CONFIG_EXT2_FS=y
 CONFIG_EXT3_FS=y
-# CONFIG_EXT3_FS_XATTR is not set
-CONFIG_AUTOFS_FS=y
 CONFIG_ISO9660_FS=y
 CONFIG_JOLIET=y
 CONFIG_VFAT_FS=y
 CONFIG_PROC_KCORE=y
 CONFIG_TMPFS=y
 CONFIG_NFS_FS=y
-CONFIG_NFS_V3=y
 CONFIG_ROOT_NFS=y
 CONFIG_NFSD=y
 CONFIG_NFSD_V4=y
-CONFIG_RPCSEC_GSS_SPKM3=m
-CONFIG_SMB_FS=m
-CONFIG_SMB_NLS_DEFAULT=y
 CONFIG_CIFS=m
 CONFIG_NLS_CODEPAGE_437=y
 CONFIG_NLS_CODEPAGE_737=m
@@ -204,30 +183,24 @@ CONFIG_NLS_ISO8859_15=m
 CONFIG_NLS_KOI8_R=m
 CONFIG_NLS_KOI8_U=m
 CONFIG_NLS_UTF8=y
-CONFIG_MAGIC_SYSRQ=y
 CONFIG_DEBUG_FS=y
 CONFIG_HEADERS_CHECK=y
+CONFIG_MAGIC_SYSRQ=y
 CONFIG_DEBUG_KERNEL=y
 CONFIG_DEBUG_MUTEXES=y
-# CONFIG_RCU_CPU_STALL_DETECTOR is not set
 CONFIG_KEYS=y
-CONFIG_CRYPTO_NULL=m
 CONFIG_CRYPTO_TEST=m
-CONFIG_CRYPTO_MD4=m
 CONFIG_CRYPTO_MICHAEL_MIC=m
-CONFIG_CRYPTO_SHA256=m
 CONFIG_CRYPTO_SHA512=m
 CONFIG_CRYPTO_TGR192=m
 CONFIG_CRYPTO_WP512=m
-CONFIG_CRYPTO_AES=m
 CONFIG_CRYPTO_ANUBIS=m
-CONFIG_CRYPTO_ARC4=m
 CONFIG_CRYPTO_BLOWFISH=m
 CONFIG_CRYPTO_CAST6=m
 CONFIG_CRYPTO_KHAZAD=m
 CONFIG_CRYPTO_SERPENT=m
 CONFIG_CRYPTO_TEA=m
 CONFIG_CRYPTO_TWOFISH=m
-# CONFIG_CRYPTO_ANSI_CPRNG is not set
 # CONFIG_CRYPTO_HW is not set
 CONFIG_LIBCRC32C=m
+CONFIG_FONTS=y
index 8688ba7f5966af8d7b626054a366d44c0448becd..37ae4b57c00151323e0561551a9aa1a3ff0d8d29 100644 (file)
@@ -2,15 +2,11 @@ CONFIG_LOCALVERSION="-32bit"
 # CONFIG_LOCALVERSION_AUTO is not set
 CONFIG_SYSVIPC=y
 CONFIG_POSIX_MQUEUE=y
-CONFIG_FHANDLE=y
 CONFIG_BSD_PROCESS_ACCT=y
 CONFIG_IKCONFIG=y
 CONFIG_IKCONFIG_PROC=y
 CONFIG_LOG_BUF_SHIFT=16
 CONFIG_BLK_DEV_INITRD=y
-CONFIG_RD_BZIP2=y
-CONFIG_RD_LZMA=y
-CONFIG_RD_LZO=y
 CONFIG_EXPERT=y
 CONFIG_SYSCTL_SYSCALL=y
 CONFIG_PERF_EVENTS=y
@@ -49,7 +45,6 @@ CONFIG_INET_ESP=m
 # CONFIG_INET_XFRM_MODE_TRANSPORT is not set
 # CONFIG_INET_XFRM_MODE_TUNNEL is not set
 # CONFIG_INET_XFRM_MODE_BEET is not set
-# CONFIG_INET_LRO is not set
 CONFIG_INET_DIAG=m
 CONFIG_LLC2=m
 # CONFIG_WIRELESS is not set
@@ -149,10 +144,8 @@ CONFIG_PRINTER=m
 CONFIG_PPDEV=m
 # CONFIG_HW_RANDOM is not set
 CONFIG_I2C=y
-CONFIG_POWER_SUPPLY=y
 # CONFIG_HWMON is not set
 CONFIG_AGP=y
-CONFIG_VIDEO_OUTPUT_CONTROL=y
 CONFIG_FB=y
 CONFIG_FB_FOREIGN_ENDIAN=y
 CONFIG_FB_MODE_HELPERS=y
@@ -169,11 +162,8 @@ CONFIG_LOGO=y
 # CONFIG_LOGO_LINUX_CLUT224 is not set
 CONFIG_SOUND=m
 CONFIG_SND=m
-CONFIG_SND_SEQUENCER=m
-CONFIG_SND_MIXER_OSS=m
-CONFIG_SND_PCM_OSS=m
-CONFIG_SND_SEQUENCER_OSS=y
 CONFIG_SND_DYNAMIC_MINORS=y
+CONFIG_SND_SEQUENCER=m
 CONFIG_SND_AD1889=m
 CONFIG_SND_HARMONY=m
 CONFIG_HIDRAW=y
@@ -223,12 +213,7 @@ CONFIG_EXT2_FS=y
 CONFIG_EXT2_FS_XATTR=y
 CONFIG_EXT2_FS_SECURITY=y
 CONFIG_EXT3_FS=y
-# CONFIG_EXT3_DEFAULTS_TO_ORDERED is not set
 CONFIG_EXT3_FS_SECURITY=y
-CONFIG_EXT4_FS=y
-CONFIG_XFS_FS=m
-CONFIG_XFS_QUOTA=y
-CONFIG_XFS_RT=y
 CONFIG_QUOTA=y
 CONFIG_QUOTA_NETLINK_INTERFACE=y
 CONFIG_QFMT_V2=y
@@ -293,15 +278,12 @@ CONFIG_DEBUG_MEMORY_INIT=y
 CONFIG_DEBUG_STACKOVERFLOW=y
 CONFIG_DEBUG_SHIRQ=y
 CONFIG_DETECT_HUNG_TASK=y
-CONFIG_TIMER_STATS=y
 CONFIG_DEBUG_RT_MUTEXES=y
 CONFIG_DEBUG_SPINLOCK=y
 CONFIG_DEBUG_MUTEXES=y
-CONFIG_RCU_CPU_STALL_INFO=y
 CONFIG_LATENCYTOP=y
 CONFIG_LKDTM=m
 CONFIG_KEYS=y
-CONFIG_CRYPTO_NULL=m
 CONFIG_CRYPTO_TEST=m
 CONFIG_CRYPTO_HMAC=y
 CONFIG_CRYPTO_MD5=y
@@ -320,7 +302,6 @@ CONFIG_CRYPTO_SERPENT=m
 CONFIG_CRYPTO_TEA=m
 CONFIG_CRYPTO_TWOFISH=m
 CONFIG_CRYPTO_DEFLATE=y
-# CONFIG_CRYPTO_ANSI_CPRNG is not set
 CONFIG_CRC_CCITT=m
 CONFIG_CRC_T10DIF=y
 CONFIG_FONTS=y
index c564e6e1fa23424c39efa967cce4a42ac9ae4f2f..d39e7f821aba318377b16bf2ef48b58315f5e252 100644 (file)
@@ -8,10 +8,11 @@ CONFIG_TASKSTATS=y
 CONFIG_TASK_DELAY_ACCT=y
 CONFIG_TASK_XACCT=y
 CONFIG_TASK_IO_ACCOUNTING=y
-# CONFIG_UTS_NS is not set
-# CONFIG_IPC_NS is not set
-# CONFIG_PID_NS is not set
-# CONFIG_NET_NS is not set
+CONFIG_CGROUPS=y
+CONFIG_MEMCG=y
+CONFIG_MEMCG_SWAP=y
+CONFIG_CGROUP_PIDS=y
+CONFIG_CPUSETS=y
 CONFIG_RELAY=y
 CONFIG_BLK_DEV_INITRD=y
 CONFIG_CC_OPTIMIZE_FOR_SIZE=y
@@ -52,7 +53,6 @@ CONFIG_INET_ESP=m
 CONFIG_INET_XFRM_MODE_TRANSPORT=m
 CONFIG_INET_XFRM_MODE_TUNNEL=m
 CONFIG_INET_XFRM_MODE_BEET=m
-CONFIG_INET_LRO=m
 CONFIG_INET_DIAG=m
 CONFIG_NETFILTER=y
 # CONFIG_NETFILTER_ADVANCED is not set
@@ -84,7 +84,6 @@ CONFIG_PATA_SIL680=y
 CONFIG_ATA_GENERIC=y
 CONFIG_MD=y
 CONFIG_MD_LINEAR=m
-CONFIG_MD_RAID0=m
 CONFIG_BLK_DEV_DM=m
 CONFIG_DM_RAID=m
 CONFIG_DM_UEVENT=y
@@ -138,21 +137,21 @@ CONFIG_QLGE=m
 # CONFIG_NET_VENDOR_TI is not set
 # CONFIG_NET_VENDOR_VIA is not set
 # CONFIG_NET_VENDOR_WIZNET is not set
+CONFIG_MDIO_BITBANG=m
 CONFIG_PHYLIB=y
-CONFIG_MARVELL_PHY=m
-CONFIG_DAVICOM_PHY=m
-CONFIG_QSEMI_PHY=m
-CONFIG_LXT_PHY=m
-CONFIG_CICADA_PHY=m
-CONFIG_VITESSE_PHY=m
-CONFIG_SMSC_PHY=m
 CONFIG_BROADCOM_PHY=m
+CONFIG_CICADA_PHY=m
+CONFIG_DAVICOM_PHY=m
 CONFIG_ICPLUS_PHY=m
-CONFIG_REALTEK_PHY=m
+CONFIG_LSI_ET1011C_PHY=m
+CONFIG_LXT_PHY=m
+CONFIG_MARVELL_PHY=m
 CONFIG_NATIONAL_PHY=m
+CONFIG_QSEMI_PHY=m
+CONFIG_REALTEK_PHY=m
+CONFIG_SMSC_PHY=m
 CONFIG_STE10XP=m
-CONFIG_LSI_ET1011C_PHY=m
-CONFIG_MDIO_BITBANG=m
+CONFIG_VITESSE_PHY=m
 CONFIG_SLIP=m
 CONFIG_SLIP_COMPRESSED=y
 CONFIG_SLIP_SMART=y
@@ -166,10 +165,8 @@ CONFIG_INPUT_MISC=y
 CONFIG_SERIO_SERPORT=m
 # CONFIG_HP_SDC is not set
 CONFIG_SERIO_RAW=m
-CONFIG_DEVPTS_MULTIPLE_INSTANCES=y
 # CONFIG_LEGACY_PTYS is not set
 CONFIG_NOZOMI=m
-# CONFIG_DEVKMEM is not set
 CONFIG_SERIAL_8250=y
 # CONFIG_SERIAL_8250_DEPRECATED_OPTIONS is not set
 CONFIG_SERIAL_8250_CONSOLE=y
@@ -207,10 +204,8 @@ CONFIG_AGP=y
 CONFIG_AGP_PARISC=y
 CONFIG_DRM=y
 CONFIG_DRM_RADEON=y
-CONFIG_DRM_RADEON_UMS=y
 CONFIG_FIRMWARE_EDID=y
 CONFIG_FB_MODE_HELPERS=y
-CONFIG_BACKLIGHT_LCD_SUPPORT=y
 # CONFIG_BACKLIGHT_GENERIC is not set
 CONFIG_FRAMEBUFFER_CONSOLE_ROTATION=y
 CONFIG_LOGO=y
@@ -246,8 +241,6 @@ CONFIG_EXT2_FS_XATTR=y
 CONFIG_EXT2_FS_SECURITY=y
 CONFIG_EXT3_FS=y
 CONFIG_EXT3_FS_SECURITY=y
-CONFIG_EXT4_FS=y
-CONFIG_EXT4_FS_SECURITY=y
 CONFIG_XFS_FS=m
 CONFIG_BTRFS_FS=m
 CONFIG_QUOTA=y
@@ -286,27 +279,16 @@ CONFIG_DEBUG_FS=y
 CONFIG_MAGIC_SYSRQ=y
 CONFIG_DEBUG_KERNEL=y
 CONFIG_DEBUG_STACKOVERFLOW=y
-CONFIG_LOCKUP_DETECTOR=y
-CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC=y
-CONFIG_BOOTPARAM_HUNG_TASK_PANIC=y
 # CONFIG_SCHED_DEBUG is not set
-CONFIG_TIMER_STATS=y
 CONFIG_CRYPTO_MANAGER=y
 CONFIG_CRYPTO_ECB=m
 CONFIG_CRYPTO_PCBC=m
 CONFIG_CRYPTO_MD4=m
 CONFIG_CRYPTO_MD5=y
 CONFIG_CRYPTO_MICHAEL_MIC=m
-CONFIG_CRYPTO_SHA256=m
 CONFIG_CRYPTO_ARC4=m
 CONFIG_CRYPTO_FCRYPT=m
 CONFIG_CRYPTO_DEFLATE=m
 # CONFIG_CRYPTO_HW is not set
 CONFIG_CRC_CCITT=m
 CONFIG_LIBCRC32C=y
-CONFIG_XZ_DEC_X86=y
-CONFIG_XZ_DEC_POWERPC=y
-CONFIG_XZ_DEC_IA64=y
-CONFIG_XZ_DEC_ARM=y
-CONFIG_XZ_DEC_ARMTHUMB=y
-CONFIG_XZ_DEC_SPARC=y
index 32e105fb8adb362f261d20432f1f8af068086376..e3c0586260d8a34cd188764dae1e5452eefd7c22 100644 (file)
 #define PDC_PAT_MEM_SETGM              9L /* Set Good Memory value        */
 #define PDC_PAT_MEM_ADD_PAGE           10L /* ADDs a page to the cell      */
 #define PDC_PAT_MEM_ADDRESS            11L /* Get Physical Location From   */
-                                                /* Memory Address               */
+                                           /* Memory Address               */
 #define PDC_PAT_MEM_GET_TXT_SIZE       12L /* Get Formatted Text Size   */
 #define PDC_PAT_MEM_GET_PD_TXT         13L /* Get PD Formatted Text     */
 #define PDC_PAT_MEM_GET_CELL_TXT       14L /* Get Cell Formatted Text   */
@@ -228,6 +228,17 @@ struct pdc_pat_mem_read_pd_retinfo { /* PDC_PAT_MEM/PDC_PAT_MEM_PD_READ */
        unsigned long pdt_entries;
 };
 
+struct pdc_pat_mem_phys_mem_location { /* PDC_PAT_MEM/PDC_PAT_MEM_ADDRESS */
+       u64 cabinet:8;
+       u64 ign1:8;
+       u64 ign2:8;
+       u64 cell_slot:8;
+       u64 ign3:8;
+       u64 dimm_slot:8; /* DIMM slot, e.g. 0x1A, 0x2B, show user hex value! */
+       u64 ign4:8;
+       u64 source:4; /* for mem: always 0x07 */
+       u64 source_detail:4; /* for mem: always 0x04 (SIMM or DIMM) */
+};
 
 struct pdc_pat_pd_addr_map_entry {
        unsigned char entry_type;       /* 1 = Memory Descriptor Entry Type */
@@ -319,6 +330,9 @@ extern int pdc_pat_mem_read_cell_pdt(struct pdc_pat_mem_read_pd_retinfo *pret,
 extern int pdc_pat_mem_read_pd_pdt(struct pdc_pat_mem_read_pd_retinfo *pret,
                unsigned long *pdt_entries_ptr, unsigned long count,
                unsigned long offset);
+extern int pdc_pat_mem_get_dimm_phys_location(
+                struct pdc_pat_mem_phys_mem_location *pret,
+                unsigned long phys_addr);
 
 #endif /* __ASSEMBLY__ */
 
index 674c68a5bbd035c86bee42834d010ba20eb06464..d0e3321403bedcd641610ba744e96ba45ef1d6cc 100644 (file)
@@ -60,7 +60,7 @@
 #define TIOCGPKT       _IOR('T', 0x38, int) /* Get packet mode state */
 #define TIOCGPTLCK     _IOR('T', 0x39, int) /* Get Pty lock state */
 #define TIOCGEXCL      _IOR('T', 0x40, int) /* Get exclusive mode state */
-#define TIOCGPTPEER    _IOR('T', 0x41, int) /* Safely open the slave */
+#define TIOCGPTPEER    _IO('T', 0x41) /* Safely open the slave */
 
 #define FIONCLEX       0x5450  /* these numbers need to be adjusted. */
 #define FIOCLEX                0x5451
index c32a0909521665b5f08c22ef37fa8d8f9c654012..85a92db70afc99ab9151924823a3e277f1c0e8c5 100644 (file)
@@ -453,8 +453,8 @@ void copy_user_page(void *vto, void *vfrom, unsigned long vaddr,
          before it can be accessed through the kernel mapping. */
        preempt_disable();
        flush_dcache_page_asm(__pa(vfrom), vaddr);
-       preempt_enable();
        copy_page_asm(vto, vfrom);
+       preempt_enable();
 }
 EXPORT_SYMBOL(copy_user_page);
 
@@ -539,6 +539,10 @@ void flush_cache_mm(struct mm_struct *mm)
        struct vm_area_struct *vma;
        pgd_t *pgd;
 
+       /* Flush the TLB to avoid speculation if coherency is required. */
+       if (parisc_requires_coherency())
+               flush_tlb_all();
+
        /* Flushing the whole cache on each cpu takes forever on
           rp3440, etc.  So, avoid it if the mm isn't too big.  */
        if (mm_total_size(mm) >= parisc_cache_flush_threshold) {
@@ -577,33 +581,22 @@ void flush_cache_mm(struct mm_struct *mm)
 void flush_cache_range(struct vm_area_struct *vma,
                unsigned long start, unsigned long end)
 {
-       unsigned long addr;
-       pgd_t *pgd;
-
        BUG_ON(!vma->vm_mm->context);
 
+       /* Flush the TLB to avoid speculation if coherency is required. */
+       if (parisc_requires_coherency())
+               flush_tlb_range(vma, start, end);
+
        if ((end - start) >= parisc_cache_flush_threshold) {
                flush_cache_all();
                return;
        }
 
-       if (vma->vm_mm->context == mfsp(3)) {
-               flush_user_dcache_range_asm(start, end);
-               if (vma->vm_flags & VM_EXEC)
-                       flush_user_icache_range_asm(start, end);
-               return;
-       }
+       BUG_ON(vma->vm_mm->context != mfsp(3));
 
-       pgd = vma->vm_mm->pgd;
-       for (addr = start & PAGE_MASK; addr < end; addr += PAGE_SIZE) {
-               unsigned long pfn;
-               pte_t *ptep = get_ptep(pgd, addr);
-               if (!ptep)
-                       continue;
-               pfn = pte_pfn(*ptep);
-               if (pfn_valid(pfn))
-                       __flush_cache_page(vma, addr, PFN_PHYS(pfn));
-       }
+       flush_user_dcache_range_asm(start, end);
+       if (vma->vm_flags & VM_EXEC)
+               flush_user_icache_range_asm(start, end);
 }
 
 void
@@ -612,7 +605,8 @@ flush_cache_page(struct vm_area_struct *vma, unsigned long vmaddr, unsigned long
        BUG_ON(!vma->vm_mm->context);
 
        if (pfn_valid(pfn)) {
-               flush_tlb_page(vma, vmaddr);
+               if (parisc_requires_coherency())
+                       flush_tlb_page(vma, vmaddr);
                __flush_cache_page(vma, vmaddr, PFN_PHYS(pfn));
        }
 }
index 98190252c12fdc801ca8f7f328733727577f48f2..f622a311d04a1a99676f5b90469d18940a9d8294 100644 (file)
@@ -1481,12 +1481,44 @@ int pdc_pat_mem_read_pd_pdt(struct pdc_pat_mem_read_pd_retinfo *pret,
                unsigned long offset)
 {
        int retval;
-       unsigned long flags;
+       unsigned long flags, entries;
 
        spin_lock_irqsave(&pdc_lock, flags);
        retval = mem_pdc_call(PDC_PAT_MEM, PDC_PAT_MEM_PD_READ,
-               __pa(&pret), __pa(pdt_entries_ptr),
+               __pa(&pdc_result), __pa(pdt_entries_ptr),
                count, offset);
+
+       if (retval == PDC_OK) {
+               entries = min(pdc_result[0], count);
+               pret->actual_count_bytes = entries;
+               pret->pdt_entries = entries / sizeof(unsigned long);
+       }
+
+       spin_unlock_irqrestore(&pdc_lock, flags);
+
+       return retval;
+}
+
+/**
+ * pdc_pat_mem_get_dimm_phys_location - Get physical DIMM slot via PAT firmware
+ * @pret: ptr to hold returned information
+ * @phys_addr: physical address to examine
+ *
+ */
+int pdc_pat_mem_get_dimm_phys_location(
+               struct pdc_pat_mem_phys_mem_location *pret,
+               unsigned long phys_addr)
+{
+       int retval;
+       unsigned long flags;
+
+       spin_lock_irqsave(&pdc_lock, flags);
+       retval = mem_pdc_call(PDC_PAT_MEM, PDC_PAT_MEM_ADDRESS,
+               __pa(&pdc_result), phys_addr);
+
+       if (retval == PDC_OK)
+               memcpy(pret, &pdc_result, sizeof(*pret));
+
        spin_unlock_irqrestore(&pdc_lock, flags);
 
        return retval;
index ba5e1c7b1f177d45f743392c0950017622b143a8..5404e4086cb95d5e7a5b49e06e783f0cfdf89b8b 100644 (file)
@@ -413,6 +413,10 @@ static inline void stack_overflow_check(struct pt_regs *regs)
        if (regs->sr[7])
                return;
 
+       /* exit if already in panic */
+       if (sysctl_panic_on_stackoverflow < 0)
+               return;
+
        /* calculate kernel stack usage */
        stack_usage = sp - stack_start;
 #ifdef CONFIG_IRQSTACKS
@@ -454,8 +458,10 @@ check_kernel_stack:
 #ifdef CONFIG_IRQSTACKS
 panic_check:
 #endif
-       if (sysctl_panic_on_stackoverflow)
+       if (sysctl_panic_on_stackoverflow) {
+               sysctl_panic_on_stackoverflow = -1; /* disable further checks */
                panic("low stack detected by irq handler - check messages\n");
+       }
 #endif
 }
 
index f3a797e670b09461b45e1e7163d036fd457beb18..d02874ecb94df27d3171ae221ba693f4f8ca0a9c 100644 (file)
@@ -112,10 +112,12 @@ void __init pdc_pdt_init(void)
 #ifdef CONFIG_64BIT
                struct pdc_pat_mem_read_pd_retinfo pat_pret;
 
+               /* try old obsolete PAT firmware function first */
+               pdt_type = PDT_PAT_OLD;
                ret = pdc_pat_mem_read_cell_pdt(&pat_pret, pdt_entry,
                        MAX_PDT_ENTRIES);
                if (ret != PDC_OK) {
-                       pdt_type = PDT_PAT_OLD;
+                       pdt_type = PDT_PAT_NEW;
                        ret = pdc_pat_mem_read_pd_pdt(&pat_pret, pdt_entry,
                                MAX_PDT_TABLE_SIZE, 0);
                }
@@ -131,11 +133,20 @@ void __init pdc_pdt_init(void)
        }
 
        for (i = 0; i < pdt_status.pdt_entries; i++) {
-               if (i < 20)
-                       pr_warn("PDT: BAD PAGE #%d at 0x%08lx (error_type = %lu)\n",
-                               i,
-                               pdt_entry[i] & PAGE_MASK,
-                               pdt_entry[i] & 1);
+               struct pdc_pat_mem_phys_mem_location loc;
+
+               /* get DIMM slot number */
+               loc.dimm_slot = 0xff;
+#ifdef CONFIG_64BIT
+               pdc_pat_mem_get_dimm_phys_location(&loc, pdt_entry[i]);
+#endif
+
+               pr_warn("PDT: BAD PAGE #%d at 0x%08lx, "
+                       "DIMM slot %02x (error_type = %lu)\n",
+                       i,
+                       pdt_entry[i] & PAGE_MASK,
+                       loc.dimm_slot,
+                       pdt_entry[i] & 1);
 
                /* mark memory page bad */
                memblock_reserve(pdt_entry[i] & PAGE_MASK, PAGE_SIZE);
index b64d7d21646ed50c4a5c1f046b0f8ca758abfcc6..a45a67d526f8ca8001fd1d06625b3b233d5a3835 100644 (file)
@@ -53,6 +53,7 @@
 #include <linux/uaccess.h>
 #include <linux/rcupdate.h>
 #include <linux/random.h>
+#include <linux/nmi.h>
 
 #include <asm/io.h>
 #include <asm/asm-offsets.h>
@@ -145,6 +146,7 @@ void machine_power_off(void)
 
        /* prevent soft lockup/stalled CPU messages for endless loop. */
        rcu_sysrq_start();
+       lockup_detector_suspend();
        for (;;);
 }
 
index 3d6ef1b29c6ad312e5114f86ad737d13bf606403..ffe2cbf52d1a25617955c54f73890fdb02e7e394 100644 (file)
@@ -78,6 +78,8 @@ SECTIONS
                *(.text.sys_exit)
                *(.text.do_sigaltstack)
                *(.text.do_fork)
+               *(.text.div)
+               *($$*)                  /* millicode routines */
                *(.text.*)
                *(.fixup)
                *(.lock.text)           /* out-of-line lock text */
index bfd609a3e928f8b8536567e4e030cf8ff05643ff..e3b10469f787786a2c7ea3ed1013aff35ce619b3 100644 (file)
 #define TIOCGPKT       _IOR('T', 0x38, int) /* Get packet mode state */
 #define TIOCGPTLCK     _IOR('T', 0x39, int) /* Get Pty lock state */
 #define TIOCGEXCL      _IOR('T', 0x40, int) /* Get exclusive mode state */
-#define TIOCGPTPEER    _IOR('T', 0x41, int) /* Safely open the slave */
+#define TIOCGPTPEER    _IO('T', 0x41) /* Safely open the slave */
 
 #define TIOCSERCONFIG  0x5453
 #define TIOCSERGWILD   0x5454
index 0c82f7903fc7a7c0bfc9c7d5b02ab79ab4a2be89..c1bf75ffb8756549b1c6a5c97908ff49dd2e79aa 100644 (file)
@@ -998,7 +998,7 @@ static int perf_push_sample(struct perf_event *event, struct sf_raw_sample *sfr)
        psw_bits(regs.psw).ia   = sfr->basic.ia;
        psw_bits(regs.psw).dat  = sfr->basic.T;
        psw_bits(regs.psw).wait = sfr->basic.W;
-       psw_bits(regs.psw).per  = sfr->basic.P;
+       psw_bits(regs.psw).pstate = sfr->basic.P;
        psw_bits(regs.psw).as   = sfr->basic.AS;
 
        /*
index d4d409ba206b2e0f4ed0b88cc4f3a3ba125b3597..4a1f7366b17aeffacb6c766ab891227e2609f1b9 100644 (file)
@@ -591,11 +591,11 @@ void ptep_zap_key(struct mm_struct *mm, unsigned long addr, pte_t *ptep)
        unsigned long ptev;
        pgste_t pgste;
 
-       /* Clear storage key */
+       /* Clear storage key ACC and F, but set R/C */
        preempt_disable();
        pgste = pgste_get_lock(ptep);
-       pgste_val(pgste) &= ~(PGSTE_ACC_BITS | PGSTE_FP_BIT |
-                             PGSTE_GR_BIT | PGSTE_GC_BIT);
+       pgste_val(pgste) &= ~(PGSTE_ACC_BITS | PGSTE_FP_BIT);
+       pgste_val(pgste) |= PGSTE_GR_BIT | PGSTE_GC_BIT;
        ptev = pte_val(*ptep);
        if (!(ptev & _PAGE_INVALID) && (ptev & _PAGE_WRITE))
                page_set_storage_key(ptev & PAGE_MASK, PAGE_DEFAULT_KEY, 1);
index eec7901e9e658b18e0eadeeb2af65966cc15993d..787bac9f67da3fd069f3f5f2d05e535b819c86cf 100644 (file)
@@ -93,7 +93,7 @@
 #define TIOCGPKT       _IOR('T', 0x38, int) /* Get packet mode state */
 #define TIOCGPTLCK     _IOR('T', 0x39, int) /* Get Pty lock state */
 #define TIOCGEXCL      _IOR('T', 0x40, int) /* Get exclusive mode state */
-#define TIOCGPTPEER    _IOR('T', 0x41, int) /* Safely open the slave */
+#define TIOCGPTPEER    _IO('T', 0x41) /* Safely open the slave */
 
 #define TIOCSERCONFIG  _IO('T', 83) /* 0x5453 */
 #define TIOCSERGWILD   _IOR('T', 84,  int) /* 0x5454 */
index 6d27398632eacd22a72e0437ea57d1c048930d11..f5df72b93bb27fe7601b4994889d4103562fffc0 100644 (file)
@@ -88,7 +88,7 @@
 #define TIOCGPTN       _IOR('t', 134, unsigned int) /* Get Pty Number */
 #define TIOCSPTLCK     _IOW('t', 135, int) /* Lock/unlock PTY */
 #define TIOCSIG                _IOW('t', 136, int) /* Generate signal on Pty slave */
-#define TIOCGPTPEER    _IOR('t', 137, int) /* Safely open the slave */
+#define TIOCGPTPEER    _IO('t', 137) /* Safely open the slave */
 
 /* Little f */
 #define FIOCLEX                _IO('f', 1)
index 1ea598e5f03025ef509aaafca17623f7d8cbed5f..51471408fdd1329b0097f2463acff17596b83b1e 100644 (file)
@@ -19,6 +19,7 @@
 #include <linux/irq_work.h>
 #include <linux/tick.h>
 #include <linux/nmi.h>
+#include <linux/cpuhotplug.h>
 
 #include <asm/paravirt.h>
 #include <asm/desc.h>
@@ -413,7 +414,7 @@ static void xen_pv_play_dead(void) /* used only with HOTPLUG_CPU */
         */
        tick_nohz_idle_enter();
 
-       cpu_startup_entry(CPUHP_AP_ONLINE_IDLE);
+       cpuhp_online_idle(CPUHP_AP_ONLINE_IDLE);
 }
 
 #else /* !CONFIG_HOTPLUG_CPU */
index a1895a8e85c15753d4781c3ac72185b4c96a7d9d..1ecb05db363203ec004f0e3c6764ca5f448fbc78 100644 (file)
@@ -309,7 +309,6 @@ static irqreturn_t xen_timer_interrupt(int irq, void *dev_id)
 void xen_teardown_timer(int cpu)
 {
        struct clock_event_device *evt;
-       BUG_ON(cpu == 0);
        evt = &per_cpu(xen_clock_events, cpu).evt;
 
        if (evt->irq >= 0) {
index 98b004e24e8523b735d60937c56e22b2b0f7d2bd..47d82c09be7b0b0df85c9fd97ec50334cc6d738c 100644 (file)
 #define TIOCGPKT       _IOR('T', 0x38, int) /* Get packet mode state */
 #define TIOCGPTLCK     _IOR('T', 0x39, int) /* Get Pty lock state */
 #define TIOCGEXCL      _IOR('T', 0x40, int) /* Get exclusive mode state */
-#define TIOCGPTPEER    _IOR('T', 0x41, int) /* Safely open the slave */
+#define TIOCGPTPEER    _IO('T', 0x41) /* Safely open the slave */
 
 #define TIOCSERCONFIG  _IO('T', 83)
 #define TIOCSERGWILD   _IOR('T', 84,  int)
index ddb01e9fa5b225eda5a83cf8a06501ddaded2fc5..62068a5e814f026a44e212bd2b93941590a3fe53 100644 (file)
@@ -151,6 +151,10 @@ static bool ec_freeze_events __read_mostly = false;
 module_param(ec_freeze_events, bool, 0644);
 MODULE_PARM_DESC(ec_freeze_events, "Disabling event handling during suspend/resume");
 
+static bool ec_no_wakeup __read_mostly;
+module_param(ec_no_wakeup, bool, 0644);
+MODULE_PARM_DESC(ec_no_wakeup, "Do not wake up from suspend-to-idle");
+
 struct acpi_ec_query_handler {
        struct list_head node;
        acpi_ec_query_func func;
@@ -535,6 +539,14 @@ static void acpi_ec_disable_event(struct acpi_ec *ec)
        spin_unlock_irqrestore(&ec->lock, flags);
        __acpi_ec_flush_event(ec);
 }
+
+void acpi_ec_flush_work(void)
+{
+       if (first_ec)
+               __acpi_ec_flush_event(first_ec);
+
+       flush_scheduled_work();
+}
 #endif /* CONFIG_PM_SLEEP */
 
 static bool acpi_ec_guard_event(struct acpi_ec *ec)
@@ -1880,6 +1892,32 @@ static int acpi_ec_suspend(struct device *dev)
        return 0;
 }
 
+static int acpi_ec_suspend_noirq(struct device *dev)
+{
+       struct acpi_ec *ec = acpi_driver_data(to_acpi_device(dev));
+
+       /*
+        * The SCI handler doesn't run at this point, so the GPE can be
+        * masked at the low level without side effects.
+        */
+       if (ec_no_wakeup && test_bit(EC_FLAGS_STARTED, &ec->flags) &&
+           ec->reference_count >= 1)
+               acpi_set_gpe(NULL, ec->gpe, ACPI_GPE_DISABLE);
+
+       return 0;
+}
+
+static int acpi_ec_resume_noirq(struct device *dev)
+{
+       struct acpi_ec *ec = acpi_driver_data(to_acpi_device(dev));
+
+       if (ec_no_wakeup && test_bit(EC_FLAGS_STARTED, &ec->flags) &&
+           ec->reference_count >= 1)
+               acpi_set_gpe(NULL, ec->gpe, ACPI_GPE_ENABLE);
+
+       return 0;
+}
+
 static int acpi_ec_resume(struct device *dev)
 {
        struct acpi_ec *ec =
@@ -1891,6 +1929,7 @@ static int acpi_ec_resume(struct device *dev)
 #endif
 
 static const struct dev_pm_ops acpi_ec_pm = {
+       SET_NOIRQ_SYSTEM_SLEEP_PM_OPS(acpi_ec_suspend_noirq, acpi_ec_resume_noirq)
        SET_SYSTEM_SLEEP_PM_OPS(acpi_ec_suspend, acpi_ec_resume)
 };
 
index 9531d3276f652a14e5eb39d9e0cb8a0325353f72..58dd7ab3c6538bd490b45e2e420c3d822ecf8c3e 100644 (file)
@@ -193,6 +193,10 @@ int acpi_ec_add_query_handler(struct acpi_ec *ec, u8 query_bit,
                              void *data);
 void acpi_ec_remove_query_handler(struct acpi_ec *ec, u8 query_bit);
 
+#ifdef CONFIG_PM_SLEEP
+void acpi_ec_flush_work(void);
+#endif
+
 
 /*--------------------------------------------------------------------------
                                   Suspend/Resume
index edb0c79f7c64eea8b4d3cdde4467a356c20a32f8..917f1cc0fda4c2f6c8cc64f7b90dc252a264ac7a 100644 (file)
@@ -443,7 +443,7 @@ int __init acpi_numa_init(void)
         * So go over all cpu entries in SRAT to get apicid to node mapping.
         */
 
-       /* SRAT: Static Resource Affinity Table */
+       /* SRAT: System Resource Affinity Table */
        if (!acpi_table_parse(ACPI_SIG_SRAT, acpi_parse_srat)) {
                struct acpi_subtable_proc srat_proc[3];
 
index be17664736b2f12388148580ccb0b2f0450c348e..fa8243c5c062c31b74847a0eb7c87e1f2d30e240 100644 (file)
@@ -777,11 +777,11 @@ static void acpi_freeze_sync(void)
        /*
         * Process all pending events in case there are any wakeup ones.
         *
-        * The EC driver uses the system workqueue, so that one needs to be
-        * flushed too.
+        * The EC driver uses the system workqueue and an additional special
+        * one, so those need to be flushed too.
         */
+       acpi_ec_flush_work();
        acpi_os_wait_events_complete();
-       flush_scheduled_work();
        s2idle_wakeup = false;
 }
 
index aae4d8d4be361b6a38195f165c630e74cefdfdd6..f7665c31fecaf3f46b64e17a821f9b8528def937 100644 (file)
@@ -2200,8 +2200,12 @@ static void binder_transaction(struct binder_proc *proc,
        list_add_tail(&t->work.entry, target_list);
        tcomplete->type = BINDER_WORK_TRANSACTION_COMPLETE;
        list_add_tail(&tcomplete->entry, &thread->todo);
-       if (target_wait)
-               wake_up_interruptible(target_wait);
+       if (target_wait) {
+               if (reply || !(t->flags & TF_ONE_WAY))
+                       wake_up_interruptible_sync(target_wait);
+               else
+                       wake_up_interruptible(target_wait);
+       }
        return;
 
 err_translate_failed:
@@ -3247,10 +3251,6 @@ static long binder_ioctl(struct file *filp, unsigned int cmd, unsigned long arg)
        /*pr_info("binder_ioctl: %d:%d %x %lx\n",
                        proc->pid, current->pid, cmd, arg);*/
 
-       if (unlikely(current->mm != proc->vma_vm_mm)) {
-               pr_err("current mm mismatch proc mm\n");
-               return -EINVAL;
-       }
        trace_binder_ioctl(cmd, arg);
 
        ret = wait_event_interruptible(binder_user_error_wait, binder_stop_on_user_error < 2);
@@ -3464,9 +3464,8 @@ static int binder_open(struct inode *nodp, struct file *filp)
        proc = kzalloc(sizeof(*proc), GFP_KERNEL);
        if (proc == NULL)
                return -ENOMEM;
-       get_task_struct(current);
-       proc->tsk = current;
-       proc->vma_vm_mm = current->mm;
+       get_task_struct(current->group_leader);
+       proc->tsk = current->group_leader;
        INIT_LIST_HEAD(&proc->todo);
        init_waitqueue_head(&proc->wait);
        proc->default_priority = task_nice(current);
index 2ae24c28e70c87901185de6d558545ebe58d8d0b..1c152aed6b8265409a0ab2a677ce4bd0a99d62a9 100644 (file)
@@ -25,7 +25,7 @@ static inline struct dma_coherent_mem *dev_get_coherent_memory(struct device *de
 {
        if (dev && dev->dma_mem)
                return dev->dma_mem;
-       return dma_coherent_default_memory;
+       return NULL;
 }
 
 static inline dma_addr_t dma_get_device_base(struct device *dev,
@@ -165,34 +165,15 @@ void *dma_mark_declared_memory_occupied(struct device *dev,
 }
 EXPORT_SYMBOL(dma_mark_declared_memory_occupied);
 
-/**
- * dma_alloc_from_coherent() - try to allocate memory from the per-device coherent area
- *
- * @dev:       device from which we allocate memory
- * @size:      size of requested memory area
- * @dma_handle:        This will be filled with the correct dma handle
- * @ret:       This pointer will be filled with the virtual address
- *             to allocated area.
- *
- * This function should be only called from per-arch dma_alloc_coherent()
- * to support allocation from per-device coherent memory pools.
- *
- * Returns 0 if dma_alloc_coherent should continue with allocating from
- * generic memory areas, or !0 if dma_alloc_coherent should return @ret.
- */
-int dma_alloc_from_coherent(struct device *dev, ssize_t size,
-                                      dma_addr_t *dma_handle, void **ret)
+static void *__dma_alloc_from_coherent(struct dma_coherent_mem *mem,
+               ssize_t size, dma_addr_t *dma_handle)
 {
-       struct dma_coherent_mem *mem = dev_get_coherent_memory(dev);
        int order = get_order(size);
        unsigned long flags;
        int pageno;
        int dma_memory_map;
+       void *ret;
 
-       if (!mem)
-               return 0;
-
-       *ret = NULL;
        spin_lock_irqsave(&mem->spinlock, flags);
 
        if (unlikely(size > (mem->size << PAGE_SHIFT)))
@@ -203,21 +184,50 @@ int dma_alloc_from_coherent(struct device *dev, ssize_t size,
                goto err;
 
        /*
-        * Memory was found in the per-device area.
+        * Memory was found in the coherent area.
         */
-       *dma_handle = dma_get_device_base(dev, mem) + (pageno << PAGE_SHIFT);
-       *ret = mem->virt_base + (pageno << PAGE_SHIFT);
+       *dma_handle = mem->device_base + (pageno << PAGE_SHIFT);
+       ret = mem->virt_base + (pageno << PAGE_SHIFT);
        dma_memory_map = (mem->flags & DMA_MEMORY_MAP);
        spin_unlock_irqrestore(&mem->spinlock, flags);
        if (dma_memory_map)
-               memset(*ret, 0, size);
+               memset(ret, 0, size);
        else
-               memset_io(*ret, 0, size);
+               memset_io(ret, 0, size);
 
-       return 1;
+       return ret;
 
 err:
        spin_unlock_irqrestore(&mem->spinlock, flags);
+       return NULL;
+}
+
+/**
+ * dma_alloc_from_dev_coherent() - allocate memory from device coherent pool
+ * @dev:       device from which we allocate memory
+ * @size:      size of requested memory area
+ * @dma_handle:        This will be filled with the correct dma handle
+ * @ret:       This pointer will be filled with the virtual address
+ *             to allocated area.
+ *
+ * This function should be only called from per-arch dma_alloc_coherent()
+ * to support allocation from per-device coherent memory pools.
+ *
+ * Returns 0 if dma_alloc_coherent should continue with allocating from
+ * generic memory areas, or !0 if dma_alloc_coherent should return @ret.
+ */
+int dma_alloc_from_dev_coherent(struct device *dev, ssize_t size,
+               dma_addr_t *dma_handle, void **ret)
+{
+       struct dma_coherent_mem *mem = dev_get_coherent_memory(dev);
+
+       if (!mem)
+               return 0;
+
+       *ret = __dma_alloc_from_coherent(mem, size, dma_handle);
+       if (*ret)
+               return 1;
+
        /*
         * In the case where the allocation can not be satisfied from the
         * per-device area, try to fall back to generic memory if the
@@ -225,25 +235,20 @@ err:
         */
        return mem->flags & DMA_MEMORY_EXCLUSIVE;
 }
-EXPORT_SYMBOL(dma_alloc_from_coherent);
+EXPORT_SYMBOL(dma_alloc_from_dev_coherent);
 
-/**
- * dma_release_from_coherent() - try to free the memory allocated from per-device coherent memory pool
- * @dev:       device from which the memory was allocated
- * @order:     the order of pages allocated
- * @vaddr:     virtual address of allocated pages
- *
- * This checks whether the memory was allocated from the per-device
- * coherent memory pool and if so, releases that memory.
- *
- * Returns 1 if we correctly released the memory, or 0 if
- * dma_release_coherent() should proceed with releasing memory from
- * generic pools.
- */
-int dma_release_from_coherent(struct device *dev, int order, void *vaddr)
+void *dma_alloc_from_global_coherent(ssize_t size, dma_addr_t *dma_handle)
 {
-       struct dma_coherent_mem *mem = dev_get_coherent_memory(dev);
+       if (!dma_coherent_default_memory)
+               return NULL;
+
+       return __dma_alloc_from_coherent(dma_coherent_default_memory, size,
+                       dma_handle);
+}
 
+static int __dma_release_from_coherent(struct dma_coherent_mem *mem,
+                                      int order, void *vaddr)
+{
        if (mem && vaddr >= mem->virt_base && vaddr <
                   (mem->virt_base + (mem->size << PAGE_SHIFT))) {
                int page = (vaddr - mem->virt_base) >> PAGE_SHIFT;
@@ -256,28 +261,39 @@ int dma_release_from_coherent(struct device *dev, int order, void *vaddr)
        }
        return 0;
 }
-EXPORT_SYMBOL(dma_release_from_coherent);
 
 /**
- * dma_mmap_from_coherent() - try to mmap the memory allocated from
- * per-device coherent memory pool to userspace
+ * dma_release_from_dev_coherent() - free memory to device coherent memory pool
  * @dev:       device from which the memory was allocated
- * @vma:       vm_area for the userspace memory
- * @vaddr:     cpu address returned by dma_alloc_from_coherent
- * @size:      size of the memory buffer allocated by dma_alloc_from_coherent
- * @ret:       result from remap_pfn_range()
+ * @order:     the order of pages allocated
+ * @vaddr:     virtual address of allocated pages
  *
  * This checks whether the memory was allocated from the per-device
- * coherent memory pool and if so, maps that memory to the provided vma.
+ * coherent memory pool and if so, releases that memory.
  *
- * Returns 1 if we correctly mapped the memory, or 0 if the caller should
- * proceed with mapping memory from generic pools.
+ * Returns 1 if we correctly released the memory, or 0 if the caller should
+ * proceed with releasing memory from generic pools.
  */
-int dma_mmap_from_coherent(struct device *dev, struct vm_area_struct *vma,
-                          void *vaddr, size_t size, int *ret)
+int dma_release_from_dev_coherent(struct device *dev, int order, void *vaddr)
 {
        struct dma_coherent_mem *mem = dev_get_coherent_memory(dev);
 
+       return __dma_release_from_coherent(mem, order, vaddr);
+}
+EXPORT_SYMBOL(dma_release_from_dev_coherent);
+
+int dma_release_from_global_coherent(int order, void *vaddr)
+{
+       if (!dma_coherent_default_memory)
+               return 0;
+
+       return __dma_release_from_coherent(dma_coherent_default_memory, order,
+                       vaddr);
+}
+
+static int __dma_mmap_from_coherent(struct dma_coherent_mem *mem,
+               struct vm_area_struct *vma, void *vaddr, size_t size, int *ret)
+{
        if (mem && vaddr >= mem->virt_base && vaddr + size <=
                   (mem->virt_base + (mem->size << PAGE_SHIFT))) {
                unsigned long off = vma->vm_pgoff;
@@ -296,7 +312,39 @@ int dma_mmap_from_coherent(struct device *dev, struct vm_area_struct *vma,
        }
        return 0;
 }
-EXPORT_SYMBOL(dma_mmap_from_coherent);
+
+/**
+ * dma_mmap_from_dev_coherent() - mmap memory from the device coherent pool
+ * @dev:       device from which the memory was allocated
+ * @vma:       vm_area for the userspace memory
+ * @vaddr:     cpu address returned by dma_alloc_from_dev_coherent
+ * @size:      size of the memory buffer allocated
+ * @ret:       result from remap_pfn_range()
+ *
+ * This checks whether the memory was allocated from the per-device
+ * coherent memory pool and if so, maps that memory to the provided vma.
+ *
+ * Returns 1 if we correctly mapped the memory, or 0 if the caller should
+ * proceed with mapping memory from generic pools.
+ */
+int dma_mmap_from_dev_coherent(struct device *dev, struct vm_area_struct *vma,
+                          void *vaddr, size_t size, int *ret)
+{
+       struct dma_coherent_mem *mem = dev_get_coherent_memory(dev);
+
+       return __dma_mmap_from_coherent(mem, vma, vaddr, size, ret);
+}
+EXPORT_SYMBOL(dma_mmap_from_dev_coherent);
+
+int dma_mmap_from_global_coherent(struct vm_area_struct *vma, void *vaddr,
+                                  size_t size, int *ret)
+{
+       if (!dma_coherent_default_memory)
+               return 0;
+
+       return __dma_mmap_from_coherent(dma_coherent_default_memory, vma,
+                                       vaddr, size, ret);
+}
 
 /*
  * Support for reserved memory regions defined in device tree
index 5096755d185e0c1a597d25189547ab797b568f36..b555ff9dd8fceb176af2f567157165726e9ab314 100644 (file)
@@ -235,7 +235,7 @@ int dma_common_mmap(struct device *dev, struct vm_area_struct *vma,
 
        vma->vm_page_prot = pgprot_noncached(vma->vm_page_prot);
 
-       if (dma_mmap_from_coherent(dev, vma, cpu_addr, size, &ret))
+       if (dma_mmap_from_dev_coherent(dev, vma, cpu_addr, size, &ret))
                return ret;
 
        if (off < count && user_count <= (count - off)) {
index 4e02aa5fdac053dfa254fb05aac1b2c252e4c1be..1498b899a593e31951c835f4f537d1bb03d0e596 100644 (file)
@@ -541,12 +541,9 @@ virtblk_cache_type_store(struct device *dev, struct device_attribute *attr,
        int i;
 
        BUG_ON(!virtio_has_feature(vblk->vdev, VIRTIO_BLK_F_CONFIG_WCE));
-       for (i = ARRAY_SIZE(virtblk_cache_types); --i >= 0; )
-               if (sysfs_streq(buf, virtblk_cache_types[i]))
-                       break;
-
+       i = sysfs_match_string(virtblk_cache_types, buf);
        if (i < 0)
-               return -EINVAL;
+               return i;
 
        virtio_cwrite8(vdev, offsetof(struct virtio_blk_config, wce), i);
        virtblk_update_cache_mode(vdev);
index a485864cb5125cd5612656e8064d62cc9408249a..06432d84cbf8c58215fdd7e1fcd07ab85926ad91 100644 (file)
@@ -532,7 +532,7 @@ static inline uint32_t fsi_smode_sid(int x)
        return (x & FSI_SMODE_SID_MASK) << FSI_SMODE_SID_SHIFT;
 }
 
-static const uint32_t fsi_slave_smode(int id)
+static uint32_t fsi_slave_smode(int id)
 {
        return FSI_SMODE_WSC | FSI_SMODE_ECRC
                | fsi_smode_sid(id)
@@ -883,17 +883,16 @@ struct bus_type fsi_bus_type = {
 };
 EXPORT_SYMBOL_GPL(fsi_bus_type);
 
-static int fsi_init(void)
+static int __init fsi_init(void)
 {
        return bus_register(&fsi_bus_type);
 }
+postcore_initcall(fsi_init);
 
 static void fsi_exit(void)
 {
        bus_unregister(&fsi_bus_type);
 }
-
-module_init(fsi_init);
 module_exit(fsi_exit);
 module_param(discard_errors, int, 0664);
 MODULE_LICENSE("GPL");
index f621ee115c98d4e5d5a4faa0d845864dc65a0b8c..5e771bc11b0054aa667bb75291da4cb9911521df 100644 (file)
@@ -198,12 +198,16 @@ amdgpu_bo_list_get(struct amdgpu_fpriv *fpriv, int id)
        result = idr_find(&fpriv->bo_list_handles, id);
 
        if (result) {
-               if (kref_get_unless_zero(&result->refcount))
+               if (kref_get_unless_zero(&result->refcount)) {
+                       rcu_read_unlock();
                        mutex_lock(&result->lock);
-               else
+               } else {
+                       rcu_read_unlock();
                        result = NULL;
+               }
+       } else {
+               rcu_read_unlock();
        }
-       rcu_read_unlock();
 
        return result;
 }
index 3a0b69b09ed62ed9dd18a8b4dbfad595b7d30030..c9b9c88231aa5070b709e97ce558a78fcfb43097 100644 (file)
@@ -1475,21 +1475,23 @@ static void gfx_v9_0_tiling_mode_table_init(struct amdgpu_device *adev)
 
 static void gfx_v9_0_select_se_sh(struct amdgpu_device *adev, u32 se_num, u32 sh_num, u32 instance)
 {
-       u32 data = REG_SET_FIELD(0, GRBM_GFX_INDEX, INSTANCE_BROADCAST_WRITES, 1);
+       u32 data;
 
-       if ((se_num == 0xffffffff) && (sh_num == 0xffffffff)) {
-               data = REG_SET_FIELD(data, GRBM_GFX_INDEX, SH_BROADCAST_WRITES, 1);
-               data = REG_SET_FIELD(data, GRBM_GFX_INDEX, SE_BROADCAST_WRITES, 1);
-       } else if (se_num == 0xffffffff) {
-               data = REG_SET_FIELD(data, GRBM_GFX_INDEX, SH_INDEX, sh_num);
+       if (instance == 0xffffffff)
+               data = REG_SET_FIELD(0, GRBM_GFX_INDEX, INSTANCE_BROADCAST_WRITES, 1);
+       else
+               data = REG_SET_FIELD(0, GRBM_GFX_INDEX, INSTANCE_INDEX, instance);
+
+       if (se_num == 0xffffffff)
                data = REG_SET_FIELD(data, GRBM_GFX_INDEX, SE_BROADCAST_WRITES, 1);
-       } else if (sh_num == 0xffffffff) {
-               data = REG_SET_FIELD(data, GRBM_GFX_INDEX, SH_BROADCAST_WRITES, 1);
+       else
                data = REG_SET_FIELD(data, GRBM_GFX_INDEX, SE_INDEX, se_num);
-       } else {
+
+       if (sh_num == 0xffffffff)
+               data = REG_SET_FIELD(data, GRBM_GFX_INDEX, SH_BROADCAST_WRITES, 1);
+       else
                data = REG_SET_FIELD(data, GRBM_GFX_INDEX, SH_INDEX, sh_num);
-               data = REG_SET_FIELD(data, GRBM_GFX_INDEX, SE_INDEX, se_num);
-       }
+
        WREG32_SOC15(GC, 0, mmGRBM_GFX_INDEX, data);
 }
 
index d6f097f44b6cfe8587b64c16cfa6af4663c729e7..197174e562d208e773492f9da2280fd03414c540 100644 (file)
@@ -2128,15 +2128,9 @@ static int vega10_populate_avfs_parameters(struct pp_hwmgr *hwmgr)
                        pp_table->AvfsGbCksOff.m2_shift = 12;
                        pp_table->AvfsGbCksOff.b_shift = 0;
 
-                       for (i = 0; i < dep_table->count; i++) {
-                               if (dep_table->entries[i].sclk_offset == 0)
-                                       pp_table->StaticVoltageOffsetVid[i] = 248;
-                               else
-                                       pp_table->StaticVoltageOffsetVid[i] =
-                                               (uint8_t)(dep_table->entries[i].sclk_offset *
-                                                               VOLTAGE_VID_OFFSET_SCALE2 /
-                                                               VOLTAGE_VID_OFFSET_SCALE1);
-                       }
+                       for (i = 0; i < dep_table->count; i++)
+                               pp_table->StaticVoltageOffsetVid[i] =
+                                               convert_to_vid((uint8_t)(dep_table->entries[i].sclk_offset));
 
                        if ((PPREGKEY_VEGA10QUADRATICEQUATION_DFLT !=
                                        data->disp_clk_quad_eqn_a) &&
index 213fb837e1c40fe79bf536d54b083d99dee1c192..08af8d6b844b67e0653f93c5dc012706d9a13b19 100644 (file)
@@ -544,7 +544,7 @@ void drm_dp_downstream_debug(struct seq_file *m,
                                 DP_DETAILED_CAP_INFO_AVAILABLE;
        int clk;
        int bpc;
-       char id[6];
+       char id[7];
        int len;
        uint8_t rev[2];
        int type = port_cap[0] & DP_DS_PORT_TYPE_MASK;
@@ -583,6 +583,7 @@ void drm_dp_downstream_debug(struct seq_file *m,
                seq_puts(m, "\t\tType: N/A\n");
        }
 
+       memset(id, 0, sizeof(id));
        drm_dp_downstream_id(aux, id);
        seq_printf(m, "\t\tID: %s\n", id);
 
@@ -591,7 +592,7 @@ void drm_dp_downstream_debug(struct seq_file *m,
                seq_printf(m, "\t\tHW: %d.%d\n",
                           (rev[0] & 0xf0) >> 4, rev[0] & 0xf);
 
-       len = drm_dp_dpcd_read(aux, DP_BRANCH_SW_REV, &rev, 2);
+       len = drm_dp_dpcd_read(aux, DP_BRANCH_SW_REV, rev, 2);
        if (len > 0)
                seq_printf(m, "\t\tSW: %d.%d\n", rev[0], rev[1]);
 
index 1d185347c64c06f7b749061909390ea0953ed3f8..305dc3d4ff772a7fe8a1ad80b9a2897f04a4cca1 100644 (file)
@@ -75,6 +75,7 @@ config DRM_EXYNOS_DP
 config DRM_EXYNOS_HDMI
        bool "HDMI"
        depends on DRM_EXYNOS_MIXER || DRM_EXYNOS5433_DECON
+       select CEC_CORE if CEC_NOTIFIER
        help
          Choose this option if you want to use Exynos HDMI for DRM.
 
index 35a8dfc93836d83f0223d3e030dea597d57abb55..242bd50faa26018bee34e3ff54faf7b3eaa5dbac 100644 (file)
@@ -453,7 +453,6 @@ static int exynos_drm_platform_probe(struct platform_device *pdev)
        struct component_match *match;
 
        pdev->dev.coherent_dma_mask = DMA_BIT_MASK(32);
-       exynos_drm_driver.num_ioctls = ARRAY_SIZE(exynos_ioctls);
 
        match = exynos_drm_match_add(&pdev->dev);
        if (IS_ERR(match))
index a11b79596e2f8d483c113b78d1df7568d59a48d4..b6a46d9a016e57982f69a6e6a02444996cb19cb5 100644 (file)
@@ -1651,8 +1651,6 @@ static int exynos_dsi_parse_dt(struct exynos_dsi *dsi)
                return ret;
 
        dsi->bridge_node = of_graph_get_remote_node(node, DSI_PORT_IN, 0);
-       if (!dsi->bridge_node)
-               return -EINVAL;
 
        return 0;
 }
@@ -1687,9 +1685,11 @@ static int exynos_dsi_bind(struct device *dev, struct device *master,
                return ret;
        }
 
-       bridge = of_drm_find_bridge(dsi->bridge_node);
-       if (bridge)
-               drm_bridge_attach(encoder, bridge, NULL);
+       if (dsi->bridge_node) {
+               bridge = of_drm_find_bridge(dsi->bridge_node);
+               if (bridge)
+                       drm_bridge_attach(encoder, bridge, NULL);
+       }
 
        return mipi_dsi_host_register(&dsi->dsi_host);
 }
index e45720543a453d22c29150807815666ca0afffd9..16bbee897e0db9e7b3025f039a047e6580a59e3b 100644 (file)
@@ -340,16 +340,10 @@ static int exynos_mic_bind(struct device *dev, struct device *master,
                           void *data)
 {
        struct exynos_mic *mic = dev_get_drvdata(dev);
-       int ret;
 
-       mic->bridge.funcs = &mic_bridge_funcs;
-       mic->bridge.of_node = dev->of_node;
        mic->bridge.driver_private = mic;
-       ret = drm_bridge_add(&mic->bridge);
-       if (ret)
-               DRM_ERROR("mic: Failed to add MIC to the global bridge list\n");
 
-       return ret;
+       return 0;
 }
 
 static void exynos_mic_unbind(struct device *dev, struct device *master,
@@ -365,8 +359,6 @@ static void exynos_mic_unbind(struct device *dev, struct device *master,
 
 already_disabled:
        mutex_unlock(&mic_mutex);
-
-       drm_bridge_remove(&mic->bridge);
 }
 
 static const struct component_ops exynos_mic_component_ops = {
@@ -461,6 +453,15 @@ static int exynos_mic_probe(struct platform_device *pdev)
 
        platform_set_drvdata(pdev, mic);
 
+       mic->bridge.funcs = &mic_bridge_funcs;
+       mic->bridge.of_node = dev->of_node;
+
+       ret = drm_bridge_add(&mic->bridge);
+       if (ret) {
+               DRM_ERROR("mic: Failed to add MIC to the global bridge list\n");
+               return ret;
+       }
+
        pm_runtime_enable(dev);
 
        ret = component_add(dev, &exynos_mic_component_ops);
@@ -479,8 +480,13 @@ err:
 
 static int exynos_mic_remove(struct platform_device *pdev)
 {
+       struct exynos_mic *mic = platform_get_drvdata(pdev);
+
        component_del(&pdev->dev, &exynos_mic_component_ops);
        pm_runtime_disable(&pdev->dev);
+
+       drm_bridge_remove(&mic->bridge);
+
        return 0;
 }
 
index 06bfbe400cf1d2ea23ec361a0fa1364a139ac43d..d3b69d66736fc9f71fbbb4c7aa0e86646035a7e4 100644 (file)
@@ -1501,8 +1501,6 @@ static void hdmi_disable(struct drm_encoder *encoder)
         */
        cancel_delayed_work(&hdata->hotplug_work);
        cec_notifier_set_phys_addr(hdata->notifier, CEC_PHYS_ADDR_INVALID);
-
-       hdmiphy_disable(hdata);
 }
 
 static const struct drm_encoder_helper_funcs exynos_hdmi_encoder_helper_funcs = {
@@ -1676,7 +1674,7 @@ static int hdmi_resources_init(struct hdmi_context *hdata)
        return hdmi_bridge_init(hdata);
 }
 
-static struct of_device_id hdmi_match_types[] = {
+static const struct of_device_id hdmi_match_types[] = {
        {
                .compatible = "samsung,exynos4210-hdmi",
                .data = &exynos4210_hdmi_driver_data,
@@ -1934,8 +1932,7 @@ static int hdmi_remove(struct platform_device *pdev)
        return 0;
 }
 
-#ifdef CONFIG_PM
-static int exynos_hdmi_suspend(struct device *dev)
+static int __maybe_unused exynos_hdmi_suspend(struct device *dev)
 {
        struct hdmi_context *hdata = dev_get_drvdata(dev);
 
@@ -1944,7 +1941,7 @@ static int exynos_hdmi_suspend(struct device *dev)
        return 0;
 }
 
-static int exynos_hdmi_resume(struct device *dev)
+static int __maybe_unused exynos_hdmi_resume(struct device *dev)
 {
        struct hdmi_context *hdata = dev_get_drvdata(dev);
        int ret;
@@ -1955,7 +1952,6 @@ static int exynos_hdmi_resume(struct device *dev)
 
        return 0;
 }
-#endif
 
 static const struct dev_pm_ops exynos_hdmi_pm_ops = {
        SET_RUNTIME_PM_OPS(exynos_hdmi_suspend, exynos_hdmi_resume, NULL)
index 6bed4f3ffcd6bd8592c51ee398a3ccdbe10355e1..a998a8dd783cbc347792f88d56141ca34e4716e1 100644 (file)
@@ -1094,28 +1094,28 @@ static const struct exynos_drm_crtc_ops mixer_crtc_ops = {
        .atomic_check           = mixer_atomic_check,
 };
 
-static struct mixer_drv_data exynos5420_mxr_drv_data = {
+static const struct mixer_drv_data exynos5420_mxr_drv_data = {
        .version = MXR_VER_128_0_0_184,
        .is_vp_enabled = 0,
 };
 
-static struct mixer_drv_data exynos5250_mxr_drv_data = {
+static const struct mixer_drv_data exynos5250_mxr_drv_data = {
        .version = MXR_VER_16_0_33_0,
        .is_vp_enabled = 0,
 };
 
-static struct mixer_drv_data exynos4212_mxr_drv_data = {
+static const struct mixer_drv_data exynos4212_mxr_drv_data = {
        .version = MXR_VER_0_0_0_16,
        .is_vp_enabled = 1,
 };
 
-static struct mixer_drv_data exynos4210_mxr_drv_data = {
+static const struct mixer_drv_data exynos4210_mxr_drv_data = {
        .version = MXR_VER_0_0_0_16,
        .is_vp_enabled = 1,
        .has_sclk = 1,
 };
 
-static struct of_device_id mixer_match_types[] = {
+static const struct of_device_id mixer_match_types[] = {
        {
                .compatible = "samsung,exynos4210-mixer",
                .data   = &exynos4210_mxr_drv_data,
index 2deb05f618fb11054064122a4b86f468d148c73b..7cb0818a13debecc1d3f08e4fb10042a3536b1e9 100644 (file)
@@ -323,27 +323,27 @@ void intel_gvt_check_vblank_emulation(struct intel_gvt *gvt)
 {
        struct intel_gvt_irq *irq = &gvt->irq;
        struct intel_vgpu *vgpu;
-       bool have_enabled_pipe = false;
        int pipe, id;
 
        if (WARN_ON(!mutex_is_locked(&gvt->lock)))
                return;
 
-       hrtimer_cancel(&irq->vblank_timer.timer);
-
        for_each_active_vgpu(gvt, vgpu, id) {
                for (pipe = 0; pipe < I915_MAX_PIPES; pipe++) {
-                       have_enabled_pipe =
-                               pipe_is_enabled(vgpu, pipe);
-                       if (have_enabled_pipe)
-                               break;
+                       if (pipe_is_enabled(vgpu, pipe))
+                               goto out;
                }
        }
 
-       if (have_enabled_pipe)
-               hrtimer_start(&irq->vblank_timer.timer,
-                       ktime_add_ns(ktime_get(), irq->vblank_timer.period),
-                       HRTIMER_MODE_ABS);
+       /* all the pipes are disabled */
+       hrtimer_cancel(&irq->vblank_timer.timer);
+       return;
+
+out:
+       hrtimer_start(&irq->vblank_timer.timer,
+               ktime_add_ns(ktime_get(), irq->vblank_timer.period),
+               HRTIMER_MODE_ABS);
+
 }
 
 static void emulate_vblank_on_pipe(struct intel_vgpu *vgpu, int pipe)
index 152f16c11878ef937e48b9139c9b8ab844322df3..348b29a845c961c73b1605b23212692b438f0f19 100644 (file)
@@ -114,7 +114,7 @@ i915_clflush_notify(struct i915_sw_fence *fence,
        return NOTIFY_DONE;
 }
 
-void i915_gem_clflush_object(struct drm_i915_gem_object *obj,
+bool i915_gem_clflush_object(struct drm_i915_gem_object *obj,
                             unsigned int flags)
 {
        struct clflush *clflush;
@@ -128,7 +128,7 @@ void i915_gem_clflush_object(struct drm_i915_gem_object *obj,
         */
        if (!i915_gem_object_has_struct_page(obj)) {
                obj->cache_dirty = false;
-               return;
+               return false;
        }
 
        /* If the GPU is snooping the contents of the CPU cache,
@@ -140,7 +140,7 @@ void i915_gem_clflush_object(struct drm_i915_gem_object *obj,
         * tracking.
         */
        if (!(flags & I915_CLFLUSH_FORCE) && obj->cache_coherent)
-               return;
+               return false;
 
        trace_i915_gem_object_clflush(obj);
 
@@ -179,4 +179,5 @@ void i915_gem_clflush_object(struct drm_i915_gem_object *obj,
        }
 
        obj->cache_dirty = false;
+       return true;
 }
index 2455a7820937b0f461839de713693a9010950997..f390247561b37691d615fe0182d47cf40bcc4277 100644 (file)
@@ -28,7 +28,7 @@
 struct drm_i915_private;
 struct drm_i915_gem_object;
 
-void i915_gem_clflush_object(struct drm_i915_gem_object *obj,
+bool i915_gem_clflush_object(struct drm_i915_gem_object *obj,
                             unsigned int flags);
 #define I915_CLFLUSH_FORCE BIT(0)
 #define I915_CLFLUSH_SYNC BIT(1)
index 054b2e54cdafd765e82f9a86276c863744f3cd14..e9503f6d110016b86311003349ff5b8ef70613d5 100644 (file)
@@ -560,9 +560,6 @@ static int eb_reserve_vma(const struct i915_execbuffer *eb,
                eb->args->flags |= __EXEC_HAS_RELOC;
        }
 
-       entry->flags |= __EXEC_OBJECT_HAS_PIN;
-       GEM_BUG_ON(eb_vma_misplaced(entry, vma));
-
        if (unlikely(entry->flags & EXEC_OBJECT_NEEDS_FENCE)) {
                err = i915_vma_get_fence(vma);
                if (unlikely(err)) {
@@ -574,6 +571,9 @@ static int eb_reserve_vma(const struct i915_execbuffer *eb,
                        entry->flags |= __EXEC_OBJECT_HAS_FENCE;
        }
 
+       entry->flags |= __EXEC_OBJECT_HAS_PIN;
+       GEM_BUG_ON(eb_vma_misplaced(entry, vma));
+
        return 0;
 }
 
@@ -1458,7 +1458,7 @@ static int eb_relocate_vma(struct i915_execbuffer *eb, struct i915_vma *vma)
         * to read. However, if the array is not writable the user loses
         * the updated relocation values.
         */
-       if (unlikely(!access_ok(VERIFY_READ, urelocs, remain*sizeof(urelocs))))
+       if (unlikely(!access_ok(VERIFY_READ, urelocs, remain*sizeof(*urelocs))))
                return -EFAULT;
 
        do {
@@ -1775,7 +1775,7 @@ out:
                }
        }
 
-       return err ?: have_copy;
+       return err;
 }
 
 static int eb_relocate(struct i915_execbuffer *eb)
@@ -1825,7 +1825,7 @@ static int eb_move_to_gpu(struct i915_execbuffer *eb)
        int err;
 
        for (i = 0; i < count; i++) {
-               const struct drm_i915_gem_exec_object2 *entry = &eb->exec[i];
+               struct drm_i915_gem_exec_object2 *entry = &eb->exec[i];
                struct i915_vma *vma = exec_to_vma(entry);
                struct drm_i915_gem_object *obj = vma->obj;
 
@@ -1841,12 +1841,14 @@ static int eb_move_to_gpu(struct i915_execbuffer *eb)
                        eb->request->capture_list = capture;
                }
 
+               if (unlikely(obj->cache_dirty && !obj->cache_coherent)) {
+                       if (i915_gem_clflush_object(obj, 0))
+                               entry->flags &= ~EXEC_OBJECT_ASYNC;
+               }
+
                if (entry->flags & EXEC_OBJECT_ASYNC)
                        goto skip_flushes;
 
-               if (unlikely(obj->cache_dirty && !obj->cache_coherent))
-                       i915_gem_clflush_object(obj, 0);
-
                err = i915_gem_request_await_object
                        (eb->request, obj, entry->flags & EXEC_OBJECT_WRITE);
                if (err)
@@ -2209,7 +2211,7 @@ i915_gem_do_execbuffer(struct drm_device *dev,
                goto err_unlock;
 
        err = eb_relocate(&eb);
-       if (err)
+       if (err) {
                /*
                 * If the user expects the execobject.offset and
                 * reloc.presumed_offset to be an exact match,
@@ -2218,8 +2220,8 @@ i915_gem_do_execbuffer(struct drm_device *dev,
                 * relocation.
                 */
                args->flags &= ~__EXEC_HAS_RELOC;
-       if (err < 0)
                goto err_vma;
+       }
 
        if (unlikely(eb.batch->exec_entry->flags & EXEC_OBJECT_WRITE)) {
                DRM_DEBUG("Attempting to use self-modifying batch buffer\n");
index 4a673fc1a4320f957595dffe5ff8c7c53fa20adf..20cf272c97b1f8e16328a0304d25539797f07631 100644 (file)
@@ -284,12 +284,12 @@ static inline void __i915_vma_pin(struct i915_vma *vma)
 
 static inline void __i915_vma_unpin(struct i915_vma *vma)
 {
-       GEM_BUG_ON(!i915_vma_is_pinned(vma));
        vma->flags--;
 }
 
 static inline void i915_vma_unpin(struct i915_vma *vma)
 {
+       GEM_BUG_ON(!i915_vma_is_pinned(vma));
        GEM_BUG_ON(!drm_mm_node_allocated(&vma->node));
        __i915_vma_unpin(vma);
 }
index 80e96f1f49d2d09deb59ec08e6ebe78ac07b8cf3..9edeaaef77adf6c38e23733769e271147698f02a 100644 (file)
@@ -1896,8 +1896,8 @@ static void cnl_ddi_vswing_sequence(struct intel_encoder *encoder, u32 level)
                val = I915_READ(CNL_PORT_TX_DW4_LN(port, ln));
                val &= ~LOADGEN_SELECT;
 
-               if (((rate < 600000) && (width == 4) && (ln >= 1))  ||
-                   ((rate < 600000) && (width < 4) && ((ln == 1) || (ln == 2)))) {
+               if ((rate <= 600000 && width == 4 && ln >= 1)  ||
+                   (rate <= 600000 && width < 4 && (ln == 1 || ln == 2))) {
                        val |= LOADGEN_SELECT;
                }
                I915_WRITE(CNL_PORT_TX_DW4_LN(port, ln), val);
index dec9e58545a111b6f8d5aa9957c924d9e2ebcf16..9471c88d449eaf84adf3411d61135bf090be9b96 100644 (file)
@@ -3427,26 +3427,6 @@ static void intel_complete_page_flips(struct drm_i915_private *dev_priv)
                intel_finish_page_flip_cs(dev_priv, crtc->pipe);
 }
 
-static void intel_update_primary_planes(struct drm_device *dev)
-{
-       struct drm_crtc *crtc;
-
-       for_each_crtc(dev, crtc) {
-               struct intel_plane *plane = to_intel_plane(crtc->primary);
-               struct intel_plane_state *plane_state =
-                       to_intel_plane_state(plane->base.state);
-
-               if (plane_state->base.visible) {
-                       trace_intel_update_plane(&plane->base,
-                                                to_intel_crtc(crtc));
-
-                       plane->update_plane(plane,
-                                           to_intel_crtc_state(crtc->state),
-                                           plane_state);
-               }
-       }
-}
-
 static int
 __intel_display_resume(struct drm_device *dev,
                       struct drm_atomic_state *state,
@@ -3499,6 +3479,12 @@ void intel_prepare_reset(struct drm_i915_private *dev_priv)
        struct drm_atomic_state *state;
        int ret;
 
+
+       /* reset doesn't touch the display */
+       if (!i915.force_reset_modeset_test &&
+           !gpu_reset_clobbers_display(dev_priv))
+               return;
+
        /*
         * Need mode_config.mutex so that we don't
         * trample ongoing ->detect() and whatnot.
@@ -3512,12 +3498,6 @@ void intel_prepare_reset(struct drm_i915_private *dev_priv)
 
                drm_modeset_backoff(ctx);
        }
-
-       /* reset doesn't touch the display, but flips might get nuked anyway, */
-       if (!i915.force_reset_modeset_test &&
-           !gpu_reset_clobbers_display(dev_priv))
-               return;
-
        /*
         * Disabling the crtcs gracefully seems nicer. Also the
         * g33 docs say we should at least disable all the planes.
@@ -3547,6 +3527,14 @@ void intel_finish_reset(struct drm_i915_private *dev_priv)
        struct drm_atomic_state *state = dev_priv->modeset_restore_state;
        int ret;
 
+       /* reset doesn't touch the display */
+       if (!i915.force_reset_modeset_test &&
+           !gpu_reset_clobbers_display(dev_priv))
+               return;
+
+       if (!state)
+               goto unlock;
+
        /*
         * Flips in the rings will be nuked by the reset,
         * so complete all pending flips so that user space
@@ -3558,22 +3546,10 @@ void intel_finish_reset(struct drm_i915_private *dev_priv)
 
        /* reset doesn't touch the display */
        if (!gpu_reset_clobbers_display(dev_priv)) {
-               if (!state) {
-                       /*
-                        * Flips in the rings have been nuked by the reset,
-                        * so update the base address of all primary
-                        * planes to the the last fb to make sure we're
-                        * showing the correct fb after a reset.
-                        *
-                        * FIXME: Atomic will make this obsolete since we won't schedule
-                        * CS-based flips (which might get lost in gpu resets) any more.
-                        */
-                       intel_update_primary_planes(dev);
-               } else {
-                       ret = __intel_display_resume(dev, state, ctx);
+               /* for testing only restore the display */
+               ret = __intel_display_resume(dev, state, ctx);
                        if (ret)
                                DRM_ERROR("Restoring old state failed with %i\n", ret);
-               }
        } else {
                /*
                 * The display has been reset as well,
@@ -3597,8 +3573,8 @@ void intel_finish_reset(struct drm_i915_private *dev_priv)
                intel_hpd_init(dev_priv);
        }
 
-       if (state)
-               drm_atomic_state_put(state);
+       drm_atomic_state_put(state);
+unlock:
        drm_modeset_drop_locks(ctx);
        drm_modeset_acquire_fini(ctx);
        mutex_unlock(&dev->mode_config.mutex);
@@ -9117,6 +9093,13 @@ static bool haswell_get_pipe_config(struct intel_crtc *crtc,
        u64 power_domain_mask;
        bool active;
 
+       if (INTEL_GEN(dev_priv) >= 9) {
+               intel_crtc_init_scalers(crtc, pipe_config);
+
+               pipe_config->scaler_state.scaler_id = -1;
+               pipe_config->scaler_state.scaler_users &= ~(1 << SKL_CRTC_INDEX);
+       }
+
        power_domain = POWER_DOMAIN_PIPE(crtc->pipe);
        if (!intel_display_power_get_if_enabled(dev_priv, power_domain))
                return false;
@@ -9145,13 +9128,6 @@ static bool haswell_get_pipe_config(struct intel_crtc *crtc,
        pipe_config->gamma_mode =
                I915_READ(GAMMA_MODE(crtc->pipe)) & GAMMA_MODE_MODE_MASK;
 
-       if (INTEL_GEN(dev_priv) >= 9) {
-               intel_crtc_init_scalers(crtc, pipe_config);
-
-               pipe_config->scaler_state.scaler_id = -1;
-               pipe_config->scaler_state.scaler_users &= ~(1 << SKL_CRTC_INDEX);
-       }
-
        power_domain = POWER_DOMAIN_PIPE_PANEL_FITTER(crtc->pipe);
        if (intel_display_power_get_if_enabled(dev_priv, power_domain)) {
                power_domain_mask |= BIT_ULL(power_domain);
@@ -9540,7 +9516,16 @@ static void i9xx_update_cursor(struct intel_plane *plane,
         * On some platforms writing CURCNTR first will also
         * cause CURPOS to be armed by the CURBASE write.
         * Without the CURCNTR write the CURPOS write would
-        * arm itself.
+        * arm itself. Thus we always start the full update
+        * with a CURCNTR write.
+        *
+        * On other platforms CURPOS always requires the
+        * CURBASE write to arm the update. Additonally
+        * a write to any of the cursor register will cancel
+        * an already armed cursor update. Thus leaving out
+        * the CURBASE write after CURPOS could lead to a
+        * cursor that doesn't appear to move, or even change
+        * shape. Thus we always write CURBASE.
         *
         * CURCNTR and CUR_FBC_CTL are always
         * armed by the CURBASE write only.
@@ -9559,6 +9544,7 @@ static void i9xx_update_cursor(struct intel_plane *plane,
                plane->cursor.cntl = cntl;
        } else {
                I915_WRITE_FW(CURPOS(pipe), pos);
+               I915_WRITE_FW(CURBASE(pipe), base);
        }
 
        POSTING_READ_FW(CURBASE(pipe));
index 52d5b82790d9fa5461a3c75977b320bd4348d407..c17ed0e62b6757b678272056326062c74f71ee6b 100644 (file)
@@ -45,7 +45,7 @@ static bool is_supported_device(struct drm_i915_private *dev_priv)
                return true;
        if (IS_SKYLAKE(dev_priv))
                return true;
-       if (IS_KABYLAKE(dev_priv) && INTEL_DEVID(dev_priv) == 0x591D)
+       if (IS_KABYLAKE(dev_priv))
                return true;
        return false;
 }
index 48ea0fca1f7239eb502b8269d57b95520ddb5708..40b224b44d1bec1bd08e970be65fe775f3a4c12e 100644 (file)
@@ -4463,8 +4463,8 @@ static int skl_compute_plane_wm(const struct drm_i915_private *dev_priv,
                if ((cpp * cstate->base.adjusted_mode.crtc_htotal / 512 < 1) &&
                    (plane_bytes_per_line / 512 < 1))
                        selected_result = method2;
-               else if ((ddb_allocation && ddb_allocation /
-                       fixed_16_16_to_u32_round_up(plane_blocks_per_line)) >= 1)
+               else if (ddb_allocation >=
+                        fixed_16_16_to_u32_round_up(plane_blocks_per_line))
                        selected_result = min_fixed_16_16(method1, method2);
                else if (latency >= linetime_us)
                        selected_result = min_fixed_16_16(method1, method2);
index 627e2aa097665f7667f2cf6a834112dd28ac1a3a..8cdec455cf7d557a1f55cf090357b8be1d3f114b 100644 (file)
@@ -206,7 +206,7 @@ struct drm_i915_private *mock_gem_device(void)
        mkwrite_device_info(i915)->ring_mask = BIT(0);
        i915->engine[RCS] = mock_engine(i915, "mock");
        if (!i915->engine[RCS])
-               goto err_dependencies;
+               goto err_priorities;
 
        i915->kernel_context = mock_context(i915, NULL);
        if (!i915->kernel_context)
index 147b22163f9f6839419ebe3051f492f20fd9e0eb..dab78c660dd63d2c938d6b33524c3aa5de048633 100644 (file)
@@ -1158,8 +1158,6 @@ nouveau_connector_aux_xfer(struct drm_dp_aux *obj, struct drm_dp_aux_msg *msg)
                return -ENODEV;
        if (WARN_ON(msg->size > 16))
                return -E2BIG;
-       if (msg->size == 0)
-               return msg->size;
 
        ret = nvkm_i2c_aux_acquire(aux);
        if (ret)
index 8d1df5678eaaa7291eaf64ce71d39d79cccd60ca..f362c9fa8b3bb42a10dd2ea63c378f1b5d8255fb 100644 (file)
@@ -409,7 +409,6 @@ nouveau_display_fini(struct drm_device *dev, bool suspend)
        struct nouveau_display *disp = nouveau_display(dev);
        struct nouveau_drm *drm = nouveau_drm(dev);
        struct drm_connector *connector;
-       struct drm_crtc *crtc;
 
        if (!suspend) {
                if (drm_drv_uses_atomic_modeset(dev))
@@ -418,10 +417,6 @@ nouveau_display_fini(struct drm_device *dev, bool suspend)
                        drm_crtc_force_disable_all(dev);
        }
 
-       /* Make sure that drm and hw vblank irqs get properly disabled. */
-       drm_for_each_crtc(crtc, dev)
-               drm_crtc_vblank_off(crtc);
-
        /* disable flip completion events */
        nvif_notify_put(&drm->flip);
 
index e3132a2ce34d60acb9eb75cdf83ec1506e8f874b..2bc0dc9852144cfe0825b5da075333d9e85c5b9c 100644 (file)
@@ -3674,15 +3674,24 @@ nv50_sor_create(struct drm_connector *connector, struct dcb_output *dcbe)
        drm_mode_connector_attach_encoder(connector, encoder);
 
        if (dcbe->type == DCB_OUTPUT_DP) {
+               struct nv50_disp *disp = nv50_disp(encoder->dev);
                struct nvkm_i2c_aux *aux =
                        nvkm_i2c_aux_find(i2c, dcbe->i2c_index);
                if (aux) {
-                       nv_encoder->i2c = &nv_connector->aux.ddc;
+                       if (disp->disp->oclass < GF110_DISP) {
+                               /* HW has no support for address-only
+                                * transactions, so we're required to
+                                * use custom I2C-over-AUX code.
+                                */
+                               nv_encoder->i2c = &aux->i2c;
+                       } else {
+                               nv_encoder->i2c = &nv_connector->aux.ddc;
+                       }
                        nv_encoder->aux = aux;
                }
 
                /*TODO: Use DP Info Table to check for support. */
-               if (nv50_disp(encoder->dev)->disp->oclass >= GF110_DISP) {
+               if (disp->disp->oclass >= GF110_DISP) {
                        ret = nv50_mstm_new(nv_encoder, &nv_connector->aux, 16,
                                            nv_connector->base.base.id,
                                            &nv_encoder->dp.mstm);
@@ -3931,6 +3940,8 @@ nv50_disp_atomic_commit_tail(struct drm_atomic_state *state)
 
                NV_ATOMIC(drm, "%s: clr %04x (set %04x)\n", crtc->name,
                          asyh->clr.mask, asyh->set.mask);
+               if (crtc_state->active && !asyh->state.active)
+                       drm_crtc_vblank_off(crtc);
 
                if (asyh->clr.mask) {
                        nv50_head_flush_clr(head, asyh, atom->flush_disable);
@@ -4016,11 +4027,13 @@ nv50_disp_atomic_commit_tail(struct drm_atomic_state *state)
                        nv50_head_flush_set(head, asyh);
                        interlock_core = 1;
                }
-       }
 
-       for_each_crtc_in_state(state, crtc, crtc_state, i) {
-               if (crtc->state->event)
-                       drm_crtc_vblank_get(crtc);
+               if (asyh->state.active) {
+                       if (!crtc_state->active)
+                               drm_crtc_vblank_on(crtc);
+                       if (asyh->state.event)
+                               drm_crtc_vblank_get(crtc);
+               }
        }
 
        /* Update plane(s). */
@@ -4067,12 +4080,14 @@ nv50_disp_atomic_commit_tail(struct drm_atomic_state *state)
                if (crtc->state->event) {
                        unsigned long flags;
                        /* Get correct count/ts if racing with vblank irq */
-                       drm_accurate_vblank_count(crtc);
+                       if (crtc->state->active)
+                               drm_accurate_vblank_count(crtc);
                        spin_lock_irqsave(&crtc->dev->event_lock, flags);
                        drm_crtc_send_vblank_event(crtc, crtc->state->event);
                        spin_unlock_irqrestore(&crtc->dev->event_lock, flags);
                        crtc->state->event = NULL;
-                       drm_crtc_vblank_put(crtc);
+                       if (crtc->state->active)
+                               drm_crtc_vblank_put(crtc);
                }
        }
 
index a24312fb0228ff1f1053bca27f33c5702d2dc2ac..a1e8bf48b778430d45d46fb9e9de453fb897cd2a 100644 (file)
@@ -22,6 +22,7 @@ struct nvkm_ior {
                unsigned proto_evo:4;
                enum nvkm_ior_proto {
                        CRT,
+                       TV,
                        TMDS,
                        LVDS,
                        DP,
index 19c635663399a2442b670479df18621119595043..6ea19466f43622565052d8600424c948c9705343 100644 (file)
@@ -22,7 +22,7 @@ struct nv50_disp {
                u8 type[3];
        } pior;
 
-       struct nv50_disp_chan *chan[17];
+       struct nv50_disp_chan *chan[21];
 };
 
 void nv50_disp_super_1(struct nv50_disp *);
index 85aff85394ac29893b25180d62a6994af266c429..be9e7f8c3b2392fa96643f91391e606196ad7a67 100644 (file)
@@ -62,6 +62,7 @@ nvkm_outp_xlat(struct nvkm_outp *outp, enum nvkm_ior_type *type)
        case 0:
                switch (outp->info.type) {
                case DCB_OUTPUT_ANALOG: *type = DAC; return  CRT;
+               case DCB_OUTPUT_TV    : *type = DAC; return   TV;
                case DCB_OUTPUT_TMDS  : *type = SOR; return TMDS;
                case DCB_OUTPUT_LVDS  : *type = SOR; return LVDS;
                case DCB_OUTPUT_DP    : *type = SOR; return   DP;
index c794b2c2d21e710faa3ac64f70ac970ae69826c9..6d8f21290aa20342c1d50f73aa836feab1266d8c 100644 (file)
@@ -129,7 +129,7 @@ gf100_bar_init(struct nvkm_bar *base)
 
        if (bar->bar[0].mem) {
                addr = nvkm_memory_addr(bar->bar[0].mem) >> 12;
-               nvkm_wr32(device, 0x001714, 0xc0000000 | addr);
+               nvkm_wr32(device, 0x001714, 0x80000000 | addr);
        }
 
        return 0;
index 48f01e40b8fcc948126cbc1601b0217c034e7b90..b768e66a472beef8da6f871b6da6bdb471dc2a05 100644 (file)
@@ -25,6 +25,7 @@ nvkm-y += nvkm/subdev/i2c/bit.o
 
 nvkm-y += nvkm/subdev/i2c/aux.o
 nvkm-y += nvkm/subdev/i2c/auxg94.o
+nvkm-y += nvkm/subdev/i2c/auxgf119.o
 nvkm-y += nvkm/subdev/i2c/auxgm200.o
 
 nvkm-y += nvkm/subdev/i2c/anx9805.o
index d172e42dd2280682d58c3907ed882bae03fa0a2f..4c1f547da463afff3dee772446f92f13b2f4043e 100644 (file)
@@ -117,6 +117,10 @@ int
 nvkm_i2c_aux_xfer(struct nvkm_i2c_aux *aux, bool retry, u8 type,
                  u32 addr, u8 *data, u8 *size)
 {
+       if (!*size && !aux->func->address_only) {
+               AUX_ERR(aux, "address-only transaction dropped");
+               return -ENOSYS;
+       }
        return aux->func->xfer(aux, retry, type, addr, data, size);
 }
 
index 27a4a39c87f0044577a6b72bd4e95c6e4fc1437b..9587ab456d9eaa882eb3e9e9749993dc8fe62e17 100644 (file)
@@ -3,6 +3,7 @@
 #include "pad.h"
 
 struct nvkm_i2c_aux_func {
+       bool address_only;
        int  (*xfer)(struct nvkm_i2c_aux *, bool retry, u8 type,
                     u32 addr, u8 *data, u8 *size);
        int  (*lnk_ctl)(struct nvkm_i2c_aux *, int link_nr, int link_bw,
@@ -17,7 +18,12 @@ void nvkm_i2c_aux_del(struct nvkm_i2c_aux **);
 int nvkm_i2c_aux_xfer(struct nvkm_i2c_aux *, bool retry, u8 type,
                      u32 addr, u8 *data, u8 *size);
 
+int g94_i2c_aux_new_(const struct nvkm_i2c_aux_func *, struct nvkm_i2c_pad *,
+                    int, u8, struct nvkm_i2c_aux **);
+
 int g94_i2c_aux_new(struct nvkm_i2c_pad *, int, u8, struct nvkm_i2c_aux **);
+int g94_i2c_aux_xfer(struct nvkm_i2c_aux *, bool, u8, u32, u8 *, u8 *);
+int gf119_i2c_aux_new(struct nvkm_i2c_pad *, int, u8, struct nvkm_i2c_aux **);
 int gm200_i2c_aux_new(struct nvkm_i2c_pad *, int, u8, struct nvkm_i2c_aux **);
 
 #define AUX_MSG(b,l,f,a...) do {                                               \
index ab8cb196c34e73202c288c7dc24a14a88a18b78f..c8ab1b5741a3e3c0e93a9943c0b3811b8c646ea6 100644 (file)
@@ -72,7 +72,7 @@ g94_i2c_aux_init(struct g94_i2c_aux *aux)
        return 0;
 }
 
-static int
+int
 g94_i2c_aux_xfer(struct nvkm_i2c_aux *obj, bool retry,
                 u8 type, u32 addr, u8 *data, u8 *size)
 {
@@ -105,9 +105,9 @@ g94_i2c_aux_xfer(struct nvkm_i2c_aux *obj, bool retry,
        }
 
        ctrl  = nvkm_rd32(device, 0x00e4e4 + base);
-       ctrl &= ~0x0001f0ff;
+       ctrl &= ~0x0001f1ff;
        ctrl |= type << 12;
-       ctrl |= *size - 1;
+       ctrl |= (*size ? (*size - 1) : 0x00000100);
        nvkm_wr32(device, 0x00e4e0 + base, addr);
 
        /* (maybe) retry transaction a number of times on failure... */
@@ -160,14 +160,10 @@ out:
        return ret < 0 ? ret : (stat & 0x000f0000) >> 16;
 }
 
-static const struct nvkm_i2c_aux_func
-g94_i2c_aux_func = {
-       .xfer = g94_i2c_aux_xfer,
-};
-
 int
-g94_i2c_aux_new(struct nvkm_i2c_pad *pad, int index, u8 drive,
-               struct nvkm_i2c_aux **paux)
+g94_i2c_aux_new_(const struct nvkm_i2c_aux_func *func,
+                struct nvkm_i2c_pad *pad, int index, u8 drive,
+                struct nvkm_i2c_aux **paux)
 {
        struct g94_i2c_aux *aux;
 
@@ -175,8 +171,20 @@ g94_i2c_aux_new(struct nvkm_i2c_pad *pad, int index, u8 drive,
                return -ENOMEM;
        *paux = &aux->base;
 
-       nvkm_i2c_aux_ctor(&g94_i2c_aux_func, pad, index, &aux->base);
+       nvkm_i2c_aux_ctor(func, pad, index, &aux->base);
        aux->ch = drive;
        aux->base.intr = 1 << aux->ch;
        return 0;
 }
+
+static const struct nvkm_i2c_aux_func
+g94_i2c_aux = {
+       .xfer = g94_i2c_aux_xfer,
+};
+
+int
+g94_i2c_aux_new(struct nvkm_i2c_pad *pad, int index, u8 drive,
+               struct nvkm_i2c_aux **paux)
+{
+       return g94_i2c_aux_new_(&g94_i2c_aux, pad, index, drive, paux);
+}
diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/i2c/auxgf119.c b/drivers/gpu/drm/nouveau/nvkm/subdev/i2c/auxgf119.c
new file mode 100644 (file)
index 0000000..dab40cd
--- /dev/null
@@ -0,0 +1,35 @@
+/*
+ * Copyright 2017 Red Hat Inc.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
+ * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
+ * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+ * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+ * OTHER DEALINGS IN THE SOFTWARE.
+ */
+#include "aux.h"
+
+static const struct nvkm_i2c_aux_func
+gf119_i2c_aux = {
+       .address_only = true,
+       .xfer = g94_i2c_aux_xfer,
+};
+
+int
+gf119_i2c_aux_new(struct nvkm_i2c_pad *pad, int index, u8 drive,
+                 struct nvkm_i2c_aux **paux)
+{
+       return g94_i2c_aux_new_(&gf119_i2c_aux, pad, index, drive, paux);
+}
index ee091fa79628e1da1864d230731d4dd8e94e5cfa..7ef60895f43a7808229a8d72e27b2b54d67f3d48 100644 (file)
@@ -105,9 +105,9 @@ gm200_i2c_aux_xfer(struct nvkm_i2c_aux *obj, bool retry,
        }
 
        ctrl  = nvkm_rd32(device, 0x00d954 + base);
-       ctrl &= ~0x0001f0ff;
+       ctrl &= ~0x0001f1ff;
        ctrl |= type << 12;
-       ctrl |= *size - 1;
+       ctrl |= (*size ? (*size - 1) : 0x00000100);
        nvkm_wr32(device, 0x00d950 + base, addr);
 
        /* (maybe) retry transaction a number of times on failure... */
@@ -162,6 +162,7 @@ out:
 
 static const struct nvkm_i2c_aux_func
 gm200_i2c_aux_func = {
+       .address_only = true,
        .xfer = gm200_i2c_aux_xfer,
 };
 
index d53212f1aa52731dc7929d2b89637d6a5d1c51b9..3bc4d03100767da585ad9d6dbd95483be3174403 100644 (file)
@@ -28,7 +28,7 @@
 static const struct nvkm_i2c_pad_func
 gf119_i2c_pad_s_func = {
        .bus_new_4 = gf119_i2c_bus_new,
-       .aux_new_6 = g94_i2c_aux_new,
+       .aux_new_6 = gf119_i2c_aux_new,
        .mode = g94_i2c_pad_mode,
 };
 
@@ -41,7 +41,7 @@ gf119_i2c_pad_s_new(struct nvkm_i2c *i2c, int id, struct nvkm_i2c_pad **ppad)
 static const struct nvkm_i2c_pad_func
 gf119_i2c_pad_x_func = {
        .bus_new_4 = gf119_i2c_bus_new,
-       .aux_new_6 = g94_i2c_aux_new,
+       .aux_new_6 = gf119_i2c_aux_new,
 };
 
 int
index 50c41c0a50ef3f989553bc091193b57288a28914..dcc539ba85d65da734d9a94a77bfc6b09d62b05e 100644 (file)
@@ -5,6 +5,10 @@ config DRM_ROCKCHIP
        select DRM_KMS_HELPER
        select DRM_PANEL
        select VIDEOMODE_HELPERS
+       select DRM_ANALOGIX_DP if ROCKCHIP_ANALOGIX_DP
+       select DRM_DW_HDMI if ROCKCHIP_DW_HDMI
+       select DRM_MIPI_DSI if ROCKCHIP_DW_MIPI_DSI
+       select SND_SOC_HDMI_CODEC if ROCKCHIP_CDN_DP && SND_SOC
        help
          Choose this option if you have a Rockchip soc chipset.
          This driver provides kernel mode setting and buffer
@@ -12,10 +16,10 @@ config DRM_ROCKCHIP
          2D or 3D acceleration; acceleration is performed by other
          IP found on the SoC.
 
+if DRM_ROCKCHIP
+
 config ROCKCHIP_ANALOGIX_DP
        bool "Rockchip specific extensions for Analogix DP driver"
-       depends on DRM_ROCKCHIP
-       select DRM_ANALOGIX_DP
        help
          This selects support for Rockchip SoC specific extensions
          for the Analogix Core DP driver. If you want to enable DP
@@ -23,9 +27,7 @@ config ROCKCHIP_ANALOGIX_DP
 
 config ROCKCHIP_CDN_DP
         bool "Rockchip cdn DP"
-        depends on DRM_ROCKCHIP
-       depends on EXTCON
-       select SND_SOC_HDMI_CODEC if SND_SOC
+       depends on EXTCON=y || (EXTCON=m && DRM_ROCKCHIP=m)
         help
          This selects support for Rockchip SoC specific extensions
          for the cdn DP driver. If you want to enable Dp on
@@ -34,8 +36,6 @@ config ROCKCHIP_CDN_DP
 
 config ROCKCHIP_DW_HDMI
         bool "Rockchip specific extensions for Synopsys DW HDMI"
-        depends on DRM_ROCKCHIP
-        select DRM_DW_HDMI
         help
          This selects support for Rockchip SoC specific extensions
          for the Synopsys DesignWare HDMI driver. If you want to
@@ -44,8 +44,6 @@ config ROCKCHIP_DW_HDMI
 
 config ROCKCHIP_DW_MIPI_DSI
        bool "Rockchip specific extensions for Synopsys DW MIPI DSI"
-       depends on DRM_ROCKCHIP
-       select DRM_MIPI_DSI
        help
         This selects support for Rockchip SoC specific extensions
         for the Synopsys DesignWare HDMI driver. If you want to
@@ -54,8 +52,9 @@ config ROCKCHIP_DW_MIPI_DSI
 
 config ROCKCHIP_INNO_HDMI
        bool "Rockchip specific extensions for Innosilicon HDMI"
-       depends on DRM_ROCKCHIP
        help
          This selects support for Rockchip SoC specific extensions
          for the Innosilicon HDMI driver. If you want to enable
          HDMI on RK3036 based SoC, you should select this option.
+
+endif
index 35bf781e418e339eae86760c04697b9a1b128d25..c7056322211cc80fa5b42742ffcd496973d19ed6 100644 (file)
 #include <drm/ttm/ttm_placement.h>
 #include <drm/ttm/ttm_page_alloc.h>
 
-static struct ttm_place vram_placement_flags = {
+static const struct ttm_place vram_placement_flags = {
        .fpfn = 0,
        .lpfn = 0,
        .flags = TTM_PL_FLAG_VRAM | TTM_PL_FLAG_CACHED
 };
 
-static struct ttm_place vram_ne_placement_flags = {
+static const struct ttm_place vram_ne_placement_flags = {
        .fpfn = 0,
        .lpfn = 0,
        .flags = TTM_PL_FLAG_VRAM | TTM_PL_FLAG_CACHED | TTM_PL_FLAG_NO_EVICT
 };
 
-static struct ttm_place sys_placement_flags = {
+static const struct ttm_place sys_placement_flags = {
        .fpfn = 0,
        .lpfn = 0,
        .flags = TTM_PL_FLAG_SYSTEM | TTM_PL_FLAG_CACHED
 };
 
-static struct ttm_place sys_ne_placement_flags = {
+static const struct ttm_place sys_ne_placement_flags = {
        .fpfn = 0,
        .lpfn = 0,
        .flags = TTM_PL_FLAG_SYSTEM | TTM_PL_FLAG_CACHED | TTM_PL_FLAG_NO_EVICT
 };
 
-static struct ttm_place gmr_placement_flags = {
+static const struct ttm_place gmr_placement_flags = {
        .fpfn = 0,
        .lpfn = 0,
        .flags = VMW_PL_FLAG_GMR | TTM_PL_FLAG_CACHED
 };
 
-static struct ttm_place gmr_ne_placement_flags = {
+static const struct ttm_place gmr_ne_placement_flags = {
        .fpfn = 0,
        .lpfn = 0,
        .flags = VMW_PL_FLAG_GMR | TTM_PL_FLAG_CACHED | TTM_PL_FLAG_NO_EVICT
 };
 
-static struct ttm_place mob_placement_flags = {
+static const struct ttm_place mob_placement_flags = {
        .fpfn = 0,
        .lpfn = 0,
        .flags = VMW_PL_FLAG_MOB | TTM_PL_FLAG_CACHED
 };
 
-static struct ttm_place mob_ne_placement_flags = {
+static const struct ttm_place mob_ne_placement_flags = {
        .fpfn = 0,
        .lpfn = 0,
        .flags = VMW_PL_FLAG_MOB | TTM_PL_FLAG_CACHED | TTM_PL_FLAG_NO_EVICT
@@ -85,7 +85,7 @@ struct ttm_placement vmw_vram_placement = {
        .busy_placement = &vram_placement_flags
 };
 
-static struct ttm_place vram_gmr_placement_flags[] = {
+static const struct ttm_place vram_gmr_placement_flags[] = {
        {
                .fpfn = 0,
                .lpfn = 0,
@@ -97,7 +97,7 @@ static struct ttm_place vram_gmr_placement_flags[] = {
        }
 };
 
-static struct ttm_place gmr_vram_placement_flags[] = {
+static const struct ttm_place gmr_vram_placement_flags[] = {
        {
                .fpfn = 0,
                .lpfn = 0,
@@ -116,7 +116,7 @@ struct ttm_placement vmw_vram_gmr_placement = {
        .busy_placement = &gmr_placement_flags
 };
 
-static struct ttm_place vram_gmr_ne_placement_flags[] = {
+static const struct ttm_place vram_gmr_ne_placement_flags[] = {
        {
                .fpfn = 0,
                .lpfn = 0,
@@ -165,7 +165,7 @@ struct ttm_placement vmw_sys_ne_placement = {
        .busy_placement = &sys_ne_placement_flags
 };
 
-static struct ttm_place evictable_placement_flags[] = {
+static const struct ttm_place evictable_placement_flags[] = {
        {
                .fpfn = 0,
                .lpfn = 0,
index 99a7f4ab7d97edf1652aae7a04ec0f8cf51c9e6f..86178796de6c354a32cf1ef35637aa459d8cb7b5 100644 (file)
@@ -779,8 +779,8 @@ static int vmw_cmdbuf_space_pool(struct vmw_cmdbuf_man *man,
        if (ret)
                return ret;
 
-       header->cb_header = dma_pool_alloc(man->headers, GFP_KERNEL,
-                                          &header->handle);
+       header->cb_header = dma_pool_zalloc(man->headers, GFP_KERNEL,
+                                           &header->handle);
        if (!header->cb_header) {
                ret = -ENOMEM;
                goto out_no_cb_header;
@@ -790,7 +790,6 @@ static int vmw_cmdbuf_space_pool(struct vmw_cmdbuf_man *man,
        cb_hdr = header->cb_header;
        offset = header->node.start << PAGE_SHIFT;
        header->cmd = man->map + offset;
-       memset(cb_hdr, 0, sizeof(*cb_hdr));
        if (man->using_mob) {
                cb_hdr->flags = SVGA_CB_FLAG_MOB;
                cb_hdr->ptr.mob.mobid = man->cmd_space->mem.start;
@@ -827,8 +826,8 @@ static int vmw_cmdbuf_space_inline(struct vmw_cmdbuf_man *man,
        if (WARN_ON_ONCE(size > VMW_CMDBUF_INLINE_SIZE))
                return -ENOMEM;
 
-       dheader = dma_pool_alloc(man->dheaders, GFP_KERNEL,
-                                &header->handle);
+       dheader = dma_pool_zalloc(man->dheaders, GFP_KERNEL,
+                                 &header->handle);
        if (!dheader)
                return -ENOMEM;
 
@@ -837,7 +836,6 @@ static int vmw_cmdbuf_space_inline(struct vmw_cmdbuf_man *man,
        cb_hdr = &dheader->cb_header;
        header->cb_header = cb_hdr;
        header->cmd = dheader->cmd;
-       memset(dheader, 0, sizeof(*dheader));
        cb_hdr->status = SVGA_CB_STATUS_NONE;
        cb_hdr->flags = SVGA_CB_FLAG_NONE;
        cb_hdr->ptr.pa = (u64)header->handle +
index 1f013d45c9e9a3959dfa19300ba76fc37820592a..36c7b6c839c0dd230752cba96c348b40e2c65c65 100644 (file)
@@ -205,7 +205,7 @@ int vmw_cmdbuf_res_add(struct vmw_cmdbuf_res_manager *man,
        int ret;
 
        cres = kzalloc(sizeof(*cres), GFP_KERNEL);
-       if (unlikely(cres == NULL))
+       if (unlikely(!cres))
                return -ENOMEM;
 
        cres->hash.key = user_key | (res_type << 24);
@@ -291,7 +291,7 @@ vmw_cmdbuf_res_man_create(struct vmw_private *dev_priv)
        int ret;
 
        man = kzalloc(sizeof(*man), GFP_KERNEL);
-       if (man == NULL)
+       if (!man)
                return ERR_PTR(-ENOMEM);
 
        man->dev_priv = dev_priv;
index bcc6d4136c878ef159e0aeefcf00f294fc565ef2..4212b3e673bce2df55c5c6b71894a97fbe9b7c5f 100644 (file)
@@ -210,8 +210,8 @@ static int vmw_gb_context_init(struct vmw_private *dev_priv,
                for (i = 0; i < SVGA_COTABLE_DX10_MAX; ++i) {
                        uctx->cotables[i] = vmw_cotable_alloc(dev_priv,
                                                              &uctx->res, i);
-                       if (unlikely(uctx->cotables[i] == NULL)) {
-                               ret = -ENOMEM;
+                       if (unlikely(IS_ERR(uctx->cotables[i]))) {
+                               ret = PTR_ERR(uctx->cotables[i]);
                                goto out_cotables;
                        }
                }
@@ -777,7 +777,7 @@ static int vmw_context_define(struct drm_device *dev, void *data,
        }
 
        ctx = kzalloc(sizeof(*ctx), GFP_KERNEL);
-       if (unlikely(ctx == NULL)) {
+       if (unlikely(!ctx)) {
                ttm_mem_global_free(vmw_mem_glob(dev_priv),
                                    vmw_user_context_size);
                ret = -ENOMEM;
index 6c026d75c18043a9e8f6926e21f3bef917038f8a..d87861bbe971b1d474e1ab2b43cd2097bd2c32de 100644 (file)
@@ -584,7 +584,7 @@ struct vmw_resource *vmw_cotable_alloc(struct vmw_private *dev_priv,
                return ERR_PTR(ret);
 
        vcotbl = kzalloc(sizeof(*vcotbl), GFP_KERNEL);
-       if (unlikely(vcotbl == NULL)) {
+       if (unlikely(!vcotbl)) {
                ret = -ENOMEM;
                goto out_no_alloc;
        }
index 4a641555b960b8fc654c6ab89c428e783a61aad4..4436d53ae16c7da1e15769e446015c69f6495995 100644 (file)
@@ -227,7 +227,7 @@ static const struct drm_ioctl_desc vmw_ioctls[] = {
                      DRM_AUTH | DRM_RENDER_ALLOW),
 };
 
-static struct pci_device_id vmw_pci_id_list[] = {
+static const struct pci_device_id vmw_pci_id_list[] = {
        {0x15ad, 0x0405, PCI_ANY_ID, PCI_ANY_ID, 0, 0, VMWGFX_CHIP_SVGAII},
        {0, 0, 0}
 };
@@ -630,7 +630,7 @@ static int vmw_driver_load(struct drm_device *dev, unsigned long chipset)
        char host_log[100] = {0};
 
        dev_priv = kzalloc(sizeof(*dev_priv), GFP_KERNEL);
-       if (unlikely(dev_priv == NULL)) {
+       if (unlikely(!dev_priv)) {
                DRM_ERROR("Failed allocating a device private struct.\n");
                return -ENOMEM;
        }
@@ -1035,7 +1035,7 @@ static int vmw_driver_open(struct drm_device *dev, struct drm_file *file_priv)
        int ret = -ENOMEM;
 
        vmw_fp = kzalloc(sizeof(*vmw_fp), GFP_KERNEL);
-       if (unlikely(vmw_fp == NULL))
+       if (unlikely(!vmw_fp))
                return ret;
 
        vmw_fp->tfile = ttm_object_file_init(dev_priv->tdev, 10);
@@ -1196,7 +1196,7 @@ static int vmw_master_create(struct drm_device *dev,
        struct vmw_master *vmaster;
 
        vmaster = kzalloc(sizeof(*vmaster), GFP_KERNEL);
-       if (unlikely(vmaster == NULL))
+       if (unlikely(!vmaster))
                return -ENOMEM;
 
        vmw_master_init(vmaster);
index c7b53d987f06c923c53eaafb0fccdd9631ba72a7..2cfb3c93f42ab430be0b36ae78c40897ef75cc4c 100644 (file)
@@ -264,7 +264,7 @@ static int vmw_resource_val_add(struct vmw_sw_context *sw_context,
        }
 
        node = kzalloc(sizeof(*node), GFP_KERNEL);
-       if (unlikely(node == NULL)) {
+       if (unlikely(!node)) {
                DRM_ERROR("Failed to allocate a resource validation "
                          "entry.\n");
                return -ENOMEM;
@@ -452,7 +452,7 @@ static int vmw_resource_relocation_add(struct list_head *list,
        struct vmw_resource_relocation *rel;
 
        rel = kmalloc(sizeof(*rel), GFP_KERNEL);
-       if (unlikely(rel == NULL)) {
+       if (unlikely(!rel)) {
                DRM_ERROR("Failed to allocate a resource relocation.\n");
                return -ENOMEM;
        }
@@ -519,7 +519,7 @@ static int vmw_cmd_invalid(struct vmw_private *dev_priv,
                           struct vmw_sw_context *sw_context,
                           SVGA3dCmdHeader *header)
 {
-       return capable(CAP_SYS_ADMIN) ? : -EINVAL;
+       return -EINVAL;
 }
 
 static int vmw_cmd_ok(struct vmw_private *dev_priv,
@@ -2584,7 +2584,7 @@ static int vmw_cmd_dx_set_vertex_buffers(struct vmw_private *dev_priv,
 
 /**
  * vmw_cmd_dx_ia_set_vertex_buffers - Validate an
- * SVGA_3D_CMD_DX_IA_SET_VERTEX_BUFFERS command.
+ * SVGA_3D_CMD_DX_IA_SET_INDEX_BUFFER command.
  *
  * @dev_priv: Pointer to a device private struct.
  * @sw_context: The software context being used for this batch.
index 6b2708b4eafe84c832d41a10f75c2be9e65fc0b9..b8bc5bc7de7e0d4616cbbfe6fbee1d309aa55360 100644 (file)
@@ -284,7 +284,7 @@ struct vmw_fence_manager *vmw_fence_manager_init(struct vmw_private *dev_priv)
 {
        struct vmw_fence_manager *fman = kzalloc(sizeof(*fman), GFP_KERNEL);
 
-       if (unlikely(fman == NULL))
+       if (unlikely(!fman))
                return NULL;
 
        fman->dev_priv = dev_priv;
@@ -541,7 +541,7 @@ int vmw_fence_create(struct vmw_fence_manager *fman,
        int ret;
 
        fence = kzalloc(sizeof(*fence), GFP_KERNEL);
-       if (unlikely(fence == NULL))
+       if (unlikely(!fence))
                return -ENOMEM;
 
        ret = vmw_fence_obj_init(fman, fence, seqno,
@@ -606,7 +606,7 @@ int vmw_user_fence_create(struct drm_file *file_priv,
                return ret;
 
        ufence = kzalloc(sizeof(*ufence), GFP_KERNEL);
-       if (unlikely(ufence == NULL)) {
+       if (unlikely(!ufence)) {
                ret = -ENOMEM;
                goto out_no_object;
        }
@@ -966,7 +966,7 @@ int vmw_event_fence_action_queue(struct drm_file *file_priv,
        struct vmw_fence_manager *fman = fman_from_fence(fence);
 
        eaction = kzalloc(sizeof(*eaction), GFP_KERNEL);
-       if (unlikely(eaction == NULL))
+       if (unlikely(!eaction))
                return -ENOMEM;
 
        eaction->event = event;
@@ -1002,7 +1002,7 @@ static int vmw_event_fence_action_create(struct drm_file *file_priv,
        int ret;
 
        event = kzalloc(sizeof(*event), GFP_KERNEL);
-       if (unlikely(event == NULL)) {
+       if (unlikely(!event)) {
                DRM_ERROR("Failed to allocate an event.\n");
                ret = -ENOMEM;
                goto out_no_space;
index c1900f4390a41efbf5a613fb6f451d391e336fed..d2b03d4a3c867d11a0167f3ff7ba85b246289b88 100644 (file)
@@ -121,7 +121,7 @@ static int vmw_gmrid_man_init(struct ttm_mem_type_manager *man,
        struct vmwgfx_gmrid_man *gman =
                kzalloc(sizeof(*gman), GFP_KERNEL);
 
-       if (unlikely(gman == NULL))
+       if (unlikely(!gman))
                return -ENOMEM;
 
        spin_lock_init(&gman->lock);
index 3d94ea67a825e1cf37d9075035283236ebff69fa..61e06f0e8cd3b43890e807a2ab2bb9037ac95e99 100644 (file)
@@ -384,6 +384,12 @@ vmw_du_cursor_plane_atomic_update(struct drm_plane *plane,
 
        hotspot_x = du->hotspot_x;
        hotspot_y = du->hotspot_y;
+
+       if (plane->fb) {
+               hotspot_x += plane->fb->hot_x;
+               hotspot_y += plane->fb->hot_y;
+       }
+
        du->cursor_surface = vps->surf;
        du->cursor_dmabuf = vps->dmabuf;
 
@@ -411,6 +417,9 @@ vmw_du_cursor_plane_atomic_update(struct drm_plane *plane,
                vmw_cursor_update_position(dev_priv, true,
                                           du->cursor_x + hotspot_x,
                                           du->cursor_y + hotspot_y);
+
+               du->core_hotspot_x = hotspot_x - du->hotspot_x;
+               du->core_hotspot_y = hotspot_y - du->hotspot_y;
        } else {
                DRM_ERROR("Failed to update cursor image\n");
        }
index 941bcfd131ff7a169472b0b92c62cf7a40e01bd9..b17f08fc50d3fa2306505bedf33d6eea1ec7e323 100644 (file)
@@ -320,14 +320,14 @@ int vmw_otables_setup(struct vmw_private *dev_priv)
 
        if (dev_priv->has_dx) {
                *otables = kmemdup(dx_tables, sizeof(dx_tables), GFP_KERNEL);
-               if (*otables == NULL)
+               if (!(*otables))
                        return -ENOMEM;
 
                dev_priv->otable_batch.num_otables = ARRAY_SIZE(dx_tables);
        } else {
                *otables = kmemdup(pre_dx_tables, sizeof(pre_dx_tables),
                                   GFP_KERNEL);
-               if (*otables == NULL)
+               if (!(*otables))
                        return -ENOMEM;
 
                dev_priv->otable_batch.num_otables = ARRAY_SIZE(pre_dx_tables);
@@ -407,7 +407,7 @@ struct vmw_mob *vmw_mob_create(unsigned long data_pages)
 {
        struct vmw_mob *mob = kzalloc(sizeof(*mob), GFP_KERNEL);
 
-       if (unlikely(mob == NULL))
+       if (unlikely(!mob))
                return NULL;
 
        mob->num_pages = vmw_mob_calculate_pt_pages(data_pages);
index 6063c9636d4a08f0b908eb54531b8f2efb818bd8..97000996b8dc5122ba5d8109af5b14930b6f4e60 100644 (file)
@@ -244,7 +244,7 @@ static int vmw_recv_msg(struct rpc_channel *channel, void **msg,
 
                reply_len = ebx;
                reply     = kzalloc(reply_len + 1, GFP_KERNEL);
-               if (reply == NULL) {
+               if (!reply) {
                        DRM_ERROR("Cannot allocate memory for reply\n");
                        return -ENOMEM;
                }
@@ -340,7 +340,7 @@ int vmw_host_get_guestinfo(const char *guest_info_param,
 
        msg_len = strlen(guest_info_param) + strlen("info-get ") + 1;
        msg = kzalloc(msg_len, GFP_KERNEL);
-       if (msg == NULL) {
+       if (!msg) {
                DRM_ERROR("Cannot allocate memory to get %s", guest_info_param);
                return -ENOMEM;
        }
@@ -400,7 +400,7 @@ int vmw_host_log(const char *log)
 
        msg_len = strlen(log) + strlen("log ") + 1;
        msg = kzalloc(msg_len, GFP_KERNEL);
-       if (msg == NULL) {
+       if (!msg) {
                DRM_ERROR("Cannot allocate memory for log message\n");
                return -ENOMEM;
        }
index 7d591f653dfa323e5f51f0bfeca58dac44bf5fa4..a96f90f017d16072423a95302779e54444339cd4 100644 (file)
@@ -446,7 +446,7 @@ int vmw_user_dmabuf_alloc(struct vmw_private *dev_priv,
        int ret;
 
        user_bo = kzalloc(sizeof(*user_bo), GFP_KERNEL);
-       if (unlikely(user_bo == NULL)) {
+       if (unlikely(!user_bo)) {
                DRM_ERROR("Failed to allocate a buffer.\n");
                return -ENOMEM;
        }
@@ -836,7 +836,7 @@ static int vmw_resource_buf_alloc(struct vmw_resource *res,
        }
 
        backup = kzalloc(sizeof(*backup), GFP_KERNEL);
-       if (unlikely(backup == NULL))
+       if (unlikely(!backup))
                return -ENOMEM;
 
        ret = vmw_dmabuf_init(res->dev_priv, backup, res->backup_size,
index 68f135c5b0d8e0b81dff7dd039ea1a032683f89b..9b832f13681370e38cf3345f1eb6f5415f715c71 100644 (file)
@@ -751,7 +751,7 @@ static int vmw_user_shader_alloc(struct vmw_private *dev_priv,
        }
 
        ushader = kzalloc(sizeof(*ushader), GFP_KERNEL);
-       if (unlikely(ushader == NULL)) {
+       if (unlikely(!ushader)) {
                ttm_mem_global_free(vmw_mem_glob(dev_priv),
                                    vmw_user_shader_size);
                ret = -ENOMEM;
@@ -821,7 +821,7 @@ static struct vmw_resource *vmw_shader_alloc(struct vmw_private *dev_priv,
        }
 
        shader = kzalloc(sizeof(*shader), GFP_KERNEL);
-       if (unlikely(shader == NULL)) {
+       if (unlikely(!shader)) {
                ttm_mem_global_free(vmw_mem_glob(dev_priv),
                                    vmw_shader_size);
                ret = -ENOMEM;
@@ -981,7 +981,7 @@ int vmw_compat_shader_add(struct vmw_private *dev_priv,
 
        /* Allocate and pin a DMA buffer */
        buf = kzalloc(sizeof(*buf), GFP_KERNEL);
-       if (unlikely(buf == NULL))
+       if (unlikely(!buf))
                return -ENOMEM;
 
        ret = vmw_dmabuf_init(dev_priv, buf, size, &vmw_sys_ne_placement,
index 50be1f034f9efa701f2c6feda57fe28d8cf6d596..5284e8d2f7ba4b0f3c45972c3446800a8debceeb 100644 (file)
@@ -1640,8 +1640,8 @@ int vmw_kms_stdu_init_display(struct vmw_private *dev_priv)
                 * something arbitrarily large and we will reject any layout
                 * that doesn't fit prim_bb_mem later
                 */
-               dev->mode_config.max_width = 16384;
-               dev->mode_config.max_height = 16384;
+               dev->mode_config.max_width = 8192;
+               dev->mode_config.max_height = 8192;
        }
 
        vmw_kms_create_implicit_placement_property(dev_priv, false);
index 2c58a390123a1a7c3f8a4e6fd6f11a34f3340fbe..7782725141648360cedd89f3363155da5f7c8d9c 100644 (file)
@@ -186,8 +186,13 @@ static int host1x_probe(struct platform_device *pdev)
                        return -ENOMEM;
 
                err = iommu_attach_device(host->domain, &pdev->dev);
-               if (err)
+               if (err == -ENODEV) {
+                       iommu_domain_free(host->domain);
+                       host->domain = NULL;
+                       goto skip_iommu;
+               } else if (err) {
                        goto fail_free_domain;
+               }
 
                geometry = &host->domain->geometry;
 
@@ -198,6 +203,7 @@ static int host1x_probe(struct platform_device *pdev)
                host->iova_end = geometry->aperture_end;
        }
 
+skip_iommu:
        err = host1x_channel_list_init(&host->channel_list,
                                       host->info->nb_channels);
        if (err) {
index 6fd01a692197af4e70c9e1bb4bfd0bd8ffb4f348..9017dcc14502d7236ff48a03457cb67a7f9d0a5e 100644 (file)
@@ -2216,6 +2216,7 @@ static const struct hid_device_id hid_have_special_driver[] = {
 #if IS_ENABLED(CONFIG_HID_ORTEK)
        { HID_USB_DEVICE(USB_VENDOR_ID_ORTEK, USB_DEVICE_ID_ORTEK_PKB1700) },
        { HID_USB_DEVICE(USB_VENDOR_ID_ORTEK, USB_DEVICE_ID_ORTEK_WKB2000) },
+       { HID_USB_DEVICE(USB_VENDOR_ID_ORTEK, USB_DEVICE_ID_ORTEK_IHOME_IMAC_A210S) },
        { HID_USB_DEVICE(USB_VENDOR_ID_SKYCABLE, USB_DEVICE_ID_SKYCABLE_WIRELESS_PRESENTER) },
 #endif
 #if IS_ENABLED(CONFIG_HID_PANTHERLORD)
index 3d911bfd91cf1a8ea67c504f344ecba32acc603e..c9ba4c6db74ca076d0e26426656d238ac878088e 100644 (file)
 #define USB_VENDOR_ID_ORTEK            0x05a4
 #define USB_DEVICE_ID_ORTEK_PKB1700    0x1700
 #define USB_DEVICE_ID_ORTEK_WKB2000    0x2000
+#define USB_DEVICE_ID_ORTEK_IHOME_IMAC_A210S   0x8003
 
 #define USB_VENDOR_ID_PLANTRONICS      0x047f
 
index 6620f15fec228a21ccf6f1b12a5e7dfd7b73046d..8783a064cdcf43b0752973a4693d72ddca4fe4fa 100644 (file)
@@ -5,6 +5,7 @@
  *
  *    Ortek PKB-1700
  *    Ortek WKB-2000
+ *    iHome IMAC-A210S
  *    Skycable wireless presenter
  *
  *  Copyright (c) 2010 Johnathon Harris <jmharris@gmail.com>
@@ -28,10 +29,10 @@ static __u8 *ortek_report_fixup(struct hid_device *hdev, __u8 *rdesc,
                unsigned int *rsize)
 {
        if (*rsize >= 56 && rdesc[54] == 0x25 && rdesc[55] == 0x01) {
-               hid_info(hdev, "Fixing up logical minimum in report descriptor (Ortek)\n");
+               hid_info(hdev, "Fixing up logical maximum in report descriptor (Ortek)\n");
                rdesc[55] = 0x92;
        } else if (*rsize >= 54 && rdesc[52] == 0x25 && rdesc[53] == 0x01) {
-               hid_info(hdev, "Fixing up logical minimum in report descriptor (Skycable)\n");
+               hid_info(hdev, "Fixing up logical maximum in report descriptor (Skycable)\n");
                rdesc[53] = 0x65;
        }
        return rdesc;
@@ -40,6 +41,7 @@ static __u8 *ortek_report_fixup(struct hid_device *hdev, __u8 *rdesc,
 static const struct hid_device_id ortek_devices[] = {
        { HID_USB_DEVICE(USB_VENDOR_ID_ORTEK, USB_DEVICE_ID_ORTEK_PKB1700) },
        { HID_USB_DEVICE(USB_VENDOR_ID_ORTEK, USB_DEVICE_ID_ORTEK_WKB2000) },
+       { HID_USB_DEVICE(USB_VENDOR_ID_ORTEK, USB_DEVICE_ID_ORTEK_IHOME_IMAC_A210S) },
        { HID_USB_DEVICE(USB_VENDOR_ID_SKYCABLE, USB_DEVICE_ID_SKYCABLE_WIRELESS_PRESENTER) },
        { }
 };
index 76013eb5cb7faedbf5ec6ca62dca6181afc5919b..c008847e0b20a2accb00451b10fb1c648f67925b 100644 (file)
@@ -680,18 +680,21 @@ static int usbhid_open(struct hid_device *hid)
        struct usbhid_device *usbhid = hid->driver_data;
        int res;
 
+       set_bit(HID_OPENED, &usbhid->iofl);
+
        if (hid->quirks & HID_QUIRK_ALWAYS_POLL)
                return 0;
 
        res = usb_autopm_get_interface(usbhid->intf);
        /* the device must be awake to reliably request remote wakeup */
-       if (res < 0)
+       if (res < 0) {
+               clear_bit(HID_OPENED, &usbhid->iofl);
                return -EIO;
+       }
 
        usbhid->intf->needs_remote_wakeup = 1;
 
        set_bit(HID_RESUME_RUNNING, &usbhid->iofl);
-       set_bit(HID_OPENED, &usbhid->iofl);
        set_bit(HID_IN_POLLING, &usbhid->iofl);
 
        res = hid_start_in(hid);
@@ -727,19 +730,20 @@ static void usbhid_close(struct hid_device *hid)
 {
        struct usbhid_device *usbhid = hid->driver_data;
 
-       if (hid->quirks & HID_QUIRK_ALWAYS_POLL)
-               return;
-
        /*
         * Make sure we don't restart data acquisition due to
         * a resumption we no longer care about by avoiding racing
         * with hid_start_in().
         */
        spin_lock_irq(&usbhid->lock);
-       clear_bit(HID_IN_POLLING, &usbhid->iofl);
        clear_bit(HID_OPENED, &usbhid->iofl);
+       if (!(hid->quirks & HID_QUIRK_ALWAYS_POLL))
+               clear_bit(HID_IN_POLLING, &usbhid->iofl);
        spin_unlock_irq(&usbhid->lock);
 
+       if (hid->quirks & HID_QUIRK_ALWAYS_POLL)
+               return;
+
        hid_cancel_delayed_stuff(usbhid);
        usb_kill_urb(usbhid->urbin);
        usbhid->intf->needs_remote_wakeup = 0;
index e9bf0bb87ac40c7e610aa28ac23d35dcc3991ba2..e57cc40cb768b7d3b85c761700e3729c2a2deebc 100644 (file)
@@ -606,6 +606,8 @@ static int vmbus_close_internal(struct vmbus_channel *channel)
                get_order(channel->ringbuffer_pagecount * PAGE_SIZE));
 
 out:
+       /* re-enable tasklet for use on re-open */
+       tasklet_enable(&channel->callback_event);
        return ret;
 }
 
index 0af7fd311979d25d0684e585ec92f9a65169bdaa..76c34f4fde132cef26d2a76900401dce82a2e23f 100644 (file)
@@ -566,6 +566,8 @@ static int applesmc_init_smcreg_try(void)
        if (ret)
                return ret;
        s->fan_count = tmp[0];
+       if (s->fan_count > 10)
+               s->fan_count = 10;
 
        ret = applesmc_get_lower_bound(&s->temp_begin, "T");
        if (ret)
@@ -811,7 +813,8 @@ static ssize_t applesmc_show_fan_speed(struct device *dev,
        char newkey[5];
        u8 buffer[2];
 
-       sprintf(newkey, fan_speed_fmt[to_option(attr)], to_index(attr));
+       scnprintf(newkey, sizeof(newkey), fan_speed_fmt[to_option(attr)],
+                 to_index(attr));
 
        ret = applesmc_read_key(newkey, buffer, 2);
        speed = ((buffer[0] << 8 | buffer[1]) >> 2);
@@ -834,7 +837,8 @@ static ssize_t applesmc_store_fan_speed(struct device *dev,
        if (kstrtoul(sysfsbuf, 10, &speed) < 0 || speed >= 0x4000)
                return -EINVAL;         /* Bigger than a 14-bit value */
 
-       sprintf(newkey, fan_speed_fmt[to_option(attr)], to_index(attr));
+       scnprintf(newkey, sizeof(newkey), fan_speed_fmt[to_option(attr)],
+                 to_index(attr));
 
        buffer[0] = (speed >> 6) & 0xff;
        buffer[1] = (speed << 2) & 0xff;
@@ -903,7 +907,7 @@ static ssize_t applesmc_show_fan_position(struct device *dev,
        char newkey[5];
        u8 buffer[17];
 
-       sprintf(newkey, FAN_ID_FMT, to_index(attr));
+       scnprintf(newkey, sizeof(newkey), FAN_ID_FMT, to_index(attr));
 
        ret = applesmc_read_key(newkey, buffer, 16);
        buffer[16] = 0;
@@ -1116,7 +1120,8 @@ static int applesmc_create_nodes(struct applesmc_node_group *groups, int num)
                }
                for (i = 0; i < num; i++) {
                        node = &grp->nodes[i];
-                       sprintf(node->name, grp->format, i + 1);
+                       scnprintf(node->name, sizeof(node->name), grp->format,
+                                 i + 1);
                        node->sda.index = (grp->option << 16) | (i & 0xffff);
                        node->sda.dev_attr.show = grp->show;
                        node->sda.dev_attr.store = grp->store;
index a9dfb26972f212587e9d6af2b223c39403a65af8..250dc6ec4c82df50f4dabb72a7e2486f093c83f9 100644 (file)
@@ -2957,7 +2957,7 @@ static struct dw_mci_board *dw_mci_parse_dt(struct dw_mci *host)
        }
 
        /* find out number of slots supported */
-       if (device_property_read_u32(dev, "num-slots", &pdata->num_slots))
+       if (!device_property_read_u32(dev, "num-slots", &pdata->num_slots))
                dev_info(dev, "'num-slots' was deprecated.\n");
 
        if (device_property_read_u32(dev, "fifo-depth", &pdata->fifo_depth))
index 7c12f3715676fc0e23855a01c4d8dfdc1365c742..04ff3c97a535143933acec93caa8483a43f633c6 100644 (file)
@@ -356,9 +356,6 @@ static int omap_hsmmc_set_power(struct omap_hsmmc_host *host, int power_on,
        struct mmc_host *mmc = host->mmc;
        int ret = 0;
 
-       if (mmc_pdata(host)->set_power)
-               return mmc_pdata(host)->set_power(host->dev, power_on, vdd);
-
        /*
         * If we don't see a Vcc regulator, assume it's a fixed
         * voltage always-on regulator.
@@ -366,9 +363,6 @@ static int omap_hsmmc_set_power(struct omap_hsmmc_host *host, int power_on,
        if (IS_ERR(mmc->supply.vmmc))
                return 0;
 
-       if (mmc_pdata(host)->before_set_reg)
-               mmc_pdata(host)->before_set_reg(host->dev, power_on, vdd);
-
        ret = omap_hsmmc_set_pbias(host, false, 0);
        if (ret)
                return ret;
@@ -400,9 +394,6 @@ static int omap_hsmmc_set_power(struct omap_hsmmc_host *host, int power_on,
                        return ret;
        }
 
-       if (mmc_pdata(host)->after_set_reg)
-               mmc_pdata(host)->after_set_reg(host->dev, power_on, vdd);
-
        return 0;
 
 err_set_voltage:
@@ -469,8 +460,6 @@ static int omap_hsmmc_reg_get(struct omap_hsmmc_host *host)
        int ret;
        struct mmc_host *mmc = host->mmc;
 
-       if (mmc_pdata(host)->set_power)
-               return 0;
 
        ret = mmc_regulator_get_supply(mmc);
        if (ret == -EPROBE_DEFER)
index d6fa2214aaae8f967bf34230f7d784b4c598718b..0fb4e4c119e10682b2a2860f5389cd6350bcbb82 100644 (file)
@@ -793,8 +793,12 @@ static int sunxi_mmc_clk_set_rate(struct sunxi_mmc_host *host,
        }
        mmc_writel(host, REG_CLKCR, rval);
 
-       if (host->cfg->needs_new_timings)
-               mmc_writel(host, REG_SD_NTSR, SDXC_2X_TIMING_MODE);
+       if (host->cfg->needs_new_timings) {
+               /* Don't touch the delay bits */
+               rval = mmc_readl(host, REG_SD_NTSR);
+               rval |= SDXC_2X_TIMING_MODE;
+               mmc_writel(host, REG_SD_NTSR, rval);
+       }
 
        ret = sunxi_mmc_clk_set_phase(host, ios, rate);
        if (ret)
index 7c754a0f14bb5327b6e590ae6f31755a3762034a..19e4e904c9bfcf5bb1ccdfba3faf2b60ced9e7e5 100644 (file)
@@ -2,20 +2,11 @@
 # Multiplexer devices
 #
 
-menuconfig MULTIPLEXER
-       tristate "Multiplexer subsystem"
-       help
-         Multiplexer controller subsystem. Multiplexers are used in a
-         variety of settings, and this subsystem abstracts their use
-         so that the rest of the kernel sees a common interface. When
-         multiple parallel multiplexers are controlled by one single
-         multiplexer controller, this subsystem also coordinates the
-         multiplexer accesses.
-
-         To compile the subsystem as a module, choose M here: the module will
-         be called mux-core.
+config MULTIPLEXER
+       tristate
 
-if MULTIPLEXER
+menu "Multiplexer drivers"
+       depends on MULTIPLEXER
 
 config MUX_ADG792A
        tristate "Analog Devices ADG792A/ADG792G Multiplexers"
@@ -56,4 +47,4 @@ config MUX_MMIO
          To compile the driver as a module, choose M here: the module will
          be called mux-mmio.
 
-endif
+endmenu
index 90b8995f07cba08ad9c0dfb241916da10eac7fcf..2fe96c4701126300dc36adfe43801ec2fe81465f 100644 (file)
@@ -46,7 +46,7 @@ static int __init mux_init(void)
 
 static void __exit mux_exit(void)
 {
-       class_register(&mux_class);
+       class_unregister(&mux_class);
        ida_destroy(&mux_ida);
 }
 
index 99a26a9efec1ab695bae833a1f9dca437e9dde5c..f41ab0ea942a6e75a66ded6f9dcab2a999f920bb 100644 (file)
@@ -2743,9 +2743,9 @@ module_init(virtio_net_driver_init);
 
 static __exit void virtio_net_driver_exit(void)
 {
+       unregister_virtio_driver(&virtio_net_driver);
        cpuhp_remove_multi_state(CPUHP_VIRT_NET_DEAD);
        cpuhp_remove_multi_state(virtionet_online);
-       unregister_virtio_driver(&virtio_net_driver);
 }
 module_exit(virtio_net_driver_exit);
 
index a0d4ede9b8fc4aae1fdedbd901376a8c06972c0b..63e3eb55f3ac62e0784b21005d3f41c3a1b544b7 100644 (file)
@@ -170,7 +170,7 @@ static const struct of_device_id rockchip_efuse_match[] = {
                .data = (void *)&rockchip_rk3288_efuse_read,
        },
        {
-               .compatible = "rockchip,rk322x-efuse",
+               .compatible = "rockchip,rk3228-efuse",
                .data = (void *)&rockchip_rk3288_efuse_read,
        },
        {
index 055f83fddc188d42e37869b4d403dfab635c9461..7147aa53e9a218b78303968b7444383a39e576ee 100644 (file)
@@ -954,7 +954,7 @@ static struct attribute *pdcs_subsys_attrs[] = {
        NULL,
 };
 
-static struct attribute_group pdcs_attr_group = {
+static const struct attribute_group pdcs_attr_group = {
        .attrs = pdcs_subsys_attrs,
 };
 
index 7e0d4f724ddae73c71f698a9e4f7775328ef4d93..432fc40990bd26ad2e0dd9e39897ba5c348b197f 100644 (file)
@@ -559,6 +559,7 @@ static void chp_process_crw(struct crw *crw0, struct crw *crw1,
        chpid.id = crw0->rsid;
        switch (crw0->erc) {
        case CRW_ERC_IPARM: /* Path has come. */
+       case CRW_ERC_INIT:
                if (!chp_is_registered(chpid))
                        chp_new(chpid);
                chsc_chp_online(chpid);
index 8914eab843372fe3dde09e97b0d2c45aa65bbf64..4f7cdb28bd38fbadc6105906f56fe813346c299c 100644 (file)
@@ -938,7 +938,7 @@ static struct scsi_host_template hpsa_driver_template = {
 #endif
        .sdev_attrs = hpsa_sdev_attrs,
        .shost_attrs = hpsa_shost_attrs,
-       .max_sectors = 8192,
+       .max_sectors = 1024,
        .no_write_same = 1,
 };
 
index 1e82d4128a84800d3f96011c49e0b3fc12c55d8e..4fe606b000b4461c05e441cbb787edcfec51e72b 100644 (file)
@@ -759,8 +759,11 @@ static bool sg_is_valid_dxfer(sg_io_hdr_t *hp)
                        return false;
                return true;
        case SG_DXFER_FROM_DEV:
-               if (hp->dxfer_len < 0)
-                       return false;
+               /*
+                * for SG_DXFER_FROM_DEV we always set dxfer_len to > 0. dxferp
+                * can either be NULL or != NULL so there's no point in checking
+                * it either. So just return true.
+                */
                return true;
        case SG_DXFER_TO_DEV:
        case SG_DXFER_TO_FROM_DEV:
index 07ec8a8877dec04b6ac3ea35aef2ac1a6c6c3e01..e164ffade38a7166690a9ecb206be1165e62278c 100644 (file)
@@ -690,7 +690,7 @@ struct pqi_config_table_heartbeat {
 
 #define PQI_MAX_OUTSTANDING_REQUESTS           ((u32)~0)
 #define PQI_MAX_OUTSTANDING_REQUESTS_KDUMP     32
-#define PQI_MAX_TRANSFER_SIZE                  (4 * 1024U * 1024U)
+#define PQI_MAX_TRANSFER_SIZE                  (1024U * 1024U)
 #define PQI_MAX_TRANSFER_SIZE_KDUMP            (512 * 1024U)
 
 #define RAID_MAP_MAX_ENTRIES           1024
index 2afe3597982e73f5b592be8f7d991c4ebef9f8ad..f4b7a98a7913e236e295d4dd3422fa0f218b6e53 100644 (file)
@@ -134,7 +134,6 @@ struct apid_data {
  * @spmic:             SPMI controller object
  * @ver_ops:           version dependent operations.
  * @ppid_to_apid       in-memory copy of PPID -> channel (APID) mapping table.
- *                     v2 only.
  */
 struct spmi_pmic_arb {
        void __iomem            *rd_base;
@@ -1016,6 +1015,13 @@ static int spmi_pmic_arb_probe(struct platform_device *pdev)
                goto err_put_ctrl;
        }
 
+       pa->ppid_to_apid = devm_kcalloc(&ctrl->dev, PMIC_ARB_MAX_PPID,
+                                       sizeof(*pa->ppid_to_apid), GFP_KERNEL);
+       if (!pa->ppid_to_apid) {
+               err = -ENOMEM;
+               goto err_put_ctrl;
+       }
+
        hw_ver = readl_relaxed(core + PMIC_ARB_VERSION);
 
        if (hw_ver < PMIC_ARB_VERSION_V2_MIN) {
@@ -1048,15 +1054,6 @@ static int spmi_pmic_arb_probe(struct platform_device *pdev)
                        err = PTR_ERR(pa->wr_base);
                        goto err_put_ctrl;
                }
-
-               pa->ppid_to_apid = devm_kcalloc(&ctrl->dev,
-                                               PMIC_ARB_MAX_PPID,
-                                               sizeof(*pa->ppid_to_apid),
-                                               GFP_KERNEL);
-               if (!pa->ppid_to_apid) {
-                       err = -ENOMEM;
-                       goto err_put_ctrl;
-               }
        }
 
        dev_info(&ctrl->dev, "PMIC arbiter version %s (0x%x)\n",
index 2b9b0941d9eb5f82e917978426290a9d39b5c5cd..6d23226e5f696ee2268073efbe899bdfea88ba8a 100644 (file)
@@ -365,11 +365,23 @@ static int spmi_drv_remove(struct device *dev)
        return 0;
 }
 
+static int spmi_drv_uevent(struct device *dev, struct kobj_uevent_env *env)
+{
+       int ret;
+
+       ret = of_device_uevent_modalias(dev, env);
+       if (ret != -ENODEV)
+               return ret;
+
+       return 0;
+}
+
 static struct bus_type spmi_bus_type = {
        .name           = "spmi",
        .match          = spmi_device_match,
        .probe          = spmi_drv_probe,
        .remove         = spmi_drv_remove,
+       .uevent         = spmi_drv_uevent,
 };
 
 /**
index 268d4e6ef48a641cd04e9647c2a07b1fc24a216e..ef28a1cb64aecf5a0af0afd0d33b3313eaf26013 100644 (file)
@@ -110,4 +110,6 @@ source "drivers/staging/ccree/Kconfig"
 
 source "drivers/staging/typec/Kconfig"
 
+source "drivers/staging/vboxvideo/Kconfig"
+
 endif # STAGING
index b93e6f5f0f6eadc21efeda879175969fc68d7f72..2918580bdb9e215bfa407d4c38b94a661069c6fa 100644 (file)
@@ -44,3 +44,4 @@ obj-$(CONFIG_KS7010)          += ks7010/
 obj-$(CONFIG_GREYBUS)          += greybus/
 obj-$(CONFIG_BCM2835_VCHIQ)    += vc04_services/
 obj-$(CONFIG_CRYPTO_DEV_CCREE) += ccree/
+obj-$(CONFIG_DRM_VBOXVIDEO)    += vboxvideo/
index b2e38288898132004152c1e00d38c8df286e5d43..2f7bfc1c59e5171583613d4ba58f06d34b4742e6 100644 (file)
@@ -3116,8 +3116,7 @@ static void ni_ao_cmd_set_update(struct comedi_device *dev,
                /* following line: 2-1 per STC */
                ni_stc_writel(dev, 1, NISTC_AO_UI_LOADA_REG);
                ni_stc_writew(dev, NISTC_AO_CMD1_UI_LOAD, NISTC_AO_CMD1_REG);
-               /* following line: N-1 per STC */
-               ni_stc_writel(dev, trigvar - 1, NISTC_AO_UI_LOADA_REG);
+               ni_stc_writel(dev, trigvar, NISTC_AO_UI_LOADA_REG);
        } else { /* TRIG_EXT */
                /* FIXME:  assert scan_begin_arg != 0, ret failure otherwise */
                devpriv->ao_cmd2  |= NISTC_AO_CMD2_BC_GATE_ENA;
index 85b242ec5f9b284442e3fffe136ced430d2dd862..8fc191d9992703932a6692b531d82b6767763d51 100644 (file)
@@ -1640,8 +1640,13 @@ kiblnd_send(struct lnet_ni *ni, void *private, struct lnet_msg *lntmsg)
        ibmsg = tx->tx_msg;
        ibmsg->ibm_u.immediate.ibim_hdr = *hdr;
 
-       copy_from_iter(&ibmsg->ibm_u.immediate.ibim_payload, IBLND_MSG_SIZE,
-                      &from);
+       rc = copy_from_iter(&ibmsg->ibm_u.immediate.ibim_payload, payload_nob,
+                           &from);
+       if (rc != payload_nob) {
+               kiblnd_pool_free_node(&tx->tx_pool->tpo_pool, &tx->tx_list);
+               return -EFAULT;
+       }
+
        nob = offsetof(struct kib_immediate_msg, ibim_payload[payload_nob]);
        kiblnd_init_tx_msg(ni, tx, IBLND_MSG_IMMEDIATE, nob);
 
@@ -1741,8 +1746,14 @@ kiblnd_recv(struct lnet_ni *ni, void *private, struct lnet_msg *lntmsg,
                        break;
                }
 
-               copy_to_iter(&rxmsg->ibm_u.immediate.ibim_payload,
-                            IBLND_MSG_SIZE, to);
+               rc = copy_to_iter(&rxmsg->ibm_u.immediate.ibim_payload, rlen,
+                                 to);
+               if (rc != rlen) {
+                       rc = -EFAULT;
+                       break;
+               }
+
+               rc = 0;
                lnet_finalize(ni, lntmsg, 0);
                break;
 
index 002d09159896e63e1d2c54b1fb47efa2766197d9..a69007ef77bf0a32bb37468c3ee83a74493c2d42 100644 (file)
@@ -132,7 +132,7 @@ void rtw_free_cmd_obj(struct cmd_obj *pcmd)
                kfree(pcmd->parmbuf);
        }
 
-       if (!pcmd->rsp) {
+       if (pcmd->rsp) {
                if (pcmd->rspsz != 0) {
                        /* free rsp in cmd_obj */
                        kfree(pcmd->rsp);
index 963235fd72921f268e8304170f01fb5bbcc48681..d283341cfe4356914e3e9071f8d6851a7a180d46 100644 (file)
@@ -43,6 +43,7 @@ static struct usb_device_id rtw_usb_id_tbl[] = {
        {USB_DEVICE(0x2001, 0x330F)}, /* DLink DWA-125 REV D1 */
        {USB_DEVICE(0x2001, 0x3310)}, /* Dlink DWA-123 REV D1 */
        {USB_DEVICE(0x2001, 0x3311)}, /* DLink GO-USB-N150 REV B1 */
+       {USB_DEVICE(0x2357, 0x010c)}, /* TP-Link TL-WN722N v2 */
        {USB_DEVICE(0x0df6, 0x0076)}, /* Sitecom N150 v2 */
        {}      /* Terminating entry */
 };
index 944dd25924beba1decd0894564df6efc3323b5bf..4754f7a2068460e1f3259afc3b5c0741150cad5d 100644 (file)
@@ -40,7 +40,7 @@ static unsigned int get_mxclk_freq(void)
 
        pll_reg = peek32(MXCLK_PLL_CTRL);
        M = (pll_reg & PLL_CTRL_M_MASK) >> PLL_CTRL_M_SHIFT;
-       N = (pll_reg & PLL_CTRL_N_MASK) >> PLL_CTRL_M_SHIFT;
+       N = (pll_reg & PLL_CTRL_N_MASK) >> PLL_CTRL_N_SHIFT;
        OD = (pll_reg & PLL_CTRL_OD_MASK) >> PLL_CTRL_OD_SHIFT;
        POD = (pll_reg & PLL_CTRL_POD_MASK) >> PLL_CTRL_POD_SHIFT;
 
index 3aa4128703d537ed665b0ddd5ee12302712c4e5c..67207b0554cd4c868a095d8b8ab7cfeb51cb9233 100644 (file)
@@ -1053,6 +1053,26 @@ release_fb:
        return err;
 }
 
+static int lynxfb_kick_out_firmware_fb(struct pci_dev *pdev)
+{
+       struct apertures_struct *ap;
+       bool primary = false;
+
+       ap = alloc_apertures(1);
+       if (!ap)
+               return -ENOMEM;
+
+       ap->ranges[0].base = pci_resource_start(pdev, 0);
+       ap->ranges[0].size = pci_resource_len(pdev, 0);
+#ifdef CONFIG_X86
+       primary = pdev->resource[PCI_ROM_RESOURCE].flags &
+                                       IORESOURCE_ROM_SHADOW;
+#endif
+       remove_conflicting_framebuffers(ap, "sm750_fb1", primary);
+       kfree(ap);
+       return 0;
+}
+
 static int lynxfb_pci_probe(struct pci_dev *pdev,
                            const struct pci_device_id *ent)
 {
@@ -1061,6 +1081,10 @@ static int lynxfb_pci_probe(struct pci_dev *pdev,
        int fbidx;
        int err;
 
+       err = lynxfb_kick_out_firmware_fb(pdev);
+       if (err)
+               return err;
+
        /* enable device */
        err = pcim_enable_device(pdev);
        if (err)
index 82e5de248947f4cd5bd24d8bf4a2cba7f903b88b..67956e24779ce6fea015da416422cdf5c834bf18 100644 (file)
@@ -2314,6 +2314,7 @@ static void __exit speakup_exit(void)
        mutex_lock(&spk_mutex);
        synth_release();
        mutex_unlock(&spk_mutex);
+       spk_ttyio_unregister_ldisc();
 
        speakup_kobj_exit();
 
@@ -2376,6 +2377,7 @@ static int __init speakup_init(void)
        if (err)
                goto error_kobjects;
 
+       spk_ttyio_register_ldisc();
        synth_init(synth_name);
        speakup_register_devsynth();
        /*
index 87b6a0a4c54dc80c8cbbbbf3b3c7d4208827cbcc..046040ac074c63851e8b289d5a6bf0f05b31684d 100644 (file)
@@ -48,6 +48,8 @@ void spk_stop_serial_interrupt(void);
 int spk_wait_for_xmitr(struct spk_synth *in_synth);
 void spk_serial_release(void);
 void spk_ttyio_release(void);
+void spk_ttyio_register_ldisc(void);
+void spk_ttyio_unregister_ldisc(void);
 
 void synth_buffer_skip_nonlatin1(void);
 u16 synth_buffer_getc(void);
index ed8e96b06ead24fde5c0c54f48d1c2dc83e825ef..fe340b07c482fac63410d57ed1b7c0d262e069c1 100644 (file)
@@ -154,12 +154,6 @@ static int spk_ttyio_initialise_ldisc(struct spk_synth *synth)
        struct ktermios tmp_termios;
        dev_t dev;
 
-       ret = tty_register_ldisc(N_SPEAKUP, &spk_ttyio_ldisc_ops);
-       if (ret) {
-               pr_err("Error registering line discipline.\n");
-               return ret;
-       }
-
        ret = get_dev_to_use(synth, &dev);
        if (ret)
                return ret;
@@ -196,10 +190,24 @@ static int spk_ttyio_initialise_ldisc(struct spk_synth *synth)
        tty_unlock(tty);
 
        ret = tty_set_ldisc(tty, N_SPEAKUP);
+       if (ret)
+               pr_err("speakup: Failed to set N_SPEAKUP on tty\n");
 
        return ret;
 }
 
+void spk_ttyio_register_ldisc(void)
+{
+       if (tty_register_ldisc(N_SPEAKUP, &spk_ttyio_ldisc_ops))
+               pr_warn("speakup: Error registering line discipline. Most synths won't work.\n");
+}
+
+void spk_ttyio_unregister_ldisc(void)
+{
+       if (tty_unregister_ldisc(N_SPEAKUP))
+               pr_warn("speakup: Couldn't unregister ldisc\n");
+}
+
 static int spk_ttyio_out(struct spk_synth *in_synth, const char ch)
 {
        if (in_synth->alive && speakup_tty && speakup_tty->ops->write) {
@@ -300,7 +308,7 @@ void spk_ttyio_release(void)
 
        tty_ldisc_flush(speakup_tty);
        tty_unlock(speakup_tty);
-       tty_ldisc_release(speakup_tty);
+       tty_release_struct(speakup_tty, speakup_tty->index);
 }
 EXPORT_SYMBOL_GPL(spk_ttyio_release);
 
diff --git a/drivers/staging/vboxvideo/Kconfig b/drivers/staging/vboxvideo/Kconfig
new file mode 100644 (file)
index 0000000..a52746f
--- /dev/null
@@ -0,0 +1,12 @@
+config DRM_VBOXVIDEO
+       tristate "Virtual Box Graphics Card"
+       depends on DRM && X86 && PCI
+       select DRM_KMS_HELPER
+       help
+         This is a KMS driver for the virtual Graphics Card used in
+         Virtual Box virtual machines.
+
+         Although it is possible to builtin this module, it is advised
+         to build this driver as a module, so that it can be updated
+         independently of the kernel. Select M to built this driver as a
+         module and add support for these devices via drm/kms interfaces.
diff --git a/drivers/staging/vboxvideo/Makefile b/drivers/staging/vboxvideo/Makefile
new file mode 100644 (file)
index 0000000..2d0b3bc
--- /dev/null
@@ -0,0 +1,7 @@
+ccflags-y := -Iinclude/drm
+
+vboxvideo-y :=  hgsmi_base.o modesetting.o vbva_base.o \
+               vbox_drv.o vbox_fb.o vbox_hgsmi.o vbox_irq.o vbox_main.o \
+               vbox_mode.o vbox_prime.o vbox_ttm.o
+
+obj-$(CONFIG_DRM_VBOXVIDEO) += vboxvideo.o
diff --git a/drivers/staging/vboxvideo/TODO b/drivers/staging/vboxvideo/TODO
new file mode 100644 (file)
index 0000000..ce76430
--- /dev/null
@@ -0,0 +1,9 @@
+TODO:
+-Move the driver over to the atomic API
+-Stop using old load / unload drm_driver hooks
+-Get a full review from the drm-maintainers on dri-devel done on this driver
+-Extend this TODO with the results of that review
+
+Please send any patches to Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
+Hans de Goede <hdegoede@redhat.com> and
+Michael Thayer <michael.thayer@oracle.com>.
diff --git a/drivers/staging/vboxvideo/hgsmi_base.c b/drivers/staging/vboxvideo/hgsmi_base.c
new file mode 100644 (file)
index 0000000..15ff5f4
--- /dev/null
@@ -0,0 +1,246 @@
+/*
+ * Copyright (C) 2006-2017 Oracle Corporation
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
+ * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
+ * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+ * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+ * OTHER DEALINGS IN THE SOFTWARE.
+ */
+
+#include "vbox_drv.h"
+#include "vbox_err.h"
+#include "vboxvideo_guest.h"
+#include "vboxvideo_vbe.h"
+#include "hgsmi_channels.h"
+#include "hgsmi_ch_setup.h"
+
+/**
+ * Inform the host of the location of the host flags in VRAM via an HGSMI cmd.
+ * @param    ctx          the context of the guest heap to use.
+ * @param    location     the offset chosen for the flags within guest VRAM.
+ * @returns 0 on success, -errno on failure
+ */
+int hgsmi_report_flags_location(struct gen_pool *ctx, u32 location)
+{
+       struct hgsmi_buffer_location *p;
+
+       p = hgsmi_buffer_alloc(ctx, sizeof(*p), HGSMI_CH_HGSMI,
+                              HGSMI_CC_HOST_FLAGS_LOCATION);
+       if (!p)
+               return -ENOMEM;
+
+       p->buf_location = location;
+       p->buf_len = sizeof(struct hgsmi_host_flags);
+
+       hgsmi_buffer_submit(ctx, p);
+       hgsmi_buffer_free(ctx, p);
+
+       return 0;
+}
+
+/**
+ * Notify the host of HGSMI-related guest capabilities via an HGSMI command.
+ * @param    ctx                 the context of the guest heap to use.
+ * @param    caps                the capabilities to report, see vbva_caps.
+ * @returns 0 on success, -errno on failure
+ */
+int hgsmi_send_caps_info(struct gen_pool *ctx, u32 caps)
+{
+       struct vbva_caps *p;
+
+       p = hgsmi_buffer_alloc(ctx, sizeof(*p), HGSMI_CH_VBVA, VBVA_INFO_CAPS);
+       if (!p)
+               return -ENOMEM;
+
+       p->rc = VERR_NOT_IMPLEMENTED;
+       p->caps = caps;
+
+       hgsmi_buffer_submit(ctx, p);
+
+       WARN_ON_ONCE(RT_FAILURE(p->rc));
+
+       hgsmi_buffer_free(ctx, p);
+
+       return 0;
+}
+
+int hgsmi_test_query_conf(struct gen_pool *ctx)
+{
+       u32 value = 0;
+       int ret;
+
+       ret = hgsmi_query_conf(ctx, U32_MAX, &value);
+       if (ret)
+               return ret;
+
+       return value == U32_MAX ? 0 : -EIO;
+}
+
+/**
+ * Query the host for an HGSMI configuration parameter via an HGSMI command.
+ * @param  ctx        the context containing the heap used
+ * @param  index      the index of the parameter to query,
+ *                    @see vbva_conf32::index
+ * @param  value_ret  where to store the value of the parameter on success
+ * @returns 0 on success, -errno on failure
+ */
+int hgsmi_query_conf(struct gen_pool *ctx, u32 index, u32 *value_ret)
+{
+       struct vbva_conf32 *p;
+
+       p = hgsmi_buffer_alloc(ctx, sizeof(*p), HGSMI_CH_VBVA,
+                              VBVA_QUERY_CONF32);
+       if (!p)
+               return -ENOMEM;
+
+       p->index = index;
+       p->value = U32_MAX;
+
+       hgsmi_buffer_submit(ctx, p);
+
+       *value_ret = p->value;
+
+       hgsmi_buffer_free(ctx, p);
+
+       return 0;
+}
+
+/**
+ * Pass the host a new mouse pointer shape via an HGSMI command.
+ *
+ * @param  ctx      the context containing the heap to be used
+ * @param  flags    cursor flags, @see VMMDevReqMousePointer::flags
+ * @param  hot_x    horizontal position of the hot spot
+ * @param  hot_y    vertical position of the hot spot
+ * @param  width    width in pixels of the cursor
+ * @param  height   height in pixels of the cursor
+ * @param  pixels   pixel data, @see VMMDevReqMousePointer for the format
+ * @param  len      size in bytes of the pixel data
+ * @returns 0 on success, -errno on failure
+ */
+int hgsmi_update_pointer_shape(struct gen_pool *ctx, u32 flags,
+                              u32 hot_x, u32 hot_y, u32 width, u32 height,
+                              u8 *pixels, u32 len)
+{
+       struct vbva_mouse_pointer_shape *p;
+       u32 pixel_len = 0;
+       int rc;
+
+       if (flags & VBOX_MOUSE_POINTER_SHAPE) {
+               /*
+                * Size of the pointer data:
+                * sizeof (AND mask) + sizeof (XOR_MASK)
+                */
+               pixel_len = ((((width + 7) / 8) * height + 3) & ~3) +
+                        width * 4 * height;
+               if (pixel_len > len)
+                       return -EINVAL;
+
+               /*
+                * If shape is supplied, then always create the pointer visible.
+                * See comments in 'vboxUpdatePointerShape'
+                */
+               flags |= VBOX_MOUSE_POINTER_VISIBLE;
+       }
+
+       p = hgsmi_buffer_alloc(ctx, sizeof(*p) + pixel_len, HGSMI_CH_VBVA,
+                              VBVA_MOUSE_POINTER_SHAPE);
+       if (!p)
+               return -ENOMEM;
+
+       p->result = VINF_SUCCESS;
+       p->flags = flags;
+       p->hot_X = hot_x;
+       p->hot_y = hot_y;
+       p->width = width;
+       p->height = height;
+       if (pixel_len)
+               memcpy(p->data, pixels, pixel_len);
+
+       hgsmi_buffer_submit(ctx, p);
+
+       switch (p->result) {
+       case VINF_SUCCESS:
+               rc = 0;
+               break;
+       case VERR_NO_MEMORY:
+               rc = -ENOMEM;
+               break;
+       case VERR_NOT_SUPPORTED:
+               rc = -EBUSY;
+               break;
+       default:
+               rc = -EINVAL;
+       }
+
+       hgsmi_buffer_free(ctx, p);
+
+       return rc;
+}
+
+/**
+ * Report the guest cursor position.  The host may wish to use this information
+ * to re-position its own cursor (though this is currently unlikely).  The
+ * current host cursor position is returned.
+ * @param  ctx              The context containing the heap used.
+ * @param  report_position  Are we reporting a position?
+ * @param  x                Guest cursor X position.
+ * @param  y                Guest cursor Y position.
+ * @param  x_host           Host cursor X position is stored here.  Optional.
+ * @param  y_host           Host cursor Y position is stored here.  Optional.
+ * @returns 0 on success, -errno on failure
+ */
+int hgsmi_cursor_position(struct gen_pool *ctx, bool report_position,
+                         u32 x, u32 y, u32 *x_host, u32 *y_host)
+{
+       struct vbva_cursor_position *p;
+
+       p = hgsmi_buffer_alloc(ctx, sizeof(*p), HGSMI_CH_VBVA,
+                              VBVA_CURSOR_POSITION);
+       if (!p)
+               return -ENOMEM;
+
+       p->report_position = report_position;
+       p->x = x;
+       p->y = y;
+
+       hgsmi_buffer_submit(ctx, p);
+
+       *x_host = p->x;
+       *y_host = p->y;
+
+       hgsmi_buffer_free(ctx, p);
+
+       return 0;
+}
+
+/**
+ * @todo Mouse pointer position to be read from VMMDev memory, address of the
+ * memory region can be queried from VMMDev via an IOCTL. This VMMDev memory
+ * region will contain host information which is needed by the guest.
+ *
+ * Reading will not cause a switch to the host.
+ *
+ * Have to take into account:
+ *  * synchronization: host must write to the memory only from EMT,
+ *    large structures must be read under flag, which tells the host
+ *    that the guest is currently reading the memory (OWNER flag?).
+ *  * guest writes: may be allocate a page for the host info and make
+ *    the page readonly for the guest.
+ *  * the information should be available only for additions drivers.
+ *  * VMMDev additions driver will inform the host which version of the info
+ *    it expects, host must support all versions.
+ */
diff --git a/drivers/staging/vboxvideo/hgsmi_ch_setup.h b/drivers/staging/vboxvideo/hgsmi_ch_setup.h
new file mode 100644 (file)
index 0000000..8e6d9e1
--- /dev/null
@@ -0,0 +1,66 @@
+/*
+ * Copyright (C) 2006-2017 Oracle Corporation
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
+ * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
+ * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+ * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+ * OTHER DEALINGS IN THE SOFTWARE.
+ */
+
+#ifndef __HGSMI_CH_SETUP_H__
+#define __HGSMI_CH_SETUP_H__
+
+/*
+ * Tell the host the location of hgsmi_host_flags structure, where the host
+ * can write information about pending buffers, etc, and which can be quickly
+ * polled by the guest without a need to port IO.
+ */
+#define HGSMI_CC_HOST_FLAGS_LOCATION 0
+
+struct hgsmi_buffer_location {
+       u32 buf_location;
+       u32 buf_len;
+} __packed;
+
+/* HGSMI setup and configuration data structures. */
+/* host->guest commands pending, should be accessed under FIFO lock only */
+#define HGSMIHOSTFLAGS_COMMANDS_PENDING    0x01u
+/* IRQ is fired, should be accessed under VGAState::lock only  */
+#define HGSMIHOSTFLAGS_IRQ                 0x02u
+/* vsync interrupt flag, should be accessed under VGAState::lock only */
+#define HGSMIHOSTFLAGS_VSYNC               0x10u
+/** monitor hotplug flag, should be accessed under VGAState::lock only */
+#define HGSMIHOSTFLAGS_HOTPLUG             0x20u
+/**
+ * Cursor capability state change flag, should be accessed under
+ * VGAState::lock only. @see vbva_conf32.
+ */
+#define HGSMIHOSTFLAGS_CURSOR_CAPABILITIES 0x40u
+
+struct hgsmi_host_flags {
+       /*
+        * Host flags can be accessed and modified in multiple threads
+        * concurrently, e.g. CrOpenGL HGCM and GUI threads when completing
+        * HGSMI 3D and Video Accel respectively, EMT thread when dealing with
+        * HGSMI command processing, etc.
+        * Besides settings/cleaning flags atomically, some flags have their
+        * own special sync restrictions, see comments for flags above.
+        */
+       u32 host_flags;
+       u32 reserved[3];
+} __packed;
+
+#endif
diff --git a/drivers/staging/vboxvideo/hgsmi_channels.h b/drivers/staging/vboxvideo/hgsmi_channels.h
new file mode 100644 (file)
index 0000000..a2a34b2
--- /dev/null
@@ -0,0 +1,53 @@
+/*
+ * Copyright (C) 2006-2017 Oracle Corporation
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
+ * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
+ * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+ * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+ * OTHER DEALINGS IN THE SOFTWARE.
+ */
+
+#ifndef __HGSMI_CHANNELS_H__
+#define __HGSMI_CHANNELS_H__
+
+/*
+ * Each channel has an 8 bit identifier. There are a number of predefined
+ * (hardcoded) channels.
+ *
+ * HGSMI_CH_HGSMI channel can be used to map a string channel identifier
+ * to a free 16 bit numerical value. values are allocated in range
+ * [HGSMI_CH_STRING_FIRST;HGSMI_CH_STRING_LAST].
+ */
+
+/* A reserved channel value */
+#define HGSMI_CH_RESERVED                              0x00
+/* HGCMI: setup and configuration */
+#define HGSMI_CH_HGSMI                                 0x01
+/* Graphics: VBVA */
+#define HGSMI_CH_VBVA                                  0x02
+/* Graphics: Seamless with a single guest region */
+#define HGSMI_CH_SEAMLESS                              0x03
+/* Graphics: Seamless with separate host windows */
+#define HGSMI_CH_SEAMLESS2                             0x04
+/* Graphics: OpenGL HW acceleration */
+#define HGSMI_CH_OPENGL                                        0x05
+
+/* The first channel index to be used for string mappings (inclusive) */
+#define HGSMI_CH_STRING_FIRST                          0x20
+/* The last channel index for string mappings (inclusive) */
+#define HGSMI_CH_STRING_LAST                           0xff
+
+#endif
diff --git a/drivers/staging/vboxvideo/hgsmi_defs.h b/drivers/staging/vboxvideo/hgsmi_defs.h
new file mode 100644 (file)
index 0000000..5b21fb9
--- /dev/null
@@ -0,0 +1,92 @@
+/*
+ * Copyright (C) 2006-2017 Oracle Corporation
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
+ * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
+ * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+ * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+ * OTHER DEALINGS IN THE SOFTWARE.
+ */
+
+#ifndef __HGSMI_DEFS_H__
+#define __HGSMI_DEFS_H__
+
+/* Buffer sequence type mask. */
+#define HGSMI_BUFFER_HEADER_F_SEQ_MASK     0x03
+/* Single buffer, not a part of a sequence. */
+#define HGSMI_BUFFER_HEADER_F_SEQ_SINGLE   0x00
+/* The first buffer in a sequence. */
+#define HGSMI_BUFFER_HEADER_F_SEQ_START    0x01
+/* A middle buffer in a sequence. */
+#define HGSMI_BUFFER_HEADER_F_SEQ_CONTINUE 0x02
+/* The last buffer in a sequence. */
+#define HGSMI_BUFFER_HEADER_F_SEQ_END      0x03
+
+/* 16 bytes buffer header. */
+struct hgsmi_buffer_header {
+       u32 data_size;          /* Size of data that follows the header. */
+       u8 flags;               /* HGSMI_BUFFER_HEADER_F_* */
+       u8 channel;             /* The channel the data must be routed to. */
+       u16 channel_info;       /* Opaque to the HGSMI, used by the channel. */
+
+       union {
+               /* Opaque placeholder to make the union 8 bytes. */
+               u8 header_data[8];
+
+               /* HGSMI_BUFFER_HEADER_F_SEQ_SINGLE */
+               struct {
+                       u32 reserved1;  /* A reserved field, initialize to 0. */
+                       u32 reserved2;  /* A reserved field, initialize to 0. */
+               } buffer;
+
+               /* HGSMI_BUFFER_HEADER_F_SEQ_START */
+               struct {
+                       /* Must be the same for all buffers in the sequence. */
+                       u32 sequence_number;
+                       /* The total size of the sequence. */
+                       u32 sequence_size;
+               } sequence_start;
+
+               /*
+                * HGSMI_BUFFER_HEADER_F_SEQ_CONTINUE and
+                * HGSMI_BUFFER_HEADER_F_SEQ_END
+                */
+               struct {
+                       /* Must be the same for all buffers in the sequence. */
+                       u32 sequence_number;
+                       /* Data offset in the entire sequence. */
+                       u32 sequence_offset;
+               } sequence_continue;
+       } u;
+} __packed;
+
+/* 8 bytes buffer tail. */
+struct hgsmi_buffer_tail {
+       /* Reserved, must be initialized to 0. */
+       u32 reserved;
+       /*
+        * One-at-a-Time Hash: http://www.burtleburtle.net/bob/hash/doobs.html
+        * Over the header, offset and for first 4 bytes of the tail.
+        */
+       u32 checksum;
+} __packed;
+
+/*
+ * The size of the array of channels. Array indexes are u8.
+ * Note: the value must not be changed.
+ */
+#define HGSMI_NUMBER_OF_CHANNELS 0x100
+
+#endif
diff --git a/drivers/staging/vboxvideo/modesetting.c b/drivers/staging/vboxvideo/modesetting.c
new file mode 100644 (file)
index 0000000..7616b8a
--- /dev/null
@@ -0,0 +1,142 @@
+/*
+ * Copyright (C) 2006-2017 Oracle Corporation
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
+ * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
+ * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+ * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+ * OTHER DEALINGS IN THE SOFTWARE.
+ */
+
+#include "vbox_drv.h"
+#include "vbox_err.h"
+#include "vboxvideo_guest.h"
+#include "vboxvideo_vbe.h"
+#include "hgsmi_channels.h"
+
+/**
+ * Set a video mode via an HGSMI request.  The views must have been
+ * initialised first using @a VBoxHGSMISendViewInfo and if the mode is being
+ * set on the first display then it must be set first using registers.
+ * @param  ctx           The context containing the heap to use
+ * @param  display       The screen number
+ * @param  origin_x      The horizontal displacement relative to the first scrn
+ * @param  origin_y      The vertical displacement relative to the first screen
+ * @param  start_offset  The offset of the visible area of the framebuffer
+ *                       relative to the framebuffer start
+ * @param  pitch         The offset in bytes between the starts of two adjecent
+ *                       scan lines in video RAM
+ * @param  width         The mode width
+ * @param  height        The mode height
+ * @param  bpp           The colour depth of the mode
+ * @param  flags         Flags
+ */
+void hgsmi_process_display_info(struct gen_pool *ctx, u32 display,
+                               s32 origin_x, s32 origin_y, u32 start_offset,
+                               u32 pitch, u32 width, u32 height,
+                               u16 bpp, u16 flags)
+{
+       struct vbva_infoscreen *p;
+
+       p = hgsmi_buffer_alloc(ctx, sizeof(*p), HGSMI_CH_VBVA,
+                              VBVA_INFO_SCREEN);
+       if (!p)
+               return;
+
+       p->view_index = display;
+       p->origin_x = origin_x;
+       p->origin_y = origin_y;
+       p->start_offset = start_offset;
+       p->line_size = pitch;
+       p->width = width;
+       p->height = height;
+       p->bits_per_pixel = bpp;
+       p->flags = flags;
+
+       hgsmi_buffer_submit(ctx, p);
+       hgsmi_buffer_free(ctx, p);
+}
+
+/**
+ * Report the rectangle relative to which absolute pointer events should be
+ * expressed.  This information remains valid until the next VBVA resize event
+ * for any screen, at which time it is reset to the bounding rectangle of all
+ * virtual screens.
+ * @param  ctx       The context containing the heap to use.
+ * @param  origin_x  Upper left X co-ordinate relative to the first screen.
+ * @param  origin_y  Upper left Y co-ordinate relative to the first screen.
+ * @param  width     Rectangle width.
+ * @param  height    Rectangle height.
+ * @returns 0 on success, -errno on failure
+ */
+int hgsmi_update_input_mapping(struct gen_pool *ctx, s32 origin_x, s32 origin_y,
+                              u32 width, u32 height)
+{
+       struct vbva_report_input_mapping *p;
+
+       p = hgsmi_buffer_alloc(ctx, sizeof(*p), HGSMI_CH_VBVA,
+                              VBVA_REPORT_INPUT_MAPPING);
+       if (!p)
+               return -ENOMEM;
+
+       p->x = origin_x;
+       p->y = origin_y;
+       p->cx = width;
+       p->cy = height;
+
+       hgsmi_buffer_submit(ctx, p);
+       hgsmi_buffer_free(ctx, p);
+
+       return 0;
+}
+
+/**
+ * Get most recent video mode hints.
+ * @param  ctx      The context containing the heap to use.
+ * @param  screens  The number of screens to query hints for, starting at 0.
+ * @param  hints    Array of vbva_modehint structures for receiving the hints.
+ * @returns 0 on success, -errno on failure
+ */
+int hgsmi_get_mode_hints(struct gen_pool *ctx, unsigned int screens,
+                        struct vbva_modehint *hints)
+{
+       struct vbva_query_mode_hints *p;
+       size_t size;
+
+       if (WARN_ON(!hints))
+               return -EINVAL;
+
+       size = screens * sizeof(struct vbva_modehint);
+       p = hgsmi_buffer_alloc(ctx, sizeof(*p) + size, HGSMI_CH_VBVA,
+                              VBVA_QUERY_MODE_HINTS);
+       if (!p)
+               return -ENOMEM;
+
+       p->hints_queried_count = screens;
+       p->hint_structure_guest_size = sizeof(struct vbva_modehint);
+       p->rc = VERR_NOT_SUPPORTED;
+
+       hgsmi_buffer_submit(ctx, p);
+
+       if (RT_FAILURE(p->rc)) {
+               hgsmi_buffer_free(ctx, p);
+               return -EIO;
+       }
+
+       memcpy(hints, ((u8 *)p) + sizeof(struct vbva_query_mode_hints), size);
+       hgsmi_buffer_free(ctx, p);
+
+       return 0;
+}
diff --git a/drivers/staging/vboxvideo/vbox_drv.c b/drivers/staging/vboxvideo/vbox_drv.c
new file mode 100644 (file)
index 0000000..92ae156
--- /dev/null
@@ -0,0 +1,286 @@
+/*
+ * Copyright (C) 2013-2017 Oracle Corporation
+ * This file is based on ast_drv.c
+ * Copyright 2012 Red Hat Inc.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the
+ * "Software"), to deal in the Software without restriction, including
+ * without limitation the rights to use, copy, modify, merge, publish,
+ * distribute, sub license, and/or sell copies of the Software, and to
+ * permit persons to whom the Software is furnished to do so, subject to
+ * the following conditions:
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
+ * THE COPYRIGHT HOLDERS, AUTHORS AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM,
+ * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
+ * USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
+ * The above copyright notice and this permission notice (including the
+ * next paragraph) shall be included in all copies or substantial portions
+ * of the Software.
+ *
+ * Authors: Dave Airlie <airlied@redhat.com>
+ *          Michael Thayer <michael.thayer@oracle.com,
+ *          Hans de Goede <hdegoede@redhat.com>
+ */
+#include <linux/module.h>
+#include <linux/console.h>
+#include <linux/vt_kern.h>
+
+#include <drm/drmP.h>
+#include <drm/drm_crtc_helper.h>
+
+#include "vbox_drv.h"
+
+int vbox_modeset = -1;
+
+MODULE_PARM_DESC(modeset, "Disable/Enable modesetting");
+module_param_named(modeset, vbox_modeset, int, 0400);
+
+static struct drm_driver driver;
+
+static const struct pci_device_id pciidlist[] = {
+       { 0x80ee, 0xbeef, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 },
+       { 0, 0, 0},
+};
+MODULE_DEVICE_TABLE(pci, pciidlist);
+
+static int vbox_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
+{
+       return drm_get_pci_dev(pdev, ent, &driver);
+}
+
+static void vbox_pci_remove(struct pci_dev *pdev)
+{
+       struct drm_device *dev = pci_get_drvdata(pdev);
+
+       drm_put_dev(dev);
+}
+
+static int vbox_drm_freeze(struct drm_device *dev)
+{
+       struct vbox_private *vbox = dev->dev_private;
+
+       drm_kms_helper_poll_disable(dev);
+
+       pci_save_state(dev->pdev);
+
+       drm_fb_helper_set_suspend_unlocked(&vbox->fbdev->helper, true);
+
+       return 0;
+}
+
+static int vbox_drm_thaw(struct drm_device *dev)
+{
+       struct vbox_private *vbox = dev->dev_private;
+
+       drm_mode_config_reset(dev);
+       drm_helper_resume_force_mode(dev);
+       drm_fb_helper_set_suspend_unlocked(&vbox->fbdev->helper, false);
+
+       return 0;
+}
+
+static int vbox_drm_resume(struct drm_device *dev)
+{
+       int ret;
+
+       if (pci_enable_device(dev->pdev))
+               return -EIO;
+
+       ret = vbox_drm_thaw(dev);
+       if (ret)
+               return ret;
+
+       drm_kms_helper_poll_enable(dev);
+
+       return 0;
+}
+
+static int vbox_pm_suspend(struct device *dev)
+{
+       struct pci_dev *pdev = to_pci_dev(dev);
+       struct drm_device *ddev = pci_get_drvdata(pdev);
+       int error;
+
+       error = vbox_drm_freeze(ddev);
+       if (error)
+               return error;
+
+       pci_disable_device(pdev);
+       pci_set_power_state(pdev, PCI_D3hot);
+
+       return 0;
+}
+
+static int vbox_pm_resume(struct device *dev)
+{
+       struct drm_device *ddev = pci_get_drvdata(to_pci_dev(dev));
+
+       return vbox_drm_resume(ddev);
+}
+
+static int vbox_pm_freeze(struct device *dev)
+{
+       struct pci_dev *pdev = to_pci_dev(dev);
+       struct drm_device *ddev = pci_get_drvdata(pdev);
+
+       if (!ddev || !ddev->dev_private)
+               return -ENODEV;
+
+       return vbox_drm_freeze(ddev);
+}
+
+static int vbox_pm_thaw(struct device *dev)
+{
+       struct drm_device *ddev = pci_get_drvdata(to_pci_dev(dev));
+
+       return vbox_drm_thaw(ddev);
+}
+
+static int vbox_pm_poweroff(struct device *dev)
+{
+       struct drm_device *ddev = pci_get_drvdata(to_pci_dev(dev));
+
+       return vbox_drm_freeze(ddev);
+}
+
+static const struct dev_pm_ops vbox_pm_ops = {
+       .suspend = vbox_pm_suspend,
+       .resume = vbox_pm_resume,
+       .freeze = vbox_pm_freeze,
+       .thaw = vbox_pm_thaw,
+       .poweroff = vbox_pm_poweroff,
+       .restore = vbox_pm_resume,
+};
+
+static struct pci_driver vbox_pci_driver = {
+       .name = DRIVER_NAME,
+       .id_table = pciidlist,
+       .probe = vbox_pci_probe,
+       .remove = vbox_pci_remove,
+       .driver.pm = &vbox_pm_ops,
+};
+
+static const struct file_operations vbox_fops = {
+       .owner = THIS_MODULE,
+       .open = drm_open,
+       .release = drm_release,
+       .unlocked_ioctl = drm_ioctl,
+       .mmap = vbox_mmap,
+       .poll = drm_poll,
+#ifdef CONFIG_COMPAT
+       .compat_ioctl = drm_compat_ioctl,
+#endif
+       .read = drm_read,
+};
+
+static int vbox_master_set(struct drm_device *dev,
+                          struct drm_file *file_priv, bool from_open)
+{
+       struct vbox_private *vbox = dev->dev_private;
+
+       /*
+        * We do not yet know whether the new owner can handle hotplug, so we
+        * do not advertise dynamic modes on the first query and send a
+        * tentative hotplug notification after that to see if they query again.
+        */
+       vbox->initial_mode_queried = false;
+
+       mutex_lock(&vbox->hw_mutex);
+       /*
+        * Disable VBVA when someone releases master in case the next person
+        * tries tries to do VESA.
+        */
+       /** @todo work out if anyone is likely to and whether it will work. */
+       /*
+        * Update: we also disable it because if the new master does not do
+        * dirty rectangle reporting (e.g. old versions of Plymouth) then at
+        * least the first screen will still be updated. We enable it as soon
+        * as we receive a dirty rectangle report.
+        */
+       vbox_disable_accel(vbox);
+       mutex_unlock(&vbox->hw_mutex);
+
+       return 0;
+}
+
+static void vbox_master_drop(struct drm_device *dev, struct drm_file *file_priv)
+{
+       struct vbox_private *vbox = dev->dev_private;
+
+       /* See vbox_master_set() */
+       vbox->initial_mode_queried = false;
+
+       mutex_lock(&vbox->hw_mutex);
+       vbox_disable_accel(vbox);
+       mutex_unlock(&vbox->hw_mutex);
+}
+
+static struct drm_driver driver = {
+       .driver_features =
+           DRIVER_MODESET | DRIVER_GEM | DRIVER_HAVE_IRQ | DRIVER_IRQ_SHARED |
+           DRIVER_PRIME,
+       .dev_priv_size = 0,
+
+       .load = vbox_driver_load,
+       .unload = vbox_driver_unload,
+       .lastclose = vbox_driver_lastclose,
+       .master_set = vbox_master_set,
+       .master_drop = vbox_master_drop,
+       .set_busid = drm_pci_set_busid,
+
+       .fops = &vbox_fops,
+       .irq_handler = vbox_irq_handler,
+       .name = DRIVER_NAME,
+       .desc = DRIVER_DESC,
+       .date = DRIVER_DATE,
+       .major = DRIVER_MAJOR,
+       .minor = DRIVER_MINOR,
+       .patchlevel = DRIVER_PATCHLEVEL,
+
+       .gem_free_object = vbox_gem_free_object,
+       .dumb_create = vbox_dumb_create,
+       .dumb_map_offset = vbox_dumb_mmap_offset,
+       .dumb_destroy = drm_gem_dumb_destroy,
+       .prime_handle_to_fd = drm_gem_prime_handle_to_fd,
+       .prime_fd_to_handle = drm_gem_prime_fd_to_handle,
+       .gem_prime_export = drm_gem_prime_export,
+       .gem_prime_import = drm_gem_prime_import,
+       .gem_prime_pin = vbox_gem_prime_pin,
+       .gem_prime_unpin = vbox_gem_prime_unpin,
+       .gem_prime_get_sg_table = vbox_gem_prime_get_sg_table,
+       .gem_prime_import_sg_table = vbox_gem_prime_import_sg_table,
+       .gem_prime_vmap = vbox_gem_prime_vmap,
+       .gem_prime_vunmap = vbox_gem_prime_vunmap,
+       .gem_prime_mmap = vbox_gem_prime_mmap,
+};
+
+static int __init vbox_init(void)
+{
+#ifdef CONFIG_VGA_CONSOLE
+       if (vgacon_text_force() && vbox_modeset == -1)
+               return -EINVAL;
+#endif
+
+       if (vbox_modeset == 0)
+               return -EINVAL;
+
+       return drm_pci_init(&driver, &vbox_pci_driver);
+}
+
+static void __exit vbox_exit(void)
+{
+       drm_pci_exit(&driver, &vbox_pci_driver);
+}
+
+module_init(vbox_init);
+module_exit(vbox_exit);
+
+MODULE_AUTHOR("Oracle Corporation");
+MODULE_DESCRIPTION(DRIVER_DESC);
+MODULE_LICENSE("GPL and additional rights");
diff --git a/drivers/staging/vboxvideo/vbox_drv.h b/drivers/staging/vboxvideo/vbox_drv.h
new file mode 100644 (file)
index 0000000..4b93027
--- /dev/null
@@ -0,0 +1,296 @@
+/*
+ * Copyright (C) 2013-2017 Oracle Corporation
+ * This file is based on ast_drv.h
+ * Copyright 2012 Red Hat Inc.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the
+ * "Software"), to deal in the Software without restriction, including
+ * without limitation the rights to use, copy, modify, merge, publish,
+ * distribute, sub license, and/or sell copies of the Software, and to
+ * permit persons to whom the Software is furnished to do so, subject to
+ * the following conditions:
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
+ * THE COPYRIGHT HOLDERS, AUTHORS AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM,
+ * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
+ * USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
+ * The above copyright notice and this permission notice (including the
+ * next paragraph) shall be included in all copies or substantial portions
+ * of the Software.
+ *
+ * Authors: Dave Airlie <airlied@redhat.com>
+ *          Michael Thayer <michael.thayer@oracle.com,
+ *          Hans de Goede <hdegoede@redhat.com>
+ */
+#ifndef __VBOX_DRV_H__
+#define __VBOX_DRV_H__
+
+#include <linux/genalloc.h>
+#include <linux/io.h>
+#include <linux/string.h>
+#include <linux/version.h>
+
+#include <drm/drmP.h>
+#include <drm/drm_encoder.h>
+#include <drm/drm_fb_helper.h>
+#include <drm/drm_gem.h>
+
+#include <drm/ttm/ttm_bo_api.h>
+#include <drm/ttm/ttm_bo_driver.h>
+#include <drm/ttm/ttm_placement.h>
+#include <drm/ttm/ttm_memory.h>
+#include <drm/ttm/ttm_module.h>
+
+#include "vboxvideo_guest.h"
+#include "vboxvideo_vbe.h"
+#include "hgsmi_ch_setup.h"
+
+#define DRIVER_NAME         "vboxvideo"
+#define DRIVER_DESC         "Oracle VM VirtualBox Graphics Card"
+#define DRIVER_DATE         "20130823"
+
+#define DRIVER_MAJOR        1
+#define DRIVER_MINOR        0
+#define DRIVER_PATCHLEVEL   0
+
+#define VBOX_MAX_CURSOR_WIDTH  64
+#define VBOX_MAX_CURSOR_HEIGHT 64
+#define CURSOR_PIXEL_COUNT (VBOX_MAX_CURSOR_WIDTH * VBOX_MAX_CURSOR_HEIGHT)
+#define CURSOR_DATA_SIZE (CURSOR_PIXEL_COUNT * 4 + CURSOR_PIXEL_COUNT / 8)
+
+#define VBOX_MAX_SCREENS  32
+
+#define GUEST_HEAP_OFFSET(vbox) ((vbox)->full_vram_size - \
+                                VBVA_ADAPTER_INFORMATION_SIZE)
+#define GUEST_HEAP_SIZE   VBVA_ADAPTER_INFORMATION_SIZE
+#define GUEST_HEAP_USABLE_SIZE (VBVA_ADAPTER_INFORMATION_SIZE - \
+                               sizeof(struct hgsmi_host_flags))
+#define HOST_FLAGS_OFFSET GUEST_HEAP_USABLE_SIZE
+
+struct vbox_fbdev;
+
+struct vbox_private {
+       struct drm_device *dev;
+
+       u8 __iomem *guest_heap;
+       u8 __iomem *vbva_buffers;
+       struct gen_pool *guest_pool;
+       struct vbva_buf_ctx *vbva_info;
+       bool any_pitch;
+       u32 num_crtcs;
+       /** Amount of available VRAM, including space used for buffers. */
+       u32 full_vram_size;
+       /** Amount of available VRAM, not including space used for buffers. */
+       u32 available_vram_size;
+       /** Array of structures for receiving mode hints. */
+       struct vbva_modehint *last_mode_hints;
+
+       struct vbox_fbdev *fbdev;
+
+       int fb_mtrr;
+
+       struct {
+               struct drm_global_reference mem_global_ref;
+               struct ttm_bo_global_ref bo_global_ref;
+               struct ttm_bo_device bdev;
+       } ttm;
+
+       struct mutex hw_mutex; /* protects modeset and accel/vbva accesses */
+       /**
+        * We decide whether or not user-space supports display hot-plug
+        * depending on whether they react to a hot-plug event after the initial
+        * mode query.
+        */
+       bool initial_mode_queried;
+       struct work_struct hotplug_work;
+       u32 input_mapping_width;
+       u32 input_mapping_height;
+       /**
+        * Is user-space using an X.Org-style layout of one large frame-buffer
+        * encompassing all screen ones or is the fbdev console active?
+        */
+       bool single_framebuffer;
+       u32 cursor_width;
+       u32 cursor_height;
+       u32 cursor_hot_x;
+       u32 cursor_hot_y;
+       size_t cursor_data_size;
+       u8 cursor_data[CURSOR_DATA_SIZE];
+};
+
+#undef CURSOR_PIXEL_COUNT
+#undef CURSOR_DATA_SIZE
+
+int vbox_driver_load(struct drm_device *dev, unsigned long flags);
+void vbox_driver_unload(struct drm_device *dev);
+void vbox_driver_lastclose(struct drm_device *dev);
+
+struct vbox_gem_object;
+
+struct vbox_connector {
+       struct drm_connector base;
+       char name[32];
+       struct vbox_crtc *vbox_crtc;
+       struct {
+               u16 width;
+               u16 height;
+               bool disconnected;
+       } mode_hint;
+};
+
+struct vbox_crtc {
+       struct drm_crtc base;
+       bool blanked;
+       bool disconnected;
+       unsigned int crtc_id;
+       u32 fb_offset;
+       bool cursor_enabled;
+       u16 x_hint;
+       u16 y_hint;
+};
+
+struct vbox_encoder {
+       struct drm_encoder base;
+};
+
+struct vbox_framebuffer {
+       struct drm_framebuffer base;
+       struct drm_gem_object *obj;
+};
+
+struct vbox_fbdev {
+       struct drm_fb_helper helper;
+       struct vbox_framebuffer afb;
+       int size;
+       struct ttm_bo_kmap_obj mapping;
+       int x1, y1, x2, y2;     /* dirty rect */
+       spinlock_t dirty_lock;
+};
+
+#define to_vbox_crtc(x) container_of(x, struct vbox_crtc, base)
+#define to_vbox_connector(x) container_of(x, struct vbox_connector, base)
+#define to_vbox_encoder(x) container_of(x, struct vbox_encoder, base)
+#define to_vbox_framebuffer(x) container_of(x, struct vbox_framebuffer, base)
+
+int vbox_mode_init(struct drm_device *dev);
+void vbox_mode_fini(struct drm_device *dev);
+
+#define DRM_MODE_FB_CMD drm_mode_fb_cmd2
+#define CRTC_FB(crtc) ((crtc)->primary->fb)
+
+void vbox_enable_accel(struct vbox_private *vbox);
+void vbox_disable_accel(struct vbox_private *vbox);
+void vbox_report_caps(struct vbox_private *vbox);
+
+void vbox_framebuffer_dirty_rectangles(struct drm_framebuffer *fb,
+                                      struct drm_clip_rect *rects,
+                                      unsigned int num_rects);
+
+int vbox_framebuffer_init(struct drm_device *dev,
+                         struct vbox_framebuffer *vbox_fb,
+                         const struct DRM_MODE_FB_CMD *mode_cmd,
+                         struct drm_gem_object *obj);
+
+int vbox_fbdev_init(struct drm_device *dev);
+void vbox_fbdev_fini(struct drm_device *dev);
+void vbox_fbdev_set_base(struct vbox_private *vbox, unsigned long gpu_addr);
+
+struct vbox_bo {
+       struct ttm_buffer_object bo;
+       struct ttm_placement placement;
+       struct ttm_bo_kmap_obj kmap;
+       struct drm_gem_object gem;
+       struct ttm_place placements[3];
+       int pin_count;
+};
+
+#define gem_to_vbox_bo(gobj) container_of((gobj), struct vbox_bo, gem)
+
+static inline struct vbox_bo *vbox_bo(struct ttm_buffer_object *bo)
+{
+       return container_of(bo, struct vbox_bo, bo);
+}
+
+#define to_vbox_obj(x) container_of(x, struct vbox_gem_object, base)
+
+int vbox_dumb_create(struct drm_file *file,
+                    struct drm_device *dev,
+                    struct drm_mode_create_dumb *args);
+
+void vbox_gem_free_object(struct drm_gem_object *obj);
+int vbox_dumb_mmap_offset(struct drm_file *file,
+                         struct drm_device *dev,
+                         u32 handle, u64 *offset);
+
+#define DRM_FILE_PAGE_OFFSET (0x10000000ULL >> PAGE_SHIFT)
+
+int vbox_mm_init(struct vbox_private *vbox);
+void vbox_mm_fini(struct vbox_private *vbox);
+
+int vbox_bo_create(struct drm_device *dev, int size, int align,
+                  u32 flags, struct vbox_bo **pvboxbo);
+
+int vbox_gem_create(struct drm_device *dev,
+                   u32 size, bool iskernel, struct drm_gem_object **obj);
+
+int vbox_bo_pin(struct vbox_bo *bo, u32 pl_flag, u64 *gpu_addr);
+int vbox_bo_unpin(struct vbox_bo *bo);
+
+static inline int vbox_bo_reserve(struct vbox_bo *bo, bool no_wait)
+{
+       int ret;
+
+       ret = ttm_bo_reserve(&bo->bo, true, no_wait, NULL);
+       if (ret) {
+               if (ret != -ERESTARTSYS && ret != -EBUSY)
+                       DRM_ERROR("reserve failed %p\n", bo);
+               return ret;
+       }
+       return 0;
+}
+
+static inline void vbox_bo_unreserve(struct vbox_bo *bo)
+{
+       ttm_bo_unreserve(&bo->bo);
+}
+
+void vbox_ttm_placement(struct vbox_bo *bo, int domain);
+int vbox_bo_push_sysram(struct vbox_bo *bo);
+int vbox_mmap(struct file *filp, struct vm_area_struct *vma);
+
+/* vbox_prime.c */
+int vbox_gem_prime_pin(struct drm_gem_object *obj);
+void vbox_gem_prime_unpin(struct drm_gem_object *obj);
+struct sg_table *vbox_gem_prime_get_sg_table(struct drm_gem_object *obj);
+struct drm_gem_object *vbox_gem_prime_import_sg_table(
+       struct drm_device *dev, struct dma_buf_attachment *attach,
+       struct sg_table *table);
+void *vbox_gem_prime_vmap(struct drm_gem_object *obj);
+void vbox_gem_prime_vunmap(struct drm_gem_object *obj, void *vaddr);
+int vbox_gem_prime_mmap(struct drm_gem_object *obj,
+                       struct vm_area_struct *area);
+
+/* vbox_irq.c */
+int vbox_irq_init(struct vbox_private *vbox);
+void vbox_irq_fini(struct vbox_private *vbox);
+void vbox_report_hotplug(struct vbox_private *vbox);
+irqreturn_t vbox_irq_handler(int irq, void *arg);
+
+/* vbox_hgsmi.c */
+void *hgsmi_buffer_alloc(struct gen_pool *guest_pool, size_t size,
+                        u8 channel, u16 channel_info);
+void hgsmi_buffer_free(struct gen_pool *guest_pool, void *buf);
+int hgsmi_buffer_submit(struct gen_pool *guest_pool, void *buf);
+
+static inline void vbox_write_ioport(u16 index, u16 data)
+{
+       outw(index, VBE_DISPI_IOPORT_INDEX);
+       outw(data, VBE_DISPI_IOPORT_DATA);
+}
+
+#endif
diff --git a/drivers/staging/vboxvideo/vbox_err.h b/drivers/staging/vboxvideo/vbox_err.h
new file mode 100644 (file)
index 0000000..562db86
--- /dev/null
@@ -0,0 +1,50 @@
+/*
+ * Copyright (C) 2017 Oracle Corporation
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
+ * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
+ * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+ * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+ * OTHER DEALINGS IN THE SOFTWARE.
+ */
+
+#ifndef __VBOX_ERR_H__
+#define __VBOX_ERR_H__
+
+/**
+ * @name VirtualBox virtual-hardware error macros
+ * @{
+ */
+
+#define VINF_SUCCESS                        0
+#define VERR_INVALID_PARAMETER              (-2)
+#define VERR_INVALID_POINTER                (-6)
+#define VERR_NO_MEMORY                      (-8)
+#define VERR_NOT_IMPLEMENTED                (-12)
+#define VERR_INVALID_FUNCTION               (-36)
+#define VERR_NOT_SUPPORTED                  (-37)
+#define VERR_TOO_MUCH_DATA                  (-42)
+#define VERR_INVALID_STATE                  (-79)
+#define VERR_OUT_OF_RESOURCES               (-80)
+#define VERR_ALREADY_EXISTS                 (-105)
+#define VERR_INTERNAL_ERROR                 (-225)
+
+#define RT_SUCCESS_NP(rc)   ((int)(rc) >= VINF_SUCCESS)
+#define RT_SUCCESS(rc)      (likely(RT_SUCCESS_NP(rc)))
+#define RT_FAILURE(rc)      (unlikely(!RT_SUCCESS_NP(rc)))
+
+/** @}  */
+
+#endif
diff --git a/drivers/staging/vboxvideo/vbox_fb.c b/drivers/staging/vboxvideo/vbox_fb.c
new file mode 100644 (file)
index 0000000..35f6d9f
--- /dev/null
@@ -0,0 +1,412 @@
+/*
+ * Copyright (C) 2013-2017 Oracle Corporation
+ * This file is based on ast_fb.c
+ * Copyright 2012 Red Hat Inc.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the
+ * "Software"), to deal in the Software without restriction, including
+ * without limitation the rights to use, copy, modify, merge, publish,
+ * distribute, sub license, and/or sell copies of the Software, and to
+ * permit persons to whom the Software is furnished to do so, subject to
+ * the following conditions:
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
+ * THE COPYRIGHT HOLDERS, AUTHORS AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM,
+ * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
+ * USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
+ * The above copyright notice and this permission notice (including the
+ * next paragraph) shall be included in all copies or substantial portions
+ * of the Software.
+ *
+ * Authors: Dave Airlie <airlied@redhat.com>
+ *          Michael Thayer <michael.thayer@oracle.com,
+ */
+#include <linux/module.h>
+#include <linux/kernel.h>
+#include <linux/errno.h>
+#include <linux/string.h>
+#include <linux/mm.h>
+#include <linux/tty.h>
+#include <linux/sysrq.h>
+#include <linux/delay.h>
+#include <linux/fb.h>
+#include <linux/init.h>
+
+#include <drm/drmP.h>
+#include <drm/drm_crtc.h>
+#include <drm/drm_fb_helper.h>
+#include <drm/drm_crtc_helper.h>
+
+#include "vbox_drv.h"
+#include "vboxvideo.h"
+
+#define VBOX_DIRTY_DELAY (HZ / 30)
+/**
+ * Tell the host about dirty rectangles to update.
+ */
+static void vbox_dirty_update(struct vbox_fbdev *fbdev,
+                             int x, int y, int width, int height)
+{
+       struct drm_gem_object *obj;
+       struct vbox_bo *bo;
+       int ret = -EBUSY;
+       bool store_for_later = false;
+       int x2, y2;
+       unsigned long flags;
+       struct drm_clip_rect rect;
+
+       obj = fbdev->afb.obj;
+       bo = gem_to_vbox_bo(obj);
+
+       /*
+        * try and reserve the BO, if we fail with busy
+        * then the BO is being moved and we should
+        * store up the damage until later.
+        */
+       if (drm_can_sleep())
+               ret = vbox_bo_reserve(bo, true);
+       if (ret) {
+               if (ret != -EBUSY)
+                       return;
+
+               store_for_later = true;
+       }
+
+       x2 = x + width - 1;
+       y2 = y + height - 1;
+       spin_lock_irqsave(&fbdev->dirty_lock, flags);
+
+       if (fbdev->y1 < y)
+               y = fbdev->y1;
+       if (fbdev->y2 > y2)
+               y2 = fbdev->y2;
+       if (fbdev->x1 < x)
+               x = fbdev->x1;
+       if (fbdev->x2 > x2)
+               x2 = fbdev->x2;
+
+       if (store_for_later) {
+               fbdev->x1 = x;
+               fbdev->x2 = x2;
+               fbdev->y1 = y;
+               fbdev->y2 = y2;
+               spin_unlock_irqrestore(&fbdev->dirty_lock, flags);
+               return;
+       }
+
+       fbdev->x1 = INT_MAX;
+       fbdev->y1 = INT_MAX;
+       fbdev->x2 = 0;
+       fbdev->y2 = 0;
+
+       spin_unlock_irqrestore(&fbdev->dirty_lock, flags);
+
+       /*
+        * Not sure why the original code subtracted 1 here, but I will keep
+        * it that way to avoid unnecessary differences.
+        */
+       rect.x1 = x;
+       rect.x2 = x2 + 1;
+       rect.y1 = y;
+       rect.y2 = y2 + 1;
+       vbox_framebuffer_dirty_rectangles(&fbdev->afb.base, &rect, 1);
+
+       vbox_bo_unreserve(bo);
+}
+
+#ifdef CONFIG_FB_DEFERRED_IO
+static void vbox_deferred_io(struct fb_info *info, struct list_head *pagelist)
+{
+       struct vbox_fbdev *fbdev = info->par;
+       unsigned long start, end, min, max;
+       struct page *page;
+       int y1, y2;
+
+       min = ULONG_MAX;
+       max = 0;
+       list_for_each_entry(page, pagelist, lru) {
+               start = page->index << PAGE_SHIFT;
+               end = start + PAGE_SIZE - 1;
+               min = min(min, start);
+               max = max(max, end);
+       }
+
+       if (min < max) {
+               y1 = min / info->fix.line_length;
+               y2 = (max / info->fix.line_length) + 1;
+               DRM_INFO("%s: Calling dirty update: 0, %d, %d, %d\n",
+                        __func__, y1, info->var.xres, y2 - y1 - 1);
+               vbox_dirty_update(fbdev, 0, y1, info->var.xres, y2 - y1 - 1);
+       }
+}
+
+static struct fb_deferred_io vbox_defio = {
+       .delay = VBOX_DIRTY_DELAY,
+       .deferred_io = vbox_deferred_io,
+};
+#endif
+
+static void vbox_fillrect(struct fb_info *info, const struct fb_fillrect *rect)
+{
+       struct vbox_fbdev *fbdev = info->par;
+
+       sys_fillrect(info, rect);
+       vbox_dirty_update(fbdev, rect->dx, rect->dy, rect->width, rect->height);
+}
+
+static void vbox_copyarea(struct fb_info *info, const struct fb_copyarea *area)
+{
+       struct vbox_fbdev *fbdev = info->par;
+
+       sys_copyarea(info, area);
+       vbox_dirty_update(fbdev, area->dx, area->dy, area->width, area->height);
+}
+
+static void vbox_imageblit(struct fb_info *info, const struct fb_image *image)
+{
+       struct vbox_fbdev *fbdev = info->par;
+
+       sys_imageblit(info, image);
+       vbox_dirty_update(fbdev, image->dx, image->dy, image->width,
+                         image->height);
+}
+
+static struct fb_ops vboxfb_ops = {
+       .owner = THIS_MODULE,
+       .fb_check_var = drm_fb_helper_check_var,
+       .fb_set_par = drm_fb_helper_set_par,
+       .fb_fillrect = vbox_fillrect,
+       .fb_copyarea = vbox_copyarea,
+       .fb_imageblit = vbox_imageblit,
+       .fb_pan_display = drm_fb_helper_pan_display,
+       .fb_blank = drm_fb_helper_blank,
+       .fb_setcmap = drm_fb_helper_setcmap,
+       .fb_debug_enter = drm_fb_helper_debug_enter,
+       .fb_debug_leave = drm_fb_helper_debug_leave,
+};
+
+static int vboxfb_create_object(struct vbox_fbdev *fbdev,
+                               struct DRM_MODE_FB_CMD *mode_cmd,
+                               struct drm_gem_object **gobj_p)
+{
+       struct drm_device *dev = fbdev->helper.dev;
+       u32 size;
+       struct drm_gem_object *gobj;
+       u32 pitch = mode_cmd->pitches[0];
+       int ret;
+
+       size = pitch * mode_cmd->height;
+       ret = vbox_gem_create(dev, size, true, &gobj);
+       if (ret)
+               return ret;
+
+       *gobj_p = gobj;
+
+       return 0;
+}
+
+static int vboxfb_create(struct drm_fb_helper *helper,
+                        struct drm_fb_helper_surface_size *sizes)
+{
+       struct vbox_fbdev *fbdev =
+           container_of(helper, struct vbox_fbdev, helper);
+       struct drm_device *dev = fbdev->helper.dev;
+       struct DRM_MODE_FB_CMD mode_cmd;
+       struct drm_framebuffer *fb;
+       struct fb_info *info;
+       struct device *device = &dev->pdev->dev;
+       struct drm_gem_object *gobj;
+       struct vbox_bo *bo;
+       int size, ret;
+       u32 pitch;
+
+       mode_cmd.width = sizes->surface_width;
+       mode_cmd.height = sizes->surface_height;
+       pitch = mode_cmd.width * ((sizes->surface_bpp + 7) / 8);
+       mode_cmd.pixel_format = drm_mode_legacy_fb_format(sizes->surface_bpp,
+                                                         sizes->surface_depth);
+       mode_cmd.pitches[0] = pitch;
+
+       size = pitch * mode_cmd.height;
+
+       ret = vboxfb_create_object(fbdev, &mode_cmd, &gobj);
+       if (ret) {
+               DRM_ERROR("failed to create fbcon backing object %d\n", ret);
+               return ret;
+       }
+
+       ret = vbox_framebuffer_init(dev, &fbdev->afb, &mode_cmd, gobj);
+       if (ret)
+               return ret;
+
+       bo = gem_to_vbox_bo(gobj);
+
+       ret = vbox_bo_reserve(bo, false);
+       if (ret)
+               return ret;
+
+       ret = vbox_bo_pin(bo, TTM_PL_FLAG_VRAM, NULL);
+       if (ret) {
+               vbox_bo_unreserve(bo);
+               return ret;
+       }
+
+       ret = ttm_bo_kmap(&bo->bo, 0, bo->bo.num_pages, &bo->kmap);
+       vbox_bo_unreserve(bo);
+       if (ret) {
+               DRM_ERROR("failed to kmap fbcon\n");
+               return ret;
+       }
+
+       info = framebuffer_alloc(0, device);
+       if (!info)
+               return -ENOMEM;
+       info->par = fbdev;
+
+       fbdev->size = size;
+
+       fb = &fbdev->afb.base;
+       fbdev->helper.fb = fb;
+       fbdev->helper.fbdev = info;
+
+       strcpy(info->fix.id, "vboxdrmfb");
+
+       /*
+        * The last flag forces a mode set on VT switches even if the kernel
+        * does not think it is needed.
+        */
+       info->flags = FBINFO_DEFAULT | FBINFO_CAN_FORCE_OUTPUT |
+                     FBINFO_MISC_ALWAYS_SETPAR;
+       info->fbops = &vboxfb_ops;
+
+       ret = fb_alloc_cmap(&info->cmap, 256, 0);
+       if (ret)
+               return -ENOMEM;
+
+       /*
+        * This seems to be done for safety checking that the framebuffer
+        * is not registered twice by different drivers.
+        */
+       info->apertures = alloc_apertures(1);
+       if (!info->apertures)
+               return -ENOMEM;
+       info->apertures->ranges[0].base = pci_resource_start(dev->pdev, 0);
+       info->apertures->ranges[0].size = pci_resource_len(dev->pdev, 0);
+
+       drm_fb_helper_fill_fix(info, fb->pitches[0], fb->format->depth);
+       drm_fb_helper_fill_var(info, &fbdev->helper, sizes->fb_width,
+                              sizes->fb_height);
+
+       info->screen_base = bo->kmap.virtual;
+       info->screen_size = size;
+
+#ifdef CONFIG_FB_DEFERRED_IO
+       info->fbdefio = &vbox_defio;
+       fb_deferred_io_init(info);
+#endif
+
+       info->pixmap.flags = FB_PIXMAP_SYSTEM;
+
+       DRM_DEBUG_KMS("allocated %dx%d\n", fb->width, fb->height);
+
+       return 0;
+}
+
+static void vbox_fb_gamma_set(struct drm_crtc *crtc, u16 red, u16 green,
+                             u16 blue, int regno)
+{
+}
+
+static void vbox_fb_gamma_get(struct drm_crtc *crtc, u16 *red, u16 *green,
+                             u16 *blue, int regno)
+{
+       *red = regno;
+       *green = regno;
+       *blue = regno;
+}
+
+static struct drm_fb_helper_funcs vbox_fb_helper_funcs = {
+       .gamma_set = vbox_fb_gamma_set,
+       .gamma_get = vbox_fb_gamma_get,
+       .fb_probe = vboxfb_create,
+};
+
+void vbox_fbdev_fini(struct drm_device *dev)
+{
+       struct vbox_private *vbox = dev->dev_private;
+       struct vbox_fbdev *fbdev = vbox->fbdev;
+       struct vbox_framebuffer *afb = &fbdev->afb;
+
+       drm_fb_helper_unregister_fbi(&fbdev->helper);
+
+       if (afb->obj) {
+               struct vbox_bo *bo = gem_to_vbox_bo(afb->obj);
+
+               if (!vbox_bo_reserve(bo, false)) {
+                       if (bo->kmap.virtual)
+                               ttm_bo_kunmap(&bo->kmap);
+                       /*
+                        * QXL does this, but is it really needed before
+                        * freeing?
+                        */
+                       if (bo->pin_count)
+                               vbox_bo_unpin(bo);
+                       vbox_bo_unreserve(bo);
+               }
+               drm_gem_object_unreference_unlocked(afb->obj);
+               afb->obj = NULL;
+       }
+       drm_fb_helper_fini(&fbdev->helper);
+
+       drm_framebuffer_unregister_private(&afb->base);
+       drm_framebuffer_cleanup(&afb->base);
+}
+
+int vbox_fbdev_init(struct drm_device *dev)
+{
+       struct vbox_private *vbox = dev->dev_private;
+       struct vbox_fbdev *fbdev;
+       int ret;
+
+       fbdev = devm_kzalloc(dev->dev, sizeof(*fbdev), GFP_KERNEL);
+       if (!fbdev)
+               return -ENOMEM;
+
+       vbox->fbdev = fbdev;
+       spin_lock_init(&fbdev->dirty_lock);
+
+       drm_fb_helper_prepare(dev, &fbdev->helper, &vbox_fb_helper_funcs);
+       ret = drm_fb_helper_init(dev, &fbdev->helper, vbox->num_crtcs);
+       if (ret)
+               return ret;
+
+       ret = drm_fb_helper_single_add_all_connectors(&fbdev->helper);
+       if (ret)
+               goto err_fini;
+
+       /* disable all the possible outputs/crtcs before entering KMS mode */
+       drm_helper_disable_unused_functions(dev);
+
+       ret = drm_fb_helper_initial_config(&fbdev->helper, 32);
+       if (ret)
+               goto err_fini;
+
+       return 0;
+
+err_fini:
+       drm_fb_helper_fini(&fbdev->helper);
+       return ret;
+}
+
+void vbox_fbdev_set_base(struct vbox_private *vbox, unsigned long gpu_addr)
+{
+       struct fb_info *fbdev = vbox->fbdev->helper.fbdev;
+
+       fbdev->fix.smem_start = fbdev->apertures->ranges[0].base + gpu_addr;
+       fbdev->fix.smem_len = vbox->available_vram_size - gpu_addr;
+}
diff --git a/drivers/staging/vboxvideo/vbox_hgsmi.c b/drivers/staging/vboxvideo/vbox_hgsmi.c
new file mode 100644 (file)
index 0000000..822fd31
--- /dev/null
@@ -0,0 +1,115 @@
+/*
+ * Copyright (C) 2017 Oracle Corporation
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the
+ * "Software"), to deal in the Software without restriction, including
+ * without limitation the rights to use, copy, modify, merge, publish,
+ * distribute, sub license, and/or sell copies of the Software, and to
+ * permit persons to whom the Software is furnished to do so, subject to
+ * the following conditions:
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
+ * THE COPYRIGHT HOLDERS, AUTHORS AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM,
+ * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
+ * USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
+ * The above copyright notice and this permission notice (including the
+ * next paragraph) shall be included in all copies or substantial portions
+ * of the Software.
+ *
+ * Authors: Hans de Goede <hdegoede@redhat.com>
+ */
+
+#include "vbox_drv.h"
+#include "vboxvideo_vbe.h"
+#include "hgsmi_defs.h"
+
+/* One-at-a-Time Hash from http://www.burtleburtle.net/bob/hash/doobs.html */
+static u32 hgsmi_hash_process(u32 hash, const u8 *data, int size)
+{
+       while (size--) {
+               hash += *data++;
+               hash += (hash << 10);
+               hash ^= (hash >> 6);
+       }
+
+       return hash;
+}
+
+static u32 hgsmi_hash_end(u32 hash)
+{
+       hash += (hash << 3);
+       hash ^= (hash >> 11);
+       hash += (hash << 15);
+
+       return hash;
+}
+
+/* Not really a checksum but that is the naming used in all vbox code */
+static u32 hgsmi_checksum(u32 offset,
+                         const struct hgsmi_buffer_header *header,
+                         const struct hgsmi_buffer_tail *tail)
+{
+       u32 checksum;
+
+       checksum = hgsmi_hash_process(0, (u8 *)&offset, sizeof(offset));
+       checksum = hgsmi_hash_process(checksum, (u8 *)header, sizeof(*header));
+       /* 4 -> Do not checksum the checksum itself */
+       checksum = hgsmi_hash_process(checksum, (u8 *)tail, 4);
+
+       return hgsmi_hash_end(checksum);
+}
+
+void *hgsmi_buffer_alloc(struct gen_pool *guest_pool, size_t size,
+                        u8 channel, u16 channel_info)
+{
+       struct hgsmi_buffer_header *h;
+       struct hgsmi_buffer_tail *t;
+       size_t total_size;
+       dma_addr_t offset;
+
+       total_size = size + sizeof(*h) + sizeof(*t);
+       h = gen_pool_dma_alloc(guest_pool, total_size, &offset);
+       if (!h)
+               return NULL;
+
+       t = (struct hgsmi_buffer_tail *)((u8 *)h + sizeof(*h) + size);
+
+       h->flags = HGSMI_BUFFER_HEADER_F_SEQ_SINGLE;
+       h->data_size = size;
+       h->channel = channel;
+       h->channel_info = channel_info;
+       memset(&h->u.header_data, 0, sizeof(h->u.header_data));
+
+       t->reserved = 0;
+       t->checksum = hgsmi_checksum(offset, h, t);
+
+       return (u8 *)h + sizeof(*h);
+}
+
+void hgsmi_buffer_free(struct gen_pool *guest_pool, void *buf)
+{
+       struct hgsmi_buffer_header *h =
+               (struct hgsmi_buffer_header *)((u8 *)buf - sizeof(*h));
+       size_t total_size = h->data_size + sizeof(*h) +
+                                            sizeof(struct hgsmi_buffer_tail);
+
+       gen_pool_free(guest_pool, (unsigned long)h, total_size);
+}
+
+int hgsmi_buffer_submit(struct gen_pool *guest_pool, void *buf)
+{
+       phys_addr_t offset;
+
+       offset = gen_pool_virt_to_phys(guest_pool, (unsigned long)buf -
+                                      sizeof(struct hgsmi_buffer_header));
+       outl(offset, VGA_PORT_HGSMI_GUEST);
+       /* Make the compiler aware that the host has changed memory. */
+       mb();
+
+       return 0;
+}
diff --git a/drivers/staging/vboxvideo/vbox_irq.c b/drivers/staging/vboxvideo/vbox_irq.c
new file mode 100644 (file)
index 0000000..3ca8bec
--- /dev/null
@@ -0,0 +1,197 @@
+/*
+ * Copyright (C) 2016-2017 Oracle Corporation
+ * This file is based on qxl_irq.c
+ * Copyright 2013 Red Hat Inc.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
+ * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
+ * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+ * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+ * OTHER DEALINGS IN THE SOFTWARE.
+ *
+ * Authors: Dave Airlie
+ *          Alon Levy
+ *          Michael Thayer <michael.thayer@oracle.com,
+ *          Hans de Goede <hdegoede@redhat.com>
+ */
+
+#include <drm/drm_crtc_helper.h>
+
+#include "vbox_drv.h"
+#include "vboxvideo.h"
+
+static void vbox_clear_irq(void)
+{
+       outl((u32)~0, VGA_PORT_HGSMI_HOST);
+}
+
+static u32 vbox_get_flags(struct vbox_private *vbox)
+{
+       return readl(vbox->guest_heap + HOST_FLAGS_OFFSET);
+}
+
+void vbox_report_hotplug(struct vbox_private *vbox)
+{
+       schedule_work(&vbox->hotplug_work);
+}
+
+irqreturn_t vbox_irq_handler(int irq, void *arg)
+{
+       struct drm_device *dev = (struct drm_device *)arg;
+       struct vbox_private *vbox = (struct vbox_private *)dev->dev_private;
+       u32 host_flags = vbox_get_flags(vbox);
+
+       if (!(host_flags & HGSMIHOSTFLAGS_IRQ))
+               return IRQ_NONE;
+
+       /*
+        * Due to a bug in the initial host implementation of hot-plug irqs,
+        * the hot-plug and cursor capability flags were never cleared.
+        * Fortunately we can tell when they would have been set by checking
+        * that the VSYNC flag is not set.
+        */
+       if (host_flags &
+           (HGSMIHOSTFLAGS_HOTPLUG | HGSMIHOSTFLAGS_CURSOR_CAPABILITIES) &&
+           !(host_flags & HGSMIHOSTFLAGS_VSYNC))
+               vbox_report_hotplug(vbox);
+
+       vbox_clear_irq();
+
+       return IRQ_HANDLED;
+}
+
+/**
+ * Check that the position hints provided by the host are suitable for GNOME
+ * shell (i.e. all screens disjoint and hints for all enabled screens) and if
+ * not replace them with default ones.  Providing valid hints improves the
+ * chances that we will get a known screen layout for pointer mapping.
+ */
+static void validate_or_set_position_hints(struct vbox_private *vbox)
+{
+       struct vbva_modehint *hintsi, *hintsj;
+       bool valid = true;
+       u16 currentx = 0;
+       int i, j;
+
+       for (i = 0; i < vbox->num_crtcs; ++i) {
+               for (j = 0; j < i; ++j) {
+                       hintsi = &vbox->last_mode_hints[i];
+                       hintsj = &vbox->last_mode_hints[j];
+
+                       if (hintsi->enabled && hintsj->enabled) {
+                               if (hintsi->dx >= 0xffff ||
+                                   hintsi->dy >= 0xffff ||
+                                   hintsj->dx >= 0xffff ||
+                                   hintsj->dy >= 0xffff ||
+                                   (hintsi->dx <
+                                       hintsj->dx + (hintsj->cx & 0x8fff) &&
+                                    hintsi->dx + (hintsi->cx & 0x8fff) >
+                                       hintsj->dx) ||
+                                   (hintsi->dy <
+                                       hintsj->dy + (hintsj->cy & 0x8fff) &&
+                                    hintsi->dy + (hintsi->cy & 0x8fff) >
+                                       hintsj->dy))
+                                       valid = false;
+                       }
+               }
+       }
+       if (!valid)
+               for (i = 0; i < vbox->num_crtcs; ++i) {
+                       if (vbox->last_mode_hints[i].enabled) {
+                               vbox->last_mode_hints[i].dx = currentx;
+                               vbox->last_mode_hints[i].dy = 0;
+                               currentx +=
+                                   vbox->last_mode_hints[i].cx & 0x8fff;
+                       }
+               }
+}
+
+/**
+ * Query the host for the most recent video mode hints.
+ */
+static void vbox_update_mode_hints(struct vbox_private *vbox)
+{
+       struct drm_device *dev = vbox->dev;
+       struct drm_connector *connector;
+       struct vbox_connector *vbox_conn;
+       struct vbva_modehint *hints;
+       u16 flags;
+       bool disconnected;
+       unsigned int crtc_id;
+       int ret;
+
+       ret = hgsmi_get_mode_hints(vbox->guest_pool, vbox->num_crtcs,
+                                  vbox->last_mode_hints);
+       if (ret) {
+               DRM_ERROR("vboxvideo: hgsmi_get_mode_hints failed: %d\n", ret);
+               return;
+       }
+
+       validate_or_set_position_hints(vbox);
+       drm_modeset_lock_all(dev);
+       list_for_each_entry(connector, &dev->mode_config.connector_list, head) {
+               vbox_conn = to_vbox_connector(connector);
+
+               hints = &vbox->last_mode_hints[vbox_conn->vbox_crtc->crtc_id];
+               if (hints->magic != VBVAMODEHINT_MAGIC)
+                       continue;
+
+               disconnected = !(hints->enabled);
+               crtc_id = vbox_conn->vbox_crtc->crtc_id;
+               vbox_conn->mode_hint.width = hints->cx & 0x8fff;
+               vbox_conn->mode_hint.height = hints->cy & 0x8fff;
+               vbox_conn->vbox_crtc->x_hint = hints->dx;
+               vbox_conn->vbox_crtc->y_hint = hints->dy;
+               vbox_conn->mode_hint.disconnected = disconnected;
+
+               if (vbox_conn->vbox_crtc->disconnected == disconnected)
+                       continue;
+
+               if (disconnected)
+                       flags = VBVA_SCREEN_F_ACTIVE | VBVA_SCREEN_F_DISABLED;
+               else
+                       flags = VBVA_SCREEN_F_ACTIVE | VBVA_SCREEN_F_BLANK;
+
+               hgsmi_process_display_info(vbox->guest_pool, crtc_id, 0, 0, 0,
+                                          hints->cx * 4, hints->cx,
+                                          hints->cy, 0, flags);
+
+               vbox_conn->vbox_crtc->disconnected = disconnected;
+       }
+       drm_modeset_unlock_all(dev);
+}
+
+static void vbox_hotplug_worker(struct work_struct *work)
+{
+       struct vbox_private *vbox = container_of(work, struct vbox_private,
+                                                hotplug_work);
+
+       vbox_update_mode_hints(vbox);
+       drm_kms_helper_hotplug_event(vbox->dev);
+}
+
+int vbox_irq_init(struct vbox_private *vbox)
+{
+       INIT_WORK(&vbox->hotplug_work, vbox_hotplug_worker);
+       vbox_update_mode_hints(vbox);
+
+       return drm_irq_install(vbox->dev, vbox->dev->pdev->irq);
+}
+
+void vbox_irq_fini(struct vbox_private *vbox)
+{
+       drm_irq_uninstall(vbox->dev);
+       flush_work(&vbox->hotplug_work);
+}
diff --git a/drivers/staging/vboxvideo/vbox_main.c b/drivers/staging/vboxvideo/vbox_main.c
new file mode 100644 (file)
index 0000000..d0c6ec7
--- /dev/null
@@ -0,0 +1,534 @@
+/*
+ * Copyright (C) 2013-2017 Oracle Corporation
+ * This file is based on ast_main.c
+ * Copyright 2012 Red Hat Inc.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the
+ * "Software"), to deal in the Software without restriction, including
+ * without limitation the rights to use, copy, modify, merge, publish,
+ * distribute, sub license, and/or sell copies of the Software, and to
+ * permit persons to whom the Software is furnished to do so, subject to
+ * the following conditions:
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
+ * THE COPYRIGHT HOLDERS, AUTHORS AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM,
+ * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
+ * USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
+ * The above copyright notice and this permission notice (including the
+ * next paragraph) shall be included in all copies or substantial portions
+ * of the Software.
+ *
+ * Authors: Dave Airlie <airlied@redhat.com>,
+ *          Michael Thayer <michael.thayer@oracle.com,
+ *          Hans de Goede <hdegoede@redhat.com>
+ */
+#include <drm/drm_fb_helper.h>
+#include <drm/drm_crtc_helper.h>
+
+#include "vbox_drv.h"
+#include "vbox_err.h"
+#include "vboxvideo_guest.h"
+#include "vboxvideo_vbe.h"
+
+static void vbox_user_framebuffer_destroy(struct drm_framebuffer *fb)
+{
+       struct vbox_framebuffer *vbox_fb = to_vbox_framebuffer(fb);
+
+       if (vbox_fb->obj)
+               drm_gem_object_unreference_unlocked(vbox_fb->obj);
+
+       drm_framebuffer_cleanup(fb);
+       kfree(fb);
+}
+
+void vbox_enable_accel(struct vbox_private *vbox)
+{
+       unsigned int i;
+       struct vbva_buffer *vbva;
+
+       if (!vbox->vbva_info || !vbox->vbva_buffers) {
+               /* Should never happen... */
+               DRM_ERROR("vboxvideo: failed to set up VBVA.\n");
+               return;
+       }
+
+       for (i = 0; i < vbox->num_crtcs; ++i) {
+               if (vbox->vbva_info[i].vbva)
+                       continue;
+
+               vbva = (void *)vbox->vbva_buffers + i * VBVA_MIN_BUFFER_SIZE;
+               if (!vbva_enable(&vbox->vbva_info[i],
+                                vbox->guest_pool, vbva, i)) {
+                       /* very old host or driver error. */
+                       DRM_ERROR("vboxvideo: vbva_enable failed\n");
+                       return;
+               }
+       }
+}
+
+void vbox_disable_accel(struct vbox_private *vbox)
+{
+       unsigned int i;
+
+       for (i = 0; i < vbox->num_crtcs; ++i)
+               vbva_disable(&vbox->vbva_info[i], vbox->guest_pool, i);
+}
+
+void vbox_report_caps(struct vbox_private *vbox)
+{
+       u32 caps = VBVACAPS_DISABLE_CURSOR_INTEGRATION |
+                  VBVACAPS_IRQ | VBVACAPS_USE_VBVA_ONLY;
+
+       if (vbox->initial_mode_queried)
+               caps |= VBVACAPS_VIDEO_MODE_HINTS;
+
+       hgsmi_send_caps_info(vbox->guest_pool, caps);
+}
+
+/**
+ * Send information about dirty rectangles to VBVA.  If necessary we enable
+ * VBVA first, as this is normally disabled after a change of master in case
+ * the new master does not send dirty rectangle information (is this even
+ * allowed?)
+ */
+void vbox_framebuffer_dirty_rectangles(struct drm_framebuffer *fb,
+                                      struct drm_clip_rect *rects,
+                                      unsigned int num_rects)
+{
+       struct vbox_private *vbox = fb->dev->dev_private;
+       struct drm_crtc *crtc;
+       unsigned int i;
+
+       mutex_lock(&vbox->hw_mutex);
+       list_for_each_entry(crtc, &fb->dev->mode_config.crtc_list, head) {
+               if (CRTC_FB(crtc) != fb)
+                       continue;
+
+               vbox_enable_accel(vbox);
+
+               for (i = 0; i < num_rects; ++i) {
+                       struct vbva_cmd_hdr cmd_hdr;
+                       unsigned int crtc_id = to_vbox_crtc(crtc)->crtc_id;
+
+                       if ((rects[i].x1 > crtc->x + crtc->hwmode.hdisplay) ||
+                           (rects[i].y1 > crtc->y + crtc->hwmode.vdisplay) ||
+                           (rects[i].x2 < crtc->x) ||
+                           (rects[i].y2 < crtc->y))
+                               continue;
+
+                       cmd_hdr.x = (s16)rects[i].x1;
+                       cmd_hdr.y = (s16)rects[i].y1;
+                       cmd_hdr.w = (u16)rects[i].x2 - rects[i].x1;
+                       cmd_hdr.h = (u16)rects[i].y2 - rects[i].y1;
+
+                       if (!vbva_buffer_begin_update(&vbox->vbva_info[crtc_id],
+                                                     vbox->guest_pool))
+                               continue;
+
+                       vbva_write(&vbox->vbva_info[crtc_id], vbox->guest_pool,
+                                  &cmd_hdr, sizeof(cmd_hdr));
+                       vbva_buffer_end_update(&vbox->vbva_info[crtc_id]);
+               }
+       }
+       mutex_unlock(&vbox->hw_mutex);
+}
+
+static int vbox_user_framebuffer_dirty(struct drm_framebuffer *fb,
+                                      struct drm_file *file_priv,
+                                      unsigned int flags, unsigned int color,
+                                      struct drm_clip_rect *rects,
+                                      unsigned int num_rects)
+{
+       vbox_framebuffer_dirty_rectangles(fb, rects, num_rects);
+
+       return 0;
+}
+
+static const struct drm_framebuffer_funcs vbox_fb_funcs = {
+       .destroy = vbox_user_framebuffer_destroy,
+       .dirty = vbox_user_framebuffer_dirty,
+};
+
+int vbox_framebuffer_init(struct drm_device *dev,
+                         struct vbox_framebuffer *vbox_fb,
+                         const struct DRM_MODE_FB_CMD *mode_cmd,
+                         struct drm_gem_object *obj)
+{
+       int ret;
+
+       drm_helper_mode_fill_fb_struct(dev, &vbox_fb->base, mode_cmd);
+       vbox_fb->obj = obj;
+       ret = drm_framebuffer_init(dev, &vbox_fb->base, &vbox_fb_funcs);
+       if (ret) {
+               DRM_ERROR("framebuffer init failed %d\n", ret);
+               return ret;
+       }
+
+       return 0;
+}
+
+static struct drm_framebuffer *vbox_user_framebuffer_create(
+               struct drm_device *dev,
+               struct drm_file *filp,
+               const struct drm_mode_fb_cmd2 *mode_cmd)
+{
+       struct drm_gem_object *obj;
+       struct vbox_framebuffer *vbox_fb;
+       int ret = -ENOMEM;
+
+       obj = drm_gem_object_lookup(filp, mode_cmd->handles[0]);
+       if (!obj)
+               return ERR_PTR(-ENOENT);
+
+       vbox_fb = kzalloc(sizeof(*vbox_fb), GFP_KERNEL);
+       if (!vbox_fb)
+               goto err_unref_obj;
+
+       ret = vbox_framebuffer_init(dev, vbox_fb, mode_cmd, obj);
+       if (ret)
+               goto err_free_vbox_fb;
+
+       return &vbox_fb->base;
+
+err_free_vbox_fb:
+       kfree(vbox_fb);
+err_unref_obj:
+       drm_gem_object_unreference_unlocked(obj);
+       return ERR_PTR(ret);
+}
+
+static const struct drm_mode_config_funcs vbox_mode_funcs = {
+       .fb_create = vbox_user_framebuffer_create,
+};
+
+static int vbox_accel_init(struct vbox_private *vbox)
+{
+       unsigned int i;
+
+       vbox->vbva_info = devm_kcalloc(vbox->dev->dev, vbox->num_crtcs,
+                                      sizeof(*vbox->vbva_info), GFP_KERNEL);
+       if (!vbox->vbva_info)
+               return -ENOMEM;
+
+       /* Take a command buffer for each screen from the end of usable VRAM. */
+       vbox->available_vram_size -= vbox->num_crtcs * VBVA_MIN_BUFFER_SIZE;
+
+       vbox->vbva_buffers = pci_iomap_range(vbox->dev->pdev, 0,
+                                            vbox->available_vram_size,
+                                            vbox->num_crtcs *
+                                            VBVA_MIN_BUFFER_SIZE);
+       if (!vbox->vbva_buffers)
+               return -ENOMEM;
+
+       for (i = 0; i < vbox->num_crtcs; ++i)
+               vbva_setup_buffer_context(&vbox->vbva_info[i],
+                                         vbox->available_vram_size +
+                                         i * VBVA_MIN_BUFFER_SIZE,
+                                         VBVA_MIN_BUFFER_SIZE);
+
+       return 0;
+}
+
+static void vbox_accel_fini(struct vbox_private *vbox)
+{
+       vbox_disable_accel(vbox);
+       pci_iounmap(vbox->dev->pdev, vbox->vbva_buffers);
+}
+
+/** Do we support the 4.3 plus mode hint reporting interface? */
+static bool have_hgsmi_mode_hints(struct vbox_private *vbox)
+{
+       u32 have_hints, have_cursor;
+       int ret;
+
+       ret = hgsmi_query_conf(vbox->guest_pool,
+                              VBOX_VBVA_CONF32_MODE_HINT_REPORTING,
+                              &have_hints);
+       if (ret)
+               return false;
+
+       ret = hgsmi_query_conf(vbox->guest_pool,
+                              VBOX_VBVA_CONF32_GUEST_CURSOR_REPORTING,
+                              &have_cursor);
+       if (ret)
+               return false;
+
+       return have_hints == VINF_SUCCESS && have_cursor == VINF_SUCCESS;
+}
+
+static bool vbox_check_supported(u16 id)
+{
+       u16 dispi_id;
+
+       vbox_write_ioport(VBE_DISPI_INDEX_ID, id);
+       dispi_id = inw(VBE_DISPI_IOPORT_DATA);
+
+       return dispi_id == id;
+}
+
+/**
+ * Set up our heaps and data exchange buffers in VRAM before handing the rest
+ * to the memory manager.
+ */
+static int vbox_hw_init(struct vbox_private *vbox)
+{
+       int ret = -ENOMEM;
+
+       vbox->full_vram_size = inl(VBE_DISPI_IOPORT_DATA);
+       vbox->any_pitch = vbox_check_supported(VBE_DISPI_ID_ANYX);
+
+       DRM_INFO("VRAM %08x\n", vbox->full_vram_size);
+
+       /* Map guest-heap at end of vram */
+       vbox->guest_heap =
+           pci_iomap_range(vbox->dev->pdev, 0, GUEST_HEAP_OFFSET(vbox),
+                           GUEST_HEAP_SIZE);
+       if (!vbox->guest_heap)
+               return -ENOMEM;
+
+       /* Create guest-heap mem-pool use 2^4 = 16 byte chunks */
+       vbox->guest_pool = gen_pool_create(4, -1);
+       if (!vbox->guest_pool)
+               goto err_unmap_guest_heap;
+
+       ret = gen_pool_add_virt(vbox->guest_pool,
+                               (unsigned long)vbox->guest_heap,
+                               GUEST_HEAP_OFFSET(vbox),
+                               GUEST_HEAP_USABLE_SIZE, -1);
+       if (ret)
+               goto err_destroy_guest_pool;
+
+       ret = hgsmi_test_query_conf(vbox->guest_pool);
+       if (ret) {
+               DRM_ERROR("vboxvideo: hgsmi_test_query_conf failed\n");
+               goto err_destroy_guest_pool;
+       }
+
+       /* Reduce available VRAM size to reflect the guest heap. */
+       vbox->available_vram_size = GUEST_HEAP_OFFSET(vbox);
+       /* Linux drm represents monitors as a 32-bit array. */
+       hgsmi_query_conf(vbox->guest_pool, VBOX_VBVA_CONF32_MONITOR_COUNT,
+                        &vbox->num_crtcs);
+       vbox->num_crtcs = clamp_t(u32, vbox->num_crtcs, 1, VBOX_MAX_SCREENS);
+
+       if (!have_hgsmi_mode_hints(vbox)) {
+               ret = -ENOTSUPP;
+               goto err_destroy_guest_pool;
+       }
+
+       vbox->last_mode_hints = devm_kcalloc(vbox->dev->dev, vbox->num_crtcs,
+                                            sizeof(struct vbva_modehint),
+                                            GFP_KERNEL);
+       if (!vbox->last_mode_hints) {
+               ret = -ENOMEM;
+               goto err_destroy_guest_pool;
+       }
+
+       ret = vbox_accel_init(vbox);
+       if (ret)
+               goto err_destroy_guest_pool;
+
+       return 0;
+
+err_destroy_guest_pool:
+       gen_pool_destroy(vbox->guest_pool);
+err_unmap_guest_heap:
+       pci_iounmap(vbox->dev->pdev, vbox->guest_heap);
+       return ret;
+}
+
+static void vbox_hw_fini(struct vbox_private *vbox)
+{
+       vbox_accel_fini(vbox);
+       gen_pool_destroy(vbox->guest_pool);
+       pci_iounmap(vbox->dev->pdev, vbox->guest_heap);
+}
+
+int vbox_driver_load(struct drm_device *dev, unsigned long flags)
+{
+       struct vbox_private *vbox;
+       int ret = 0;
+
+       if (!vbox_check_supported(VBE_DISPI_ID_HGSMI))
+               return -ENODEV;
+
+       vbox = devm_kzalloc(dev->dev, sizeof(*vbox), GFP_KERNEL);
+       if (!vbox)
+               return -ENOMEM;
+
+       dev->dev_private = vbox;
+       vbox->dev = dev;
+
+       mutex_init(&vbox->hw_mutex);
+
+       ret = vbox_hw_init(vbox);
+       if (ret)
+               return ret;
+
+       ret = vbox_mm_init(vbox);
+       if (ret)
+               goto err_hw_fini;
+
+       drm_mode_config_init(dev);
+
+       dev->mode_config.funcs = (void *)&vbox_mode_funcs;
+       dev->mode_config.min_width = 64;
+       dev->mode_config.min_height = 64;
+       dev->mode_config.preferred_depth = 24;
+       dev->mode_config.max_width = VBE_DISPI_MAX_XRES;
+       dev->mode_config.max_height = VBE_DISPI_MAX_YRES;
+
+       ret = vbox_mode_init(dev);
+       if (ret)
+               goto err_drm_mode_cleanup;
+
+       ret = vbox_irq_init(vbox);
+       if (ret)
+               goto err_mode_fini;
+
+       ret = vbox_fbdev_init(dev);
+       if (ret)
+               goto err_irq_fini;
+
+       return 0;
+
+err_irq_fini:
+       vbox_irq_fini(vbox);
+err_mode_fini:
+       vbox_mode_fini(dev);
+err_drm_mode_cleanup:
+       drm_mode_config_cleanup(dev);
+       vbox_mm_fini(vbox);
+err_hw_fini:
+       vbox_hw_fini(vbox);
+       return ret;
+}
+
+void vbox_driver_unload(struct drm_device *dev)
+{
+       struct vbox_private *vbox = dev->dev_private;
+
+       vbox_fbdev_fini(dev);
+       vbox_irq_fini(vbox);
+       vbox_mode_fini(dev);
+       drm_mode_config_cleanup(dev);
+       vbox_mm_fini(vbox);
+       vbox_hw_fini(vbox);
+}
+
+/**
+ * @note this is described in the DRM framework documentation.  AST does not
+ * have it, but we get an oops on driver unload if it is not present.
+ */
+void vbox_driver_lastclose(struct drm_device *dev)
+{
+       struct vbox_private *vbox = dev->dev_private;
+
+       if (vbox->fbdev)
+               drm_fb_helper_restore_fbdev_mode_unlocked(&vbox->fbdev->helper);
+}
+
+int vbox_gem_create(struct drm_device *dev,
+                   u32 size, bool iskernel, struct drm_gem_object **obj)
+{
+       struct vbox_bo *vboxbo;
+       int ret;
+
+       *obj = NULL;
+
+       size = roundup(size, PAGE_SIZE);
+       if (size == 0)
+               return -EINVAL;
+
+       ret = vbox_bo_create(dev, size, 0, 0, &vboxbo);
+       if (ret) {
+               if (ret != -ERESTARTSYS)
+                       DRM_ERROR("failed to allocate GEM object\n");
+               return ret;
+       }
+
+       *obj = &vboxbo->gem;
+
+       return 0;
+}
+
+int vbox_dumb_create(struct drm_file *file,
+                    struct drm_device *dev, struct drm_mode_create_dumb *args)
+{
+       int ret;
+       struct drm_gem_object *gobj;
+       u32 handle;
+
+       args->pitch = args->width * ((args->bpp + 7) / 8);
+       args->size = args->pitch * args->height;
+
+       ret = vbox_gem_create(dev, args->size, false, &gobj);
+       if (ret)
+               return ret;
+
+       ret = drm_gem_handle_create(file, gobj, &handle);
+       drm_gem_object_unreference_unlocked(gobj);
+       if (ret)
+               return ret;
+
+       args->handle = handle;
+
+       return 0;
+}
+
+static void vbox_bo_unref(struct vbox_bo **bo)
+{
+       struct ttm_buffer_object *tbo;
+
+       if ((*bo) == NULL)
+               return;
+
+       tbo = &((*bo)->bo);
+       ttm_bo_unref(&tbo);
+       if (!tbo)
+               *bo = NULL;
+}
+
+void vbox_gem_free_object(struct drm_gem_object *obj)
+{
+       struct vbox_bo *vbox_bo = gem_to_vbox_bo(obj);
+
+       vbox_bo_unref(&vbox_bo);
+}
+
+static inline u64 vbox_bo_mmap_offset(struct vbox_bo *bo)
+{
+       return drm_vma_node_offset_addr(&bo->bo.vma_node);
+}
+
+int
+vbox_dumb_mmap_offset(struct drm_file *file,
+                     struct drm_device *dev,
+                     u32 handle, u64 *offset)
+{
+       struct drm_gem_object *obj;
+       int ret;
+       struct vbox_bo *bo;
+
+       mutex_lock(&dev->struct_mutex);
+       obj = drm_gem_object_lookup(file, handle);
+       if (!obj) {
+               ret = -ENOENT;
+               goto out_unlock;
+       }
+
+       bo = gem_to_vbox_bo(obj);
+       *offset = vbox_bo_mmap_offset(bo);
+
+       drm_gem_object_unreference(obj);
+       ret = 0;
+
+out_unlock:
+       mutex_unlock(&dev->struct_mutex);
+       return ret;
+}
diff --git a/drivers/staging/vboxvideo/vbox_mode.c b/drivers/staging/vboxvideo/vbox_mode.c
new file mode 100644 (file)
index 0000000..f2b85f3
--- /dev/null
@@ -0,0 +1,877 @@
+/*
+ * Copyright (C) 2013-2017 Oracle Corporation
+ * This file is based on ast_mode.c
+ * Copyright 2012 Red Hat Inc.
+ * Parts based on xf86-video-ast
+ * Copyright (c) 2005 ASPEED Technology Inc.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the
+ * "Software"), to deal in the Software without restriction, including
+ * without limitation the rights to use, copy, modify, merge, publish,
+ * distribute, sub license, and/or sell copies of the Software, and to
+ * permit persons to whom the Software is furnished to do so, subject to
+ * the following conditions:
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
+ * THE COPYRIGHT HOLDERS, AUTHORS AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM,
+ * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
+ * USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
+ * The above copyright notice and this permission notice (including the
+ * next paragraph) shall be included in all copies or substantial portions
+ * of the Software.
+ *
+ */
+/*
+ * Authors: Dave Airlie <airlied@redhat.com>
+ *          Michael Thayer <michael.thayer@oracle.com,
+ *          Hans de Goede <hdegoede@redhat.com>
+ */
+#include <linux/export.h>
+#include <drm/drm_crtc_helper.h>
+#include <drm/drm_plane_helper.h>
+
+#include "vbox_drv.h"
+#include "vboxvideo.h"
+#include "hgsmi_channels.h"
+
+static int vbox_cursor_set2(struct drm_crtc *crtc, struct drm_file *file_priv,
+                           u32 handle, u32 width, u32 height,
+                           s32 hot_x, s32 hot_y);
+static int vbox_cursor_move(struct drm_crtc *crtc, int x, int y);
+
+/**
+ * Set a graphics mode.  Poke any required values into registers, do an HGSMI
+ * mode set and tell the host we support advanced graphics functions.
+ */
+static void vbox_do_modeset(struct drm_crtc *crtc,
+                           const struct drm_display_mode *mode)
+{
+       struct vbox_crtc *vbox_crtc = to_vbox_crtc(crtc);
+       struct vbox_private *vbox;
+       int width, height, bpp, pitch;
+       unsigned int crtc_id;
+       u16 flags;
+       s32 x_offset, y_offset;
+
+       vbox = crtc->dev->dev_private;
+       width = mode->hdisplay ? mode->hdisplay : 640;
+       height = mode->vdisplay ? mode->vdisplay : 480;
+       crtc_id = vbox_crtc->crtc_id;
+       bpp = crtc->enabled ? CRTC_FB(crtc)->format->cpp[0] * 8 : 32;
+       pitch = crtc->enabled ? CRTC_FB(crtc)->pitches[0] : width * bpp / 8;
+       x_offset = vbox->single_framebuffer ? crtc->x : vbox_crtc->x_hint;
+       y_offset = vbox->single_framebuffer ? crtc->y : vbox_crtc->y_hint;
+
+       /*
+        * This is the old way of setting graphics modes.  It assumed one screen
+        * and a frame-buffer at the start of video RAM.  On older versions of
+        * VirtualBox, certain parts of the code still assume that the first
+        * screen is programmed this way, so try to fake it.
+        */
+       if (vbox_crtc->crtc_id == 0 && crtc->enabled &&
+           vbox_crtc->fb_offset / pitch < 0xffff - crtc->y &&
+           vbox_crtc->fb_offset % (bpp / 8) == 0) {
+               vbox_write_ioport(VBE_DISPI_INDEX_XRES, width);
+               vbox_write_ioport(VBE_DISPI_INDEX_YRES, height);
+               vbox_write_ioport(VBE_DISPI_INDEX_VIRT_WIDTH, pitch * 8 / bpp);
+               vbox_write_ioport(VBE_DISPI_INDEX_BPP,
+                                 CRTC_FB(crtc)->format->cpp[0] * 8);
+               vbox_write_ioport(VBE_DISPI_INDEX_ENABLE, VBE_DISPI_ENABLED);
+               vbox_write_ioport(
+                       VBE_DISPI_INDEX_X_OFFSET,
+                       vbox_crtc->fb_offset % pitch / bpp * 8 + crtc->x);
+               vbox_write_ioport(VBE_DISPI_INDEX_Y_OFFSET,
+                                 vbox_crtc->fb_offset / pitch + crtc->y);
+       }
+
+       flags = VBVA_SCREEN_F_ACTIVE;
+       flags |= (crtc->enabled && !vbox_crtc->blanked) ?
+                0 : VBVA_SCREEN_F_BLANK;
+       flags |= vbox_crtc->disconnected ? VBVA_SCREEN_F_DISABLED : 0;
+       hgsmi_process_display_info(vbox->guest_pool, vbox_crtc->crtc_id,
+                                  x_offset, y_offset,
+                                  crtc->x * bpp / 8 + crtc->y * pitch,
+                                  pitch, width, height,
+                                  vbox_crtc->blanked ? 0 : bpp, flags);
+}
+
+static int vbox_set_view(struct drm_crtc *crtc)
+{
+       struct vbox_crtc *vbox_crtc = to_vbox_crtc(crtc);
+       struct vbox_private *vbox = crtc->dev->dev_private;
+       struct vbva_infoview *p;
+
+       /*
+        * Tell the host about the view.  This design originally targeted the
+        * Windows XP driver architecture and assumed that each screen would
+        * have a dedicated frame buffer with the command buffer following it,
+        * the whole being a "view".  The host works out which screen a command
+        * buffer belongs to by checking whether it is in the first view, then
+        * whether it is in the second and so on.  The first match wins.  We
+        * cheat around this by making the first view be the managed memory
+        * plus the first command buffer, the second the same plus the second
+        * buffer and so on.
+        */
+       p = hgsmi_buffer_alloc(vbox->guest_pool, sizeof(*p),
+                              HGSMI_CH_VBVA, VBVA_INFO_VIEW);
+       if (!p)
+               return -ENOMEM;
+
+       p->view_index = vbox_crtc->crtc_id;
+       p->view_offset = vbox_crtc->fb_offset;
+       p->view_size = vbox->available_vram_size - vbox_crtc->fb_offset +
+                      vbox_crtc->crtc_id * VBVA_MIN_BUFFER_SIZE;
+       p->max_screen_size = vbox->available_vram_size - vbox_crtc->fb_offset;
+
+       hgsmi_buffer_submit(vbox->guest_pool, p);
+       hgsmi_buffer_free(vbox->guest_pool, p);
+
+       return 0;
+}
+
+static void vbox_crtc_load_lut(struct drm_crtc *crtc)
+{
+}
+
+static void vbox_crtc_dpms(struct drm_crtc *crtc, int mode)
+{
+       struct vbox_crtc *vbox_crtc = to_vbox_crtc(crtc);
+       struct vbox_private *vbox = crtc->dev->dev_private;
+
+       switch (mode) {
+       case DRM_MODE_DPMS_ON:
+               vbox_crtc->blanked = false;
+               break;
+       case DRM_MODE_DPMS_STANDBY:
+       case DRM_MODE_DPMS_SUSPEND:
+       case DRM_MODE_DPMS_OFF:
+               vbox_crtc->blanked = true;
+               break;
+       }
+
+       mutex_lock(&vbox->hw_mutex);
+       vbox_do_modeset(crtc, &crtc->hwmode);
+       mutex_unlock(&vbox->hw_mutex);
+}
+
+static bool vbox_crtc_mode_fixup(struct drm_crtc *crtc,
+                                const struct drm_display_mode *mode,
+                                struct drm_display_mode *adjusted_mode)
+{
+       return true;
+}
+
+/*
+ * Try to map the layout of virtual screens to the range of the input device.
+ * Return true if we need to re-set the crtc modes due to screen offset
+ * changes.
+ */
+static bool vbox_set_up_input_mapping(struct vbox_private *vbox)
+{
+       struct drm_crtc *crtci;
+       struct drm_connector *connectori;
+       struct drm_framebuffer *fb1 = NULL;
+       bool single_framebuffer = true;
+       bool old_single_framebuffer = vbox->single_framebuffer;
+       u16 width = 0, height = 0;
+
+       /*
+        * Are we using an X.Org-style single large frame-buffer for all crtcs?
+        * If so then screen layout can be deduced from the crtc offsets.
+        * Same fall-back if this is the fbdev frame-buffer.
+        */
+       list_for_each_entry(crtci, &vbox->dev->mode_config.crtc_list, head) {
+               if (!fb1) {
+                       fb1 = CRTC_FB(crtci);
+                       if (to_vbox_framebuffer(fb1) == &vbox->fbdev->afb)
+                               break;
+               } else if (CRTC_FB(crtci) && fb1 != CRTC_FB(crtci)) {
+                       single_framebuffer = false;
+               }
+       }
+       if (single_framebuffer) {
+               list_for_each_entry(crtci, &vbox->dev->mode_config.crtc_list,
+                                   head) {
+                       if (to_vbox_crtc(crtci)->crtc_id != 0)
+                               continue;
+
+                       vbox->single_framebuffer = true;
+                       vbox->input_mapping_width = CRTC_FB(crtci)->width;
+                       vbox->input_mapping_height = CRTC_FB(crtci)->height;
+                       return old_single_framebuffer !=
+                              vbox->single_framebuffer;
+               }
+       }
+       /* Otherwise calculate the total span of all screens. */
+       list_for_each_entry(connectori, &vbox->dev->mode_config.connector_list,
+                           head) {
+               struct vbox_connector *vbox_connector =
+                   to_vbox_connector(connectori);
+               struct vbox_crtc *vbox_crtc = vbox_connector->vbox_crtc;
+
+               width = max_t(u16, width, vbox_crtc->x_hint +
+                                         vbox_connector->mode_hint.width);
+               height = max_t(u16, height, vbox_crtc->y_hint +
+                                           vbox_connector->mode_hint.height);
+       }
+
+       vbox->single_framebuffer = false;
+       vbox->input_mapping_width = width;
+       vbox->input_mapping_height = height;
+
+       return old_single_framebuffer != vbox->single_framebuffer;
+}
+
+static int vbox_crtc_do_set_base(struct drm_crtc *crtc,
+                                struct drm_framebuffer *old_fb, int x, int y)
+{
+       struct vbox_private *vbox = crtc->dev->dev_private;
+       struct vbox_crtc *vbox_crtc = to_vbox_crtc(crtc);
+       struct drm_gem_object *obj;
+       struct vbox_framebuffer *vbox_fb;
+       struct vbox_bo *bo;
+       int ret;
+       u64 gpu_addr;
+
+       /* Unpin the previous fb. */
+       if (old_fb) {
+               vbox_fb = to_vbox_framebuffer(old_fb);
+               obj = vbox_fb->obj;
+               bo = gem_to_vbox_bo(obj);
+               ret = vbox_bo_reserve(bo, false);
+               if (ret)
+                       return ret;
+
+               vbox_bo_unpin(bo);
+               vbox_bo_unreserve(bo);
+       }
+
+       vbox_fb = to_vbox_framebuffer(CRTC_FB(crtc));
+       obj = vbox_fb->obj;
+       bo = gem_to_vbox_bo(obj);
+
+       ret = vbox_bo_reserve(bo, false);
+       if (ret)
+               return ret;
+
+       ret = vbox_bo_pin(bo, TTM_PL_FLAG_VRAM, &gpu_addr);
+       if (ret) {
+               vbox_bo_unreserve(bo);
+               return ret;
+       }
+
+       if (&vbox->fbdev->afb == vbox_fb)
+               vbox_fbdev_set_base(vbox, gpu_addr);
+       vbox_bo_unreserve(bo);
+
+       /* vbox_set_start_address_crt1(crtc, (u32)gpu_addr); */
+       vbox_crtc->fb_offset = gpu_addr;
+       if (vbox_set_up_input_mapping(vbox)) {
+               struct drm_crtc *crtci;
+
+               list_for_each_entry(crtci, &vbox->dev->mode_config.crtc_list,
+                                   head) {
+                       vbox_set_view(crtc);
+                       vbox_do_modeset(crtci, &crtci->mode);
+               }
+       }
+
+       return 0;
+}
+
+static int vbox_crtc_mode_set_base(struct drm_crtc *crtc, int x, int y,
+                                  struct drm_framebuffer *old_fb)
+{
+       return vbox_crtc_do_set_base(crtc, old_fb, x, y);
+}
+
+static int vbox_crtc_mode_set(struct drm_crtc *crtc,
+                             struct drm_display_mode *mode,
+                             struct drm_display_mode *adjusted_mode,
+                             int x, int y, struct drm_framebuffer *old_fb)
+{
+       struct vbox_private *vbox = crtc->dev->dev_private;
+       int ret;
+
+       vbox_crtc_mode_set_base(crtc, x, y, old_fb);
+
+       mutex_lock(&vbox->hw_mutex);
+       ret = vbox_set_view(crtc);
+       if (!ret)
+               vbox_do_modeset(crtc, mode);
+       hgsmi_update_input_mapping(vbox->guest_pool, 0, 0,
+                                  vbox->input_mapping_width,
+                                  vbox->input_mapping_height);
+       mutex_unlock(&vbox->hw_mutex);
+
+       return ret;
+}
+
+static void vbox_crtc_disable(struct drm_crtc *crtc)
+{
+}
+
+static void vbox_crtc_prepare(struct drm_crtc *crtc)
+{
+}
+
+static void vbox_crtc_commit(struct drm_crtc *crtc)
+{
+}
+
+static const struct drm_crtc_helper_funcs vbox_crtc_helper_funcs = {
+       .dpms = vbox_crtc_dpms,
+       .mode_fixup = vbox_crtc_mode_fixup,
+       .mode_set = vbox_crtc_mode_set,
+       /* .mode_set_base = vbox_crtc_mode_set_base, */
+       .disable = vbox_crtc_disable,
+       .load_lut = vbox_crtc_load_lut,
+       .prepare = vbox_crtc_prepare,
+       .commit = vbox_crtc_commit,
+};
+
+static void vbox_crtc_reset(struct drm_crtc *crtc)
+{
+}
+
+static void vbox_crtc_destroy(struct drm_crtc *crtc)
+{
+       drm_crtc_cleanup(crtc);
+       kfree(crtc);
+}
+
+static const struct drm_crtc_funcs vbox_crtc_funcs = {
+       .cursor_move = vbox_cursor_move,
+       .cursor_set2 = vbox_cursor_set2,
+       .reset = vbox_crtc_reset,
+       .set_config = drm_crtc_helper_set_config,
+       /* .gamma_set = vbox_crtc_gamma_set, */
+       .destroy = vbox_crtc_destroy,
+};
+
+static struct vbox_crtc *vbox_crtc_init(struct drm_device *dev, unsigned int i)
+{
+       struct vbox_crtc *vbox_crtc;
+
+       vbox_crtc = kzalloc(sizeof(*vbox_crtc), GFP_KERNEL);
+       if (!vbox_crtc)
+               return NULL;
+
+       vbox_crtc->crtc_id = i;
+
+       drm_crtc_init(dev, &vbox_crtc->base, &vbox_crtc_funcs);
+       drm_mode_crtc_set_gamma_size(&vbox_crtc->base, 256);
+       drm_crtc_helper_add(&vbox_crtc->base, &vbox_crtc_helper_funcs);
+
+       return vbox_crtc;
+}
+
+static void vbox_encoder_destroy(struct drm_encoder *encoder)
+{
+       drm_encoder_cleanup(encoder);
+       kfree(encoder);
+}
+
+static struct drm_encoder *vbox_best_single_encoder(struct drm_connector
+                                                   *connector)
+{
+       int enc_id = connector->encoder_ids[0];
+
+       /* pick the encoder ids */
+       if (enc_id)
+               return drm_encoder_find(connector->dev, enc_id);
+
+       return NULL;
+}
+
+static const struct drm_encoder_funcs vbox_enc_funcs = {
+       .destroy = vbox_encoder_destroy,
+};
+
+static void vbox_encoder_dpms(struct drm_encoder *encoder, int mode)
+{
+}
+
+static bool vbox_mode_fixup(struct drm_encoder *encoder,
+                           const struct drm_display_mode *mode,
+                           struct drm_display_mode *adjusted_mode)
+{
+       return true;
+}
+
+static void vbox_encoder_mode_set(struct drm_encoder *encoder,
+                                 struct drm_display_mode *mode,
+                                 struct drm_display_mode *adjusted_mode)
+{
+}
+
+static void vbox_encoder_prepare(struct drm_encoder *encoder)
+{
+}
+
+static void vbox_encoder_commit(struct drm_encoder *encoder)
+{
+}
+
+static const struct drm_encoder_helper_funcs vbox_enc_helper_funcs = {
+       .dpms = vbox_encoder_dpms,
+       .mode_fixup = vbox_mode_fixup,
+       .prepare = vbox_encoder_prepare,
+       .commit = vbox_encoder_commit,
+       .mode_set = vbox_encoder_mode_set,
+};
+
+static struct drm_encoder *vbox_encoder_init(struct drm_device *dev,
+                                            unsigned int i)
+{
+       struct vbox_encoder *vbox_encoder;
+
+       vbox_encoder = kzalloc(sizeof(*vbox_encoder), GFP_KERNEL);
+       if (!vbox_encoder)
+               return NULL;
+
+       drm_encoder_init(dev, &vbox_encoder->base, &vbox_enc_funcs,
+                        DRM_MODE_ENCODER_DAC, NULL);
+       drm_encoder_helper_add(&vbox_encoder->base, &vbox_enc_helper_funcs);
+
+       vbox_encoder->base.possible_crtcs = 1 << i;
+       return &vbox_encoder->base;
+}
+
+/**
+ * Generate EDID data with a mode-unique serial number for the virtual
+ *  monitor to try to persuade Unity that different modes correspond to
+ *  different monitors and it should not try to force the same resolution on
+ *  them.
+ */
+static void vbox_set_edid(struct drm_connector *connector, int width,
+                         int height)
+{
+       enum { EDID_SIZE = 128 };
+       unsigned char edid[EDID_SIZE] = {
+               0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, /* header */
+               0x58, 0x58,     /* manufacturer (VBX) */
+               0x00, 0x00,     /* product code */
+               0x00, 0x00, 0x00, 0x00, /* serial number goes here */
+               0x01,           /* week of manufacture */
+               0x00,           /* year of manufacture */
+               0x01, 0x03,     /* EDID version */
+               0x80,           /* capabilities - digital */
+               0x00,           /* horiz. res in cm, zero for projectors */
+               0x00,           /* vert. res in cm */
+               0x78,           /* display gamma (120 == 2.2). */
+               0xEE,           /* features (standby, suspend, off, RGB, std */
+                               /* colour space, preferred timing mode) */
+               0xEE, 0x91, 0xA3, 0x54, 0x4C, 0x99, 0x26, 0x0F, 0x50, 0x54,
+               /* chromaticity for standard colour space. */
+               0x00, 0x00, 0x00,       /* no default timings */
+               0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
+                   0x01, 0x01,
+               0x01, 0x01, 0x01, 0x01, /* no standard timings */
+               0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x06, 0x00, 0x02, 0x02,
+                   0x02, 0x02,
+               /* descriptor block 1 goes below */
+               0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+               /* descriptor block 2, monitor ranges */
+               0x00, 0x00, 0x00, 0xFD, 0x00,
+               0x00, 0xC8, 0x00, 0xC8, 0x64, 0x00, 0x0A, 0x20, 0x20, 0x20,
+                   0x20, 0x20,
+               /* 0-200Hz vertical, 0-200KHz horizontal, 1000MHz pixel clock */
+               0x20,
+               /* descriptor block 3, monitor name */
+               0x00, 0x00, 0x00, 0xFC, 0x00,
+               'V', 'B', 'O', 'X', ' ', 'm', 'o', 'n', 'i', 't', 'o', 'r',
+               '\n',
+               /* descriptor block 4: dummy data */
+               0x00, 0x00, 0x00, 0x10, 0x00,
+               0x0A, 0x20, 0x20, 0x20, 0x20, 0x20,
+               0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
+               0x20,
+               0x00,           /* number of extensions */
+               0x00            /* checksum goes here */
+       };
+       int clock = (width + 6) * (height + 6) * 60 / 10000;
+       unsigned int i, sum = 0;
+
+       edid[12] = width & 0xff;
+       edid[13] = width >> 8;
+       edid[14] = height & 0xff;
+       edid[15] = height >> 8;
+       edid[54] = clock & 0xff;
+       edid[55] = clock >> 8;
+       edid[56] = width & 0xff;
+       edid[58] = (width >> 4) & 0xf0;
+       edid[59] = height & 0xff;
+       edid[61] = (height >> 4) & 0xf0;
+       for (i = 0; i < EDID_SIZE - 1; ++i)
+               sum += edid[i];
+       edid[EDID_SIZE - 1] = (0x100 - (sum & 0xFF)) & 0xFF;
+       drm_mode_connector_update_edid_property(connector, (struct edid *)edid);
+}
+
+static int vbox_get_modes(struct drm_connector *connector)
+{
+       struct vbox_connector *vbox_connector = NULL;
+       struct drm_display_mode *mode = NULL;
+       struct vbox_private *vbox = NULL;
+       unsigned int num_modes = 0;
+       int preferred_width, preferred_height;
+
+       vbox_connector = to_vbox_connector(connector);
+       vbox = connector->dev->dev_private;
+       /*
+        * Heuristic: we do not want to tell the host that we support dynamic
+        * resizing unless we feel confident that the user space client using
+        * the video driver can handle hot-plug events.  So the first time modes
+        * are queried after a "master" switch we tell the host that we do not,
+        * and immediately after we send the client a hot-plug notification as
+        * a test to see if they will respond and query again.
+        * That is also the reason why capabilities are reported to the host at
+        * this place in the code rather than elsewhere.
+        * We need to report the flags location before reporting the IRQ
+        * capability.
+        */
+       hgsmi_report_flags_location(vbox->guest_pool, GUEST_HEAP_OFFSET(vbox) +
+                                   HOST_FLAGS_OFFSET);
+       if (vbox_connector->vbox_crtc->crtc_id == 0)
+               vbox_report_caps(vbox);
+       if (!vbox->initial_mode_queried) {
+               if (vbox_connector->vbox_crtc->crtc_id == 0) {
+                       vbox->initial_mode_queried = true;
+                       vbox_report_hotplug(vbox);
+               }
+               return drm_add_modes_noedid(connector, 800, 600);
+       }
+       num_modes = drm_add_modes_noedid(connector, 2560, 1600);
+       preferred_width = vbox_connector->mode_hint.width ?
+                         vbox_connector->mode_hint.width : 1024;
+       preferred_height = vbox_connector->mode_hint.height ?
+                          vbox_connector->mode_hint.height : 768;
+       mode = drm_cvt_mode(connector->dev, preferred_width, preferred_height,
+                           60, false, false, false);
+       if (mode) {
+               mode->type |= DRM_MODE_TYPE_PREFERRED;
+               drm_mode_probed_add(connector, mode);
+               ++num_modes;
+       }
+       vbox_set_edid(connector, preferred_width, preferred_height);
+       drm_object_property_set_value(
+               &connector->base, vbox->dev->mode_config.suggested_x_property,
+               vbox_connector->vbox_crtc->x_hint);
+       drm_object_property_set_value(
+               &connector->base, vbox->dev->mode_config.suggested_y_property,
+               vbox_connector->vbox_crtc->y_hint);
+
+       return num_modes;
+}
+
+static int vbox_mode_valid(struct drm_connector *connector,
+                          struct drm_display_mode *mode)
+{
+       return MODE_OK;
+}
+
+static void vbox_connector_destroy(struct drm_connector *connector)
+{
+       struct vbox_connector *vbox_connector;
+
+       vbox_connector = to_vbox_connector(connector);
+       drm_connector_unregister(connector);
+       drm_connector_cleanup(connector);
+       kfree(connector);
+}
+
+static enum drm_connector_status
+vbox_connector_detect(struct drm_connector *connector, bool force)
+{
+       struct vbox_connector *vbox_connector;
+
+       vbox_connector = to_vbox_connector(connector);
+
+       return vbox_connector->mode_hint.disconnected ?
+           connector_status_disconnected : connector_status_connected;
+}
+
+static int vbox_fill_modes(struct drm_connector *connector, u32 max_x,
+                          u32 max_y)
+{
+       struct vbox_connector *vbox_connector;
+       struct drm_device *dev;
+       struct drm_display_mode *mode, *iterator;
+
+       vbox_connector = to_vbox_connector(connector);
+       dev = vbox_connector->base.dev;
+       list_for_each_entry_safe(mode, iterator, &connector->modes, head) {
+               list_del(&mode->head);
+               drm_mode_destroy(dev, mode);
+       }
+
+       return drm_helper_probe_single_connector_modes(connector, max_x, max_y);
+}
+
+static const struct drm_connector_helper_funcs vbox_connector_helper_funcs = {
+       .mode_valid = vbox_mode_valid,
+       .get_modes = vbox_get_modes,
+       .best_encoder = vbox_best_single_encoder,
+};
+
+static const struct drm_connector_funcs vbox_connector_funcs = {
+       .dpms = drm_helper_connector_dpms,
+       .detect = vbox_connector_detect,
+       .fill_modes = vbox_fill_modes,
+       .destroy = vbox_connector_destroy,
+};
+
+static int vbox_connector_init(struct drm_device *dev,
+                              struct vbox_crtc *vbox_crtc,
+                              struct drm_encoder *encoder)
+{
+       struct vbox_connector *vbox_connector;
+       struct drm_connector *connector;
+
+       vbox_connector = kzalloc(sizeof(*vbox_connector), GFP_KERNEL);
+       if (!vbox_connector)
+               return -ENOMEM;
+
+       connector = &vbox_connector->base;
+       vbox_connector->vbox_crtc = vbox_crtc;
+
+       drm_connector_init(dev, connector, &vbox_connector_funcs,
+                          DRM_MODE_CONNECTOR_VGA);
+       drm_connector_helper_add(connector, &vbox_connector_helper_funcs);
+
+       connector->interlace_allowed = 0;
+       connector->doublescan_allowed = 0;
+
+       drm_mode_create_suggested_offset_properties(dev);
+       drm_object_attach_property(&connector->base,
+                                  dev->mode_config.suggested_x_property, -1);
+       drm_object_attach_property(&connector->base,
+                                  dev->mode_config.suggested_y_property, -1);
+       drm_connector_register(connector);
+
+       drm_mode_connector_attach_encoder(connector, encoder);
+
+       return 0;
+}
+
+int vbox_mode_init(struct drm_device *dev)
+{
+       struct vbox_private *vbox = dev->dev_private;
+       struct drm_encoder *encoder;
+       struct vbox_crtc *vbox_crtc;
+       unsigned int i;
+       int ret;
+
+       /* vbox_cursor_init(dev); */
+       for (i = 0; i < vbox->num_crtcs; ++i) {
+               vbox_crtc = vbox_crtc_init(dev, i);
+               if (!vbox_crtc)
+                       return -ENOMEM;
+               encoder = vbox_encoder_init(dev, i);
+               if (!encoder)
+                       return -ENOMEM;
+               ret = vbox_connector_init(dev, vbox_crtc, encoder);
+               if (ret)
+                       return ret;
+       }
+
+       return 0;
+}
+
+void vbox_mode_fini(struct drm_device *dev)
+{
+       /* vbox_cursor_fini(dev); */
+}
+
+/**
+ * Copy the ARGB image and generate the mask, which is needed in case the host
+ * does not support ARGB cursors.  The mask is a 1BPP bitmap with the bit set
+ * if the corresponding alpha value in the ARGB image is greater than 0xF0.
+ */
+static void copy_cursor_image(u8 *src, u8 *dst, u32 width, u32 height,
+                             size_t mask_size)
+{
+       size_t line_size = (width + 7) / 8;
+       u32 i, j;
+
+       memcpy(dst + mask_size, src, width * height * 4);
+       for (i = 0; i < height; ++i)
+               for (j = 0; j < width; ++j)
+                       if (((u32 *)src)[i * width + j] > 0xf0000000)
+                               dst[i * line_size + j / 8] |= (0x80 >> (j % 8));
+}
+
+static int vbox_cursor_set2(struct drm_crtc *crtc, struct drm_file *file_priv,
+                           u32 handle, u32 width, u32 height,
+                           s32 hot_x, s32 hot_y)
+{
+       struct vbox_private *vbox = crtc->dev->dev_private;
+       struct vbox_crtc *vbox_crtc = to_vbox_crtc(crtc);
+       struct ttm_bo_kmap_obj uobj_map;
+       size_t data_size, mask_size;
+       struct drm_gem_object *obj;
+       u32 flags, caps = 0;
+       struct vbox_bo *bo;
+       bool src_isiomem;
+       u8 *dst = NULL;
+       u8 *src;
+       int ret;
+
+       /*
+        * Re-set this regularly as in 5.0.20 and earlier the information was
+        * lost on save and restore.
+        */
+       hgsmi_update_input_mapping(vbox->guest_pool, 0, 0,
+                                  vbox->input_mapping_width,
+                                  vbox->input_mapping_height);
+       if (!handle) {
+               bool cursor_enabled = false;
+               struct drm_crtc *crtci;
+
+               /* Hide cursor. */
+               vbox_crtc->cursor_enabled = false;
+               list_for_each_entry(crtci, &vbox->dev->mode_config.crtc_list,
+                                   head) {
+                       if (to_vbox_crtc(crtci)->cursor_enabled)
+                               cursor_enabled = true;
+               }
+
+               if (!cursor_enabled)
+                       hgsmi_update_pointer_shape(vbox->guest_pool, 0, 0, 0,
+                                                  0, 0, NULL, 0);
+               return 0;
+       }
+
+       vbox_crtc->cursor_enabled = true;
+
+       if (width > VBOX_MAX_CURSOR_WIDTH || height > VBOX_MAX_CURSOR_HEIGHT ||
+           width == 0 || height == 0)
+               return -EINVAL;
+
+       ret = hgsmi_query_conf(vbox->guest_pool,
+                              VBOX_VBVA_CONF32_CURSOR_CAPABILITIES, &caps);
+       if (ret)
+               return ret;
+
+       if (!(caps & VBOX_VBVA_CURSOR_CAPABILITY_HARDWARE)) {
+               /*
+                * -EINVAL means cursor_set2() not supported, -EAGAIN means
+                * retry at once.
+                */
+               return -EBUSY;
+       }
+
+       obj = drm_gem_object_lookup(file_priv, handle);
+       if (!obj) {
+               DRM_ERROR("Cannot find cursor object %x for crtc\n", handle);
+               return -ENOENT;
+       }
+
+       bo = gem_to_vbox_bo(obj);
+       ret = vbox_bo_reserve(bo, false);
+       if (ret)
+               goto out_unref_obj;
+
+       /*
+        * The mask must be calculated based on the alpha
+        * channel, one bit per ARGB word, and must be 32-bit
+        * padded.
+        */
+       mask_size = ((width + 7) / 8 * height + 3) & ~3;
+       data_size = width * height * 4 + mask_size;
+       vbox->cursor_hot_x = min_t(u32, max(hot_x, 0), width);
+       vbox->cursor_hot_y = min_t(u32, max(hot_y, 0), height);
+       vbox->cursor_width = width;
+       vbox->cursor_height = height;
+       vbox->cursor_data_size = data_size;
+       dst = vbox->cursor_data;
+
+       ret = ttm_bo_kmap(&bo->bo, 0, bo->bo.num_pages, &uobj_map);
+       if (ret) {
+               vbox->cursor_data_size = 0;
+               goto out_unreserve_bo;
+       }
+
+       src = ttm_kmap_obj_virtual(&uobj_map, &src_isiomem);
+       if (src_isiomem) {
+               DRM_ERROR("src cursor bo not in main memory\n");
+               ret = -EIO;
+               goto out_unmap_bo;
+       }
+
+       copy_cursor_image(src, dst, width, height, mask_size);
+
+       flags = VBOX_MOUSE_POINTER_VISIBLE | VBOX_MOUSE_POINTER_SHAPE |
+               VBOX_MOUSE_POINTER_ALPHA;
+       ret = hgsmi_update_pointer_shape(vbox->guest_pool, flags,
+                                        vbox->cursor_hot_x, vbox->cursor_hot_y,
+                                        width, height, dst, data_size);
+out_unmap_bo:
+       ttm_bo_kunmap(&uobj_map);
+out_unreserve_bo:
+       vbox_bo_unreserve(bo);
+out_unref_obj:
+       drm_gem_object_unreference_unlocked(obj);
+
+       return ret;
+}
+
+static int vbox_cursor_move(struct drm_crtc *crtc, int x, int y)
+{
+       struct vbox_private *vbox = crtc->dev->dev_private;
+       u32 flags = VBOX_MOUSE_POINTER_VISIBLE |
+           VBOX_MOUSE_POINTER_SHAPE | VBOX_MOUSE_POINTER_ALPHA;
+       s32 crtc_x =
+           vbox->single_framebuffer ? crtc->x : to_vbox_crtc(crtc)->x_hint;
+       s32 crtc_y =
+           vbox->single_framebuffer ? crtc->y : to_vbox_crtc(crtc)->y_hint;
+       u32 host_x, host_y;
+       u32 hot_x = 0;
+       u32 hot_y = 0;
+       int ret;
+
+       /*
+        * We compare these to unsigned later and don't
+        * need to handle negative.
+        */
+       if (x + crtc_x < 0 || y + crtc_y < 0 || vbox->cursor_data_size == 0)
+               return 0;
+
+       ret = hgsmi_cursor_position(vbox->guest_pool, true, x + crtc_x,
+                                   y + crtc_y, &host_x, &host_y);
+
+       /*
+        * The only reason we have vbox_cursor_move() is that some older clients
+        * might use DRM_IOCTL_MODE_CURSOR instead of DRM_IOCTL_MODE_CURSOR2 and
+        * use DRM_MODE_CURSOR_MOVE to set the hot-spot.
+        *
+        * However VirtualBox 5.0.20 and earlier has a bug causing it to return
+        * 0,0 as host cursor location after a save and restore.
+        *
+        * To work around this we ignore a 0, 0 return, since missing the odd
+        * time when it legitimately happens is not going to hurt much.
+        */
+       if (ret || (host_x == 0 && host_y == 0))
+               return ret;
+
+       if (x + crtc_x < host_x)
+               hot_x = min(host_x - x - crtc_x, vbox->cursor_width);
+       if (y + crtc_y < host_y)
+               hot_y = min(host_y - y - crtc_y, vbox->cursor_height);
+
+       if (hot_x == vbox->cursor_hot_x && hot_y == vbox->cursor_hot_y)
+               return 0;
+
+       vbox->cursor_hot_x = hot_x;
+       vbox->cursor_hot_y = hot_y;
+
+       return hgsmi_update_pointer_shape(vbox->guest_pool, flags,
+                       hot_x, hot_y, vbox->cursor_width, vbox->cursor_height,
+                       vbox->cursor_data, vbox->cursor_data_size);
+}
diff --git a/drivers/staging/vboxvideo/vbox_prime.c b/drivers/staging/vboxvideo/vbox_prime.c
new file mode 100644 (file)
index 0000000..b7453e4
--- /dev/null
@@ -0,0 +1,74 @@
+/*
+ * Copyright (C) 2017 Oracle Corporation
+ * Copyright 2017 Canonical
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
+ * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
+ * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+ * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+ * OTHER DEALINGS IN THE SOFTWARE.
+ *
+ * Authors: Andreas Pokorny
+ */
+
+#include "vbox_drv.h"
+
+/*
+ * Based on qxl_prime.c:
+ * Empty Implementations as there should not be any other driver for a virtual
+ * device that might share buffers with vboxvideo
+ */
+
+int vbox_gem_prime_pin(struct drm_gem_object *obj)
+{
+       WARN_ONCE(1, "not implemented");
+       return -ENOSYS;
+}
+
+void vbox_gem_prime_unpin(struct drm_gem_object *obj)
+{
+       WARN_ONCE(1, "not implemented");
+}
+
+struct sg_table *vbox_gem_prime_get_sg_table(struct drm_gem_object *obj)
+{
+       WARN_ONCE(1, "not implemented");
+       return ERR_PTR(-ENOSYS);
+}
+
+struct drm_gem_object *vbox_gem_prime_import_sg_table(
+       struct drm_device *dev, struct dma_buf_attachment *attach,
+       struct sg_table *table)
+{
+       WARN_ONCE(1, "not implemented");
+       return ERR_PTR(-ENOSYS);
+}
+
+void *vbox_gem_prime_vmap(struct drm_gem_object *obj)
+{
+       WARN_ONCE(1, "not implemented");
+       return ERR_PTR(-ENOSYS);
+}
+
+void vbox_gem_prime_vunmap(struct drm_gem_object *obj, void *vaddr)
+{
+       WARN_ONCE(1, "not implemented");
+}
+
+int vbox_gem_prime_mmap(struct drm_gem_object *obj, struct vm_area_struct *area)
+{
+       WARN_ONCE(1, "not implemented");
+       return -ENOSYS;
+}
diff --git a/drivers/staging/vboxvideo/vbox_ttm.c b/drivers/staging/vboxvideo/vbox_ttm.c
new file mode 100644 (file)
index 0000000..34a905d
--- /dev/null
@@ -0,0 +1,472 @@
+/*
+ * Copyright (C) 2013-2017 Oracle Corporation
+ * This file is based on ast_ttm.c
+ * Copyright 2012 Red Hat Inc.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the
+ * "Software"), to deal in the Software without restriction, including
+ * without limitation the rights to use, copy, modify, merge, publish,
+ * distribute, sub license, and/or sell copies of the Software, and to
+ * permit persons to whom the Software is furnished to do so, subject to
+ * the following conditions:
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
+ * THE COPYRIGHT HOLDERS, AUTHORS AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM,
+ * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
+ * USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
+ * The above copyright notice and this permission notice (including the
+ * next paragraph) shall be included in all copies or substantial portions
+ * of the Software.
+ *
+ *
+ * Authors: Dave Airlie <airlied@redhat.com>
+ *          Michael Thayer <michael.thayer@oracle.com>
+ */
+#include "vbox_drv.h"
+#include <ttm/ttm_page_alloc.h>
+
+static inline struct vbox_private *vbox_bdev(struct ttm_bo_device *bd)
+{
+       return container_of(bd, struct vbox_private, ttm.bdev);
+}
+
+static int vbox_ttm_mem_global_init(struct drm_global_reference *ref)
+{
+       return ttm_mem_global_init(ref->object);
+}
+
+static void vbox_ttm_mem_global_release(struct drm_global_reference *ref)
+{
+       ttm_mem_global_release(ref->object);
+}
+
+/**
+ * Adds the vbox memory manager object/structures to the global memory manager.
+ */
+static int vbox_ttm_global_init(struct vbox_private *vbox)
+{
+       struct drm_global_reference *global_ref;
+       int ret;
+
+       global_ref = &vbox->ttm.mem_global_ref;
+       global_ref->global_type = DRM_GLOBAL_TTM_MEM;
+       global_ref->size = sizeof(struct ttm_mem_global);
+       global_ref->init = &vbox_ttm_mem_global_init;
+       global_ref->release = &vbox_ttm_mem_global_release;
+       ret = drm_global_item_ref(global_ref);
+       if (ret) {
+               DRM_ERROR("Failed setting up TTM memory subsystem.\n");
+               return ret;
+       }
+
+       vbox->ttm.bo_global_ref.mem_glob = vbox->ttm.mem_global_ref.object;
+       global_ref = &vbox->ttm.bo_global_ref.ref;
+       global_ref->global_type = DRM_GLOBAL_TTM_BO;
+       global_ref->size = sizeof(struct ttm_bo_global);
+       global_ref->init = &ttm_bo_global_init;
+       global_ref->release = &ttm_bo_global_release;
+
+       ret = drm_global_item_ref(global_ref);
+       if (ret) {
+               DRM_ERROR("Failed setting up TTM BO subsystem.\n");
+               drm_global_item_unref(&vbox->ttm.mem_global_ref);
+               return ret;
+       }
+
+       return 0;
+}
+
+/**
+ * Removes the vbox memory manager object from the global memory manager.
+ */
+static void vbox_ttm_global_release(struct vbox_private *vbox)
+{
+       drm_global_item_unref(&vbox->ttm.bo_global_ref.ref);
+       drm_global_item_unref(&vbox->ttm.mem_global_ref);
+}
+
+static void vbox_bo_ttm_destroy(struct ttm_buffer_object *tbo)
+{
+       struct vbox_bo *bo;
+
+       bo = container_of(tbo, struct vbox_bo, bo);
+
+       drm_gem_object_release(&bo->gem);
+       kfree(bo);
+}
+
+static bool vbox_ttm_bo_is_vbox_bo(struct ttm_buffer_object *bo)
+{
+       if (bo->destroy == &vbox_bo_ttm_destroy)
+               return true;
+
+       return false;
+}
+
+static int
+vbox_bo_init_mem_type(struct ttm_bo_device *bdev, u32 type,
+                     struct ttm_mem_type_manager *man)
+{
+       switch (type) {
+       case TTM_PL_SYSTEM:
+               man->flags = TTM_MEMTYPE_FLAG_MAPPABLE;
+               man->available_caching = TTM_PL_MASK_CACHING;
+               man->default_caching = TTM_PL_FLAG_CACHED;
+               break;
+       case TTM_PL_VRAM:
+               man->func = &ttm_bo_manager_func;
+               man->flags = TTM_MEMTYPE_FLAG_FIXED | TTM_MEMTYPE_FLAG_MAPPABLE;
+               man->available_caching = TTM_PL_FLAG_UNCACHED | TTM_PL_FLAG_WC;
+               man->default_caching = TTM_PL_FLAG_WC;
+               break;
+       default:
+               DRM_ERROR("Unsupported memory type %u\n", (unsigned int)type);
+               return -EINVAL;
+       }
+
+       return 0;
+}
+
+static void
+vbox_bo_evict_flags(struct ttm_buffer_object *bo, struct ttm_placement *pl)
+{
+       struct vbox_bo *vboxbo = vbox_bo(bo);
+
+       if (!vbox_ttm_bo_is_vbox_bo(bo))
+               return;
+
+       vbox_ttm_placement(vboxbo, TTM_PL_FLAG_SYSTEM);
+       *pl = vboxbo->placement;
+}
+
+static int vbox_bo_verify_access(struct ttm_buffer_object *bo,
+                                struct file *filp)
+{
+       return 0;
+}
+
+static int vbox_ttm_io_mem_reserve(struct ttm_bo_device *bdev,
+                                  struct ttm_mem_reg *mem)
+{
+       struct ttm_mem_type_manager *man = &bdev->man[mem->mem_type];
+       struct vbox_private *vbox = vbox_bdev(bdev);
+
+       mem->bus.addr = NULL;
+       mem->bus.offset = 0;
+       mem->bus.size = mem->num_pages << PAGE_SHIFT;
+       mem->bus.base = 0;
+       mem->bus.is_iomem = false;
+       if (!(man->flags & TTM_MEMTYPE_FLAG_MAPPABLE))
+               return -EINVAL;
+       switch (mem->mem_type) {
+       case TTM_PL_SYSTEM:
+               /* system memory */
+               return 0;
+       case TTM_PL_VRAM:
+               mem->bus.offset = mem->start << PAGE_SHIFT;
+               mem->bus.base = pci_resource_start(vbox->dev->pdev, 0);
+               mem->bus.is_iomem = true;
+               break;
+       default:
+               return -EINVAL;
+       }
+       return 0;
+}
+
+static void vbox_ttm_io_mem_free(struct ttm_bo_device *bdev,
+                                struct ttm_mem_reg *mem)
+{
+}
+
+static int vbox_bo_move(struct ttm_buffer_object *bo,
+                       bool evict, bool interruptible,
+                       bool no_wait_gpu, struct ttm_mem_reg *new_mem)
+{
+       return ttm_bo_move_memcpy(bo, interruptible, no_wait_gpu, new_mem);
+}
+
+static void vbox_ttm_backend_destroy(struct ttm_tt *tt)
+{
+       ttm_tt_fini(tt);
+       kfree(tt);
+}
+
+static struct ttm_backend_func vbox_tt_backend_func = {
+       .destroy = &vbox_ttm_backend_destroy,
+};
+
+static struct ttm_tt *vbox_ttm_tt_create(struct ttm_bo_device *bdev,
+                                        unsigned long size,
+                                        u32 page_flags,
+                                        struct page *dummy_read_page)
+{
+       struct ttm_tt *tt;
+
+       tt = kzalloc(sizeof(*tt), GFP_KERNEL);
+       if (!tt)
+               return NULL;
+
+       tt->func = &vbox_tt_backend_func;
+       if (ttm_tt_init(tt, bdev, size, page_flags, dummy_read_page)) {
+               kfree(tt);
+               return NULL;
+       }
+
+       return tt;
+}
+
+static int vbox_ttm_tt_populate(struct ttm_tt *ttm)
+{
+       return ttm_pool_populate(ttm);
+}
+
+static void vbox_ttm_tt_unpopulate(struct ttm_tt *ttm)
+{
+       ttm_pool_unpopulate(ttm);
+}
+
+struct ttm_bo_driver vbox_bo_driver = {
+       .ttm_tt_create = vbox_ttm_tt_create,
+       .ttm_tt_populate = vbox_ttm_tt_populate,
+       .ttm_tt_unpopulate = vbox_ttm_tt_unpopulate,
+       .init_mem_type = vbox_bo_init_mem_type,
+       .eviction_valuable = ttm_bo_eviction_valuable,
+       .evict_flags = vbox_bo_evict_flags,
+       .move = vbox_bo_move,
+       .verify_access = vbox_bo_verify_access,
+       .io_mem_reserve = &vbox_ttm_io_mem_reserve,
+       .io_mem_free = &vbox_ttm_io_mem_free,
+       .io_mem_pfn = ttm_bo_default_io_mem_pfn,
+};
+
+int vbox_mm_init(struct vbox_private *vbox)
+{
+       int ret;
+       struct drm_device *dev = vbox->dev;
+       struct ttm_bo_device *bdev = &vbox->ttm.bdev;
+
+       ret = vbox_ttm_global_init(vbox);
+       if (ret)
+               return ret;
+
+       ret = ttm_bo_device_init(&vbox->ttm.bdev,
+                                vbox->ttm.bo_global_ref.ref.object,
+                                &vbox_bo_driver,
+                                dev->anon_inode->i_mapping,
+                                DRM_FILE_PAGE_OFFSET, true);
+       if (ret) {
+               DRM_ERROR("Error initialising bo driver; %d\n", ret);
+               goto err_ttm_global_release;
+       }
+
+       ret = ttm_bo_init_mm(bdev, TTM_PL_VRAM,
+                            vbox->available_vram_size >> PAGE_SHIFT);
+       if (ret) {
+               DRM_ERROR("Failed ttm VRAM init: %d\n", ret);
+               goto err_device_release;
+       }
+
+#ifdef DRM_MTRR_WC
+       vbox->fb_mtrr = drm_mtrr_add(pci_resource_start(dev->pdev, 0),
+                                    pci_resource_len(dev->pdev, 0),
+                                    DRM_MTRR_WC);
+#else
+       vbox->fb_mtrr = arch_phys_wc_add(pci_resource_start(dev->pdev, 0),
+                                        pci_resource_len(dev->pdev, 0));
+#endif
+       return 0;
+
+err_device_release:
+       ttm_bo_device_release(&vbox->ttm.bdev);
+err_ttm_global_release:
+       vbox_ttm_global_release(vbox);
+       return ret;
+}
+
+void vbox_mm_fini(struct vbox_private *vbox)
+{
+#ifdef DRM_MTRR_WC
+       drm_mtrr_del(vbox->fb_mtrr,
+                    pci_resource_start(vbox->dev->pdev, 0),
+                    pci_resource_len(vbox->dev->pdev, 0), DRM_MTRR_WC);
+#else
+       arch_phys_wc_del(vbox->fb_mtrr);
+#endif
+       ttm_bo_device_release(&vbox->ttm.bdev);
+       vbox_ttm_global_release(vbox);
+}
+
+void vbox_ttm_placement(struct vbox_bo *bo, int domain)
+{
+       unsigned int i;
+       u32 c = 0;
+
+       bo->placement.placement = bo->placements;
+       bo->placement.busy_placement = bo->placements;
+
+       if (domain & TTM_PL_FLAG_VRAM)
+               bo->placements[c++].flags =
+                   TTM_PL_FLAG_WC | TTM_PL_FLAG_UNCACHED | TTM_PL_FLAG_VRAM;
+       if (domain & TTM_PL_FLAG_SYSTEM)
+               bo->placements[c++].flags =
+                   TTM_PL_MASK_CACHING | TTM_PL_FLAG_SYSTEM;
+       if (!c)
+               bo->placements[c++].flags =
+                   TTM_PL_MASK_CACHING | TTM_PL_FLAG_SYSTEM;
+
+       bo->placement.num_placement = c;
+       bo->placement.num_busy_placement = c;
+
+       for (i = 0; i < c; ++i) {
+               bo->placements[i].fpfn = 0;
+               bo->placements[i].lpfn = 0;
+       }
+}
+
+int vbox_bo_create(struct drm_device *dev, int size, int align,
+                  u32 flags, struct vbox_bo **pvboxbo)
+{
+       struct vbox_private *vbox = dev->dev_private;
+       struct vbox_bo *vboxbo;
+       size_t acc_size;
+       int ret;
+
+       vboxbo = kzalloc(sizeof(*vboxbo), GFP_KERNEL);
+       if (!vboxbo)
+               return -ENOMEM;
+
+       ret = drm_gem_object_init(dev, &vboxbo->gem, size);
+       if (ret)
+               goto err_free_vboxbo;
+
+       vboxbo->bo.bdev = &vbox->ttm.bdev;
+
+       vbox_ttm_placement(vboxbo, TTM_PL_FLAG_VRAM | TTM_PL_FLAG_SYSTEM);
+
+       acc_size = ttm_bo_dma_acc_size(&vbox->ttm.bdev, size,
+                                      sizeof(struct vbox_bo));
+
+       ret = ttm_bo_init(&vbox->ttm.bdev, &vboxbo->bo, size,
+                         ttm_bo_type_device, &vboxbo->placement,
+                         align >> PAGE_SHIFT, false, NULL, acc_size,
+                         NULL, NULL, vbox_bo_ttm_destroy);
+       if (ret)
+               goto err_free_vboxbo;
+
+       *pvboxbo = vboxbo;
+
+       return 0;
+
+err_free_vboxbo:
+       kfree(vboxbo);
+       return ret;
+}
+
+static inline u64 vbox_bo_gpu_offset(struct vbox_bo *bo)
+{
+       return bo->bo.offset;
+}
+
+int vbox_bo_pin(struct vbox_bo *bo, u32 pl_flag, u64 *gpu_addr)
+{
+       int i, ret;
+
+       if (bo->pin_count) {
+               bo->pin_count++;
+               if (gpu_addr)
+                       *gpu_addr = vbox_bo_gpu_offset(bo);
+
+               return 0;
+       }
+
+       vbox_ttm_placement(bo, pl_flag);
+
+       for (i = 0; i < bo->placement.num_placement; i++)
+               bo->placements[i].flags |= TTM_PL_FLAG_NO_EVICT;
+
+       ret = ttm_bo_validate(&bo->bo, &bo->placement, false, false);
+       if (ret)
+               return ret;
+
+       bo->pin_count = 1;
+
+       if (gpu_addr)
+               *gpu_addr = vbox_bo_gpu_offset(bo);
+
+       return 0;
+}
+
+int vbox_bo_unpin(struct vbox_bo *bo)
+{
+       int i, ret;
+
+       if (!bo->pin_count) {
+               DRM_ERROR("unpin bad %p\n", bo);
+               return 0;
+       }
+       bo->pin_count--;
+       if (bo->pin_count)
+               return 0;
+
+       for (i = 0; i < bo->placement.num_placement; i++)
+               bo->placements[i].flags &= ~TTM_PL_FLAG_NO_EVICT;
+
+       ret = ttm_bo_validate(&bo->bo, &bo->placement, false, false);
+       if (ret)
+               return ret;
+
+       return 0;
+}
+
+/*
+ * Move a vbox-owned buffer object to system memory if no one else has it
+ * pinned.  The caller must have pinned it previously, and this call will
+ * release the caller's pin.
+ */
+int vbox_bo_push_sysram(struct vbox_bo *bo)
+{
+       int i, ret;
+
+       if (!bo->pin_count) {
+               DRM_ERROR("unpin bad %p\n", bo);
+               return 0;
+       }
+       bo->pin_count--;
+       if (bo->pin_count)
+               return 0;
+
+       if (bo->kmap.virtual)
+               ttm_bo_kunmap(&bo->kmap);
+
+       vbox_ttm_placement(bo, TTM_PL_FLAG_SYSTEM);
+
+       for (i = 0; i < bo->placement.num_placement; i++)
+               bo->placements[i].flags |= TTM_PL_FLAG_NO_EVICT;
+
+       ret = ttm_bo_validate(&bo->bo, &bo->placement, false, false);
+       if (ret) {
+               DRM_ERROR("pushing to VRAM failed\n");
+               return ret;
+       }
+
+       return 0;
+}
+
+int vbox_mmap(struct file *filp, struct vm_area_struct *vma)
+{
+       struct drm_file *file_priv;
+       struct vbox_private *vbox;
+
+       if (unlikely(vma->vm_pgoff < DRM_FILE_PAGE_OFFSET))
+               return -EINVAL;
+
+       file_priv = filp->private_data;
+       vbox = file_priv->minor->dev->dev_private;
+
+       return ttm_bo_mmap(filp, vma, &vbox->ttm.bdev);
+}
diff --git a/drivers/staging/vboxvideo/vboxvideo.h b/drivers/staging/vboxvideo/vboxvideo.h
new file mode 100644 (file)
index 0000000..d835d75
--- /dev/null
@@ -0,0 +1,491 @@
+/*
+ * Copyright (C) 2006-2016 Oracle Corporation
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the
+ * "Software"), to deal in the Software without restriction, including
+ * without limitation the rights to use, copy, modify, merge, publish,
+ * distribute, sub license, and/or sell copies of the Software, and to
+ * permit persons to whom the Software is furnished to do so, subject to
+ * the following conditions:
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
+ * THE COPYRIGHT HOLDERS, AUTHORS AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM,
+ * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
+ * USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ */
+
+#ifndef __VBOXVIDEO_H__
+#define __VBOXVIDEO_H__
+
+/*
+ * This should be in sync with monitorCount <xsd:maxInclusive value="64"/> in
+ * src/VBox/Main/xml/VirtualBox-settings-common.xsd
+ */
+#define VBOX_VIDEO_MAX_SCREENS 64
+
+/*
+ * The last 4096 bytes of the guest VRAM contains the generic info for all
+ * DualView chunks: sizes and offsets of chunks. This is filled by miniport.
+ *
+ * Last 4096 bytes of each chunk contain chunk specific data: framebuffer info,
+ * etc. This is used exclusively by the corresponding instance of a display
+ * driver.
+ *
+ * The VRAM layout:
+ *   Last 4096 bytes - Adapter information area.
+ *   4096 bytes aligned miniport heap (value specified in the config rouded up).
+ *   Slack - what left after dividing the VRAM.
+ *   4096 bytes aligned framebuffers:
+ *     last 4096 bytes of each framebuffer is the display information area.
+ *
+ * The Virtual Graphics Adapter information in the guest VRAM is stored by the
+ * guest video driver using structures prepended by VBOXVIDEOINFOHDR.
+ *
+ * When the guest driver writes dword 0 to the VBE_DISPI_INDEX_VBOX_VIDEO
+ * the host starts to process the info. The first element at the start of
+ * the 4096 bytes region should be normally be a LINK that points to
+ * actual information chain. That way the guest driver can have some
+ * fixed layout of the information memory block and just rewrite
+ * the link to point to relevant memory chain.
+ *
+ * The processing stops at the END element.
+ *
+ * The host can access the memory only when the port IO is processed.
+ * All data that will be needed later must be copied from these 4096 bytes.
+ * But other VRAM can be used by host until the mode is disabled.
+ *
+ * The guest driver writes dword 0xffffffff to the VBE_DISPI_INDEX_VBOX_VIDEO
+ * to disable the mode.
+ *
+ * VBE_DISPI_INDEX_VBOX_VIDEO is used to read the configuration information
+ * from the host and issue commands to the host.
+ *
+ * The guest writes the VBE_DISPI_INDEX_VBOX_VIDEO index register, the the
+ * following operations with the VBE data register can be performed:
+ *
+ * Operation            Result
+ * write 16 bit value   NOP
+ * read 16 bit value    count of monitors
+ * write 32 bit value   set the vbox cmd value and the cmd processed by the host
+ * read 32 bit value    result of the last vbox command is returned
+ */
+
+/**
+ * VBVA command header.
+ *
+ * @todo Where does this fit in?
+ */
+struct vbva_cmd_hdr {
+   /** Coordinates of affected rectangle. */
+       s16 x;
+       s16 y;
+       u16 w;
+       u16 h;
+} __packed;
+
+/** @name VBVA ring defines.
+ *
+ * The VBVA ring buffer is suitable for transferring large (< 2GB) amount of
+ * data. For example big bitmaps which do not fit to the buffer.
+ *
+ * Guest starts writing to the buffer by initializing a record entry in the
+ * records queue. VBVA_F_RECORD_PARTIAL indicates that the record is being
+ * written. As data is written to the ring buffer, the guest increases
+ * free_offset.
+ *
+ * The host reads the records on flushes and processes all completed records.
+ * When host encounters situation when only a partial record presents and
+ * len_and_flags & ~VBVA_F_RECORD_PARTIAL >= VBVA_RING_BUFFER_SIZE -
+ * VBVA_RING_BUFFER_THRESHOLD, the host fetched all record data and updates
+ * data_offset. After that on each flush the host continues fetching the data
+ * until the record is completed.
+ *
+ */
+#define VBVA_RING_BUFFER_SIZE        (4194304 - 1024)
+#define VBVA_RING_BUFFER_THRESHOLD   (4096)
+
+#define VBVA_MAX_RECORDS (64)
+
+#define VBVA_F_MODE_ENABLED         0x00000001u
+#define VBVA_F_MODE_VRDP            0x00000002u
+#define VBVA_F_MODE_VRDP_RESET      0x00000004u
+#define VBVA_F_MODE_VRDP_ORDER_MASK 0x00000008u
+
+#define VBVA_F_STATE_PROCESSING     0x00010000u
+
+#define VBVA_F_RECORD_PARTIAL       0x80000000u
+
+/**
+ * VBVA record.
+ */
+struct vbva_record {
+       /** The length of the record. Changed by guest. */
+       u32 len_and_flags;
+} __packed;
+
+/*
+ * The minimum HGSMI heap size is PAGE_SIZE (4096 bytes) and is a restriction of
+ * the runtime heapsimple API. Use minimum 2 pages here, because the info area
+ * also may contain other data (for example hgsmi_host_flags structure).
+ */
+#define VBVA_ADAPTER_INFORMATION_SIZE 65536
+#define VBVA_MIN_BUFFER_SIZE          65536
+
+/* The value for port IO to let the adapter to interpret the adapter memory. */
+#define VBOX_VIDEO_DISABLE_ADAPTER_MEMORY        0xFFFFFFFF
+
+/* The value for port IO to let the adapter to interpret the adapter memory. */
+#define VBOX_VIDEO_INTERPRET_ADAPTER_MEMORY      0x00000000
+
+/* The value for port IO to let the adapter to interpret the display memory.
+ * The display number is encoded in low 16 bits.
+ */
+#define VBOX_VIDEO_INTERPRET_DISPLAY_MEMORY_BASE 0x00010000
+
+struct vbva_host_flags {
+       u32 host_events;
+       u32 supported_orders;
+} __packed;
+
+struct vbva_buffer {
+       struct vbva_host_flags host_flags;
+
+       /* The offset where the data start in the buffer. */
+       u32 data_offset;
+       /* The offset where next data must be placed in the buffer. */
+       u32 free_offset;
+
+       /* The queue of record descriptions. */
+       struct vbva_record records[VBVA_MAX_RECORDS];
+       u32 record_first_index;
+       u32 record_free_index;
+
+       /* Space to leave free when large partial records are transferred. */
+       u32 partial_write_tresh;
+
+       u32 data_len;
+       /* variable size for the rest of the vbva_buffer area in VRAM. */
+       u8 data[0];
+} __packed;
+
+#define VBVA_MAX_RECORD_SIZE (128 * 1024 * 1024)
+
+/* guest->host commands */
+#define VBVA_QUERY_CONF32                       1
+#define VBVA_SET_CONF32                                 2
+#define VBVA_INFO_VIEW                          3
+#define VBVA_INFO_HEAP                          4
+#define VBVA_FLUSH                              5
+#define VBVA_INFO_SCREEN                        6
+#define VBVA_ENABLE                             7
+#define VBVA_MOUSE_POINTER_SHAPE                8
+/* informs host about HGSMI caps. see vbva_caps below */
+#define VBVA_INFO_CAPS                         12
+/* configures scanline, see VBVASCANLINECFG below */
+#define VBVA_SCANLINE_CFG                      13
+/* requests scanline info, see VBVASCANLINEINFO below */
+#define VBVA_SCANLINE_INFO                     14
+/* inform host about VBVA Command submission */
+#define VBVA_CMDVBVA_SUBMIT                    16
+/* inform host about VBVA Command submission */
+#define VBVA_CMDVBVA_FLUSH                     17
+/* G->H DMA command */
+#define VBVA_CMDVBVA_CTL                       18
+/* Query most recent mode hints sent */
+#define VBVA_QUERY_MODE_HINTS                  19
+/**
+ * Report the guest virtual desktop position and size for mapping host and
+ * guest pointer positions.
+ */
+#define VBVA_REPORT_INPUT_MAPPING              20
+/** Report the guest cursor position and query the host position. */
+#define VBVA_CURSOR_POSITION                   21
+
+/* host->guest commands */
+#define VBVAHG_EVENT                           1
+#define VBVAHG_DISPLAY_CUSTOM                  2
+
+/* vbva_conf32::index */
+#define VBOX_VBVA_CONF32_MONITOR_COUNT         0
+#define VBOX_VBVA_CONF32_HOST_HEAP_SIZE                1
+/**
+ * Returns VINF_SUCCESS if the host can report mode hints via VBVA.
+ * Set value to VERR_NOT_SUPPORTED before calling.
+ */
+#define VBOX_VBVA_CONF32_MODE_HINT_REPORTING   2
+/**
+ * Returns VINF_SUCCESS if the host can report guest cursor enabled status via
+ * VBVA.  Set value to VERR_NOT_SUPPORTED before calling.
+ */
+#define VBOX_VBVA_CONF32_GUEST_CURSOR_REPORTING        3
+/**
+ * Returns the currently available host cursor capabilities.  Available if
+ * vbva_conf32::VBOX_VBVA_CONF32_GUEST_CURSOR_REPORTING returns success.
+ * @see VMMDevReqMouseStatus::mouseFeatures.
+ */
+#define VBOX_VBVA_CONF32_CURSOR_CAPABILITIES   4
+/** Returns the supported flags in vbva_infoscreen::flags. */
+#define VBOX_VBVA_CONF32_SCREEN_FLAGS          5
+/** Returns the max size of VBVA record. */
+#define VBOX_VBVA_CONF32_MAX_RECORD_SIZE       6
+
+struct vbva_conf32 {
+       u32 index;
+       u32 value;
+} __packed;
+
+/** Reserved for historical reasons. */
+#define VBOX_VBVA_CURSOR_CAPABILITY_RESERVED0   BIT(0)
+/**
+ * Guest cursor capability: can the host show a hardware cursor at the host
+ * pointer location?
+ */
+#define VBOX_VBVA_CURSOR_CAPABILITY_HARDWARE    BIT(1)
+/** Reserved for historical reasons. */
+#define VBOX_VBVA_CURSOR_CAPABILITY_RESERVED2   BIT(2)
+/** Reserved for historical reasons.  Must always be unset. */
+#define VBOX_VBVA_CURSOR_CAPABILITY_RESERVED3   BIT(3)
+/** Reserved for historical reasons. */
+#define VBOX_VBVA_CURSOR_CAPABILITY_RESERVED4   BIT(4)
+/** Reserved for historical reasons. */
+#define VBOX_VBVA_CURSOR_CAPABILITY_RESERVED5   BIT(5)
+
+struct vbva_infoview {
+       /* Index of the screen, assigned by the guest. */
+       u32 view_index;
+
+       /* The screen offset in VRAM, the framebuffer starts here. */
+       u32 view_offset;
+
+       /* The size of the VRAM memory that can be used for the view. */
+       u32 view_size;
+
+       /* The recommended maximum size of the VRAM memory for the screen. */
+       u32 max_screen_size;
+} __packed;
+
+struct vbva_flush {
+       u32 reserved;
+} __packed;
+
+/* vbva_infoscreen::flags */
+#define VBVA_SCREEN_F_NONE                     0x0000
+#define VBVA_SCREEN_F_ACTIVE                   0x0001
+/**
+ * The virtual monitor has been disabled by the guest and should be removed
+ * by the host and ignored for purposes of pointer position calculation.
+ */
+#define VBVA_SCREEN_F_DISABLED                 0x0002
+/**
+ * The virtual monitor has been blanked by the guest and should be blacked
+ * out by the host using width, height, etc values from the vbva_infoscreen
+ * request.
+ */
+#define VBVA_SCREEN_F_BLANK                    0x0004
+/**
+ * The virtual monitor has been blanked by the guest and should be blacked
+ * out by the host using the previous mode values for width. height, etc.
+ */
+#define VBVA_SCREEN_F_BLANK2                   0x0008
+
+struct vbva_infoscreen {
+       /* Which view contains the screen. */
+       u32 view_index;
+
+       /* Physical X origin relative to the primary screen. */
+       s32 origin_x;
+
+       /* Physical Y origin relative to the primary screen. */
+       s32 origin_y;
+
+       /* Offset of visible framebuffer relative to the framebuffer start. */
+       u32 start_offset;
+
+       /* The scan line size in bytes. */
+       u32 line_size;
+
+       /* Width of the screen. */
+       u32 width;
+
+       /* Height of the screen. */
+       u32 height;
+
+       /* Color depth. */
+       u16 bits_per_pixel;
+
+       /* VBVA_SCREEN_F_* */
+       u16 flags;
+} __packed;
+
+/* vbva_enable::flags */
+#define VBVA_F_NONE                            0x00000000
+#define VBVA_F_ENABLE                          0x00000001
+#define VBVA_F_DISABLE                         0x00000002
+/* extended VBVA to be used with WDDM */
+#define VBVA_F_EXTENDED                                0x00000004
+/* vbva offset is absolute VRAM offset */
+#define VBVA_F_ABSOFFSET                       0x00000008
+
+struct vbva_enable {
+       u32 flags;
+       u32 offset;
+       s32 result;
+} __packed;
+
+struct vbva_enable_ex {
+       struct vbva_enable base;
+       u32 screen_id;
+} __packed;
+
+struct vbva_mouse_pointer_shape {
+       /* The host result. */
+       s32 result;
+
+       /* VBOX_MOUSE_POINTER_* bit flags. */
+       u32 flags;
+
+       /* X coordinate of the hot spot. */
+       u32 hot_X;
+
+       /* Y coordinate of the hot spot. */
+       u32 hot_y;
+
+       /* Width of the pointer in pixels. */
+       u32 width;
+
+       /* Height of the pointer in scanlines. */
+       u32 height;
+
+       /* Pointer data.
+        *
+        ****
+        * The data consists of 1 bpp AND mask followed by 32 bpp XOR (color)
+        * mask.
+        *
+        * For pointers without alpha channel the XOR mask pixels are 32 bit
+        * values: (lsb)BGR0(msb). For pointers with alpha channel the XOR mask
+        * consists of (lsb)BGRA(msb) 32 bit values.
+        *
+        * Guest driver must create the AND mask for pointers with alpha chan.,
+        * so if host does not support alpha, the pointer could be displayed as
+        * a normal color pointer. The AND mask can be constructed from alpha
+        * values. For example alpha value >= 0xf0 means bit 0 in the AND mask.
+        *
+        * The AND mask is 1 bpp bitmap with byte aligned scanlines. Size of AND
+        * mask, therefore, is and_len = (width + 7) / 8 * height. The padding
+        * bits at the end of any scanline are undefined.
+        *
+        * The XOR mask follows the AND mask on the next 4 bytes aligned offset:
+        * u8 *xor = and + (and_len + 3) & ~3
+        * Bytes in the gap between the AND and the XOR mask are undefined.
+        * XOR mask scanlines have no gap between them and size of XOR mask is:
+        * xor_len = width * 4 * height.
+        ****
+        *
+        * Preallocate 4 bytes for accessing actual data as p->data.
+        */
+       u8 data[4];
+} __packed;
+
+/**
+ * @name vbva_mouse_pointer_shape::flags
+ * @note The VBOX_MOUSE_POINTER_* flags are used in the guest video driver,
+ *       values must be <= 0x8000 and must not be changed. (try make more sense
+ *       of this, please).
+ * @{
+ */
+
+/** pointer is visible */
+#define VBOX_MOUSE_POINTER_VISIBLE             0x0001
+/** pointer has alpha channel */
+#define VBOX_MOUSE_POINTER_ALPHA               0x0002
+/** pointerData contains new pointer shape */
+#define VBOX_MOUSE_POINTER_SHAPE               0x0004
+
+/** @} */
+
+/*
+ * The guest driver can handle asynch guest cmd completion by reading the
+ * command offset from io port.
+ */
+#define VBVACAPS_COMPLETEGCMD_BY_IOREAD                0x00000001
+/* the guest driver can handle video adapter IRQs */
+#define VBVACAPS_IRQ                           0x00000002
+/** The guest can read video mode hints sent via VBVA. */
+#define VBVACAPS_VIDEO_MODE_HINTS              0x00000004
+/** The guest can switch to a software cursor on demand. */
+#define VBVACAPS_DISABLE_CURSOR_INTEGRATION    0x00000008
+/** The guest does not depend on host handling the VBE registers. */
+#define VBVACAPS_USE_VBVA_ONLY                 0x00000010
+
+struct vbva_caps {
+       s32 rc;
+       u32 caps;
+} __packed;
+
+/** Query the most recent mode hints received from the host. */
+struct vbva_query_mode_hints {
+       /** The maximum number of screens to return hints for. */
+       u16 hints_queried_count;
+       /** The size of the mode hint structures directly following this one. */
+       u16 hint_structure_guest_size;
+       /** Return code for the operation. Initialise to VERR_NOT_SUPPORTED. */
+       s32 rc;
+} __packed;
+
+/**
+ * Structure in which a mode hint is returned. The guest allocates an array
+ * of these immediately after the vbva_query_mode_hints structure.
+ * To accommodate future extensions, the vbva_query_mode_hints structure
+ * specifies the size of the vbva_modehint structures allocated by the guest,
+ * and the host only fills out structure elements which fit into that size. The
+ * host should fill any unused members (e.g. dx, dy) or structure space on the
+ * end with ~0. The whole structure can legally be set to ~0 to skip a screen.
+ */
+struct vbva_modehint {
+       u32 magic;
+       u32 cx;
+       u32 cy;
+       u32 bpp;                /* Which has never been used... */
+       u32 display;
+       u32 dx;                 /**< X offset into the virtual frame-buffer. */
+       u32 dy;                 /**< Y offset into the virtual frame-buffer. */
+       u32 enabled;            /* Not flags. Add new members for new flags. */
+} __packed;
+
+#define VBVAMODEHINT_MAGIC 0x0801add9u
+
+/**
+ * Report the rectangle relative to which absolute pointer events should be
+ * expressed. This information remains valid until the next VBVA resize event
+ * for any screen, at which time it is reset to the bounding rectangle of all
+ * virtual screens and must be re-set.
+ * @see VBVA_REPORT_INPUT_MAPPING.
+ */
+struct vbva_report_input_mapping {
+       s32 x;  /**< Upper left X co-ordinate relative to the first screen. */
+       s32 y;  /**< Upper left Y co-ordinate relative to the first screen. */
+       u32 cx; /**< Rectangle width. */
+       u32 cy; /**< Rectangle height. */
+} __packed;
+
+/**
+ * Report the guest cursor position and query the host one. The host may wish
+ * to use the guest information to re-position its own cursor (though this is
+ * currently unlikely).
+ * @see VBVA_CURSOR_POSITION
+ */
+struct vbva_cursor_position {
+       u32 report_position;    /**< Are we reporting a position? */
+       u32 x;                  /**< Guest cursor X position */
+       u32 y;                  /**< Guest cursor Y position */
+} __packed;
+
+#endif
diff --git a/drivers/staging/vboxvideo/vboxvideo_guest.h b/drivers/staging/vboxvideo/vboxvideo_guest.h
new file mode 100644 (file)
index 0000000..d09da84
--- /dev/null
@@ -0,0 +1,95 @@
+/*
+ * Copyright (C) 2006-2017 Oracle Corporation
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
+ * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
+ * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+ * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+ * OTHER DEALINGS IN THE SOFTWARE.
+ */
+
+#ifndef __VBOXVIDEO_GUEST_H__
+#define __VBOXVIDEO_GUEST_H__
+
+#include <linux/genalloc.h>
+#include "vboxvideo.h"
+
+/**
+ * Structure grouping the context needed for sending graphics acceleration
+ * information to the host via VBVA.  Each screen has its own VBVA buffer.
+ */
+struct vbva_buf_ctx {
+       /** Offset of the buffer in the VRAM section for the screen */
+       u32 buffer_offset;
+       /** Length of the buffer in bytes */
+       u32 buffer_length;
+       /** Set if we wrote to the buffer faster than the host could read it */
+       bool buffer_overflow;
+       /** VBVA record that we are currently preparing for the host, or NULL */
+       struct vbva_record *record;
+       /**
+        * Pointer to the VBVA buffer mapped into the current address space.
+        * Will be NULL if VBVA is not enabled.
+        */
+       struct vbva_buffer *vbva;
+};
+
+/**
+ * @name Base HGSMI APIs
+ * @{
+ */
+int hgsmi_report_flags_location(struct gen_pool *ctx, u32 location);
+int hgsmi_send_caps_info(struct gen_pool *ctx, u32 caps);
+int hgsmi_test_query_conf(struct gen_pool *ctx);
+int hgsmi_query_conf(struct gen_pool *ctx, u32 index, u32 *value_ret);
+int hgsmi_update_pointer_shape(struct gen_pool *ctx, u32 flags,
+                              u32 hot_x, u32 hot_y, u32 width, u32 height,
+                              u8 *pixels, u32 len);
+int hgsmi_cursor_position(struct gen_pool *ctx, bool report_position,
+                         u32 x, u32 y, u32 *x_host, u32 *y_host);
+/** @}  */
+
+/**
+ * @name VBVA APIs
+ * @{
+ */
+bool vbva_enable(struct vbva_buf_ctx *vbva_ctx, struct gen_pool *ctx,
+                struct vbva_buffer *vbva, s32 screen);
+void vbva_disable(struct vbva_buf_ctx *vbva_ctx, struct gen_pool *ctx,
+                 s32 screen);
+bool vbva_buffer_begin_update(struct vbva_buf_ctx *vbva_ctx,
+                             struct gen_pool *ctx);
+void vbva_buffer_end_update(struct vbva_buf_ctx *vbva_ctx);
+bool vbva_write(struct vbva_buf_ctx *vbva_ctx, struct gen_pool *ctx,
+               const void *p, u32 len);
+void vbva_setup_buffer_context(struct vbva_buf_ctx *vbva_ctx,
+                              u32 buffer_offset, u32 buffer_length);
+/** @}  */
+
+/**
+ * @name Modesetting APIs
+ * @{
+ */
+void hgsmi_process_display_info(struct gen_pool *ctx, u32 display,
+                               s32 origin_x, s32 origin_y, u32 start_offset,
+                               u32 pitch, u32 width, u32 height,
+                               u16 bpp, u16 flags);
+int hgsmi_update_input_mapping(struct gen_pool *ctx, s32 origin_x, s32 origin_y,
+                              u32 width, u32 height);
+int hgsmi_get_mode_hints(struct gen_pool *ctx, unsigned int screens,
+                        struct vbva_modehint *hints);
+/** @}  */
+
+#endif
diff --git a/drivers/staging/vboxvideo/vboxvideo_vbe.h b/drivers/staging/vboxvideo/vboxvideo_vbe.h
new file mode 100644 (file)
index 0000000..f842f4d
--- /dev/null
@@ -0,0 +1,84 @@
+/*
+ * Copyright (C) 2006-2017 Oracle Corporation
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
+ * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
+ * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+ * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+ * OTHER DEALINGS IN THE SOFTWARE.
+ */
+
+#ifndef __VBOXVIDEO_VBE_H__
+#define __VBOXVIDEO_VBE_H__
+
+/* GUEST <-> HOST Communication API */
+
+/**
+ * @todo FIXME: Either dynamicly ask host for this or put somewhere high in
+ *              physical memory like 0xE0000000.
+ */
+
+#define VBE_DISPI_BANK_ADDRESS          0xA0000
+#define VBE_DISPI_BANK_SIZE_KB          64
+
+#define VBE_DISPI_MAX_XRES              16384
+#define VBE_DISPI_MAX_YRES              16384
+#define VBE_DISPI_MAX_BPP               32
+
+#define VBE_DISPI_IOPORT_INDEX          0x01CE
+#define VBE_DISPI_IOPORT_DATA           0x01CF
+
+#define VBE_DISPI_IOPORT_DAC_WRITE_INDEX  0x03C8
+#define VBE_DISPI_IOPORT_DAC_DATA         0x03C9
+
+#define VBE_DISPI_INDEX_ID              0x0
+#define VBE_DISPI_INDEX_XRES            0x1
+#define VBE_DISPI_INDEX_YRES            0x2
+#define VBE_DISPI_INDEX_BPP             0x3
+#define VBE_DISPI_INDEX_ENABLE          0x4
+#define VBE_DISPI_INDEX_BANK            0x5
+#define VBE_DISPI_INDEX_VIRT_WIDTH      0x6
+#define VBE_DISPI_INDEX_VIRT_HEIGHT     0x7
+#define VBE_DISPI_INDEX_X_OFFSET        0x8
+#define VBE_DISPI_INDEX_Y_OFFSET        0x9
+#define VBE_DISPI_INDEX_VBOX_VIDEO      0xa
+#define VBE_DISPI_INDEX_FB_BASE_HI      0xb
+
+#define VBE_DISPI_ID0                   0xB0C0
+#define VBE_DISPI_ID1                   0xB0C1
+#define VBE_DISPI_ID2                   0xB0C2
+#define VBE_DISPI_ID3                   0xB0C3
+#define VBE_DISPI_ID4                   0xB0C4
+
+#define VBE_DISPI_ID_VBOX_VIDEO         0xBE00
+/* The VBOX interface id. Indicates support for VBVA shared memory interface. */
+#define VBE_DISPI_ID_HGSMI              0xBE01
+#define VBE_DISPI_ID_ANYX               0xBE02
+
+#define VBE_DISPI_DISABLED              0x00
+#define VBE_DISPI_ENABLED               0x01
+#define VBE_DISPI_GETCAPS               0x02
+#define VBE_DISPI_8BIT_DAC              0x20
+/**
+ * @note this definition is a BOCHS legacy, used only in the video BIOS
+ * code and ignored by the emulated hardware.
+ */
+#define VBE_DISPI_LFB_ENABLED           0x40
+#define VBE_DISPI_NOCLEARMEM            0x80
+
+#define VGA_PORT_HGSMI_HOST             0x3b0
+#define VGA_PORT_HGSMI_GUEST            0x3d0
+
+#endif
diff --git a/drivers/staging/vboxvideo/vbva_base.c b/drivers/staging/vboxvideo/vbva_base.c
new file mode 100644 (file)
index 0000000..c10c782
--- /dev/null
@@ -0,0 +1,233 @@
+/*
+ * Copyright (C) 2006-2017 Oracle Corporation
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
+ * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
+ * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+ * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+ * OTHER DEALINGS IN THE SOFTWARE.
+ */
+
+#include "vbox_drv.h"
+#include "vbox_err.h"
+#include "vboxvideo_guest.h"
+#include "hgsmi_channels.h"
+
+/*
+ * There is a hardware ring buffer in the graphics device video RAM, formerly
+ * in the VBox VMMDev PCI memory space.
+ * All graphics commands go there serialized by vbva_buffer_begin_update.
+ * and vbva_buffer_end_update.
+ *
+ * free_offset is writing position. data_offset is reading position.
+ * free_offset == data_offset means buffer is empty.
+ * There must be always gap between data_offset and free_offset when data
+ * are in the buffer.
+ * Guest only changes free_offset, host changes data_offset.
+ */
+
+static u32 vbva_buffer_available(const struct vbva_buffer *vbva)
+{
+       s32 diff = vbva->data_offset - vbva->free_offset;
+
+       return diff > 0 ? diff : vbva->data_len + diff;
+}
+
+static void vbva_buffer_place_data_at(struct vbva_buf_ctx *vbva_ctx,
+                                     const void *p, u32 len, u32 offset)
+{
+       struct vbva_buffer *vbva = vbva_ctx->vbva;
+       u32 bytes_till_boundary = vbva->data_len - offset;
+       u8 *dst = &vbva->data[offset];
+       s32 diff = len - bytes_till_boundary;
+
+       if (diff <= 0) {
+               /* Chunk will not cross buffer boundary. */
+               memcpy(dst, p, len);
+       } else {
+               /* Chunk crosses buffer boundary. */
+               memcpy(dst, p, bytes_till_boundary);
+               memcpy(&vbva->data[0], (u8 *)p + bytes_till_boundary, diff);
+       }
+}
+
+static void vbva_buffer_flush(struct gen_pool *ctx)
+{
+       struct vbva_flush *p;
+
+       p = hgsmi_buffer_alloc(ctx, sizeof(*p), HGSMI_CH_VBVA, VBVA_FLUSH);
+       if (!p)
+               return;
+
+       p->reserved = 0;
+
+       hgsmi_buffer_submit(ctx, p);
+       hgsmi_buffer_free(ctx, p);
+}
+
+bool vbva_write(struct vbva_buf_ctx *vbva_ctx, struct gen_pool *ctx,
+               const void *p, u32 len)
+{
+       struct vbva_record *record;
+       struct vbva_buffer *vbva;
+       u32 available;
+
+       vbva = vbva_ctx->vbva;
+       record = vbva_ctx->record;
+
+       if (!vbva || vbva_ctx->buffer_overflow ||
+           !record || !(record->len_and_flags & VBVA_F_RECORD_PARTIAL))
+               return false;
+
+       available = vbva_buffer_available(vbva);
+
+       while (len > 0) {
+               u32 chunk = len;
+
+               if (chunk >= available) {
+                       vbva_buffer_flush(ctx);
+                       available = vbva_buffer_available(vbva);
+               }
+
+               if (chunk >= available) {
+                       if (WARN_ON(available <= vbva->partial_write_tresh)) {
+                               vbva_ctx->buffer_overflow = true;
+                               return false;
+                       }
+                       chunk = available - vbva->partial_write_tresh;
+               }
+
+               vbva_buffer_place_data_at(vbva_ctx, p, chunk,
+                                         vbva->free_offset);
+
+               vbva->free_offset = (vbva->free_offset + chunk) %
+                                   vbva->data_len;
+               record->len_and_flags += chunk;
+               available -= chunk;
+               len -= chunk;
+               p += chunk;
+       }
+
+       return true;
+}
+
+static bool vbva_inform_host(struct vbva_buf_ctx *vbva_ctx,
+                            struct gen_pool *ctx, s32 screen, bool enable)
+{
+       struct vbva_enable_ex *p;
+       bool ret;
+
+       p = hgsmi_buffer_alloc(ctx, sizeof(*p), HGSMI_CH_VBVA, VBVA_ENABLE);
+       if (!p)
+               return false;
+
+       p->base.flags = enable ? VBVA_F_ENABLE : VBVA_F_DISABLE;
+       p->base.offset = vbva_ctx->buffer_offset;
+       p->base.result = VERR_NOT_SUPPORTED;
+       if (screen >= 0) {
+               p->base.flags |= VBVA_F_EXTENDED | VBVA_F_ABSOFFSET;
+               p->screen_id = screen;
+       }
+
+       hgsmi_buffer_submit(ctx, p);
+
+       if (enable)
+               ret = RT_SUCCESS(p->base.result);
+       else
+               ret = true;
+
+       hgsmi_buffer_free(ctx, p);
+
+       return ret;
+}
+
+bool vbva_enable(struct vbva_buf_ctx *vbva_ctx, struct gen_pool *ctx,
+                struct vbva_buffer *vbva, s32 screen)
+{
+       bool ret = false;
+
+       memset(vbva, 0, sizeof(*vbva));
+       vbva->partial_write_tresh = 256;
+       vbva->data_len = vbva_ctx->buffer_length - sizeof(struct vbva_buffer);
+       vbva_ctx->vbva = vbva;
+
+       ret = vbva_inform_host(vbva_ctx, ctx, screen, true);
+       if (!ret)
+               vbva_disable(vbva_ctx, ctx, screen);
+
+       return ret;
+}
+
+void vbva_disable(struct vbva_buf_ctx *vbva_ctx, struct gen_pool *ctx,
+                 s32 screen)
+{
+       vbva_ctx->buffer_overflow = false;
+       vbva_ctx->record = NULL;
+       vbva_ctx->vbva = NULL;
+
+       vbva_inform_host(vbva_ctx, ctx, screen, false);
+}
+
+bool vbva_buffer_begin_update(struct vbva_buf_ctx *vbva_ctx,
+                             struct gen_pool *ctx)
+{
+       struct vbva_record *record;
+       u32 next;
+
+       if (!vbva_ctx->vbva ||
+           !(vbva_ctx->vbva->host_flags.host_events & VBVA_F_MODE_ENABLED))
+               return false;
+
+       WARN_ON(vbva_ctx->buffer_overflow || vbva_ctx->record);
+
+       next = (vbva_ctx->vbva->record_free_index + 1) % VBVA_MAX_RECORDS;
+
+       /* Flush if all slots in the records queue are used */
+       if (next == vbva_ctx->vbva->record_first_index)
+               vbva_buffer_flush(ctx);
+
+       /* If even after flush there is no place then fail the request */
+       if (next == vbva_ctx->vbva->record_first_index)
+               return false;
+
+       record = &vbva_ctx->vbva->records[vbva_ctx->vbva->record_free_index];
+       record->len_and_flags = VBVA_F_RECORD_PARTIAL;
+       vbva_ctx->vbva->record_free_index = next;
+       /* Remember which record we are using. */
+       vbva_ctx->record = record;
+
+       return true;
+}
+
+void vbva_buffer_end_update(struct vbva_buf_ctx *vbva_ctx)
+{
+       struct vbva_record *record = vbva_ctx->record;
+
+       WARN_ON(!vbva_ctx->vbva || !record ||
+               !(record->len_and_flags & VBVA_F_RECORD_PARTIAL));
+
+       /* Mark the record completed. */
+       record->len_and_flags &= ~VBVA_F_RECORD_PARTIAL;
+
+       vbva_ctx->buffer_overflow = false;
+       vbva_ctx->record = NULL;
+}
+
+void vbva_setup_buffer_context(struct vbva_buf_ctx *vbva_ctx,
+                              u32 buffer_offset, u32 buffer_length)
+{
+       vbva_ctx->buffer_offset = buffer_offset;
+       vbva_ctx->buffer_length = buffer_length;
+}
index 030bec855d86aabff800548016eca5e7f403248b..314ffac50bb8303971ca71a5f702f07fb8ed6639 100644 (file)
@@ -3391,7 +3391,6 @@ static int vchiq_probe(struct platform_device *pdev)
        struct device_node *fw_node;
        struct rpi_firmware *fw;
        int err;
-       void *ptr_err;
 
        fw_node = of_parse_phandle(pdev->dev.of_node, "firmware", 0);
        if (!fw_node) {
@@ -3427,14 +3426,14 @@ static int vchiq_probe(struct platform_device *pdev)
 
        /* create sysfs entries */
        vchiq_class = class_create(THIS_MODULE, DEVICE_NAME);
-       ptr_err = vchiq_class;
-       if (IS_ERR(ptr_err))
+       err = PTR_ERR(vchiq_class);
+       if (IS_ERR(vchiq_class))
                goto failed_class_create;
 
        vchiq_dev = device_create(vchiq_class, NULL,
                vchiq_devid, NULL, "vchiq");
-       ptr_err = vchiq_dev;
-       if (IS_ERR(ptr_err))
+       err = PTR_ERR(vchiq_dev);
+       if (IS_ERR(vchiq_dev))
                goto failed_device_create;
 
        /* create debugfs entries */
@@ -3455,7 +3454,6 @@ failed_device_create:
        class_destroy(vchiq_class);
 failed_class_create:
        cdev_del(&vchiq_cdev);
-       err = PTR_ERR(ptr_err);
 failed_cdev_add:
        unregister_chrdev_region(vchiq_devid, 1);
 failed_platform_init:
index ab3e8f410444498c49d0c43c86c93d12fc016cbf..e9391bbd4036023c63d8b7ec90185f56f9523ade 100644 (file)
@@ -30,7 +30,7 @@ static DEFINE_IDA(nvm_ida);
 
 struct nvm_auth_status {
        struct list_head list;
-       uuid_be uuid;
+       uuid_t uuid;
        u32 status;
 };
 
@@ -47,7 +47,7 @@ static struct nvm_auth_status *__nvm_get_auth_status(const struct tb_switch *sw)
        struct nvm_auth_status *st;
 
        list_for_each_entry(st, &nvm_auth_status_cache, list) {
-               if (!uuid_be_cmp(st->uuid, *sw->uuid))
+               if (uuid_equal(&st->uuid, sw->uuid))
                        return st;
        }
 
@@ -281,9 +281,11 @@ static struct nvmem_device *register_nvmem(struct tb_switch *sw, int id,
        if (active) {
                config.name = "nvm_active";
                config.reg_read = tb_switch_nvm_read;
+               config.read_only = true;
        } else {
                config.name = "nvm_non_active";
                config.reg_write = tb_switch_nvm_write;
+               config.root_only = true;
        }
 
        config.id = id;
@@ -292,7 +294,6 @@ static struct nvmem_device *register_nvmem(struct tb_switch *sw, int id,
        config.size = size;
        config.dev = &sw->dev;
        config.owner = THIS_MODULE;
-       config.root_only = true;
        config.priv = sw;
 
        return nvmem_register(&config);
@@ -1460,7 +1461,7 @@ struct tb_sw_lookup {
        struct tb *tb;
        u8 link;
        u8 depth;
-       const uuid_be *uuid;
+       const uuid_t *uuid;
 };
 
 static int tb_switch_match(struct device *dev, void *data)
@@ -1517,7 +1518,7 @@ struct tb_switch *tb_switch_find_by_link_depth(struct tb *tb, u8 link, u8 depth)
  * Returned switch has reference count increased so the caller needs to
  * call tb_switch_put() when done with the switch.
  */
-struct tb_switch *tb_switch_find_by_uuid(struct tb *tb, const uuid_be *uuid)
+struct tb_switch *tb_switch_find_by_uuid(struct tb *tb, const uuid_t *uuid)
 {
        struct tb_sw_lookup lookup;
        struct device *dev;
index 3d9f64676e5839d35b5b3a7edb56a9bbcc00c211..e0deee4f1eb095233789ca7ff8fa3de377d770c1 100644 (file)
@@ -101,7 +101,7 @@ struct tb_switch {
        struct tb_dma_port *dma_port;
        struct tb *tb;
        u64 uid;
-       uuid_be *uuid;
+       uuid_t *uuid;
        u16 vendor;
        u16 device;
        const char *vendor_name;
@@ -407,7 +407,7 @@ void tb_sw_set_unplugged(struct tb_switch *sw);
 struct tb_switch *get_switch_at_route(struct tb_switch *sw, u64 route);
 struct tb_switch *tb_switch_find_by_link_depth(struct tb *tb, u8 link,
                                               u8 depth);
-struct tb_switch *tb_switch_find_by_uuid(struct tb *tb, const uuid_be *uuid);
+struct tb_switch *tb_switch_find_by_uuid(struct tb *tb, const uuid_t *uuid);
 
 static inline unsigned int tb_switch_phy_port_from_link(unsigned int link)
 {
index 85b6d33c09193a4fdf255d3c809ecfb84e7f8177..de6441e4a060283f6e5abdd43672f34103577e93 100644 (file)
@@ -179,7 +179,7 @@ struct icm_fr_pkg_get_topology_response {
 
 struct icm_fr_event_device_connected {
        struct icm_pkg_header hdr;
-       uuid_be ep_uuid;
+       uuid_t ep_uuid;
        u8 connection_key;
        u8 connection_id;
        u16 link_info;
@@ -193,7 +193,7 @@ struct icm_fr_event_device_connected {
 
 struct icm_fr_pkg_approve_device {
        struct icm_pkg_header hdr;
-       uuid_be ep_uuid;
+       uuid_t ep_uuid;
        u8 connection_key;
        u8 connection_id;
        u16 reserved;
@@ -207,7 +207,7 @@ struct icm_fr_event_device_disconnected {
 
 struct icm_fr_pkg_add_device_key {
        struct icm_pkg_header hdr;
-       uuid_be ep_uuid;
+       uuid_t ep_uuid;
        u8 connection_key;
        u8 connection_id;
        u16 reserved;
@@ -216,7 +216,7 @@ struct icm_fr_pkg_add_device_key {
 
 struct icm_fr_pkg_add_device_key_response {
        struct icm_pkg_header hdr;
-       uuid_be ep_uuid;
+       uuid_t ep_uuid;
        u8 connection_key;
        u8 connection_id;
        u16 reserved;
@@ -224,7 +224,7 @@ struct icm_fr_pkg_add_device_key_response {
 
 struct icm_fr_pkg_challenge_device {
        struct icm_pkg_header hdr;
-       uuid_be ep_uuid;
+       uuid_t ep_uuid;
        u8 connection_key;
        u8 connection_id;
        u16 reserved;
@@ -233,7 +233,7 @@ struct icm_fr_pkg_challenge_device {
 
 struct icm_fr_pkg_challenge_device_response {
        struct icm_pkg_header hdr;
-       uuid_be ep_uuid;
+       uuid_t ep_uuid;
        u8 connection_key;
        u8 connection_id;
        u16 reserved;
index d1399aac05a17e96ead10d5bd616a5a780ce9237..284749fb0f6b96d3d6d667332e569ba0d745e048 100644 (file)
@@ -448,48 +448,6 @@ err:
        return retval;
 }
 
-/**
- *     pty_open_peer - open the peer of a pty
- *     @tty: the peer of the pty being opened
- *
- *     Open the cached dentry in tty->link, providing a safe way for userspace
- *     to get the slave end of a pty (where they have the master fd and cannot
- *     access or trust the mount namespace /dev/pts was mounted inside).
- */
-static struct file *pty_open_peer(struct tty_struct *tty, int flags)
-{
-       if (tty->driver->subtype != PTY_TYPE_MASTER)
-               return ERR_PTR(-EIO);
-       return dentry_open(tty->link->driver_data, flags, current_cred());
-}
-
-static int pty_get_peer(struct tty_struct *tty, int flags)
-{
-       int fd = -1;
-       struct file *filp = NULL;
-       int retval = -EINVAL;
-
-       fd = get_unused_fd_flags(0);
-       if (fd < 0) {
-               retval = fd;
-               goto err;
-       }
-
-       filp = pty_open_peer(tty, flags);
-       if (IS_ERR(filp)) {
-               retval = PTR_ERR(filp);
-               goto err_put;
-       }
-
-       fd_install(fd, filp);
-       return fd;
-
-err_put:
-       put_unused_fd(fd);
-err:
-       return retval;
-}
-
 static void pty_cleanup(struct tty_struct *tty)
 {
        tty_port_put(tty->port);
@@ -646,9 +604,50 @@ static inline void legacy_pty_init(void) { }
 
 /* Unix98 devices */
 #ifdef CONFIG_UNIX98_PTYS
-
 static struct cdev ptmx_cdev;
 
+/**
+ *     pty_open_peer - open the peer of a pty
+ *     @tty: the peer of the pty being opened
+ *
+ *     Open the cached dentry in tty->link, providing a safe way for userspace
+ *     to get the slave end of a pty (where they have the master fd and cannot
+ *     access or trust the mount namespace /dev/pts was mounted inside).
+ */
+static struct file *pty_open_peer(struct tty_struct *tty, int flags)
+{
+       if (tty->driver->subtype != PTY_TYPE_MASTER)
+               return ERR_PTR(-EIO);
+       return dentry_open(tty->link->driver_data, flags, current_cred());
+}
+
+static int pty_get_peer(struct tty_struct *tty, int flags)
+{
+       int fd = -1;
+       struct file *filp = NULL;
+       int retval = -EINVAL;
+
+       fd = get_unused_fd_flags(0);
+       if (fd < 0) {
+               retval = fd;
+               goto err;
+       }
+
+       filp = pty_open_peer(tty, flags);
+       if (IS_ERR(filp)) {
+               retval = PTR_ERR(filp);
+               goto err_put;
+       }
+
+       fd_install(fd, filp);
+       return fd;
+
+err_put:
+       put_unused_fd(fd);
+err:
+       return retval;
+}
+
 static int pty_unix98_ioctl(struct tty_struct *tty,
                            unsigned int cmd, unsigned long arg)
 {
index 343de8c384b027366e92818d39cc9c525a95a77f..898dcb091a279fde22b40431acf6dfd8e5badfe8 100644 (file)
@@ -619,6 +619,12 @@ static unsigned int lpuart32_tx_empty(struct uart_port *port)
                TIOCSER_TEMT : 0;
 }
 
+static bool lpuart_is_32(struct lpuart_port *sport)
+{
+       return sport->port.iotype == UPIO_MEM32 ||
+              sport->port.iotype ==  UPIO_MEM32BE;
+}
+
 static irqreturn_t lpuart_txint(int irq, void *dev_id)
 {
        struct lpuart_port *sport = dev_id;
@@ -627,7 +633,7 @@ static irqreturn_t lpuart_txint(int irq, void *dev_id)
 
        spin_lock_irqsave(&sport->port.lock, flags);
        if (sport->port.x_char) {
-               if (sport->port.iotype & (UPIO_MEM32 | UPIO_MEM32BE))
+               if (lpuart_is_32(sport))
                        lpuart32_write(&sport->port, sport->port.x_char, UARTDATA);
                else
                        writeb(sport->port.x_char, sport->port.membase + UARTDR);
@@ -635,14 +641,14 @@ static irqreturn_t lpuart_txint(int irq, void *dev_id)
        }
 
        if (uart_circ_empty(xmit) || uart_tx_stopped(&sport->port)) {
-               if (sport->port.iotype & (UPIO_MEM32 | UPIO_MEM32BE))
+               if (lpuart_is_32(sport))
                        lpuart32_stop_tx(&sport->port);
                else
                        lpuart_stop_tx(&sport->port);
                goto out;
        }
 
-       if (sport->port.iotype & (UPIO_MEM32 | UPIO_MEM32BE))
+       if (lpuart_is_32(sport))
                lpuart32_transmit_buffer(sport);
        else
                lpuart_transmit_buffer(sport);
@@ -1978,12 +1984,12 @@ static int __init lpuart_console_setup(struct console *co, char *options)
        if (options)
                uart_parse_options(options, &baud, &parity, &bits, &flow);
        else
-               if (sport->port.iotype & (UPIO_MEM32 | UPIO_MEM32BE))
+               if (lpuart_is_32(sport))
                        lpuart32_console_get_options(sport, &baud, &parity, &bits);
                else
                        lpuart_console_get_options(sport, &baud, &parity, &bits);
 
-       if (sport->port.iotype & (UPIO_MEM32 | UPIO_MEM32BE))
+       if (lpuart_is_32(sport))
                lpuart32_setup_watermark(sport);
        else
                lpuart_setup_watermark(sport);
@@ -2118,7 +2124,7 @@ static int lpuart_probe(struct platform_device *pdev)
        }
        sport->port.irq = ret;
        sport->port.iotype = sdata->iotype;
-       if (sport->port.iotype & (UPIO_MEM32 | UPIO_MEM32BE))
+       if (lpuart_is_32(sport))
                sport->port.ops = &lpuart32_pops;
        else
                sport->port.ops = &lpuart_pops;
@@ -2145,7 +2151,7 @@ static int lpuart_probe(struct platform_device *pdev)
 
        platform_set_drvdata(pdev, &sport->port);
 
-       if (sport->port.iotype & (UPIO_MEM32 | UPIO_MEM32BE))
+       if (lpuart_is_32(sport))
                lpuart_reg.cons = LPUART32_CONSOLE;
        else
                lpuart_reg.cons = LPUART_CONSOLE;
@@ -2198,7 +2204,7 @@ static int lpuart_suspend(struct device *dev)
        struct lpuart_port *sport = dev_get_drvdata(dev);
        unsigned long temp;
 
-       if (sport->port.iotype & (UPIO_MEM32 | UPIO_MEM32BE)) {
+       if (lpuart_is_32(sport)) {
                /* disable Rx/Tx and interrupts */
                temp = lpuart32_read(&sport->port, UARTCTRL);
                temp &= ~(UARTCTRL_TE | UARTCTRL_TIE | UARTCTRL_TCIE);
@@ -2249,7 +2255,7 @@ static int lpuart_resume(struct device *dev)
        if (sport->port.suspended && !sport->port.irq_wake)
                clk_prepare_enable(sport->clk);
 
-       if (sport->port.iotype & (UPIO_MEM32 | UPIO_MEM32BE)) {
+       if (lpuart_is_32(sport)) {
                lpuart32_setup_watermark(sport);
                temp = lpuart32_read(&sport->port, UARTCTRL);
                temp |= (UARTCTRL_RIE | UARTCTRL_TIE | UARTCTRL_RE |
index 9e3162bf3bd12ea32a0bc35d5851a1f17297907d..80934e7bd67f422629b8ea7c37fdf1f8afc188e6 100644 (file)
 
 #define UART_NR 8
 
-/* RX DMA buffer periods */
-#define RX_DMA_PERIODS 4
-#define RX_BUF_SIZE    (PAGE_SIZE)
-
-
 /* i.MX21 type uart runs on all i.mx except i.MX1 and i.MX6q */
 enum imx_uart_type {
        IMX1_UART,
@@ -226,7 +221,6 @@ struct imx_port {
        struct dma_chan         *dma_chan_rx, *dma_chan_tx;
        struct scatterlist      rx_sgl, tx_sgl[2];
        void                    *rx_buf;
-       unsigned int            rx_buf_size;
        struct circ_buf         rx_ring;
        unsigned int            rx_periods;
        dma_cookie_t            rx_cookie;
@@ -464,7 +458,7 @@ static inline void imx_transmit_buffer(struct imx_port *sport)
                }
        }
 
-       while (!uart_circ_empty(xmit) &&
+       while (!uart_circ_empty(xmit) && !sport->dma_is_txing &&
               !(readl(sport->port.membase + uts_reg(sport)) & UTS_TXFULL)) {
                /* send xmit->buf[xmit->tail]
                 * out the port here */
@@ -967,6 +961,8 @@ static void imx_timeout(unsigned long data)
        }
 }
 
+#define RX_BUF_SIZE    (PAGE_SIZE)
+
 /*
  * There are two kinds of RX DMA interrupts(such as in the MX6Q):
  *   [1] the RX DMA buffer is full.
@@ -1049,6 +1045,9 @@ static void dma_rx_callback(void *data)
        }
 }
 
+/* RX DMA buffer periods */
+#define RX_DMA_PERIODS 4
+
 static int start_rx_dma(struct imx_port *sport)
 {
        struct scatterlist *sgl = &sport->rx_sgl;
@@ -1059,8 +1058,9 @@ static int start_rx_dma(struct imx_port *sport)
 
        sport->rx_ring.head = 0;
        sport->rx_ring.tail = 0;
+       sport->rx_periods = RX_DMA_PERIODS;
 
-       sg_init_one(sgl, sport->rx_buf, sport->rx_buf_size);
+       sg_init_one(sgl, sport->rx_buf, RX_BUF_SIZE);
        ret = dma_map_sg(dev, sgl, 1, DMA_FROM_DEVICE);
        if (ret == 0) {
                dev_err(dev, "DMA mapping error for RX.\n");
@@ -1171,7 +1171,7 @@ static int imx_uart_dma_init(struct imx_port *sport)
                goto err;
        }
 
-       sport->rx_buf = kzalloc(sport->rx_buf_size, GFP_KERNEL);
+       sport->rx_buf = kzalloc(PAGE_SIZE, GFP_KERNEL);
        if (!sport->rx_buf) {
                ret = -ENOMEM;
                goto err;
@@ -2036,7 +2036,6 @@ static int serial_imx_probe_dt(struct imx_port *sport,
 {
        struct device_node *np = pdev->dev.of_node;
        int ret;
-       u32 dma_buf_size[2];
 
        sport->devdata = of_device_get_match_data(&pdev->dev);
        if (!sport->devdata)
@@ -2060,14 +2059,6 @@ static int serial_imx_probe_dt(struct imx_port *sport,
        if (of_get_property(np, "rts-gpios", NULL))
                sport->have_rtsgpio = 1;
 
-       if (!of_property_read_u32_array(np, "fsl,dma-size", dma_buf_size, 2)) {
-               sport->rx_buf_size = dma_buf_size[0] * dma_buf_size[1];
-               sport->rx_periods = dma_buf_size[1];
-       } else {
-               sport->rx_buf_size = RX_BUF_SIZE;
-               sport->rx_periods = RX_DMA_PERIODS;
-       }
-
        return 0;
 }
 #else
index da5ddfc14778869cdc8974fa618a923ba75c90ea..e08b16b070c0fb914916dd6c2f78fcf3546edfea 100644 (file)
@@ -1085,10 +1085,12 @@ static ssize_t rx_trigger_store(struct device *dev,
 {
        struct uart_port *port = dev_get_drvdata(dev);
        struct sci_port *sci = to_sci_port(port);
+       int ret;
        long r;
 
-       if (kstrtol(buf, 0, &r) == -EINVAL)
-               return -EINVAL;
+       ret = kstrtol(buf, 0, &r);
+       if (ret)
+               return ret;
 
        sci->rx_trigger = scif_set_rtrg(port, r);
        if (port->type == PORT_SCIFA || port->type == PORT_SCIFB)
@@ -1116,10 +1118,12 @@ static ssize_t rx_fifo_timeout_store(struct device *dev,
 {
        struct uart_port *port = dev_get_drvdata(dev);
        struct sci_port *sci = to_sci_port(port);
+       int ret;
        long r;
 
-       if (kstrtol(buf, 0, &r) == -EINVAL)
-               return -EINVAL;
+       ret = kstrtol(buf, 0, &r);
+       if (ret)
+               return ret;
        sci->rx_fifo_timeout = r;
        scif_set_rtrg(port, 1);
        if (r > 0)
index f5335be344f67ced2a601c81e3713a7d90e275c7..6b0ca65027d00162e6a8099527878cdea3599f82 100644 (file)
@@ -758,6 +758,7 @@ static int asc_init_port(struct asc_port *ascport,
        if (IS_ERR(ascport->pinctrl)) {
                ret = PTR_ERR(ascport->pinctrl);
                dev_err(&pdev->dev, "Failed to get Pinctrl: %d\n", ret);
+               return ret;
        }
 
        ascport->states[DEFAULT] =
index 5357d83bbda2b87d8823b24995dbfcd626c2262f..5e056064259c85432ebe9f3d9eb12616e2aa1271 100644 (file)
@@ -1829,6 +1829,9 @@ static const struct usb_device_id acm_ids[] = {
        { USB_DEVICE(0x1576, 0x03b1), /* Maretron USB100 */
        .driver_info = NO_UNION_NORMAL, /* reports zero length descriptor */
        },
+       { USB_DEVICE(0xfff0, 0x0100), /* DATECS FP-2000 */
+       .driver_info = NO_UNION_NORMAL, /* reports zero length descriptor */
+       },
 
        { USB_DEVICE(0x2912, 0x0001), /* ATOL FPrint */
        .driver_info = CLEAR_HALT_CONDITIONS,
index bc3b3fda5000d94813d51bade73eac5f2a2b0b70..c4066cd77e47345bc1f31791ba9955c80a12d452 100644 (file)
@@ -3573,6 +3573,9 @@ irq_retry:
                /* Report disconnection if it is not already done. */
                dwc2_hsotg_disconnect(hsotg);
 
+               /* Reset device address to zero */
+               __bic32(hsotg->regs + DCFG, DCFG_DEVADDR_MASK);
+
                if (usb_status & GOTGCTL_BSESVLD && connected)
                        dwc2_hsotg_core_init_disconnected(hsotg, true);
        }
index 326b302fc440d89d7aa4b4ea3d5ba9e839005318..03474d3575abe1381771a88eeb563a39649aa162 100644 (file)
@@ -766,15 +766,15 @@ static int dwc3_core_init(struct dwc3 *dwc)
                        dwc->maximum_speed = USB_SPEED_HIGH;
        }
 
-       ret = dwc3_core_soft_reset(dwc);
+       ret = dwc3_core_get_phy(dwc);
        if (ret)
                goto err0;
 
-       ret = dwc3_phy_setup(dwc);
+       ret = dwc3_core_soft_reset(dwc);
        if (ret)
                goto err0;
 
-       ret = dwc3_core_get_phy(dwc);
+       ret = dwc3_phy_setup(dwc);
        if (ret)
                goto err0;
 
index 98926504b55b5b425eb3c9dce66e889a524d2152..f5aaa0cf38734ccdfea16cfd29dbf2e8e1599cf1 100644 (file)
@@ -512,15 +512,6 @@ static int dwc3_omap_probe(struct platform_device *pdev)
 
        /* check the DMA Status */
        reg = dwc3_omap_readl(omap->base, USBOTGSS_SYSCONFIG);
-       irq_set_status_flags(omap->irq, IRQ_NOAUTOEN);
-       ret = devm_request_threaded_irq(dev, omap->irq, dwc3_omap_interrupt,
-                                       dwc3_omap_interrupt_thread, IRQF_SHARED,
-                                       "dwc3-omap", omap);
-       if (ret) {
-               dev_err(dev, "failed to request IRQ #%d --> %d\n",
-                               omap->irq, ret);
-               goto err1;
-       }
 
        ret = dwc3_omap_extcon_register(omap);
        if (ret < 0)
@@ -532,8 +523,15 @@ static int dwc3_omap_probe(struct platform_device *pdev)
                goto err1;
        }
 
+       ret = devm_request_threaded_irq(dev, omap->irq, dwc3_omap_interrupt,
+                                       dwc3_omap_interrupt_thread, IRQF_SHARED,
+                                       "dwc3-omap", omap);
+       if (ret) {
+               dev_err(dev, "failed to request IRQ #%d --> %d\n",
+                       omap->irq, ret);
+               goto err1;
+       }
        dwc3_omap_enable_irqs(omap);
-       enable_irq(omap->irq);
        return 0;
 
 err1:
index 9e41605a276ba8bc8718340272f2cf21d27cfed7..6b299c7b765611e0cb6c0d30e5de50f8ef279cb7 100644 (file)
@@ -191,14 +191,16 @@ void dwc3_gadget_giveback(struct dwc3_ep *dep, struct dwc3_request *req,
 
        req->started = false;
        list_del(&req->list);
-       req->trb = NULL;
        req->remaining = 0;
 
        if (req->request.status == -EINPROGRESS)
                req->request.status = status;
 
-       usb_gadget_unmap_request_by_dev(dwc->sysdev,
-                                       &req->request, req->direction);
+       if (req->trb)
+               usb_gadget_unmap_request_by_dev(dwc->sysdev,
+                                               &req->request, req->direction);
+
+       req->trb = NULL;
 
        trace_dwc3_gadget_giveback(req);
 
index e80b9c123a9dd27eb9e547210e1d1ee34b3fcc63..f95bddd6513f7e88e4d511508afef2b9c84c063b 100644 (file)
@@ -2490,7 +2490,7 @@ static int fsg_main_thread(void *common_)
                int i;
 
                down_write(&common->filesem);
-               for (i = 0; i < ARRAY_SIZE(common->luns); --i) {
+               for (i = 0; i < ARRAY_SIZE(common->luns); i++) {
                        struct fsg_lun *curlun = common->luns[i];
                        if (!curlun || !fsg_lun_is_open(curlun))
                                continue;
index 8656f84e17d95ffcaac97f7c60b0d0251828b8c7..29efbedc91f9b1bfe9a3d84d5c906c5fc38fc775 100644 (file)
@@ -92,9 +92,9 @@ static struct uac_input_terminal_descriptor usb_out_it_desc = {
        .bDescriptorType =      USB_DT_CS_INTERFACE,
        .bDescriptorSubtype =   UAC_INPUT_TERMINAL,
        .bTerminalID =          USB_OUT_IT_ID,
-       .wTerminalType =        UAC_TERMINAL_STREAMING,
+       .wTerminalType =        cpu_to_le16(UAC_TERMINAL_STREAMING),
        .bAssocTerminal =       0,
-       .wChannelConfig =       0x3,
+       .wChannelConfig =       cpu_to_le16(0x3),
 };
 
 #define IO_OUT_OT_ID   2
@@ -103,7 +103,7 @@ static struct uac1_output_terminal_descriptor io_out_ot_desc = {
        .bDescriptorType        = USB_DT_CS_INTERFACE,
        .bDescriptorSubtype     = UAC_OUTPUT_TERMINAL,
        .bTerminalID            = IO_OUT_OT_ID,
-       .wTerminalType          = UAC_OUTPUT_TERMINAL_SPEAKER,
+       .wTerminalType          = cpu_to_le16(UAC_OUTPUT_TERMINAL_SPEAKER),
        .bAssocTerminal         = 0,
        .bSourceID              = USB_OUT_IT_ID,
 };
@@ -114,9 +114,9 @@ static struct uac_input_terminal_descriptor io_in_it_desc = {
        .bDescriptorType        = USB_DT_CS_INTERFACE,
        .bDescriptorSubtype     = UAC_INPUT_TERMINAL,
        .bTerminalID            = IO_IN_IT_ID,
-       .wTerminalType          = UAC_INPUT_TERMINAL_MICROPHONE,
+       .wTerminalType          = cpu_to_le16(UAC_INPUT_TERMINAL_MICROPHONE),
        .bAssocTerminal         = 0,
-       .wChannelConfig         = 0x3,
+       .wChannelConfig         = cpu_to_le16(0x3),
 };
 
 #define USB_IN_OT_ID   4
@@ -125,7 +125,7 @@ static struct uac1_output_terminal_descriptor usb_in_ot_desc = {
        .bDescriptorType =      USB_DT_CS_INTERFACE,
        .bDescriptorSubtype =   UAC_OUTPUT_TERMINAL,
        .bTerminalID =          USB_IN_OT_ID,
-       .wTerminalType =        UAC_TERMINAL_STREAMING,
+       .wTerminalType =        cpu_to_le16(UAC_TERMINAL_STREAMING),
        .bAssocTerminal =       0,
        .bSourceID =            IO_IN_IT_ID,
 };
@@ -174,7 +174,7 @@ static struct uac1_as_header_descriptor as_out_header_desc = {
        .bDescriptorSubtype =   UAC_AS_GENERAL,
        .bTerminalLink =        USB_OUT_IT_ID,
        .bDelay =               1,
-       .wFormatTag =           UAC_FORMAT_TYPE_I_PCM,
+       .wFormatTag =           cpu_to_le16(UAC_FORMAT_TYPE_I_PCM),
 };
 
 static struct uac1_as_header_descriptor as_in_header_desc = {
@@ -183,7 +183,7 @@ static struct uac1_as_header_descriptor as_in_header_desc = {
        .bDescriptorSubtype =   UAC_AS_GENERAL,
        .bTerminalLink =        USB_IN_OT_ID,
        .bDelay =               1,
-       .wFormatTag =           UAC_FORMAT_TYPE_I_PCM,
+       .wFormatTag =           cpu_to_le16(UAC_FORMAT_TYPE_I_PCM),
 };
 
 DECLARE_UAC_FORMAT_TYPE_I_DISCRETE_DESC(1);
@@ -606,8 +606,8 @@ static int f_audio_bind(struct usb_configuration *c, struct usb_function *f)
        if (status)
                goto fail;
 
-       audio->out_ep_maxpsize = as_out_ep_desc.wMaxPacketSize;
-       audio->in_ep_maxpsize = as_in_ep_desc.wMaxPacketSize;
+       audio->out_ep_maxpsize = le16_to_cpu(as_out_ep_desc.wMaxPacketSize);
+       audio->in_ep_maxpsize = le16_to_cpu(as_in_ep_desc.wMaxPacketSize);
        audio->params.c_chmask = audio_opts->c_chmask;
        audio->params.c_srate = audio_opts->c_srate;
        audio->params.c_ssize = audio_opts->c_ssize;
index 9082ce261e70a7fa00979abacf11d84c94940261..f05c3f3e6103c61ca322da00fce6d5fc02aa1881 100644 (file)
@@ -168,7 +168,7 @@ static struct uac2_input_terminal_descriptor usb_out_it_desc = {
        .bAssocTerminal = 0,
        .bCSourceID = USB_OUT_CLK_ID,
        .iChannelNames = 0,
-       .bmControls = (CONTROL_RDWR << COPY_CTRL),
+       .bmControls = cpu_to_le16(CONTROL_RDWR << COPY_CTRL),
 };
 
 /* Input Terminal for I/O-In */
@@ -182,7 +182,7 @@ static struct uac2_input_terminal_descriptor io_in_it_desc = {
        .bAssocTerminal = 0,
        .bCSourceID = USB_IN_CLK_ID,
        .iChannelNames = 0,
-       .bmControls = (CONTROL_RDWR << COPY_CTRL),
+       .bmControls = cpu_to_le16(CONTROL_RDWR << COPY_CTRL),
 };
 
 /* Ouput Terminal for USB_IN */
@@ -196,7 +196,7 @@ static struct uac2_output_terminal_descriptor usb_in_ot_desc = {
        .bAssocTerminal = 0,
        .bSourceID = IO_IN_IT_ID,
        .bCSourceID = USB_IN_CLK_ID,
-       .bmControls = (CONTROL_RDWR << COPY_CTRL),
+       .bmControls = cpu_to_le16(CONTROL_RDWR << COPY_CTRL),
 };
 
 /* Ouput Terminal for I/O-Out */
@@ -210,7 +210,7 @@ static struct uac2_output_terminal_descriptor io_out_ot_desc = {
        .bAssocTerminal = 0,
        .bSourceID = USB_OUT_IT_ID,
        .bCSourceID = USB_OUT_CLK_ID,
-       .bmControls = (CONTROL_RDWR << COPY_CTRL),
+       .bmControls = cpu_to_le16(CONTROL_RDWR << COPY_CTRL),
 };
 
 static struct uac2_ac_header_descriptor ac_hdr_desc = {
@@ -220,9 +220,10 @@ static struct uac2_ac_header_descriptor ac_hdr_desc = {
        .bDescriptorSubtype = UAC_MS_HEADER,
        .bcdADC = cpu_to_le16(0x200),
        .bCategory = UAC2_FUNCTION_IO_BOX,
-       .wTotalLength = sizeof in_clk_src_desc + sizeof out_clk_src_desc
-                        + sizeof usb_out_it_desc + sizeof io_in_it_desc
-                       + sizeof usb_in_ot_desc + sizeof io_out_ot_desc,
+       .wTotalLength = cpu_to_le16(sizeof in_clk_src_desc
+                       + sizeof out_clk_src_desc + sizeof usb_out_it_desc
+                       + sizeof io_in_it_desc + sizeof usb_in_ot_desc
+                       + sizeof io_out_ot_desc),
        .bmControls = 0,
 };
 
@@ -569,10 +570,12 @@ afunc_bind(struct usb_configuration *cfg, struct usb_function *fn)
                return ret;
        }
 
-       agdev->in_ep_maxpsize = max(fs_epin_desc.wMaxPacketSize,
-                                       hs_epin_desc.wMaxPacketSize);
-       agdev->out_ep_maxpsize = max(fs_epout_desc.wMaxPacketSize,
-                                       hs_epout_desc.wMaxPacketSize);
+       agdev->in_ep_maxpsize = max_t(u16,
+                               le16_to_cpu(fs_epin_desc.wMaxPacketSize),
+                               le16_to_cpu(hs_epin_desc.wMaxPacketSize));
+       agdev->out_ep_maxpsize = max_t(u16,
+                               le16_to_cpu(fs_epout_desc.wMaxPacketSize),
+                               le16_to_cpu(hs_epout_desc.wMaxPacketSize));
 
        hs_epout_desc.bEndpointAddress = fs_epout_desc.bEndpointAddress;
        hs_epin_desc.bEndpointAddress = fs_epin_desc.bEndpointAddress;
index 9ffb11ec9ed961eb157a7c35e43a5d3a01b651b8..7cd5c969fcbe9724ec0892403f1a5bd1c7d01320 100644 (file)
@@ -192,7 +192,7 @@ config USB_RENESAS_USBHS_UDC
 config USB_RENESAS_USB3
        tristate 'Renesas USB3.0 Peripheral controller'
        depends on ARCH_RENESAS || COMPILE_TEST
-       depends on EXTCON
+       depends on EXTCON && HAS_DMA
        help
           Renesas USB3.0 Peripheral controller is a USB peripheral controller
           that supports super, high, and full speed USB 3.0 data transfers.
@@ -257,6 +257,7 @@ config USB_MV_U3D
 
 config USB_SNP_CORE
        depends on (USB_AMD5536UDC || USB_SNP_UDC_PLAT)
+       depends on HAS_DMA
        tristate
        help
          This enables core driver support for Synopsys USB 2.0 Device
@@ -271,7 +272,7 @@ config USB_SNP_CORE
 
 config USB_SNP_UDC_PLAT
        tristate "Synopsys USB 2.0 Device controller"
-       depends on (USB_GADGET && OF)
+       depends on USB_GADGET && OF && HAS_DMA
        select USB_GADGET_DUALSPEED
        select USB_SNP_CORE
        default ARCH_BCM_IPROC
index d8278322d5ac1b4fafca40af9b757016be40b0ce..62dc9c7798e78a034a9e63f8c3163fcebec9e57a 100644 (file)
@@ -89,6 +89,9 @@
 
 /* USB_COM_CON */
 #define USB_COM_CON_CONF               BIT(24)
+#define USB_COM_CON_PN_WDATAIF_NL      BIT(23)
+#define USB_COM_CON_PN_RDATAIF_NL      BIT(22)
+#define USB_COM_CON_PN_LSTTR_PP                BIT(21)
 #define USB_COM_CON_SPD_MODE           BIT(17)
 #define USB_COM_CON_EP0_EN             BIT(16)
 #define USB_COM_CON_DEV_ADDR_SHIFT     8
@@ -686,6 +689,9 @@ static void renesas_usb3_init_controller(struct renesas_usb3 *usb3)
 {
        usb3_init_axi_bridge(usb3);
        usb3_init_epc_registers(usb3);
+       usb3_set_bit(usb3, USB_COM_CON_PN_WDATAIF_NL |
+                    USB_COM_CON_PN_RDATAIF_NL | USB_COM_CON_PN_LSTTR_PP,
+                    USB3_USB_COM_CON);
        usb3_write(usb3, USB_OTG_IDMON, USB3_USB_OTG_INT_STA);
        usb3_write(usb3, USB_OTG_IDMON, USB3_USB_OTG_INT_ENA);
 
@@ -1369,7 +1375,7 @@ static int renesas_usb3_dma_free_prd(struct renesas_usb3 *usb3,
 
        usb3_for_each_dma(usb3, dma, i) {
                if (dma->prd) {
-                       dma_free_coherent(dev, USB3_DMA_MAX_XFER_SIZE,
+                       dma_free_coherent(dev, USB3_DMA_PRD_SIZE,
                                          dma->prd, dma->prd_dma);
                        dma->prd = NULL;
                }
@@ -1409,12 +1415,12 @@ static void usb3_start_pipen(struct renesas_usb3_ep *usb3_ep,
        int ret = -EAGAIN;
        u32 enable_bits = 0;
 
+       spin_lock_irqsave(&usb3->lock, flags);
        if (usb3_ep->halt || usb3_ep->started)
-               return;
+               goto out;
        if (usb3_req != usb3_req_first)
-               return;
+               goto out;
 
-       spin_lock_irqsave(&usb3->lock, flags);
        if (usb3_pn_change(usb3, usb3_ep->num) < 0)
                goto out;
 
index 2e11f19e07ae8ae42bfdea6e5c1c2755b42c8a0f..f7b4d0f159e4e4492bbfb6d5877370bb9275cda5 100644 (file)
@@ -28,7 +28,7 @@
 /* description */
 #define UDC_MOD_DESCRIPTION     "Synopsys UDC platform driver"
 
-void start_udc(struct udc *udc)
+static void start_udc(struct udc *udc)
 {
        if (udc->driver) {
                dev_info(udc->dev, "Connecting...\n");
@@ -38,7 +38,7 @@ void start_udc(struct udc *udc)
        }
 }
 
-void stop_udc(struct udc *udc)
+static void stop_udc(struct udc *udc)
 {
        int tmp;
        u32 reg;
@@ -76,7 +76,7 @@ void stop_udc(struct udc *udc)
        dev_info(udc->dev, "Device disconnected\n");
 }
 
-void udc_drd_work(struct work_struct *work)
+static void udc_drd_work(struct work_struct *work)
 {
        struct udc *udc;
 
index a9a1e4c40480cf2c5c7c7995aa5d337d3ef3ee87..c8989c62a2621b88cf8b9d0c3001a37a31d5e151 100644 (file)
 #define USB_INTEL_USB3_PSSEN   0xD8
 #define USB_INTEL_USB3PRM      0xDC
 
+/* ASMEDIA quirk use */
+#define ASMT_DATA_WRITE0_REG   0xF8
+#define ASMT_DATA_WRITE1_REG   0xFC
+#define ASMT_CONTROL_REG       0xE0
+#define ASMT_CONTROL_WRITE_BIT 0x02
+#define ASMT_WRITEREG_CMD      0x10423
+#define ASMT_FLOWCTL_ADDR      0xFA30
+#define ASMT_FLOWCTL_DATA      0xBA
+#define ASMT_PSEUDO_DATA       0
+
 /*
  * amd_chipset_gen values represent AMD different chipset generations
  */
@@ -412,6 +422,50 @@ void usb_amd_quirk_pll_disable(void)
 }
 EXPORT_SYMBOL_GPL(usb_amd_quirk_pll_disable);
 
+static int usb_asmedia_wait_write(struct pci_dev *pdev)
+{
+       unsigned long retry_count;
+       unsigned char value;
+
+       for (retry_count = 1000; retry_count > 0; --retry_count) {
+
+               pci_read_config_byte(pdev, ASMT_CONTROL_REG, &value);
+
+               if (value == 0xff) {
+                       dev_err(&pdev->dev, "%s: check_ready ERROR", __func__);
+                       return -EIO;
+               }
+
+               if ((value & ASMT_CONTROL_WRITE_BIT) == 0)
+                       return 0;
+
+               usleep_range(40, 60);
+       }
+
+       dev_warn(&pdev->dev, "%s: check_write_ready timeout", __func__);
+       return -ETIMEDOUT;
+}
+
+void usb_asmedia_modifyflowcontrol(struct pci_dev *pdev)
+{
+       if (usb_asmedia_wait_write(pdev) != 0)
+               return;
+
+       /* send command and address to device */
+       pci_write_config_dword(pdev, ASMT_DATA_WRITE0_REG, ASMT_WRITEREG_CMD);
+       pci_write_config_dword(pdev, ASMT_DATA_WRITE1_REG, ASMT_FLOWCTL_ADDR);
+       pci_write_config_byte(pdev, ASMT_CONTROL_REG, ASMT_CONTROL_WRITE_BIT);
+
+       if (usb_asmedia_wait_write(pdev) != 0)
+               return;
+
+       /* send data to device */
+       pci_write_config_dword(pdev, ASMT_DATA_WRITE0_REG, ASMT_FLOWCTL_DATA);
+       pci_write_config_dword(pdev, ASMT_DATA_WRITE1_REG, ASMT_PSEUDO_DATA);
+       pci_write_config_byte(pdev, ASMT_CONTROL_REG, ASMT_CONTROL_WRITE_BIT);
+}
+EXPORT_SYMBOL_GPL(usb_asmedia_modifyflowcontrol);
+
 void usb_amd_quirk_pll_enable(void)
 {
        usb_amd_quirk_pll(0);
index 0222195bd5b0e2a954ec8d2e841720b577c7282a..6559944801987728a1db6ba31f09db51b92362e3 100644 (file)
@@ -11,6 +11,7 @@ bool usb_amd_prefetch_quirk(void);
 void usb_amd_dev_put(void);
 void usb_amd_quirk_pll_disable(void);
 void usb_amd_quirk_pll_enable(void);
+void usb_asmedia_modifyflowcontrol(struct pci_dev *pdev);
 void usb_enable_intel_xhci_ports(struct pci_dev *xhci_pdev);
 void usb_disable_xhci_ports(struct pci_dev *xhci_pdev);
 void sb800_prefetch(struct device *dev, int on);
@@ -18,6 +19,7 @@ void sb800_prefetch(struct device *dev, int on);
 struct pci_dev;
 static inline void usb_amd_quirk_pll_disable(void) {}
 static inline void usb_amd_quirk_pll_enable(void) {}
+static inline void usb_asmedia_modifyflowcontrol(struct pci_dev *pdev) {}
 static inline void usb_amd_dev_put(void) {}
 static inline void usb_disable_xhci_ports(struct pci_dev *xhci_pdev) {}
 static inline void sb800_prefetch(struct device *dev, int on) {}
index 1adae9eab8313f341bf01f43145a94c6b5f8121e..00721e8807ab472f1e886fff791e7bbbaeec3a13 100644 (file)
@@ -398,14 +398,21 @@ static int xhci_stop_device(struct xhci_hcd *xhci, int slot_id, int suspend)
        spin_lock_irqsave(&xhci->lock, flags);
        for (i = LAST_EP_INDEX; i > 0; i--) {
                if (virt_dev->eps[i].ring && virt_dev->eps[i].ring->dequeue) {
+                       struct xhci_ep_ctx *ep_ctx;
                        struct xhci_command *command;
+
+                       ep_ctx = xhci_get_ep_ctx(xhci, virt_dev->out_ctx, i);
+
+                       /* Check ep is running, required by AMD SNPS 3.1 xHC */
+                       if (GET_EP_CTX_STATE(ep_ctx) != EP_STATE_RUNNING)
+                               continue;
+
                        command = xhci_alloc_command(xhci, false, false,
                                                     GFP_NOWAIT);
                        if (!command) {
                                spin_unlock_irqrestore(&xhci->lock, flags);
                                xhci_free_command(xhci, cmd);
                                return -ENOMEM;
-
                        }
                        xhci_queue_stop_endpoint(xhci, command, slot_id, i,
                                                 suspend);
@@ -603,12 +610,14 @@ static int xhci_enter_test_mode(struct xhci_hcd *xhci,
 
        /* Disable all Device Slots */
        xhci_dbg(xhci, "Disable all slots\n");
+       spin_unlock_irqrestore(&xhci->lock, *flags);
        for (i = 1; i <= HCS_MAX_SLOTS(xhci->hcs_params1); i++) {
                retval = xhci_disable_slot(xhci, NULL, i);
                if (retval)
                        xhci_err(xhci, "Failed to disable slot %d, %d. Enter test mode anyway\n",
                                 i, retval);
        }
+       spin_lock_irqsave(&xhci->lock, *flags);
        /* Put all ports to the Disable state by clear PP */
        xhci_dbg(xhci, "Disable all port (PP = 0)\n");
        /* Power off USB3 ports*/
@@ -897,6 +906,9 @@ static u32 xhci_get_port_status(struct usb_hcd *hcd,
                        clear_bit(wIndex, &bus_state->resuming_ports);
 
                        set_bit(wIndex, &bus_state->rexit_ports);
+
+                       xhci_test_and_clear_bit(xhci, port_array, wIndex,
+                                               PORT_PLC);
                        xhci_set_link_state(xhci, port_array, wIndex,
                                        XDEV_U0);
 
index 53882e2babbb2ec3903aebdb14b9fd3a28482d47..5b0fa553c8bc940e88a6db731cf6dfeb0c9fb971 100644 (file)
@@ -59,6 +59,8 @@
 #define PCI_DEVICE_ID_AMD_PROMONTORYA_2                        0x43bb
 #define PCI_DEVICE_ID_AMD_PROMONTORYA_1                        0x43bc
 
+#define PCI_DEVICE_ID_ASMEDIA_1042A_XHCI               0x1142
+
 static const char hcd_name[] = "xhci_hcd";
 
 static struct hc_driver __read_mostly xhci_pci_hc_driver;
@@ -217,6 +219,10 @@ static void xhci_pci_quirks(struct device *dev, struct xhci_hcd *xhci)
                        pdev->device == 0x1142)
                xhci->quirks |= XHCI_TRUST_TX_LENGTH;
 
+       if (pdev->vendor == PCI_VENDOR_ID_ASMEDIA &&
+               pdev->device == PCI_DEVICE_ID_ASMEDIA_1042A_XHCI)
+               xhci->quirks |= XHCI_ASMEDIA_MODIFY_FLOWCONTROL;
+
        if (pdev->vendor == PCI_VENDOR_ID_TI && pdev->device == 0x8241)
                xhci->quirks |= XHCI_LIMIT_ENDPOINT_INTERVAL_7;
 
index c50c902d009ed8ea634ce073ecff75024ff8cda8..cc368ad2b51e44c731a2926902f78de830e2f17a 100644 (file)
@@ -864,13 +864,16 @@ static void xhci_kill_endpoint_urbs(struct xhci_hcd *xhci,
                        (ep->ep_state & EP_GETTING_NO_STREAMS)) {
                int stream_id;
 
-               for (stream_id = 0; stream_id < ep->stream_info->num_streams;
+               for (stream_id = 1; stream_id < ep->stream_info->num_streams;
                                stream_id++) {
+                       ring = ep->stream_info->stream_rings[stream_id];
+                       if (!ring)
+                               continue;
+
                        xhci_dbg_trace(xhci, trace_xhci_dbg_cancel_urb,
                                        "Killing URBs for slot ID %u, ep index %u, stream %u",
-                                       slot_id, ep_index, stream_id + 1);
-                       xhci_kill_ring_urbs(xhci,
-                                       ep->stream_info->stream_rings[stream_id]);
+                                       slot_id, ep_index, stream_id);
+                       xhci_kill_ring_urbs(xhci, ring);
                }
        } else {
                ring = ep->ring;
index 56f85df013dbd7201d48c7a0afc2e93041d6e851..b2ff1ff1a02faff066374cafdf9fa5b531db5b81 100644 (file)
@@ -198,6 +198,9 @@ int xhci_reset(struct xhci_hcd *xhci)
        if (ret)
                return ret;
 
+       if (xhci->quirks & XHCI_ASMEDIA_MODIFY_FLOWCONTROL)
+               usb_asmedia_modifyflowcontrol(to_pci_dev(xhci_to_hcd(xhci)->self.controller));
+
        xhci_dbg_trace(xhci, trace_xhci_dbg_init,
                         "Wait for controller to be ready for doorbell rings");
        /*
@@ -622,8 +625,10 @@ int xhci_run(struct usb_hcd *hcd)
                if (!command)
                        return -ENOMEM;
 
-               xhci_queue_vendor_command(xhci, command, 0, 0, 0,
+               ret = xhci_queue_vendor_command(xhci, command, 0, 0, 0,
                                TRB_TYPE(TRB_NEC_GET_FW));
+               if (ret)
+                       xhci_free_command(xhci, command);
        }
        xhci_dbg_trace(xhci, trace_xhci_dbg_init,
                        "Finished xhci_run for USB2 roothub");
@@ -1085,6 +1090,9 @@ int xhci_resume(struct xhci_hcd *xhci, bool hibernated)
        if ((xhci->quirks & XHCI_COMP_MODE_QUIRK) && !comp_timer_running)
                compliance_mode_recovery_timer_init(xhci);
 
+       if (xhci->quirks & XHCI_ASMEDIA_MODIFY_FLOWCONTROL)
+               usb_asmedia_modifyflowcontrol(to_pci_dev(hcd->self.controller));
+
        /* Re-enable port polling. */
        xhci_dbg(xhci, "%s: starting port polling.\n", __func__);
        set_bit(HCD_FLAG_POLL_RH, &xhci->shared_hcd->flags);
index 3c6da1f93c845a6373deffcbf81be9530b03b122..e3e935291ed6fcb57be0402000a4beac6161a9ce 100644 (file)
@@ -1820,6 +1820,7 @@ struct xhci_hcd {
 #define XHCI_BROKEN_PORT_PED   (1 << 25)
 #define XHCI_LIMIT_ENDPOINT_INTERVAL_7 (1 << 26)
 #define XHCI_U2_DISABLE_WAKE   (1 << 27)
+#define XHCI_ASMEDIA_MODIFY_FLOWCONTROL        (1 << 28)
 
        unsigned int            num_active_eps;
        unsigned int            limit_active_eps;
index 623c5130039303b389717f94ea6a89972627bc55..f0ce304c5aaf54f1255bd94d786a3e1cb4148b79 100644 (file)
@@ -752,8 +752,10 @@ static int usbhsc_resume(struct device *dev)
        struct usbhs_priv *priv = dev_get_drvdata(dev);
        struct platform_device *pdev = usbhs_priv_to_pdev(priv);
 
-       if (!usbhsc_flags_has(priv, USBHSF_RUNTIME_PWCTRL))
+       if (!usbhsc_flags_has(priv, USBHSF_RUNTIME_PWCTRL)) {
                usbhsc_power_ctrl(priv, 1);
+               usbhs_mod_autonomy_mode(priv);
+       }
 
        usbhs_platform_call(priv, phy_reset, pdev);
 
index 5bc7a6138855ec7ecf69046ceb71a3c992ccb9fa..93fba9033b00a7136b85a9995d7da32a140c61e9 100644 (file)
@@ -37,6 +37,7 @@ struct usbhsg_gpriv;
 struct usbhsg_uep {
        struct usb_ep            ep;
        struct usbhs_pipe       *pipe;
+       spinlock_t              lock;   /* protect the pipe */
 
        char ep_name[EP_NAME_SIZE];
 
@@ -636,10 +637,16 @@ usbhsg_ep_enable_end:
 static int usbhsg_ep_disable(struct usb_ep *ep)
 {
        struct usbhsg_uep *uep = usbhsg_ep_to_uep(ep);
-       struct usbhs_pipe *pipe = usbhsg_uep_to_pipe(uep);
+       struct usbhs_pipe *pipe;
+       unsigned long flags;
+       int ret = 0;
 
-       if (!pipe)
-               return -EINVAL;
+       spin_lock_irqsave(&uep->lock, flags);
+       pipe = usbhsg_uep_to_pipe(uep);
+       if (!pipe) {
+               ret = -EINVAL;
+               goto out;
+       }
 
        usbhsg_pipe_disable(uep);
        usbhs_pipe_free(pipe);
@@ -647,6 +654,9 @@ static int usbhsg_ep_disable(struct usb_ep *ep)
        uep->pipe->mod_private  = NULL;
        uep->pipe               = NULL;
 
+out:
+       spin_unlock_irqrestore(&uep->lock, flags);
+
        return 0;
 }
 
@@ -696,8 +706,11 @@ static int usbhsg_ep_dequeue(struct usb_ep *ep, struct usb_request *req)
 {
        struct usbhsg_uep *uep = usbhsg_ep_to_uep(ep);
        struct usbhsg_request *ureq = usbhsg_req_to_ureq(req);
-       struct usbhs_pipe *pipe = usbhsg_uep_to_pipe(uep);
+       struct usbhs_pipe *pipe;
+       unsigned long flags;
 
+       spin_lock_irqsave(&uep->lock, flags);
+       pipe = usbhsg_uep_to_pipe(uep);
        if (pipe)
                usbhs_pkt_pop(pipe, usbhsg_ureq_to_pkt(ureq));
 
@@ -706,6 +719,7 @@ static int usbhsg_ep_dequeue(struct usb_ep *ep, struct usb_request *req)
         * even if the pipe is NULL.
         */
        usbhsg_queue_pop(uep, ureq, -ECONNRESET);
+       spin_unlock_irqrestore(&uep->lock, flags);
 
        return 0;
 }
@@ -852,10 +866,10 @@ static int usbhsg_try_stop(struct usbhs_priv *priv, u32 status)
 {
        struct usbhsg_gpriv *gpriv = usbhsg_priv_to_gpriv(priv);
        struct usbhs_mod *mod = usbhs_mod_get_current(priv);
-       struct usbhsg_uep *dcp = usbhsg_gpriv_to_dcp(gpriv);
+       struct usbhsg_uep *uep;
        struct device *dev = usbhs_priv_to_dev(priv);
        unsigned long flags;
-       int ret = 0;
+       int ret = 0, i;
 
        /********************  spin lock ********************/
        usbhs_lock(priv, flags);
@@ -887,7 +901,9 @@ static int usbhsg_try_stop(struct usbhs_priv *priv, u32 status)
        usbhs_sys_set_test_mode(priv, 0);
        usbhs_sys_function_ctrl(priv, 0);
 
-       usbhsg_ep_disable(&dcp->ep);
+       /* disable all eps */
+       usbhsg_for_each_uep_with_dcp(uep, gpriv, i)
+               usbhsg_ep_disable(&uep->ep);
 
        dev_dbg(dev, "stop gadget\n");
 
@@ -1069,6 +1085,7 @@ int usbhs_mod_gadget_probe(struct usbhs_priv *priv)
                ret = -ENOMEM;
                goto usbhs_mod_gadget_probe_err_gpriv;
        }
+       spin_lock_init(&uep->lock);
 
        gpriv->transceiver = usb_get_phy(USB_PHY_TYPE_UNDEFINED);
        dev_info(dev, "%stransceiver found\n",
index fba4005dd737b9a43689ae1db1ecc20f3ac46ac7..6a7720e66595609160c7cc9c5be7f64a157cc3b0 100644 (file)
@@ -1529,8 +1529,11 @@ static void isd200_ata_command(struct scsi_cmnd *srb, struct us_data *us)
 
        /* Make sure driver was initialized */
 
-       if (us->extra == NULL)
+       if (us->extra == NULL) {
                usb_stor_dbg(us, "ERROR Driver not initialized\n");
+               srb->result = DID_ERROR << 16;
+               return;
+       }
 
        scsi_set_resid(srb, 0);
        /* scsi_bufflen might change in protocol translation to ata */
index 6b0d2f0918c6dd7fbf19207a47b2f6a43fcd9d57..8a88f45822e39eb1a8c1826c2c5129371d555aef 100644 (file)
@@ -3,6 +3,7 @@
 #define __DRIVER_USB_TYPEC_UCSI_H
 
 #include <linux/bitops.h>
+#include <linux/device.h>
 #include <linux/types.h>
 
 /* -------------------------------------------------------------------------- */
index 22caf808bfaba97e45662de0f4150632bcb85d2f..f0b3a0b9d42f8b8b3ea9c6943a4010c3d7e15f18 100644 (file)
@@ -104,12 +104,6 @@ static u32 page_to_balloon_pfn(struct page *page)
        return pfn * VIRTIO_BALLOON_PAGES_PER_PAGE;
 }
 
-static struct page *balloon_pfn_to_page(u32 pfn)
-{
-       BUG_ON(pfn % VIRTIO_BALLOON_PAGES_PER_PAGE);
-       return pfn_to_page(pfn / VIRTIO_BALLOON_PAGES_PER_PAGE);
-}
-
 static void balloon_ack(struct virtqueue *vq)
 {
        struct virtio_balloon *vb = vq->vdev->priv;
@@ -138,8 +132,10 @@ static void set_page_pfns(struct virtio_balloon *vb,
 {
        unsigned int i;
 
-       /* Set balloon pfns pointing at this page.
-        * Note that the first pfn points at start of the page. */
+       /*
+        * Set balloon pfns pointing at this page.
+        * Note that the first pfn points at start of the page.
+        */
        for (i = 0; i < VIRTIO_BALLOON_PAGES_PER_PAGE; i++)
                pfns[i] = cpu_to_virtio32(vb->vdev,
                                          page_to_balloon_pfn(page) + i);
@@ -182,18 +178,16 @@ static unsigned fill_balloon(struct virtio_balloon *vb, size_t num)
        return num_allocated_pages;
 }
 
-static void release_pages_balloon(struct virtio_balloon *vb)
+static void release_pages_balloon(struct virtio_balloon *vb,
+                                struct list_head *pages)
 {
-       unsigned int i;
-       struct page *page;
+       struct page *page, *next;
 
-       /* Find pfns pointing at start of each page, get pages and free them. */
-       for (i = 0; i < vb->num_pfns; i += VIRTIO_BALLOON_PAGES_PER_PAGE) {
-               page = balloon_pfn_to_page(virtio32_to_cpu(vb->vdev,
-                                                          vb->pfns[i]));
+       list_for_each_entry_safe(page, next, pages, lru) {
                if (!virtio_has_feature(vb->vdev,
                                        VIRTIO_BALLOON_F_DEFLATE_ON_OOM))
                        adjust_managed_page_count(page, 1);
+               list_del(&page->lru);
                put_page(page); /* balloon reference */
        }
 }
@@ -203,6 +197,7 @@ static unsigned leak_balloon(struct virtio_balloon *vb, size_t num)
        unsigned num_freed_pages;
        struct page *page;
        struct balloon_dev_info *vb_dev_info = &vb->vb_dev_info;
+       LIST_HEAD(pages);
 
        /* We can only do one array worth at a time. */
        num = min(num, ARRAY_SIZE(vb->pfns));
@@ -216,6 +211,7 @@ static unsigned leak_balloon(struct virtio_balloon *vb, size_t num)
                if (!page)
                        break;
                set_page_pfns(vb, vb->pfns + vb->num_pfns, page);
+               list_add(&page->lru, &pages);
                vb->num_pages -= VIRTIO_BALLOON_PAGES_PER_PAGE;
        }
 
@@ -227,7 +223,7 @@ static unsigned leak_balloon(struct virtio_balloon *vb, size_t num)
         */
        if (vb->num_pfns != 0)
                tell_host(vb, vb->deflate_vq);
-       release_pages_balloon(vb);
+       release_pages_balloon(vb, &pages);
        mutex_unlock(&vb->balloon_lock);
        return num_freed_pages;
 }
index 3612542b604444bbfdf30a2212e45e830eb5e9d3..83fc9aab34e872377274c3521055365fc618bef4 100644 (file)
@@ -704,7 +704,8 @@ static int omap_hdq_probe(struct platform_device *pdev)
 
        irq = platform_get_irq(pdev, 0);
        if (irq < 0) {
-               ret = -ENXIO;
+               dev_dbg(&pdev->dev, "Failed to get IRQ: %d\n", irq);
+               ret = irq;
                goto err_irq;
        }
 
index 95ea7e6b1d991b681579477653e173fd2412a4b0..74471e7aa5cc42d82305967bc5a1795363fb5895 100644 (file)
@@ -728,6 +728,7 @@ int w1_attach_slave_device(struct w1_master *dev, struct w1_reg_num *rn)
        memcpy(&sl->reg_num, rn, sizeof(sl->reg_num));
        atomic_set(&sl->refcnt, 1);
        atomic_inc(&sl->master->refcnt);
+       dev->slave_count++;
 
        /* slave modules need to be loaded in a context with unlocked mutex */
        mutex_unlock(&dev->mutex);
@@ -747,11 +748,11 @@ int w1_attach_slave_device(struct w1_master *dev, struct w1_reg_num *rn)
 
        sl->family = f;
 
-
        err = __w1_attach_slave_device(sl);
        if (err < 0) {
                dev_err(&dev->dev, "%s: Attaching %s failed.\n", __func__,
                         sl->name);
+               dev->slave_count--;
                w1_family_put(sl->family);
                atomic_dec(&sl->master->refcnt);
                kfree(sl);
@@ -759,7 +760,6 @@ int w1_attach_slave_device(struct w1_master *dev, struct w1_reg_num *rn)
        }
 
        sl->ttl = dev->slave_ttl;
-       dev->slave_count++;
 
        memcpy(msg.id.id, rn, sizeof(msg.id));
        msg.type = W1_SLAVE_ADD;
index 50dcb68d8070756ef8e4a67af8200c9d5e4c8c20..ab609255a0f35f02aaa401ecb0be925a2b4b5ba9 100644 (file)
@@ -780,6 +780,9 @@ static int __init balloon_init(void)
        }
 #endif
 
+       /* Init the xen-balloon driver. */
+       xen_balloon_init();
+
        return 0;
 }
 subsys_initcall(balloon_init);
index d6786b87e13b2392c366cfa807c35cf2401c8387..2c6a9114d332c74a85e2d679b9c2672a7447e188 100644 (file)
@@ -42,6 +42,7 @@
 #include <linux/delay.h>
 #include <linux/hardirq.h>
 #include <linux/workqueue.h>
+#include <linux/ratelimit.h>
 
 #include <xen/xen.h>
 #include <xen/interface/xen.h>
@@ -1072,8 +1073,14 @@ static int gnttab_expand(unsigned int req_entries)
        cur = nr_grant_frames;
        extra = ((req_entries + (grefs_per_grant_frame-1)) /
                 grefs_per_grant_frame);
-       if (cur + extra > gnttab_max_grant_frames())
+       if (cur + extra > gnttab_max_grant_frames()) {
+               pr_warn_ratelimited("xen/grant-table: max_grant_frames reached"
+                                   " cur=%u extra=%u limit=%u"
+                                   " gnttab_free_count=%u req_entries=%u\n",
+                                   cur, extra, gnttab_max_grant_frames(),
+                                   gnttab_free_count, req_entries);
                return -ENOSPC;
+       }
 
        rc = gnttab_map(cur, cur + extra - 1);
        if (rc == 0)
index e7715cb62eefc307a354a77902baaaa5916a157c..e89136ab851e30c1aff97893615f72f2d5bf3cd7 100644 (file)
@@ -59,6 +59,8 @@ static void watch_target(struct xenbus_watch *watch,
 {
        unsigned long long new_target;
        int err;
+       static bool watch_fired;
+       static long target_diff;
 
        err = xenbus_scanf(XBT_NIL, "memory", "target", "%llu", &new_target);
        if (err != 1) {
@@ -69,7 +71,14 @@ static void watch_target(struct xenbus_watch *watch,
        /* The given memory/target value is in KiB, so it needs converting to
         * pages. PAGE_SHIFT converts bytes to pages, hence PAGE_SHIFT - 10.
         */
-       balloon_set_new_target(new_target >> (PAGE_SHIFT - 10));
+       new_target >>= PAGE_SHIFT - 10;
+       if (watch_fired) {
+               balloon_set_new_target(new_target - target_diff);
+               return;
+       }
+
+       watch_fired = true;
+       target_diff = new_target - balloon_stats.target_pages;
 }
 static struct xenbus_watch target_watch = {
        .node = "memory/target",
@@ -94,22 +103,15 @@ static struct notifier_block xenstore_notifier = {
        .notifier_call = balloon_init_watcher,
 };
 
-static int __init balloon_init(void)
+void xen_balloon_init(void)
 {
-       if (!xen_domain())
-               return -ENODEV;
-
-       pr_info("Initialising balloon driver\n");
-
        register_balloon(&balloon_dev);
 
        register_xen_selfballooning(&balloon_dev);
 
        register_xenstore_notifier(&xenstore_notifier);
-
-       return 0;
 }
-subsys_initcall(balloon_init);
+EXPORT_SYMBOL_GPL(xen_balloon_init);
 
 #define BALLOON_SHOW(name, format, args...)                            \
        static ssize_t show_##name(struct device *dev,                  \
index 7bc186f4ed4de6837b94ab8670cca7043122b28c..2e71b6e7e646a489e35bad17c23cc2140c5bc64b 100644 (file)
@@ -77,13 +77,6 @@ static int __jfs_set_acl(tid_t tid, struct inode *inode, int type,
        switch (type) {
        case ACL_TYPE_ACCESS:
                ea_name = XATTR_NAME_POSIX_ACL_ACCESS;
-               if (acl) {
-                       rc = posix_acl_update_mode(inode, &inode->i_mode, &acl);
-                       if (rc)
-                               return rc;
-                       inode->i_ctime = current_time(inode);
-                       mark_inode_dirty(inode);
-               }
                break;
        case ACL_TYPE_DEFAULT:
                ea_name = XATTR_NAME_POSIX_ACL_DEFAULT;
@@ -115,12 +108,27 @@ int jfs_set_acl(struct inode *inode, struct posix_acl *acl, int type)
 {
        int rc;
        tid_t tid;
+       int update_mode = 0;
+       umode_t mode = inode->i_mode;
 
        tid = txBegin(inode->i_sb, 0);
        mutex_lock(&JFS_IP(inode)->commit_mutex);
+       if (type == ACL_TYPE_ACCESS && acl) {
+               rc = posix_acl_update_mode(inode, &mode, &acl);
+               if (rc)
+                       goto end_tx;
+               update_mode = 1;
+       }
        rc = __jfs_set_acl(tid, inode, type, acl);
-       if (!rc)
+       if (!rc) {
+               if (update_mode) {
+                       inode->i_mode = mode;
+                       inode->i_ctime = current_time(inode);
+                       mark_inode_dirty(inode);
+               }
                rc = txCommit(tid, 1, &inode, 0);
+       }
+end_tx:
        txEnd(tid);
        mutex_unlock(&JFS_IP(inode)->commit_mutex);
        return rc;
index bd9b641ada2c5e9ba507c4efaf346a244559f4fb..7ddcb445a3d9f65c61a4c423e2e969bf14649394 100644 (file)
@@ -98,7 +98,7 @@ int jfs_extendfs(struct super_block *sb, s64 newLVSize, int newLogSize)
                goto out;
        }
 
-       VolumeSize = sb->s_bdev->bd_inode->i_size >> sb->s_blocksize_bits;
+       VolumeSize = i_size_read(sb->s_bdev->bd_inode) >> sb->s_blocksize_bits;
 
        if (VolumeSize) {
                if (newLVSize > VolumeSize) {
@@ -211,7 +211,7 @@ int jfs_extendfs(struct super_block *sb, s64 newLVSize, int newLogSize)
        txQuiesce(sb);
 
        /* Reset size of direct inode */
-       sbi->direct_inode->i_size =  sb->s_bdev->bd_inode->i_size;
+       sbi->direct_inode->i_size =  i_size_read(sb->s_bdev->bd_inode);
 
        if (sbi->mntflag & JFS_INLINELOG) {
                /*
index e8aad7d87b8c938aad4a51db500684950df73944..78b41e1d5c67151744fb1c98bf1af54560593457 100644 (file)
@@ -313,7 +313,7 @@ static int parse_options(char *options, struct super_block *sb, s64 *newLVSize,
                }
                case Opt_resize_nosize:
                {
-                       *newLVSize = sb->s_bdev->bd_inode->i_size >>
+                       *newLVSize = i_size_read(sb->s_bdev->bd_inode) >>
                                sb->s_blocksize_bits;
                        if (*newLVSize == 0)
                                pr_err("JFS: Cannot determine volume size\n");
@@ -579,7 +579,7 @@ static int jfs_fill_super(struct super_block *sb, void *data, int silent)
                goto out_unload;
        }
        inode->i_ino = 0;
-       inode->i_size = sb->s_bdev->bd_inode->i_size;
+       inode->i_size = i_size_read(sb->s_bdev->bd_inode);
        inode->i_mapping->a_ops = &jfs_metapage_aops;
        hlist_add_fake(&inode->i_hash);
        mapping_set_gfp_mask(inode->i_mapping, GFP_NOFS);
index d4b72944ccdabc89748f054dd92c7b355f05de5a..1e3a74f94131eb15448f9c48c8410d75602949cd 100644 (file)
@@ -3,6 +3,7 @@
 
 #ifdef CONFIG_ACPI_NUMA
 #include <linux/kernel.h>
+#include <linux/numa.h>
 
 /* Proximity bitmap length */
 #if MAX_NUMNODES > 256
index 843ab866e0f487c2000e0974592ee98544293758..03c0196a6f2474ea4e34e9840638ff80a45370ec 100644 (file)
@@ -157,16 +157,40 @@ static inline int is_device_dma_capable(struct device *dev)
  * These three functions are only for dma allocator.
  * Don't use them in device drivers.
  */
-int dma_alloc_from_coherent(struct device *dev, ssize_t size,
+int dma_alloc_from_dev_coherent(struct device *dev, ssize_t size,
                                       dma_addr_t *dma_handle, void **ret);
-int dma_release_from_coherent(struct device *dev, int order, void *vaddr);
+int dma_release_from_dev_coherent(struct device *dev, int order, void *vaddr);
 
-int dma_mmap_from_coherent(struct device *dev, struct vm_area_struct *vma,
+int dma_mmap_from_dev_coherent(struct device *dev, struct vm_area_struct *vma,
                            void *cpu_addr, size_t size, int *ret);
+
+void *dma_alloc_from_global_coherent(ssize_t size, dma_addr_t *dma_handle);
+int dma_release_from_global_coherent(int order, void *vaddr);
+int dma_mmap_from_global_coherent(struct vm_area_struct *vma, void *cpu_addr,
+                                 size_t size, int *ret);
+
 #else
-#define dma_alloc_from_coherent(dev, size, handle, ret) (0)
-#define dma_release_from_coherent(dev, order, vaddr) (0)
-#define dma_mmap_from_coherent(dev, vma, vaddr, order, ret) (0)
+#define dma_alloc_from_dev_coherent(dev, size, handle, ret) (0)
+#define dma_release_from_dev_coherent(dev, order, vaddr) (0)
+#define dma_mmap_from_dev_coherent(dev, vma, vaddr, order, ret) (0)
+
+static inline void *dma_alloc_from_global_coherent(ssize_t size,
+                                                  dma_addr_t *dma_handle)
+{
+       return NULL;
+}
+
+static inline int dma_release_from_global_coherent(int order, void *vaddr)
+{
+       return 0;
+}
+
+static inline int dma_mmap_from_global_coherent(struct vm_area_struct *vma,
+                                               void *cpu_addr, size_t size,
+                                               int *ret)
+{
+       return 0;
+}
 #endif /* CONFIG_HAVE_GENERIC_DMA_COHERENT */
 
 #ifdef CONFIG_HAS_DMA
@@ -481,7 +505,7 @@ static inline void *dma_alloc_attrs(struct device *dev, size_t size,
 
        BUG_ON(!ops);
 
-       if (dma_alloc_from_coherent(dev, size, dma_handle, &cpu_addr))
+       if (dma_alloc_from_dev_coherent(dev, size, dma_handle, &cpu_addr))
                return cpu_addr;
 
        if (!arch_dma_alloc_attrs(&dev, &flag))
@@ -503,7 +527,7 @@ static inline void dma_free_attrs(struct device *dev, size_t size,
        BUG_ON(!ops);
        WARN_ON(irqs_disabled());
 
-       if (dma_release_from_coherent(dev, get_order(size), cpu_addr))
+       if (dma_release_from_dev_coherent(dev, get_order(size), cpu_addr))
                return;
 
        if (!ops->free || !cpu_addr)
index 8e981be2e2c2ee8c0472e7824300a6178b474640..0ff1e0dba7201b146a561369ddb3deedfe4d7d67 100644 (file)
@@ -55,9 +55,6 @@ struct omap_hsmmc_platform_data {
        u32 caps;       /* Used for the MMC driver on 2430 and later */
        u32 pm_caps;    /* PM capabilities of the mmc */
 
-       /* use the internal clock */
-       unsigned internal_clock:1;
-
        /* nonremovable e.g. eMMC */
        unsigned nonremovable:1;
 
@@ -73,13 +70,6 @@ struct omap_hsmmc_platform_data {
        int gpio_cd;                    /* gpio (card detect) */
        int gpio_cod;                   /* gpio (cover detect) */
        int gpio_wp;                    /* gpio (write protect) */
-
-       int (*set_power)(struct device *dev, int power_on, int vdd);
-       void (*remux)(struct device *dev, int power_on);
-       /* Call back before enabling / disabling regulators */
-       void (*before_set_reg)(struct device *dev, int power_on, int vdd);
-       /* Call back after enabling / disabling regulators */
-       void (*after_set_reg)(struct device *dev, int power_on, int vdd);
        /* if we have special card, init it using this callback */
        void (*init_card)(struct mmc_card *card);
 
index c5f2158ab00e48742b0b47d6a18d5e167f50f86b..fd73bc0e902744de88104e2df7a2aaf375beaa9e 100644 (file)
@@ -115,13 +115,13 @@ struct uac2_input_terminal_descriptor {
        __u8 bDescriptorType;
        __u8 bDescriptorSubtype;
        __u8 bTerminalID;
-       __u16 wTerminalType;
+       __le16 wTerminalType;
        __u8 bAssocTerminal;
        __u8 bCSourceID;
        __u8 bNrChannels;
-       __u32 bmChannelConfig;
+       __le32 bmChannelConfig;
        __u8 iChannelNames;
-       __u16 bmControls;
+       __le16 bmControls;
        __u8 iTerminal;
 } __attribute__((packed));
 
@@ -132,11 +132,11 @@ struct uac2_output_terminal_descriptor {
        __u8 bDescriptorType;
        __u8 bDescriptorSubtype;
        __u8 bTerminalID;
-       __u16 wTerminalType;
+       __le16 wTerminalType;
        __u8 bAssocTerminal;
        __u8 bSourceID;
        __u8 bCSourceID;
-       __u16 bmControls;
+       __le16 bmControls;
        __u8 iTerminal;
 } __attribute__((packed));
 
@@ -164,9 +164,9 @@ struct uac2_as_header_descriptor {
        __u8 bTerminalLink;
        __u8 bmControls;
        __u8 bFormatType;
-       __u32 bmFormats;
+       __le32 bmFormats;
        __u8 bNrChannels;
-       __u32 bmChannelConfig;
+       __le32 bmChannelConfig;
        __u8 iChannelNames;
 } __attribute__((packed));
 
index 2251e1925ea4f34b491b615288c19ca6aba921fb..33b0bdbb613c6b63c9d8c16ca8ee155e981f52b7 100644 (file)
@@ -84,26 +84,12 @@ int guid_parse(const char *uuid, guid_t *u);
 int uuid_parse(const char *uuid, uuid_t *u);
 
 /* backwards compatibility, don't use in new code */
-typedef uuid_t uuid_be;
-#define UUID_BE(a, _b, c, d0, d1, d2, d3, d4, d5, d6, d7) \
-       UUID_INIT(a, _b, c, d0, d1, d2, d3, d4, d5, d6, d7)
-#define NULL_UUID_BE                                                   \
-       UUID_BE(0x00000000, 0x0000, 0x0000, 0x00, 0x00, 0x00, 0x00,     \
-            0x00, 0x00, 0x00, 0x00)
-
 #define uuid_le_gen(u)         guid_gen(u)
-#define uuid_be_gen(u)         uuid_gen(u)
 #define uuid_le_to_bin(guid, u)        guid_parse(guid, u)
-#define uuid_be_to_bin(uuid, u)        uuid_parse(uuid, u)
 
 static inline int uuid_le_cmp(const guid_t u1, const guid_t u2)
 {
        return memcmp(&u1, &u2, sizeof(guid_t));
 }
 
-static inline int uuid_be_cmp(const uuid_t u1, const uuid_t u2)
-{
-       return memcmp(&u1, &u2, sizeof(uuid_t));
-}
-
 #endif
index 06d5f7ddf84e73bc08e1719c1c97795ada561fff..14baf9f23a14b952e76e9d4aaa7030e53e5092ed 100644 (file)
@@ -77,7 +77,7 @@
 #define TIOCGPKT       _IOR('T', 0x38, int) /* Get packet mode state */
 #define TIOCGPTLCK     _IOR('T', 0x39, int) /* Get Pty lock state */
 #define TIOCGEXCL      _IOR('T', 0x40, int) /* Get exclusive mode state */
-#define TIOCGPTPEER    _IOR('T', 0x41, int) /* Safely open the slave */
+#define TIOCGPTPEER    _IO('T', 0x41) /* Safely open the slave */
 
 #define FIONCLEX       0x5450
 #define FIOCLEX                0x5451
index d2314be4f0c03381c1390f0d0d3eefe4f958f4ed..a4680a5bf5dd4724aad4d16743543f3f35b52be3 100644 (file)
@@ -333,7 +333,7 @@ struct uac_processing_unit_descriptor {
        __u8 bDescriptorType;
        __u8 bDescriptorSubtype;
        __u8 bUnitID;
-       __u16 wProcessType;
+       __le16 wProcessType;
        __u8 bNrInPins;
        __u8 baSourceID[];
 } __attribute__ ((packed));
@@ -491,8 +491,8 @@ struct uac_format_type_ii_ext_descriptor {
        __u8 bDescriptorType;
        __u8 bDescriptorSubtype;
        __u8 bFormatType;
-       __u16 wMaxBitRate;
-       __u16 wSamplesPerFrame;
+       __le16 wMaxBitRate;
+       __le16 wSamplesPerFrame;
        __u8 bHeaderLength;
        __u8 bSideBandProtocol;
 } __attribute__((packed));
index d1767dfb0d95d76dff1b91bb5c2b40f18fee8f6f..8906361bb50ca318fae27126799629210446b3f1 100644 (file)
@@ -35,3 +35,11 @@ static inline int register_xen_selfballooning(struct device *dev)
        return -ENOSYS;
 }
 #endif
+
+#ifdef CONFIG_XEN_BALLOON
+void xen_balloon_init(void);
+#else
+static inline void xen_balloon_init(void)
+{
+}
+#endif
index 478c049630b5cb8e09a57c5ccd012d51b5c4be97..cd819c397dc7ebed8be5bc6167254c543d0f26c8 100644 (file)
@@ -82,7 +82,7 @@ static void __init test_uuid_test(const struct test_uuid_data *data)
                test_uuid_failed("conversion", false, true, data->uuid, NULL);
 
        total_tests++;
-       if (uuid_equal(&data->be, &be)) {
+       if (!uuid_equal(&data->be, &be)) {
                sprintf(buf, "%pUb", &be);
                test_uuid_failed("cmp", false, true, data->uuid, buf);
        }
diff --git a/scripts/parse-maintainers.pl b/scripts/parse-maintainers.pl
new file mode 100644 (file)
index 0000000..a0fe343
--- /dev/null
@@ -0,0 +1,77 @@
+#!/usr/bin/perl -w
+
+use strict;
+
+my %map;
+
+# sort comparison function
+sub by_category($$) {
+    my ($a, $b) = @_;
+
+    $a = uc $a;
+    $b = uc $b;
+
+    # This always sorts last
+    $a =~ s/THE REST/ZZZZZZ/g;
+    $b =~ s/THE REST/ZZZZZZ/g;
+
+    $a cmp $b;
+}
+
+sub alpha_output {
+    my $key;
+    my $sort_method = \&by_category;
+    my $sep = "";
+
+    foreach $key (sort $sort_method keys %map) {
+        if ($key ne " ") {
+            print $sep . $key . "\n";
+            $sep = "\n";
+        }
+        print $map{$key};
+    }
+}
+
+sub trim {
+    my $s = shift;
+    $s =~ s/\s+$//;
+    $s =~ s/^\s+//;
+    return $s;
+}
+
+sub file_input {
+    my $lastline = "";
+    my $case = " ";
+    $map{$case} = "";
+
+    while (<>) {
+        my $line = $_;
+
+        # Pattern line?
+        if ($line =~ m/^([A-Z]):\s*(.*)/) {
+            $line = $1 . ":\t" . trim($2) . "\n";
+            if ($lastline eq "") {
+                $map{$case} = $map{$case} . $line;
+                next;
+            }
+            $case = trim($lastline);
+            exists $map{$case} and die "Header '$case' already exists";
+            $map{$case} = $line;
+            $lastline = "";
+            next;
+        }
+
+        if ($case eq " ") {
+            $map{$case} = $map{$case} . $lastline;
+            $lastline = $line;
+            next;
+        }
+        trim($lastline) eq "" or die ("Odd non-pattern line '$lastline' for '$case'");
+        $lastline = $line;
+    }
+    $map{$case} = $map{$case} . $lastline;
+}
+
+&file_input;
+&alpha_output;
+exit(0);
index 2e402ece4c86d274b40f2e22d659bf63c53f8272..8e6b04b39dcc199a9895f5f7680066ee203fe2ea 100644 (file)
@@ -1235,8 +1235,6 @@ static int snd_fm801_create(struct snd_card *card,
                }
        }
 
-       snd_fm801_chip_init(chip);
-
        if ((chip->tea575x_tuner & TUNER_ONLY) == 0) {
                if (devm_request_irq(&pci->dev, pci->irq, snd_fm801_interrupt,
                                IRQF_SHARED, KBUILD_MODNAME, chip)) {
@@ -1248,6 +1246,8 @@ static int snd_fm801_create(struct snd_card *card,
                pci_set_master(pci);
        }
 
+       snd_fm801_chip_init(chip);
+
        if ((err = snd_device_new(card, SNDRV_DEV_LOWLEVEL, chip, &ops)) < 0) {
                snd_fm801_free(chip);
                return err;
index 63bc894ddf5e8102c3f1ed93c80fef50c3f95700..8c1289963c802b34783a8a8b4af42ed55bbcd71c 100644 (file)
@@ -933,6 +933,7 @@ static const struct snd_pci_quirk cxt5066_fixups[] = {
        SND_PCI_QUIRK(0x103c, 0x8174, "HP Spectre x360", CXT_FIXUP_HP_SPECTRE),
        SND_PCI_QUIRK(0x103c, 0x8115, "HP Z1 Gen3", CXT_FIXUP_HP_GATE_MIC),
        SND_PCI_QUIRK(0x103c, 0x814f, "HP ZBook 15u G3", CXT_FIXUP_MUTE_LED_GPIO),
+       SND_PCI_QUIRK(0x103c, 0x822e, "HP ProBook 440 G4", CXT_FIXUP_MUTE_LED_GPIO),
        SND_PCI_QUIRK(0x1043, 0x138d, "Asus", CXT_FIXUP_HEADPHONE_MIC_PIN),
        SND_PCI_QUIRK(0x152d, 0x0833, "OLPC XO-1.5", CXT_FIXUP_OLPC_XO),
        SND_PCI_QUIRK(0x17aa, 0x20f2, "Lenovo T400", CXT_PINCFG_LENOVO_TP410),
index d549f35f39d3e2ba1eab84b368354a3618153542..53f9311370dec18fabdc0cb03820f7f24c1dab1d 100644 (file)
@@ -3733,11 +3733,15 @@ HDA_CODEC_ENTRY(0x1002aa01, "R6xx HDMI",        patch_atihdmi),
 HDA_CODEC_ENTRY(0x10951390, "SiI1390 HDMI",    patch_generic_hdmi),
 HDA_CODEC_ENTRY(0x10951392, "SiI1392 HDMI",    patch_generic_hdmi),
 HDA_CODEC_ENTRY(0x17e80047, "Chrontel HDMI",   patch_generic_hdmi),
+HDA_CODEC_ENTRY(0x10de0001, "MCP73 HDMI",      patch_nvhdmi_2ch),
 HDA_CODEC_ENTRY(0x10de0002, "MCP77/78 HDMI",   patch_nvhdmi_8ch_7x),
 HDA_CODEC_ENTRY(0x10de0003, "MCP77/78 HDMI",   patch_nvhdmi_8ch_7x),
+HDA_CODEC_ENTRY(0x10de0004, "GPU 04 HDMI",     patch_nvhdmi_8ch_7x),
 HDA_CODEC_ENTRY(0x10de0005, "MCP77/78 HDMI",   patch_nvhdmi_8ch_7x),
 HDA_CODEC_ENTRY(0x10de0006, "MCP77/78 HDMI",   patch_nvhdmi_8ch_7x),
 HDA_CODEC_ENTRY(0x10de0007, "MCP79/7A HDMI",   patch_nvhdmi_8ch_7x),
+HDA_CODEC_ENTRY(0x10de0008, "GPU 08 HDMI/DP",  patch_nvhdmi),
+HDA_CODEC_ENTRY(0x10de0009, "GPU 09 HDMI/DP",  patch_nvhdmi),
 HDA_CODEC_ENTRY(0x10de000a, "GPU 0a HDMI/DP",  patch_nvhdmi),
 HDA_CODEC_ENTRY(0x10de000b, "GPU 0b HDMI/DP",  patch_nvhdmi),
 HDA_CODEC_ENTRY(0x10de000c, "MCP89 HDMI",      patch_nvhdmi),
@@ -3764,17 +3768,40 @@ HDA_CODEC_ENTRY(0x10de0041, "GPU 41 HDMI/DP",   patch_nvhdmi),
 HDA_CODEC_ENTRY(0x10de0042, "GPU 42 HDMI/DP",  patch_nvhdmi),
 HDA_CODEC_ENTRY(0x10de0043, "GPU 43 HDMI/DP",  patch_nvhdmi),
 HDA_CODEC_ENTRY(0x10de0044, "GPU 44 HDMI/DP",  patch_nvhdmi),
+HDA_CODEC_ENTRY(0x10de0045, "GPU 45 HDMI/DP",  patch_nvhdmi),
+HDA_CODEC_ENTRY(0x10de0050, "GPU 50 HDMI/DP",  patch_nvhdmi),
 HDA_CODEC_ENTRY(0x10de0051, "GPU 51 HDMI/DP",  patch_nvhdmi),
+HDA_CODEC_ENTRY(0x10de0052, "GPU 52 HDMI/DP",  patch_nvhdmi),
 HDA_CODEC_ENTRY(0x10de0060, "GPU 60 HDMI/DP",  patch_nvhdmi),
+HDA_CODEC_ENTRY(0x10de0061, "GPU 61 HDMI/DP",  patch_nvhdmi),
+HDA_CODEC_ENTRY(0x10de0062, "GPU 62 HDMI/DP",  patch_nvhdmi),
 HDA_CODEC_ENTRY(0x10de0067, "MCP67 HDMI",      patch_nvhdmi_2ch),
 HDA_CODEC_ENTRY(0x10de0070, "GPU 70 HDMI/DP",  patch_nvhdmi),
 HDA_CODEC_ENTRY(0x10de0071, "GPU 71 HDMI/DP",  patch_nvhdmi),
 HDA_CODEC_ENTRY(0x10de0072, "GPU 72 HDMI/DP",  patch_nvhdmi),
+HDA_CODEC_ENTRY(0x10de0073, "GPU 73 HDMI/DP",  patch_nvhdmi),
+HDA_CODEC_ENTRY(0x10de0074, "GPU 74 HDMI/DP",  patch_nvhdmi),
+HDA_CODEC_ENTRY(0x10de0076, "GPU 76 HDMI/DP",  patch_nvhdmi),
+HDA_CODEC_ENTRY(0x10de007b, "GPU 7b HDMI/DP",  patch_nvhdmi),
+HDA_CODEC_ENTRY(0x10de007c, "GPU 7c HDMI/DP",  patch_nvhdmi),
 HDA_CODEC_ENTRY(0x10de007d, "GPU 7d HDMI/DP",  patch_nvhdmi),
+HDA_CODEC_ENTRY(0x10de007e, "GPU 7e HDMI/DP",  patch_nvhdmi),
 HDA_CODEC_ENTRY(0x10de0080, "GPU 80 HDMI/DP",  patch_nvhdmi),
+HDA_CODEC_ENTRY(0x10de0081, "GPU 81 HDMI/DP",  patch_nvhdmi),
 HDA_CODEC_ENTRY(0x10de0082, "GPU 82 HDMI/DP",  patch_nvhdmi),
 HDA_CODEC_ENTRY(0x10de0083, "GPU 83 HDMI/DP",  patch_nvhdmi),
+HDA_CODEC_ENTRY(0x10de0084, "GPU 84 HDMI/DP",  patch_nvhdmi),
+HDA_CODEC_ENTRY(0x10de0090, "GPU 90 HDMI/DP",  patch_nvhdmi),
+HDA_CODEC_ENTRY(0x10de0091, "GPU 91 HDMI/DP",  patch_nvhdmi),
+HDA_CODEC_ENTRY(0x10de0092, "GPU 92 HDMI/DP",  patch_nvhdmi),
+HDA_CODEC_ENTRY(0x10de0093, "GPU 93 HDMI/DP",  patch_nvhdmi),
+HDA_CODEC_ENTRY(0x10de0094, "GPU 94 HDMI/DP",  patch_nvhdmi),
+HDA_CODEC_ENTRY(0x10de0095, "GPU 95 HDMI/DP",  patch_nvhdmi),
+HDA_CODEC_ENTRY(0x10de0097, "GPU 97 HDMI/DP",  patch_nvhdmi),
+HDA_CODEC_ENTRY(0x10de0098, "GPU 98 HDMI/DP",  patch_nvhdmi),
+HDA_CODEC_ENTRY(0x10de0099, "GPU 99 HDMI/DP",  patch_nvhdmi),
 HDA_CODEC_ENTRY(0x10de8001, "MCP73 HDMI",      patch_nvhdmi_2ch),
+HDA_CODEC_ENTRY(0x10de8067, "MCP67/68 HDMI",   patch_nvhdmi_2ch),
 HDA_CODEC_ENTRY(0x11069f80, "VX900 HDMI/DP",   patch_via_hdmi),
 HDA_CODEC_ENTRY(0x11069f81, "VX900 HDMI/DP",   patch_via_hdmi),
 HDA_CODEC_ENTRY(0x11069f84, "VX11 HDMI/DP",    patch_generic_hdmi),
index 45d58fc1df393a3bb0bda87aec6f7d8983760d9e..443a45eaec3267d98ba9a3f12c5da128b762cfce 100644 (file)
@@ -3838,6 +3838,17 @@ static void alc269_fixup_hp_line1_mic1_led(struct hda_codec *codec,
        }
 }
 
+static struct coef_fw alc225_pre_hsmode[] = {
+       UPDATE_COEF(0x4a, 1<<8, 0),
+       UPDATE_COEFEX(0x57, 0x05, 1<<14, 0),
+       UPDATE_COEF(0x63, 3<<14, 3<<14),
+       UPDATE_COEF(0x4a, 3<<4, 2<<4),
+       UPDATE_COEF(0x4a, 3<<10, 3<<10),
+       UPDATE_COEF(0x45, 0x3f<<10, 0x34<<10),
+       UPDATE_COEF(0x4a, 3<<10, 0),
+       {}
+};
+
 static void alc_headset_mode_unplugged(struct hda_codec *codec)
 {
        static struct coef_fw coef0255[] = {
@@ -3873,6 +3884,10 @@ static void alc_headset_mode_unplugged(struct hda_codec *codec)
                UPDATE_COEF(0x67, 0x2000, 0),
                {}
        };
+       static struct coef_fw coef0298[] = {
+               UPDATE_COEF(0x19, 0x1300, 0x0300),
+               {}
+       };
        static struct coef_fw coef0292[] = {
                WRITE_COEF(0x76, 0x000e),
                WRITE_COEF(0x6c, 0x2400),
@@ -3895,13 +3910,7 @@ static void alc_headset_mode_unplugged(struct hda_codec *codec)
                {}
        };
        static struct coef_fw coef0225[] = {
-               UPDATE_COEF(0x4a, 1<<8, 0),
-               UPDATE_COEFEX(0x57, 0x05, 1<<14, 0),
-               UPDATE_COEF(0x63, 3<<14, 3<<14),
-               UPDATE_COEF(0x4a, 3<<4, 2<<4),
-               UPDATE_COEF(0x4a, 3<<10, 3<<10),
-               UPDATE_COEF(0x45, 0x3f<<10, 0x34<<10),
-               UPDATE_COEF(0x4a, 3<<10, 0),
+               UPDATE_COEF(0x63, 3<<14, 0),
                {}
        };
        static struct coef_fw coef0274[] = {
@@ -3935,7 +3944,10 @@ static void alc_headset_mode_unplugged(struct hda_codec *codec)
                break;
        case 0x10ec0286:
        case 0x10ec0288:
+               alc_process_coef_fw(codec, coef0288);
+               break;
        case 0x10ec0298:
+               alc_process_coef_fw(codec, coef0298);
                alc_process_coef_fw(codec, coef0288);
                break;
        case 0x10ec0292:
@@ -3976,6 +3988,7 @@ static void alc_headset_mode_mic_in(struct hda_codec *codec, hda_nid_t hp_pin,
                {}
        };
        static struct coef_fw coef0288[] = {
+               UPDATE_COEF(0x4f, 0x00c0, 0),
                UPDATE_COEF(0x50, 0x2000, 0),
                UPDATE_COEF(0x56, 0x0006, 0),
                UPDATE_COEF(0x4f, 0xfcc0, 0xc400),
@@ -4039,7 +4052,6 @@ static void alc_headset_mode_mic_in(struct hda_codec *codec, hda_nid_t hp_pin,
        case 0x10ec0286:
        case 0x10ec0288:
        case 0x10ec0298:
-               alc_update_coef_idx(codec, 0x4f, 0x000c, 0);
                snd_hda_set_pin_ctl_cache(codec, hp_pin, 0);
                alc_process_coef_fw(codec, coef0288);
                snd_hda_set_pin_ctl_cache(codec, mic_pin, PIN_VREF50);
@@ -4072,6 +4084,7 @@ static void alc_headset_mode_mic_in(struct hda_codec *codec, hda_nid_t hp_pin,
        case 0x10ec0225:
        case 0x10ec0295:
        case 0x10ec0299:
+               alc_process_coef_fw(codec, alc225_pre_hsmode);
                alc_update_coef_idx(codec, 0x45, 0x3f<<10, 0x31<<10);
                snd_hda_set_pin_ctl_cache(codec, hp_pin, 0);
                alc_process_coef_fw(codec, coef0225);
@@ -4084,7 +4097,12 @@ static void alc_headset_mode_mic_in(struct hda_codec *codec, hda_nid_t hp_pin,
 static void alc_headset_mode_default(struct hda_codec *codec)
 {
        static struct coef_fw coef0225[] = {
-               UPDATE_COEF(0x45, 0x3f<<10, 0x34<<10),
+               UPDATE_COEF(0x45, 0x3f<<10, 0x30<<10),
+               UPDATE_COEF(0x45, 0x3f<<10, 0x31<<10),
+               UPDATE_COEF(0x49, 3<<8, 0<<8),
+               UPDATE_COEF(0x4a, 3<<4, 3<<4),
+               UPDATE_COEF(0x63, 3<<14, 0),
+               UPDATE_COEF(0x67, 0xf000, 0x3000),
                {}
        };
        static struct coef_fw coef0255[] = {
@@ -4138,6 +4156,7 @@ static void alc_headset_mode_default(struct hda_codec *codec)
        case 0x10ec0225:
        case 0x10ec0295:
        case 0x10ec0299:
+               alc_process_coef_fw(codec, alc225_pre_hsmode);
                alc_process_coef_fw(codec, coef0225);
                break;
        case 0x10ec0255:
@@ -4177,6 +4196,8 @@ static void alc_headset_mode_default(struct hda_codec *codec)
 /* Iphone type */
 static void alc_headset_mode_ctia(struct hda_codec *codec)
 {
+       int val;
+
        static struct coef_fw coef0255[] = {
                WRITE_COEF(0x45, 0xd489), /* Set to CTIA type */
                WRITE_COEF(0x1b, 0x0c2b),
@@ -4219,11 +4240,14 @@ static void alc_headset_mode_ctia(struct hda_codec *codec)
                WRITE_COEF(0xc3, 0x0000),
                {}
        };
-       static struct coef_fw coef0225[] = {
+       static struct coef_fw coef0225_1[] = {
                UPDATE_COEF(0x45, 0x3f<<10, 0x35<<10),
-               UPDATE_COEF(0x49, 1<<8, 1<<8),
-               UPDATE_COEF(0x4a, 7<<6, 7<<6),
-               UPDATE_COEF(0x4a, 3<<4, 3<<4),
+               UPDATE_COEF(0x63, 3<<14, 2<<14),
+               {}
+       };
+       static struct coef_fw coef0225_2[] = {
+               UPDATE_COEF(0x45, 0x3f<<10, 0x35<<10),
+               UPDATE_COEF(0x63, 3<<14, 1<<14),
                {}
        };
 
@@ -4244,8 +4268,17 @@ static void alc_headset_mode_ctia(struct hda_codec *codec)
                alc_process_coef_fw(codec, coef0233);
                break;
        case 0x10ec0298:
-               alc_update_coef_idx(codec, 0x8e, 0x0070, 0x0020);/* Headset output enable */
-               /* ALC298 jack type setting is the same with ALC286/ALC288 */
+               val = alc_read_coef_idx(codec, 0x50);
+               if (val & (1 << 12)) {
+                       alc_update_coef_idx(codec, 0x8e, 0x0070, 0x0020);
+                       alc_update_coef_idx(codec, 0x4f, 0xfcc0, 0xd400);
+                       msleep(300);
+               } else {
+                       alc_update_coef_idx(codec, 0x8e, 0x0070, 0x0010);
+                       alc_update_coef_idx(codec, 0x4f, 0xfcc0, 0xd400);
+                       msleep(300);
+               }
+               break;
        case 0x10ec0286:
        case 0x10ec0288:
                alc_update_coef_idx(codec, 0x4f, 0xfcc0, 0xd400);
@@ -4264,7 +4297,11 @@ static void alc_headset_mode_ctia(struct hda_codec *codec)
        case 0x10ec0225:
        case 0x10ec0295:
        case 0x10ec0299:
-               alc_process_coef_fw(codec, coef0225);
+               val = alc_read_coef_idx(codec, 0x45);
+               if (val & (1 << 9))
+                       alc_process_coef_fw(codec, coef0225_2);
+               else
+                       alc_process_coef_fw(codec, coef0225_1);
                break;
        case 0x10ec0867:
                alc_update_coefex_idx(codec, 0x57, 0x5, 1<<14, 0);
@@ -4320,9 +4357,7 @@ static void alc_headset_mode_omtp(struct hda_codec *codec)
        };
        static struct coef_fw coef0225[] = {
                UPDATE_COEF(0x45, 0x3f<<10, 0x39<<10),
-               UPDATE_COEF(0x49, 1<<8, 1<<8),
-               UPDATE_COEF(0x4a, 7<<6, 7<<6),
-               UPDATE_COEF(0x4a, 3<<4, 3<<4),
+               UPDATE_COEF(0x63, 3<<14, 2<<14),
                {}
        };
 
@@ -4344,7 +4379,9 @@ static void alc_headset_mode_omtp(struct hda_codec *codec)
                break;
        case 0x10ec0298:
                alc_update_coef_idx(codec, 0x8e, 0x0070, 0x0010);/* Headset output enable */
-               /* ALC298 jack type setting is the same with ALC286/ALC288 */
+               alc_update_coef_idx(codec, 0x4f, 0xfcc0, 0xe400);
+               msleep(300);
+               break;
        case 0x10ec0286:
        case 0x10ec0288:
                alc_update_coef_idx(codec, 0x4f, 0xfcc0, 0xe400);
@@ -4384,6 +4421,14 @@ static void alc_determine_headset_type(struct hda_codec *codec)
                UPDATE_COEF(0x4f, 0xfcc0, 0xd400), /* Check Type */
                {}
        };
+       static struct coef_fw coef0298[] = {
+               UPDATE_COEF(0x50, 0x2000, 0x2000),
+               UPDATE_COEF(0x56, 0x0006, 0x0006),
+               UPDATE_COEF(0x66, 0x0008, 0),
+               UPDATE_COEF(0x67, 0x2000, 0),
+               UPDATE_COEF(0x19, 0x1300, 0x1300),
+               {}
+       };
        static struct coef_fw coef0293[] = {
                UPDATE_COEF(0x4a, 0x000f, 0x0008), /* Combo Jack auto detect */
                WRITE_COEF(0x45, 0xD429), /* Set to ctia type */
@@ -4396,11 +4441,6 @@ static void alc_determine_headset_type(struct hda_codec *codec)
                WRITE_COEF(0xc3, 0x0c00),
                {}
        };
-       static struct coef_fw coef0225[] = {
-               UPDATE_COEF(0x45, 0x3f<<10, 0x34<<10),
-               UPDATE_COEF(0x49, 1<<8, 1<<8),
-               {}
-       };
        static struct coef_fw coef0274[] = {
                UPDATE_COEF(0x4a, 0x0010, 0),
                UPDATE_COEF(0x4a, 0x8000, 0),
@@ -4433,8 +4473,34 @@ static void alc_determine_headset_type(struct hda_codec *codec)
                is_ctia = (val & 0x0070) == 0x0070;
                break;
        case 0x10ec0298:
-               alc_update_coef_idx(codec, 0x8e, 0x0070, 0x0020); /* Headset output enable */
-               /* ALC298 check jack type is the same with ALC286/ALC288 */
+               snd_hda_codec_write(codec, 0x21, 0,
+                           AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE);
+               msleep(100);
+               snd_hda_codec_write(codec, 0x21, 0,
+                           AC_VERB_SET_PIN_WIDGET_CONTROL, 0x0);
+               msleep(200);
+
+               val = alc_read_coef_idx(codec, 0x50);
+               if (val & (1 << 12)) {
+                       alc_update_coef_idx(codec, 0x8e, 0x0070, 0x0020);
+                       alc_process_coef_fw(codec, coef0288);
+                       msleep(350);
+                       val = alc_read_coef_idx(codec, 0x50);
+                       is_ctia = (val & 0x0070) == 0x0070;
+               } else {
+                       alc_update_coef_idx(codec, 0x8e, 0x0070, 0x0010);
+                       alc_process_coef_fw(codec, coef0288);
+                       msleep(350);
+                       val = alc_read_coef_idx(codec, 0x50);
+                       is_ctia = (val & 0x0070) == 0x0070;
+               }
+               alc_process_coef_fw(codec, coef0298);
+               snd_hda_codec_write(codec, 0x21, 0,
+                           AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_HP);
+               msleep(75);
+               snd_hda_codec_write(codec, 0x21, 0,
+                           AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE);
+               break;
        case 0x10ec0286:
        case 0x10ec0288:
                alc_process_coef_fw(codec, coef0288);
@@ -4463,10 +4529,25 @@ static void alc_determine_headset_type(struct hda_codec *codec)
        case 0x10ec0225:
        case 0x10ec0295:
        case 0x10ec0299:
-               alc_process_coef_fw(codec, coef0225);
-               msleep(800);
-               val = alc_read_coef_idx(codec, 0x46);
-               is_ctia = (val & 0x00f0) == 0x00f0;
+               alc_process_coef_fw(codec, alc225_pre_hsmode);
+               alc_update_coef_idx(codec, 0x67, 0xf000, 0x1000);
+               val = alc_read_coef_idx(codec, 0x45);
+               if (val & (1 << 9)) {
+                       alc_update_coef_idx(codec, 0x45, 0x3f<<10, 0x34<<10);
+                       alc_update_coef_idx(codec, 0x49, 3<<8, 2<<8);
+                       msleep(800);
+                       val = alc_read_coef_idx(codec, 0x46);
+                       is_ctia = (val & 0x00f0) == 0x00f0;
+               } else {
+                       alc_update_coef_idx(codec, 0x45, 0x3f<<10, 0x34<<10);
+                       alc_update_coef_idx(codec, 0x49, 3<<8, 1<<8);
+                       msleep(800);
+                       val = alc_read_coef_idx(codec, 0x46);
+                       is_ctia = (val & 0x00f0) == 0x00f0;
+               }
+               alc_update_coef_idx(codec, 0x4a, 7<<6, 7<<6);
+               alc_update_coef_idx(codec, 0x4a, 3<<4, 3<<4);
+               alc_update_coef_idx(codec, 0x67, 0xf000, 0x3000);
                break;
        case 0x10ec0867:
                is_ctia = true;
@@ -6724,6 +6805,7 @@ static int patch_alc269(struct hda_codec *codec)
        case 0x10ec0225:
        case 0x10ec0295:
                spec->codec_variant = ALC269_TYPE_ALC225;
+               spec->gen.mixer_nid = 0; /* no loopback on ALC225 ALC295 */
                break;
        case 0x10ec0299:
                spec->codec_variant = ALC269_TYPE_ALC225;